:root {
  --acg-ink: #13213c;
  --acg-muted: #5c6880;
  --acg-line: #dfe5ef;
  --acg-soft: #f5f7fb;
  --acg-blue: #1f5eff;
  --acg-blue-dark: #1648c8;
  --acg-green: #18a66a;
  --acg-warn: #fff7dc;
  --acg-shadow: 0 18px 50px rgba(19, 33, 60, .09);
}

html { scroll-behavior: smooth; }
body { color: var(--acg-ink); }
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.97); border-bottom: 1px solid var(--acg-line); backdrop-filter: blur(12px); }
.site-header .nav-inner { min-height: 72px; gap: 22px; }
.site-header nav { display: flex; align-items: center; gap: 17px; white-space: nowrap; }
.site-header nav a { color: var(--acg-ink); font-size: .91rem; font-weight: 700; text-decoration: none; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { color: var(--acg-blue); }
.site-header .search-compact { margin-left: auto; min-width: 184px; max-width: 250px; position: relative; }
.site-header .search-box { position: relative; }
.site-header .search-box input { width: 100%; border: 1px solid var(--acg-line); border-radius: 999px; padding: 10px 13px 10px 35px; background: var(--acg-soft); color: var(--acg-ink); }
.site-header .search-symbol { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); z-index: 1; color: var(--acg-muted); }
.search-results { position: absolute; top: calc(100% + 8px); right: 0; width: min(390px, 90vw); max-height: 390px; overflow: auto; background: #fff; border: 1px solid var(--acg-line); border-radius: 15px; box-shadow: var(--acg-shadow); padding: 7px; }
.search-results[hidden] { display: none; }
.search-results a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--acg-ink); text-decoration: none; }
.search-results a:hover, .search-results a:focus { background: var(--acg-soft); }
.search-results strong { display: block; font-size: .92rem; }
.search-results span { color: var(--acg-muted); font-size: .78rem; }

.mobile-menu { display: none; position: relative; }
.mobile-menu summary { cursor: pointer; font-weight: 800; }
.mobile-menu > div { position: absolute; right: 0; top: 34px; width: 260px; padding: 12px; background: #fff; border: 1px solid var(--acg-line); border-radius: 14px; box-shadow: var(--acg-shadow); }
.mobile-menu a { display: block; padding: 9px; color: var(--acg-ink); text-decoration: none; }

.acg-hero { padding: 78px 0 64px; background: radial-gradient(circle at 80% 10%, #dce8ff 0, transparent 35%), linear-gradient(155deg, #f8fbff, #eef3ff); border-bottom: 1px solid var(--acg-line); }
.acg-hero-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr); gap: 50px; align-items: center; }
.acg-kicker, .acg-eyebrow { display: inline-flex; align-items: center; gap: 7px; color: var(--acg-blue); font-size: .78rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.acg-hero h1 { max-width: 850px; margin: 14px 0 18px; font-size: clamp(2.45rem, 5vw, 5.1rem); line-height: .98; letter-spacing: -.045em; }
.acg-hero h1 em { color: var(--acg-blue); font-style: normal; }
.acg-hero p { max-width: 760px; color: var(--acg-muted); font-size: clamp(1.02rem, 1.6vw, 1.23rem); line-height: 1.7; }
.acg-code-display { background: #fff; border: 1px solid var(--acg-line); border-radius: 26px; padding: 30px; box-shadow: var(--acg-shadow); }
.acg-code-display small { color: var(--acg-muted); font-weight: 700; }
.acg-code-display > strong { display: block; margin: 4px 0 18px; color: var(--acg-blue); font-size: clamp(3rem, 7vw, 6rem); line-height: 1; letter-spacing: -.06em; }
.acg-code-display div { display: flex; flex-wrap: wrap; gap: 8px; }
.acg-chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; background: var(--acg-soft); padding: 7px 11px; color: var(--acg-ink); font-size: .82rem; font-weight: 750; text-decoration: none; }
.acg-chip:hover { background: #e7edff; }

.acg-search-hero { max-width: 720px; margin-top: 25px; position: relative; }
.acg-search-hero input { width: 100%; padding: 17px 20px; border: 1px solid #cbd5e7; border-radius: 14px; background: #fff; font-size: 1rem; box-shadow: 0 10px 30px rgba(19,33,60,.06); }
.acg-search-hero .search-results { left: 0; right: auto; width: 100%; }

.acg-section { padding: 70px 0; }
.acg-section.acg-soft { background: var(--acg-soft); border-top: 1px solid var(--acg-line); border-bottom: 1px solid var(--acg-line); }
.acg-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 28px; }
.acg-heading h2 { margin: 7px 0 0; font-size: clamp(1.85rem, 3vw, 3rem); line-height: 1.05; letter-spacing: -.035em; }
.acg-heading > p { max-width: 590px; margin: 0; color: var(--acg-muted); line-height: 1.65; }
.acg-section h2 { scroll-margin-top: 95px; }
.acg-section p, .acg-prose li { line-height: 1.72; }
.acg-prose { max-width: 880px; }
.acg-prose p { color: var(--acg-muted); }

.acg-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.acg-card-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.acg-card-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.acg-card { display: block; padding: 24px; background: #fff; border: 1px solid var(--acg-line); border-radius: 18px; color: var(--acg-ink); text-decoration: none; box-shadow: 0 7px 24px rgba(19,33,60,.035); }
.acg-card:hover { border-color: #b9c9f5; transform: translateY(-2px); box-shadow: 0 13px 35px rgba(19,33,60,.08); }
.acg-card h3 { margin: 8px 0; font-size: 1.25rem; }
.acg-card p { margin: 0; color: var(--acg-muted); line-height: 1.58; }
.acg-card .acg-code { display: inline-block; margin-top: 16px; color: var(--acg-blue); font-weight: 850; }
.acg-card-static:hover { transform: none; border-color: var(--acg-line); box-shadow: 0 7px 24px rgba(19,33,60,.035); }

.acg-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 35px; }
.acg-fact { padding: 18px; background: rgba(255,255,255,.87); border: 1px solid var(--acg-line); border-radius: 14px; }
.acg-fact small { display: block; color: var(--acg-muted); font-weight: 700; }
.acg-fact strong { display: block; margin-top: 5px; font-size: 1rem; }

.acg-table-wrap { overflow-x: auto; border: 1px solid var(--acg-line); border-radius: 18px; background: #fff; }
.acg-table { width: 100%; border-collapse: collapse; }
.acg-table caption { padding: 14px 18px; color: var(--acg-muted); font-size: .83rem; text-align: left; border-bottom: 1px solid var(--acg-line); }
.acg-table th { padding: 13px 17px; background: #eff3fa; color: var(--acg-muted); font-size: .76rem; letter-spacing: .05em; text-align: left; text-transform: uppercase; }
.acg-table td { padding: 15px 17px; border-top: 1px solid var(--acg-line); vertical-align: top; }
.acg-table td a { color: var(--acg-blue-dark); font-weight: 780; text-decoration: none; }
.acg-table td small { display: block; margin-top: 3px; color: var(--acg-muted); }
.acg-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: nowrap; }

.acg-alert { padding: 20px 22px; border: 1px solid #edd893; border-radius: 16px; background: var(--acg-warn); }
.acg-alert.info { border-color: #bcd0ff; background: #eef4ff; }
.acg-alert.success { border-color: #a9dfc7; background: #effbf6; }
.acg-alert strong { display: block; margin-bottom: 5px; }
.acg-alert p { margin: 0; color: #4d5668; }

.acg-editorial-note { margin: 24px 0 4px; max-width: 880px; padding: 20px 22px; border: 2px solid #b42318; border-radius: 16px; background: #fff1f0; color: #5d1712; box-shadow: 0 12px 30px rgba(180,35,24,.10); }
.acg-editorial-note strong { display: block; margin-bottom: 8px; color: #8f1710; font-size: 1.08rem; line-height: 1.35; }
.acg-editorial-note p { margin: 0; max-width: none; color: #5d1712; font-size: .92rem; line-height: 1.62; }
.acg-editorial-note div { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; }
.acg-editorial-note a { color: #8f1710; font-size: .82rem; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

.acg-map { min-height: 275px; display: grid; place-items: center; position: relative; overflow: hidden; border: 1px solid #b7c8f4; border-radius: 22px; background: linear-gradient(135deg, #e8f0ff, #f7faff); }
.acg-map::before, .acg-map::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(31,94,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(31,94,255,.08) 1px, transparent 1px); background-size: 34px 34px; }
.acg-map::after { inset: 20% 25%; border: 2px dashed rgba(31,94,255,.35); border-radius: 45% 55% 40% 60%; background: rgba(31,94,255,.06); }
.acg-map-content { position: relative; z-index: 2; max-width: 550px; padding: 30px; text-align: center; }
.acg-map-content strong { display: block; color: var(--acg-blue); font-size: 2rem; }
.acg-map-content p { margin: 8px 0 0; color: var(--acg-muted); }

.acg-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; align-items: start; }
.acg-panel { padding: 26px; border: 1px solid var(--acg-line); border-radius: 18px; background: #fff; }
.acg-panel h2, .acg-panel h3 { margin-top: 0; }
.acg-panel p:last-child, .acg-panel ul:last-child { margin-bottom: 0; }
.acg-number-anatomy { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 18px 0; }
.acg-number-anatomy span { border: 1px solid var(--acg-line); border-radius: 10px; background: var(--acg-soft); padding: 10px 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 750; }
.acg-number-anatomy b { color: var(--acg-muted); }
.acg-link-list { display: flex; flex-wrap: wrap; gap: 9px; padding: 0; list-style: none; }
.acg-link-list a { display: inline-flex; border: 1px solid var(--acg-line); border-radius: 999px; padding: 8px 12px; color: var(--acg-blue-dark); background: #fff; font-weight: 750; text-decoration: none; }
.acg-link-list a:hover { border-color: var(--acg-blue); }

.acg-faq details { padding: 17px 0; border-top: 1px solid var(--acg-line); }
.acg-faq details:last-child { border-bottom: 1px solid var(--acg-line); }
.acg-faq summary { cursor: pointer; font-weight: 820; }
.acg-faq details p { color: var(--acg-muted); }

.acg-source { margin-top: 28px; padding: 18px 20px; border-left: 4px solid var(--acg-green); background: #f1fbf6; border-radius: 0 13px 13px 0; }
.acg-source a { color: var(--acg-blue-dark); }
.acg-updated { color: var(--acg-muted); font-size: .84rem; }
.acg-empty { color: var(--acg-muted); font-style: italic; }
.acg-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.acg-button { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 11px 17px; background: var(--acg-blue); color: #fff; font-weight: 800; text-decoration: none; }
.acg-button:hover { background: var(--acg-blue-dark); }
.acg-button.secondary { border: 1px solid var(--acg-line); background: #fff; color: var(--acg-ink); }
.acg-directory-search { width: 100%; max-width: 680px; border: 1px solid var(--acg-line); border-radius: 12px; padding: 14px 16px; font-size: 1rem; }

.breadcrumbs { padding: 18px 0 0; font-size: .84rem; }
.breadcrumbs a { color: var(--acg-muted); text-decoration: none; }
.breadcrumbs span { color: var(--acg-muted); }
.breadcrumbs b { margin: 0 8px; color: #a5aec0; }

.continent-jump { display: flex; flex-wrap: wrap; gap: 9px; margin: 22px 0 0; }
.continent-jump a { padding: 8px 12px; border: 1px solid var(--acg-line); border-radius: 999px; background: #fff; color: var(--acg-ink); text-decoration: none; font-weight: 750; }

.site-footer { background: #101a31; color: #fff; }
.site-footer p, .site-footer .footer-bottom { color: #b7c1d6; }
.site-footer a { color: #dce6ff; }
.site-footer .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
.site-footer .footer-grid h3 { color: #fff; }

@media (max-width: 1180px) {
  .site-header nav { display: none; }
  .mobile-menu { display: block; margin-left: auto; }
  .site-header .search-compact { margin-left: 0; }
  .acg-card-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .site-header .nav-inner { min-height: 62px; gap: 12px; }
  .site-header .search-compact { display: none; }
  .acg-hero { padding: 52px 0 45px; }
  .acg-hero-grid, .acg-split { grid-template-columns: 1fr; }
  .acg-hero-grid { gap: 28px; }
  .acg-section { padding: 50px 0; }
  .acg-heading { display: block; }
  .acg-heading > p { margin-top: 12px; }
  .acg-card-grid, .acg-card-grid.two, .acg-card-grid.four { grid-template-columns: 1fr; }
  .acg-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acg-table th, .acg-table td { padding: 12px; }
  .site-footer .footer-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
