/* Layout: white org360.app-style header, sticky part tabs, left article sidebar, one calm reading column. */
:root {
  --bg: #ffffff;
  --surface: #f4f8fa;
  --line: #e3e2f3;
  --fg: #1e262c;
  --muted: #4f677a;
  --top-bg: #eef3f7;
  --frame: #eef3f7;
  --frame-hover: #e2eaf0;
  --lav: #c8c7de;
  --navy: #16243c;
  --navy-fg: #eef3f6;
  --mint: #39d7b7;
  --mint-ink: #0b6f5d;
  --mint-soft: #dff6f0;
  --focus: #1f8c76;
  --font-ui: "DM Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-read: "Lora", Georgia, "Times New Roman", serif;
  --font-display: "Francois One", "Arial Narrow", "DM Sans", sans-serif;
  --top-h: 64px;
  --tabs-h: 44px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f161d; --surface: #16212b; --line: #263441; --fg: #e4eaee; --muted: #9aa8b2; --top-bg: #16212b; --frame: #16212b; --frame-hover: #1f2d3a; --lav: #c8c7de;
    --navy: #0b1420; --navy-fg: #e4eaee; --mint-ink: #5fe3c6; --mint-soft: #133a33; --focus: #5fe3c6;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f161d; --surface: #16212b; --line: #263441; --fg: #e4eaee; --muted: #9aa8b2; --top-bg: #16212b; --frame: #16212b; --frame-hover: #1f2d3a; --lav: #c8c7de;
  --navy: #0b1420; --navy-fg: #e4eaee; --mint-ink: #5fe3c6; --mint-soft: #133a33; --focus: #5fe3c6;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top-h) + var(--tabs-h) + 20px); }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 16px/1.5 var(--font-ui); -webkit-text-size-adjust: 100%; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--top-bg); }
a { color: var(--mint-ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* top banner: white, like the org360.app header */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--top-bg); color: var(--fg); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: 1240px; margin: 0 auto; height: var(--top-h); display: flex; align-items: center; gap: 16px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.brand { display: inline-flex; align-items: center; color: var(--fg); text-decoration: none; font: 500 22px/1 var(--font-read); }
.logo-mark::before { content: "Org36"; }
.logo-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--mint); margin: 0 0 3px 2px; align-self: flex-end; }
.brand-light { color: #ffffff; }
.brand-sub { color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 500; padding-left: 16px; border-left: 1px solid var(--line); white-space: nowrap; }
.brand-sub:hover { color: var(--fg); }
.search { position: relative; margin-left: auto; flex: 0 1 340px; min-width: 0; }
.search input { width: 100%; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--fg);
  padding: 0 12px 0 34px; font: 400 14.5px var(--font-ui);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%234f677a' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='M11 11l4 4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 11px center; }
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--mint); background-color: var(--bg); }
.top-login { color: var(--mint-ink); font-size: 15px; font-weight: 500; text-decoration: none; padding: 8px 6px; white-space: nowrap; }
.top-login:hover { opacity: .8; }
.q-results { position: absolute; top: 40px; right: 0; width: min(520px, calc(100vw - 32px)); max-height: 70vh; overflow: auto; background: var(--bg); color: var(--fg);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(10,20,30,.18); padding: 6px; }
.q-results a { display: block; padding: 10px 12px; border-radius: 7px; text-decoration: none; color: var(--fg); }
.q-results a:hover, .q-results a[aria-selected="true"] { background: var(--surface); }
.q-results .qr-t { display: block; font-weight: 700; font-size: 14px; }
.q-results .qr-s { display: block; font-size: 12.5px; color: var(--mint-ink); }
.q-results .qr-x { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.q-results mark { background: var(--mint-soft); color: inherit; border-radius: 2px; }
.q-empty { padding: 12px; color: var(--muted); font-size: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 12px; padding: 10px 16px; font: 500 15px var(--font-ui); text-decoration: none; border: 1px solid transparent; cursor: pointer; white-space: nowrap; }
.btn-mint { background: var(--mint); color: #1e262c; }
.btn-mint:hover { filter: brightness(.95); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--mint-ink); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.top-cta { padding: 8px 16px; font-size: 15px; }

/* part tabs */
.tabs { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--top-h)); z-index: 15; background: var(--frame); box-shadow: 0 6px 14px -12px rgba(22,36,60,.35); border-bottom: 1px solid var(--line); }
.tabs-in { max-width: 1240px; margin: 0 auto; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; height: var(--tabs-h); align-items: stretch;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.tabs-in::-webkit-scrollbar { display: none; }
.tabs a { display: flex; align-items: center; padding: 0 12px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap; border-bottom: 3px solid transparent; }
.tabs a:hover { color: var(--fg); }
.tabs a[aria-current="page"] { color: var(--fg); font-weight: 700; border-bottom-color: var(--mint); }

/* shell */
.shell { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 28px 64px; }
.sidebar { position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--top-h) + var(--tabs-h) + 20px); align-self: start; max-height: calc(100vh - var(--top-h) - var(--tabs-h) - 40px); overflow: auto; font-size: 14px; background: var(--frame); border: 1px solid var(--line); border-radius: 12px; padding: 18px 12px 18px 14px; }
.side-mobile { display: none; }
.side-group { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.side-group:last-child { border-bottom: 0; }
.side-part { font-weight: 700; color: var(--fg); text-decoration: none; font-size: 13px; letter-spacing: .02em; text-transform: uppercase; }
.side-part.is-cur { color: var(--mint-ink); }
.side-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.side-group li > a { display: block; padding: 5px 8px; border-radius: 6px; color: var(--muted); text-decoration: none; line-height: 1.35; }
.side-group li > a:hover { background: var(--frame-hover); color: var(--fg); }
.side-group li > a[aria-current="page"] { background: var(--bg); box-shadow: inset 3px 0 0 var(--mint); color: var(--fg); font-weight: 700; }
.side-more { flex-direction: column; gap: 6px; }
.side-more a { color: var(--fg); font-weight: 500; text-decoration: none; }

/* reading column */
.content { min-width: 0; max-width: 740px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--muted); }
.eyebrow { font: 700 12px var(--font-ui); letter-spacing: .08em; text-transform: uppercase; color: var(--mint-ink); margin: 0 0 8px; }
h1, h2, h3 { font-family: var(--font-ui); text-wrap: balance; letter-spacing: -0.015em; line-height: 1.2; color: var(--fg); }
h1 { font-family: var(--font-display); font-size: clamp(32px, 4.2vw, 44px); font-weight: 400; letter-spacing: 0; margin: 0 0 12px; }
h2 { font-family: var(--font-display); font-size: 27px; font-weight: 400; letter-spacing: 0; margin: 44px 0 12px; }
h3 { font-size: 18px; font-weight: 700; margin: 28px 0 8px; }
.byline { font-size: 13.5px; color: var(--muted); margin: 0 0 28px; }
.byline .author { color: var(--fg); font-weight: 500; }
article p, article li, article dd { font-family: var(--font-read); font-size: 18px; line-height: 1.72; }
article p { margin: 0 0 16px; }
article ul, article ol { margin: 0 0 18px; padding-left: 24px; }
article li { margin-bottom: 6px; }
article strong { font-weight: 600; }
.lede { font-size: 20px !important; color: var(--fg); }
a.xref { color: var(--mint-ink); text-decoration-style: dotted; }
a.ext::after { content: "\2197"; font-size: .75em; margin-left: 2px; text-decoration: none; display: inline-block; }

.inshort { background: var(--surface); border-radius: 12px; padding: 18px 22px 8px; margin: 0 0 28px; }
.inshort h2 { font-family: var(--font-ui); font-weight: 700; margin: 0 0 8px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--mint-ink); }
.inshort li { font-size: 17px; }
.definition { border-left: 4px solid var(--mint); padding: 4px 0 4px 18px; margin: 0 0 24px; }
.definition p { font-size: 19px; margin: 0; }
.definition strong { font-weight: 600; }
.qa { padding: 2px 0; }
.qa h3 { font-size: 17px; margin: 18px 0 4px; }
.qa p { margin-bottom: 8px; }
.related, .readings, .sources { font-family: var(--font-ui) !important; font-size: 14.5px !important; line-height: 1.55 !important; color: var(--muted); }
.related { background: var(--surface); padding: 12px 16px; border-radius: 10px; color: var(--fg); }
.script { margin: 0 0 18px; padding: 14px 18px; background: var(--surface); border-radius: 10px; }
.script p { margin: 0; font-style: italic; }
hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }

/* cards */
.cards { list-style: none; padding: 0 !important; margin: 12px 0 24px !important; display: grid; gap: 10px; }
.cards li { margin: 0; font-family: var(--font-ui) !important; }
.cards a { display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--fg); background: var(--bg); }
.cards a:hover { border-color: var(--mint-ink); }
.card-n { grid-row: span 2; width: 32px; height: 32px; border-radius: 50%; background: var(--mint-soft); color: var(--mint-ink); display: grid; place-items: center; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.card-t { font-weight: 700; font-size: 16px; line-height: 1.3; }
.card-d { font-size: 14.5px; color: var(--muted); line-height: 1.45; font-family: var(--font-ui); }
.part-block { margin: 20px 0 8px; }
.part-block h3 { font-size: 20px; margin-bottom: 4px; }
.part-block h3 a { color: var(--fg); text-decoration: none; }
.part-block h3 a:hover { color: var(--mint-ink); }
.terms li { font-size: 16.5px; }

/* glossary + research */
.gloss { margin: 0 0 12px; }
.gl-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.gl-item:target { background: var(--mint-soft); border-radius: 8px; padding-inline: 12px; }
.gl-item dt { font: 700 17px var(--font-ui); margin-bottom: 4px; }
.gl-item dd { margin: 0; font-size: 17px; }
.more { font-family: var(--font-ui); font-size: 14px; white-space: nowrap; }
.rl-h { font-size: 16px; margin-top: 22px; }
.refs li { font-size: 16px; line-height: 1.55; }

/* CTA */
.cta { margin: 48px 0 0; padding: 28px; border-radius: 16px; background: var(--navy); color: var(--navy-fg); }
.cta h2 { color: #ffffff; margin: 0 0 8px; font-size: 28px; }
.cta p { margin: 0 0 16px; color: var(--navy-fg); opacity: .9; font-size: 16px; }
.cta-surveys { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 18px; }
.cta-survey { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); color: var(--navy-fg); text-decoration: none; }
.cta-survey:hover { border-color: var(--mint); }
.cs-name { font-weight: 700; font-size: 15px; }
.cs-meta { font-size: 13px; opacity: .8; }
.cs-go { font-size: 13px; color: var(--mint); font-weight: 700; margin-top: 4px; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cta .btn-ghost { color: var(--mint); border-color: var(--mint); }
.cta .btn-ghost:hover { background: rgba(57,215,183,.1); }
.cta-small { font-size: 13px !important; margin: 12px 0 0 !important; opacity: .75 !important; }

.cite { margin-top: 36px; padding: 18px 20px; border: 1px dashed var(--line); border-radius: 12px; }
.cite h2 { font-family: var(--font-ui); font-weight: 700; font-size: 16px; margin: 0 0 8px; }
.cite p { font-size: 15.5px !important; }
.copy-status { margin-left: 10px; font-size: 13px; color: var(--mint-ink); }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 32px; }
.pager a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--fg); font-weight: 700; font-size: 15px; line-height: 1.3; }
.pager a span { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pager .next { text-align: right; }
.pager a:hover { border-color: var(--mint-ink); }

.foot { background: var(--navy); color: var(--lav); }
.foot-in { max-width: 1240px; margin: 0 auto; padding-block: 32px 40px; font-size: 13.5px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.foot-in p { margin: 0 0 8px; max-width: 760px; }
.foot-in a { color: var(--lav); }
.foot-in a:hover { color: #ffffff; }
.foot-in strong { color: #ffffff; font-weight: 500; }
.foot-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,.12); }
.foot-top .brand { color: #ffffff; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0 !important; font-size: 14px; }
.foot-links a { text-decoration: none; }

/* narrow screens */
@media (max-width: 920px) {
  .shell { grid-template-columns: minmax(0, 1fr); gap: 0; padding-block: 16px 48px; }
  .sidebar { position: static; max-height: none; overflow: visible; margin-bottom: 16px; background: none; border: 0; padding: 0; }
  .side-desktop { display: none; }
  .side-mobile { display: block; background: var(--frame); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
  .side-mobile summary { font-weight: 700; cursor: pointer; }
  .side-mobile .side-inner { margin-top: 12px; }
}
@media (max-width: 640px) {
  .brand-sub { display: none; }
  .top-cta, .top-login { display: none; }
  .search { flex: 1 1 auto; }
  article p, article li, article dd { font-size: 17px; }
  .lede { font-size: 18.5px !important; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { text-align: left; }
  .cta { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* desktop: the sidebar carries navigation, so the tab bar is phone-only */
@media (min-width: 921px) {
  :root { --tabs-h: 0px; }
  .tabs { display: none; }
}
