:root {
  color-scheme: light;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  color: #132d43;
  background: #f5f8fa;
  --navy: #00274d;
  --navy-light: #0b3b67;
  --green: #19763d;
  --green-dark: #12582d;
  --muted: #486276;
  --border: #d5e1e9;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; line-height: 1.5; }
a { color: var(--green-dark); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid #24916b; outline-offset: 3px; }
button { font: inherit; cursor: pointer; }
.sn-site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--navy);
  box-shadow: 0 2px 12px rgb(0 0 0 / 12%);
  font-family: Arial, sans-serif;
}
.sn-header-inner {
  max-width: 1200px;
  margin-inline: auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.sn-site-header a { color: #fff; text-decoration: none; }
.sn-site-header :focus-visible { outline-color: #a5eac0; }
.sn-brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 900; white-space: nowrap; }
.sn-brand img { display: block; width: 40px; height: 40px; object-fit: contain; }
.sn-desktop-nav { display: flex; align-items: center; gap: 24px; margin-left: auto; }
.sn-desktop-nav a { font-size: 14px; font-weight: 700; }
.sn-desktop-nav a:hover, .sn-desktop-nav a[aria-current] { text-decoration: underline; }
.sn-site-header .sn-start-btn { padding: 10px 17px; border-radius: 9px; background: #28a745; color: var(--navy); }
.sn-mobile-menu { display: none; }
.sn-menu-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgb(255 255 255 / 34%);
  border-radius: 8px;
  color: #fff;
  list-style: none;
  cursor: pointer;
}
.sn-menu-btn::-webkit-details-marker { display: none; }
.sn-menu-btn::before { content: ''; width: 18px; height: 2px; background: currentColor; box-shadow: 0 -5px, 0 5px; }
.sn-mobile-panel {
  position: absolute;
  inset: 100% 0 auto;
  max-height: 70vh;
  overflow: auto;
  padding: 10px 20px 18px;
  background: var(--navy-light);
  box-shadow: 0 10px 18px rgb(0 0 0 / 12%);
}
.sn-mobile-panel a { display: block; padding: 11px 5px; border-bottom: 1px solid rgb(255 255 255 / 16%); font-weight: 700; }
.sn-mobile-panel a[aria-current] { text-decoration: underline; }
.sn-mobile-panel .sn-start-btn { margin-top: 12px; text-align: center; border-bottom: 0; }

.library-main { min-height: calc(100vh - 64px); background: linear-gradient(#e9f2f7, #f5f8fa 390px); }
.container { width: min(1120px, 100%); padding: 34px 26px 24px; margin-inline: auto; }
h1 { margin: 0 0 18px; color: var(--navy); font-size: clamp(2rem, 4.8vw, 3rem); line-height: 1.12; letter-spacing: -.032em; }
.document-guide { padding: clamp(16px, 3vw, 28px); border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: 0 6px 22px rgb(0 39 77 / 6%); }
.document-guide h2 { margin: 0 0 14px; color: var(--navy); font-size: clamp(1.25rem, 2.6vw, 1.65rem); line-height: 1.25; }
.document-guide, .document-panel, .section, .category-group { scroll-margin-top: 92px; }
.document-panels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 12px;
  margin-top: 16px;
}
.document-panels.searching { grid-template-columns: repeat(auto-fit, minmax(min(265px, 100%), 1fr)); }
@media (min-width: 970px) {
  .document-panels:not(.searching) { grid-template-columns: minmax(0, .82fr) minmax(0, .96fr) minmax(0, 1.22fr); }
}
.document-panel { min-width: 0; padding: 15px; border: 1px solid #c4d4e0; border-radius: 11px; background: #fff; }
.document-panel h3 { margin: 0 0 9px; color: var(--navy); font-size: 1.075rem; line-height: 1.28; }
.own-panel { border-color: #a1cdb0; background: #eef8f0; }
.own-panel h3 { color: var(--green-dark); }
.own-panel p { margin: 0 0 13px; color: #355c43; font-size: .9rem; }
.own-panel .btn { min-height: 44px; }
.own-panel-upload { margin-bottom: 9px; }

.direct-links { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.direct-links li { min-width: 0; border-top: 1px solid var(--border); }
.document-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 7px;
  border-radius: 6px;
  color: var(--navy);
  font-size: .9rem;
  font-weight: 650;
  line-height: 1.35;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.document-link:hover { background: #eef5f9; text-decoration: underline; }
.form-detail { margin: -1px 7px 8px; color: var(--muted); font-size: .85rem; line-height: 1.4; }
.panel-secondary { display: inline-flex; align-items: center; min-height: 44px; padding: 0 7px; font-size: .86rem; font-weight: 650; }
.template-panel, .search-guides { container-type: inline-size; }
.search-guides { margin-top: 14px; }
@container (min-width: 285px) {
  .template-links { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 9px; }
}

.document-catalog { margin-top: 18px; scroll-margin-top: 82px; }
.document-catalog > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  min-height: 44px;
  padding: 5px 9px 5px 0;
  color: var(--navy);
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}
.document-catalog > summary::-webkit-details-marker { display: none; }
.document-catalog > summary::before { content: '+'; font-size: 1.1rem; line-height: 1; }
.document-catalog[open] > summary::before { content: '−'; }
.document-catalog > summary:hover { text-decoration: underline; }
.search { max-width: 680px; }
.search label { display: block; margin: 0 0 6px; font-size: .875rem; font-weight: 680; }
.search-field { display: flex; min-height: 50px; border: 1px solid #a8bac9; border-radius: 9px; background: white; }
.search-field:focus-within { outline: 2px solid #24916b; outline-offset: 2px; }
.search-field input { width: 100%; min-width: 0; border: 0; background: transparent; border-radius: 9px; color: inherit; padding: 10px 13px; font: inherit; }
.search-field input:focus-visible { outline: none; }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-field button { background: transparent; border: 0; color: var(--green-dark); padding: 0 12px; font-size: .875rem; font-weight: 680; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 12px; }
.filters button {
  min-height: 43px;
  padding: 6px 13px;
  border: 1px solid #aebfcc;
  border-radius: 8px;
  background: white;
  color: var(--navy);
  font-size: .9rem;
  font-weight: 650;
}
.filters button:hover { border-color: var(--green); }
.filters [aria-pressed="true"] { border-color: var(--navy); background: var(--navy); color: white; }
.search-status { margin: 8px 0 0; color: var(--muted); font-size: .875rem; }
.search-status:empty { margin: 0; }

.section { margin: 24px 0 35px; }
.section-head h2 { margin: 0 0 5px; font-size: 1.5rem; letter-spacing: -.016em; }
.section-head p { margin: 0 0 13px; color: var(--muted); }
.category-title { margin: 20px 0 10px; font-size: 1.0625rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(265px, 100%), 1fr)); gap: 12px; }
.card { display: flex; flex-direction: column; min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: 11px; background: white; }
.card .tag, .card .code { color: var(--muted); font-size: .8rem; font-weight: 650; }
.card .code { color: var(--green-dark); }
.card h3 { margin: 5px 0; font-size: 1.0625rem; line-height: 1.35; }
.card p { margin: 0 0 14px; color: var(--muted); font-size: .9rem; }
.actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 7px; margin-top: auto; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 7px 11px;
  border: 1px solid #b3c6bc;
  border-radius: 7px;
  background: white;
  color: var(--green-dark);
  font-size: .875rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}
.btn:hover { background: #f1f8f3; }
.btn.create, .btn.upload { border-color: var(--green); background: var(--green); color: white; }
.btn.create:hover, .btn.upload:hover { background: var(--green-dark); }
.no-results { margin: 24px 0; padding: 20px; border: 1px solid var(--border); border-radius: 11px; background: white; }
.no-results h3 { margin: 0; font-size: 1.125rem; }
.no-results p { margin: 6px 0 12px; color: var(--muted); }
.library-footer { margin: 22px 0 16px; color: var(--muted); font-size: .875rem; }

@media (max-width: 900px) {
  .sn-desktop-nav { display: none; }
  .sn-mobile-menu { display: block; }
}

@media (max-width: 780px) {
  .document-panels, .document-panels.searching { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 620px) {
  .sn-header-inner { padding: 10px 14px; gap: 8px; }
  .sn-brand { gap: 7px; }
  .sn-brand img { width: 36px; height: 36px; }
  .container { padding: 23px 14px 24px; }
  h1 { margin-bottom: 14px; }
  .filters button { padding-inline: 10px; }
}
