/* Base */
:root{--sig-grad:linear-gradient(135deg,#ffe8c6 0%,#ffd49e 100%);--bg:#ffffff;--surface:#ffffff;--text:#1f2328;--muted:#59636e;--border:#e6e8eb;--accent:#ffb26b;--header-h:72px}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;font-family:"Pretendard",system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,"Apple Color Emoji","Segoe UI Emoji";color:var(--text);background:var(--bg);font-size:16px;line-height:1.75}
a{color:#7fc7ff;text-decoration:none}
a:hover{text-decoration:underline}

/* Accessibility */
.skip-link{position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden}
.skip-link:focus{position:static;width:auto;height:auto;padding:8px 12px;background:#000;color:#fff}

/* Header */
.site-header{background:#ffffff;border-bottom:1px solid var(--border);position:sticky;top:0;z-index:100;box-shadow:0 2px 12px rgba(0,0,0,.08)}
.navbar{padding:12px 0;min-height:72px}
.brand{display:flex;align-items:center;gap:16px;text-decoration:none}
.site-logo{width:48px;height:48px;border-radius:12px;object-fit:contain}
.brand-text{display:flex;flex-direction:column}
.site-title{margin:0;font-weight:800;font-size:28px;line-height:1.2;color:#2d2a26}
.site-subtitle{margin:6px 0 0 0;color:#6b7280;font-size:15px;font-weight:500}

/* Mobile header layout */
@media (max-width:768px){
  :root{--header-h:56px}
  .navbar{flex-direction:column;align-items:stretch;gap:8px;padding:8px 0;min-height:56px}
  .brand{justify-content:center;margin-bottom:6px}
  .site-logo{width:40px;height:40px;border-radius:10px}
  .site-search{order:2;max-width:100%;margin:0 16px}
  .header-controls{order:3;justify-content:center;margin-top:6px}
  .site-title{font-size:20px}
  .site-subtitle{font-size:12px;text-align:center}
}

/* Quick nav under header */
.quick-nav{max-width:1200px;margin:0 auto;padding:0 20px 16px 20px;overflow-x:auto;white-space:nowrap;-webkit-overflow-scrolling:touch}
.quick-nav .chip{display:inline-block;margin-right:12px;margin-top:8px;padding:.6rem 1.2rem;border:1px solid var(--border);border-radius:999px;background:#fff;color:#344054;text-decoration:none;font-size:14px;font-weight:500;transition:all 0.2s ease}
.quick-nav .chip:hover{background:#fff6ec;border-color:#ffd49e;transform:translateY(-1px)}
.quick-nav .chip.active{background:#ffefe0;color:#5a3500;border-color:#ffd49e}
.quick-nav .chip:focus-visible{outline:3px solid rgba(255,178,107,.45);outline-offset:2px}
/* Keep quick nav visible while scrolling */
.quick-nav{position:sticky;top:var(--header-h);z-index:60;background:#ffffff;border-bottom:1px solid var(--border)}

/* Mobile quick nav optimization */
@media (max-width:768px){
  .quick-nav{padding:0 12px 10px 12px;overflow-x:auto;white-space:nowrap;position:sticky;top:var(--header-h);z-index:60;background:#fff;border-bottom:1px solid var(--border)}
  .quick-nav .chip{padding:.5rem 1rem;font-size:13px;margin-right:8px;margin-top:6px;flex-shrink:0}
  .quick-nav .chip:last-child{margin-right:0}
  .quick-nav::-webkit-scrollbar{height:6px}
  .quick-nav::-webkit-scrollbar-thumb{background:#ffd49e;border-radius:3px}
  .quick-nav::-webkit-scrollbar-track{background:#f5f5f5;border-radius:3px}
}

/* Search */
.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;border:0;padding:0;clip:rect(0 0 0 0);overflow:hidden}
.site-search{flex:1;display:flex;flex-direction:column;gap:6px;max-width:600px;margin:0 24px}
.site-search input{width:100%;padding:8px 12px;border:1px solid #e6e8eb;border-radius:12px;font-size:14px;background:#fff;box-shadow:none;transition:all 0.2s ease}
.site-search input::placeholder{color:#7d8794}
.site-search input:focus{outline:none;border-color:#ffb26b;box-shadow:0 0 0 2px rgba(255,178,107,.25);transform:none}
.site-search input.is-invalid{border-color:#dc3545;box-shadow:0 0 0 3px rgba(220,53,69,.15)}

/* Mobile search optimization */
@media (max-width:768px){
  .site-search{max-width:100%;margin:0 16px;flex:0 1 auto;order:2}
  .site-search input{font-size:15px;padding:10px 14px;border-radius:12px;width:100%;box-sizing:border-box}
  .search-results{left:16px;right:16px;border-radius:14px}
  .search-results ul{padding:8px}
  .search-results li{padding:10px 14px;border-radius:10px}
}
.search-results{position:absolute;top:100%;left:0;right:0;margin-top:8px;background:#fff;border:1px solid var(--border);border-radius:18px;box-shadow:0 16px 32px rgba(0,0,0,.12);max-height:70vh;overflow:auto;display:none;z-index:1000}
.search-results ul{list-style:none;margin:0;padding:10px}
.search-results li{padding:14px 18px;border-radius:14px;transition:background-color 0.2s ease}
.search-results li+li{margin-top:4px}
.search-results li:hover,.search-results li.active{background:#fff6ec}
.search-results a{color:inherit;text-decoration:none;display:block}
.sr-item{display:grid;grid-template-columns:36px 1fr;gap:14px;align-items:flex-start}
.sr-badge{width:36px;height:36px;border-radius:12px;background:#fff6ec;color:#5a3500;display:flex;align-items:center;justify-content:center;font-size:16px;font-weight:600}
.sr-text{min-width:0}
.sr-title{font-weight:700;font-size:15px;line-height:1.4;margin:0 0 6px 0;color:#1f2328}
.sr-snippet{font-size:14px;color:#59636e;line-height:1.5;margin:0}
.sr-highlight{background:linear-gradient(180deg,rgba(255,212,158,.6),rgba(255,212,158,0));border-radius:4px;padding:0 2px}

/* Layout */
.layout{display:grid;grid-template-columns:1fr;gap:32px;max-width:1000px;margin:32px auto 0 auto;padding:0 20px}

/* TOC */
.toc{position:relative;top:auto;align-self:auto;background:var(--surface);border:1px solid var(--border);border-radius:18px;max-height:none;overflow:visible}
.toc--hidden{display:none}
.toc__title{margin:16px 20px 10px 20px;font-size:14px;letter-spacing:.02em;color:#8a98a8;text-transform:uppercase;font-weight:600}
.toc__toggle{display:block;width:100%;text-align:left;padding:16px 20px;background:#fff;border:none;border-bottom:1px solid var(--border);color:var(--text);cursor:pointer;border-top-left-radius:18px;border-top-right-radius:18px;font-weight:500}
.toc__nav{display:none;padding:16px 16px 20px 16px}
.toc ol{margin:0;padding-left:24px}
.toc a{color:#2b3138;display:block;padding:12px 16px;border-radius:14px;transition:all 0.2s ease}
.toc a:hover{background:#fff6ec;transform:translateX(2px)}
.toc a.active{background:#ffefe0;color:#5a3500;font-weight:600}
.toc li{margin:4px 0}

/* Content */
.content{min-width:0}
.section{background:var(--surface);border:1px solid var(--border);border-radius:16px;padding:28px;margin-bottom:20px;scroll-margin-top:160px;box-shadow:0 4px 16px rgba(0,0,0,.04);transition:all 0.3s ease;display:grid;grid-template-rows:auto 1fr}
.section:hover{box-shadow:0 10px 32px rgba(0,0,0,.08)}
.subsection{margin-top:24px}
h2{margin:0 0 20px 0;font-size:24px;font-weight:600;color:#1f2328}
h3{margin:20px 0 14px 0;font-size:22px;font-weight:600;color:#2b3138}
p{line-height:1.75;color:var(--text);margin:0 0 20px 0}
.note{color:var(--muted);font-size:15px;background:#f8f9fa;padding:16px 20px;border-radius:14px;border-left:4px solid #ffd49e}
.kicker{display:inline-block;margin-right:12px;padding:8px 14px;border-radius:999px;background:#fff6ec;color:#5a3500;font-weight:700;font-size:13px;vertical-align:middle}
.content a{color:#0b6bcb;text-decoration:none;font-weight:500}
.content a:hover{text-decoration:underline;color:#0056b3}
.subsection ul{margin:0 0 20px 24px}
.subsection ul li{margin:0 0 10px 0;line-height:1.6}

/* Tables */
.table-wrap{overflow-x:auto;border:1px solid var(--border);border-radius:16px;box-shadow:0 8px 20px rgba(0,0,0,.06);background:#fff;margin:16px 0}
/* GP list emphasis */
.table-gp thead th{background:#fff4e5;border-bottom:2px solid #ffd49e}
.table-gp tbody tr{border-left:4px solid transparent}
.table-gp tbody tr:nth-child(odd){background:#fff}
.table-gp tbody tr:nth-child(even){background:#fffdf8}
.table-gp tbody tr:hover{background:#fffaf3;border-left-color:#ffb26b}
.table-gp td:nth-child(1){font-weight:600;color:#2b3138}
.table-gp td:nth-child(2){color:#334155}
.table-gp td:nth-child(5) a{font-weight:600}
.table-gp td,.table-gp th{border-color:#eef1f4}

/* Filter bar */
.filter-bar,.filter-row,.filter-meta{display:none}

@media (max-width:768px){ }

/* Useful Links Grid */
.useful-links-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:24px;margin:24px 0}
.useful-link-card{background:#fff;border:1px solid var(--border);border-radius:20px;padding:28px;transition:all 0.3s ease;box-shadow:0 4px 16px rgba(0,0,0,.04)}
.useful-link-card:hover{transform:translateY(-4px);box-shadow:0 12px 32px rgba(0,0,0,.08);border-color:#ffd49e}
.link-card-header{display:flex;align-items:center;gap:16px;margin-bottom:16px}
.link-icon{font-size:32px;line-height:1}
.useful-link-card h3{margin:0;font-size:20px;font-weight:600;color:#1f2328}
.useful-link-card p{margin:0 0 20px 0;color:#59636e;line-height:1.6}
.link-card-features{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:20px}
.feature-tag{display:inline-block;padding:6px 12px;background:#fff6ec;color:#5a3500;border-radius:999px;font-size:12px;font-weight:500}
.link-card-button{display:inline-block;padding:12px 24px;background:linear-gradient(135deg,#ffd49e 0%,#ffb26b 100%);color:#5a3500;text-decoration:none;border-radius:12px;font-weight:600;font-size:14px;transition:all 0.2s ease;text-align:center}
.link-card-button:hover{transform:translateY(-2px);box-shadow:0 8px 24px rgba(255,178,107,.3);text-decoration:none;color:#5a3500}

/* Community Card */
.community-card{background:linear-gradient(135deg,#fff6ec 0%,#fff 100%);border:2px solid #ffd49e;border-radius:20px;padding:32px;margin:24px 0;text-align:center}
.community-header{display:flex;flex-direction:column;align-items:center;gap:16px;margin-bottom:24px}
.community-icon{font-size:48px;line-height:1}
.community-info h3{margin:0 0 8px 0;font-size:24px;font-weight:700;color:#1f2328}
.community-description{margin:0;color:#59636e;font-size:16px}
.community-features{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-bottom:24px}
.community-button{display:inline-block;padding:16px 32px;background:linear-gradient(135deg,#ffb26b 0%,#ff8c42 100%);color:#fff;text-decoration:none;border-radius:16px;font-weight:700;font-size:16px;transition:all 0.3s ease;box-shadow:0 4px 16px rgba(255,178,107,.3)}
.community-button:hover{transform:translateY(-3px);box-shadow:0 8px 32px rgba(255,178,107,.4);text-decoration:none;color:#fff}

/* Mobile Responsiveness */
@media (max-width:768px){
  .useful-links-grid{grid-template-columns:1fr;gap:20px;margin:20px 0}
  .useful-link-card{padding:20px;margin-bottom:16px}
  .link-card-header{flex-direction:column;text-align:center;gap:12px}
  .link-icon{font-size:28px}
  .useful-link-card h3{font-size:18px;margin-bottom:12px}
  .useful-link-card p{font-size:14px;line-height:1.5;margin-bottom:16px}
  .link-card-features{justify-content:center;gap:6px;margin-bottom:16px}
  .feature-tag{font-size:11px;padding:4px 8px}
  .link-card-button{width:100%;padding:12px 20px;font-size:14px}
  
  .community-card{padding:20px;margin:20px 0}
  .community-header{gap:12px}
  .community-icon{font-size:36px}
  .community-info h3{font-size:18px;margin-bottom:8px}
  .community-description{font-size:14px}
  .community-features{justify-content:center;gap:6px;margin-bottom:20px}
  .community-button{width:100%;padding:14px 24px;font-size:15px}
}
table{width:100%;border-collapse:separate;border-spacing:0;min-width:620px;background:#fff;table-layout:auto}
th,td{padding:16px 18px;border-bottom:1px solid #eef1f4;vertical-align:top}
th{position:sticky;top:0;background:#fff4e5;text-align:left;font-weight:700;letter-spacing:.01em;color:#2b3138;z-index:1;font-size:15px}
tbody tr{transition:background-color .2s ease}
.table-gp th:nth-child(1){width:22%}
.table-gp th:nth-child(2){width:18%}
.table-gp th:nth-child(3){width:30%}
.table-gp th:nth-child(4){width:12%}
.table-gp th:nth-child(5){width:10%}
.table-gp th:nth-child(6){width:8%}
.table-wrap::-webkit-scrollbar{height:14px}
.table-wrap::-webkit-scrollbar-thumb{background:#e6e8eb;border-radius:14px}
.table-wrap::-webkit-scrollbar-track{background:#fafbfc}
tbody tr:nth-child(even){background:#fffdf8}
tbody tr:hover{background:#fffaf7;transform:scale(1.005)}
td,th{white-space:nowrap;word-break:normal;line-height:1.7;font-size:15px}
.table-wrap table td{overflow:hidden;text-overflow:ellipsis}
.table-wrap table tr> :first-child{position:sticky;left:0;background:inherit;box-shadow:1px 0 0 #eef1f4;z-index:2}
.table-wrap table th:nth-child(1),.table-wrap table td:nth-child(1){min-width:180px}
.table-wrap table th:nth-child(2),.table-wrap table td:nth-child(2){min-width:160px}
.table-wrap table th:nth-child(3),.table-wrap table td:nth-child(3){min-width:260px}
.table-wrap table td:nth-child(3){display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}
.table-wrap table td a{color:#0b6bcb;font-weight:500}
.table-wrap a{word-break:break-all}

/* Mobile: transform table rows into cards for readability */
@media (max-width: 768px){
  .table-wrap table, .table-wrap thead, .table-wrap tbody, .table-wrap th, .table-wrap td, .table-wrap tr{display:block}
  .table-wrap thead{display:none}
  .table-wrap tr{background:#fff;border:1px solid var(--border);border-radius:14px;margin:12px 0;box-shadow:0 4px 12px rgba(0,0,0,.06);transition:all 0.2s ease}
  .table-wrap tr:hover{transform:translateY(-2px);box-shadow:0 6px 20px rgba(0,0,0,.12)}
  .table-wrap td{border:none;border-top:1px solid #f2f4f7;position:relative;padding:12px 12px 12px 120px;min-height:44px;white-space:normal}
  .table-wrap td:first-child{border-top:none}
  .table-wrap td::before{content:attr(data-label);position:absolute;left:12px;top:10px;width:105px;font-weight:700;color:#6b7280;white-space:pre-wrap;font-size:12px}
  .table-wrap{margin:16px 0;border-radius:16px}
}

/* Encyclopedic tone: dividers and spacing */
.section + .section{margin-top:32px}
.section{--section-pad:24px;padding:var(--section-pad);}
.section:not(:last-child){box-shadow:0 1px 0 0 #f1f3f5 inset}

/* Remove extra margin from last section to prevent bottom spacing */
.section:last-of-type{margin-bottom:0}

/* Remove margin from last few sections to prevent bottom spacing */
.section:nth-last-child(-n+3){margin-bottom:16px}
.section:last-child{margin-bottom:0}

/* Collapsible sections */
.section-header{display:flex;align-items:center;gap:12px;margin-bottom:12px}
.section-header h2{margin:0;font-size:22px;font-weight:600;line-height:1.3;flex:1;min-width:0}
.section-header::after{content:"▾";font-size:14px;color:#8a98a8;transition:transform .2s ease}
.section.collapsed .section-header::after{transform:rotate(-90deg)}
.section-toggle{display:none}
.section-content{overflow:hidden;transition:opacity .35s ease}
.section.collapsed{padding-bottom:20px;grid-template-rows:auto 0fr}
.section.collapsed .section-content{opacity:0;pointer-events:none}

/* Mobile section header optimization */
@media (max-width:768px){
  .section-header{flex-direction:row;align-items:center;gap:8px}
  .section-header h2{font-size:18px;line-height:1.2;width:100%}
  .section-toggle{display:none}
  .kicker{font-size:10px;padding:4px 8px;margin-right:8px;display:inline-block}
  .section{padding:20px;margin-bottom:16px;border-radius:16px}
  .section h2{font-size:20px;margin-bottom:12px}
  .section h3{font-size:16px;margin:12px 0 8px 0}
  .section p{font-size:14px;line-height:1.5;margin-bottom:12px}
}

/* Header controls */
.header-controls{display:flex;gap:12px;align-items:center}
.ghost-btn{border:1px solid var(--border);background:#fff;border-radius:14px;padding:12px 18px;font-size:14px;color:#344054;cursor:pointer;font-weight:500;transition:all 0.2s ease}

/* Mobile header controls */
@media (max-width:768px){
  .header-controls{display:flex;justify-content:center;gap:8px;margin-top:8px}
  .header-controls .btn{font-size:13px;padding:8px 12px;min-width:80px}
}
.ghost-btn:hover{background:#fff6ec;border-color:#ffd49e;transform:translateY(-1px)}
.ghost-btn:active{transform:translateY(0px)}

/* Contacts */
.contacts ul{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:16px;list-style:none;padding:0;margin:0}
.contacts li{background:#fff;border:1px solid var(--border);border-radius:16px;padding:20px;transition:all 0.2s ease}
.contacts li:hover{background:#fff6ec;transform:translateY(-2px);box-shadow:0 6px 20px rgba(0,0,0,.08)}

/* Back to top */
.back-to-top{position:fixed;right:20px;bottom:20px;border:none;border-radius:999px;width:52px;height:52px;background:var(--sig-grad);color:#5a3500;font-weight:700;cursor:pointer;display:none;box-shadow:0 8px 24px rgba(0,0,0,.15);transition:all 0.3s ease}
.back-to-top.show{display:inline-flex;align-items:center;justify-content:center}
.back-to-top:hover{transform:translateY(-2px);box-shadow:0 10px 28px rgba(0,0,0,.2)}

/* Footer */
.site-footer{border-top:1px solid var(--border);padding:24px 0;margin-top:40px;background:var(--surface)}
.site-footer__inner{max-width:1200px;margin:0 auto;padding:0 20px;color:var(--muted);font-size:14px;text-align:center}

/* Responsive */
@media (min-width: 992px){
  .layout{grid-template-columns:1fr;gap:40px;margin:40px auto;padding:0 24px;max-width:900px}
  .section{padding:36px}
  h2{font-size:32px}
  h3{font-size:24px}
  .site-title{font-size:32px}
  .site-search{max-width:650px}
  .fab{display:none}
  .navbar{padding:20px 0;min-height:88px}
  .quick-nav{top:88px}
  .site-search{margin:0 32px}
}
@media (min-width: 1200px){
  .layout{max-width:1000px}
  .section{padding:40px}
  h2{font-size:36px}
  h3{font-size:26px}
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  html:focus-within{scroll-behavior:auto}
  *{transition:none !important}
}
@media (max-width: 576px){
  .site-header__inner{padding:12px 12px;gap:10px}
  .section{padding:20px}
  h2{font-size:26px}
  h3{font-size:20px}
  .navbar{padding:12px 0;min-height:72px}
  .quick-nav{top:72px}
  .site-search{margin:0 16px}
  .site-search input{padding:14px 18px;font-size:14px}
  .layout{padding:0 16px;margin:20px auto}
}

/* FAB and Overlay TOC */
.fab{display:none}
.toc-overlay{position:fixed;inset:0;display:none;z-index:2000}
.toc-overlay[aria-hidden="false"]{display:block}
/* Put panel above backdrop so it's interactive */
.toc-overlay__backdrop{position:absolute;inset:0;background:rgba(0,0,0,.25);backdrop-filter:none;z-index:1}
.toc-overlay__panel{position:absolute;left:0;top:0;bottom:0;width:92%;max-width:400px;background:#fff;border-right:1px solid var(--border);box-shadow:6px 0 32px rgba(0,0,0,.2);display:flex;flex-direction:column;overflow:auto;z-index:2}
.toc-overlay__header{display:flex;align-items:center;justify-content:space-between;padding:20px 20px;border-bottom:1px solid var(--border);background:#fff}
.toc-overlay__nav{padding:16px 16px 20px 16px;overflow:auto;flex:1}
.toc-overlay__nav a{display:block;padding:14px;border-radius:14px;color:#2b3138;transition:all 0.2s ease;font-size:15px}
.toc-overlay__nav a:hover{background:#fff6ec;transform:translateX(2px)}
.toc-overlay__nav ol{margin:0;padding-left:20px}
.toc-overlay__nav ol ol{margin:8px 0;padding-left:16px}

/* Section accents */
.section{position:relative}
.section::before{content:"";position:absolute;top:0;left:0;right:0;height:8px;background:linear-gradient(90deg,#ffd49e,#ffb26b);border-top-left-radius:20px;border-top-right-radius:20px}
.section-header{margin-top:8px}

/* Header/nav colors */
.site-title{color:#2d2a26;background:none}
.site-subtitle{color:#6b7280}
.site-header a{color:#2b3138}
.site-header a:hover{color:#8a5b00}

/* Enhanced mobile experience (merged into single block) */
@media (max-width: 768px) {
  .section{margin-bottom:16px;border-radius:16px}
  .section-header h2{font-size:18px}
  .section-header h3{font-size:16px}
  .kicker{font-size:10px;padding:4px 8px}
  .table-wrap{border-radius:14px}
  .quick-nav .chip{font-size:13px;padding:.5rem 1rem}
  .site-search input{font-size:15px;padding:10px 14px}
  .search-results{max-height:60vh}
  .sr-item{grid-template-columns:32px 1fr;gap:12px}
  .sr-badge{width:32px;height:32px;font-size:14px}
  .sr-title{font-size:14px}
  .sr-snippet{font-size:13px}
}

/* Mobile search positioning */
@media (max-width: 768px) {
  .site-search{max-width:100%;margin:0 16px}
  .site-search input{border-radius:12px}
  .search-results{left:16px;right:16px;border-radius:14px}
  .search-results ul{padding:8px}
  .search-results li{padding:10px 14px;border-radius:10px}
}

