/* ============================================================
   agentapiai.com 2026 — modern data editorial + macOS shell
   One design system for the new shell, home, detect, board,
   directory, tools, and legacy content pages.
   ============================================================ */

:root {
  --paper: #F4F3EF;
  --paper-2: #ECEBE6;
  --surface: #FFFFFF;
  --surface-2: #FAFAF7;
  --ink: #17191E;
  --ink-2: #3E424B;
  --muted: #737985;
  --faint: #8A909A;
  --line: #DCDDD8;
  --line-strong: #C7C9C3;
  --accent: #D9552F;
  --accent-ink: #A7381B;
  --blue: #2F6BFF;
  --blue-soft: #E8EEFF;
  --green: #1D8F63;
  --green-soft: #E4F3EC;
  --amber: #B7791F;
  --amber-soft: #F7EEDC;
  --danger: #BB3A3A;
  --danger-soft: #F9E8E6;
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 16px;
  --shadow-1: 0 1px 2px rgba(20, 22, 26, .05), 0 8px 24px rgba(20, 22, 26, .06);
  --shadow-2: 0 2px 6px rgba(20, 22, 26, .08), 0 24px 60px rgba(20, 22, 26, .12);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --serif: "Instrument Serif", "Noto Serif SC", "Songti SC", serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Legacy token bridge: old templates read these names. */
  --cream: var(--paper);
  --persimmon: var(--accent);
  --persimmon-dark: var(--accent-ink);
  --accent-text: var(--accent-ink);
  --warning-text: var(--amber);
  --moss: var(--green);
  --moss-text: var(--green);
  --line-2: rgba(23, 25, 30, .08);
  --butter: #F2D8A8;
  --peach: #F6D3C4;
  --sage: var(--green-soft);
  --wrap: 1280px;
  --r: 12px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #141519;
  --paper-2: #1B1D22;
  --surface: #202228;
  --surface-2: #25272E;
  --ink: #F2F1EC;
  --ink-2: #C9C9C4;
  --muted: #9A9EA7;
  --faint: #7F848E;
  --line: #33363E;
  --line-strong: #454952;
  --accent: #ED7652;
  --accent-ink: #F08A69;
  --blue: #7FA0FF;
  --blue-soft: #233152;
  --green: #55C594;
  --green-soft: #1D3A2D;
  --amber: #E4B25E;
  --amber-soft: #3B2F1B;
  --danger: #F07B72;
  --danger-soft: #3B2322;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .24);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .4), 0 24px 60px rgba(0, 0, 0, .36);
  --line-2: rgba(255, 255, 255, .08);
  --cream: var(--paper);
  --sage: var(--green-soft);
  --butter: #4A3B24;
  --peach: #4A2D25;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
::selection { background: var(--accent); color: #fff; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* The old chrome is replaced by the 2026 shell on Chinese pages. */
body.nx-has-shell > .grain,
body.nx-has-shell > .mobile-menu,
body.nx-has-shell > .a-rail,
body.nx-has-shell > #mobileMenu { display: none !important; }
body.nx-has-shell > .top,
body.nx-has-shell > header.top { display: none !important; }
body.nx-has-shell > .foot { display: none !important; }

.nx-skip {
  position: fixed; left: 12px; top: -60px; z-index: 300;
  background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 8px;
  transition: top .15s;
}
.nx-skip:focus { top: 12px; }

/* ============================================================ shell */
.nx-shell { min-height: 100dvh; display: flex; flex-direction: column; }
.nx-main { flex: 1 0 auto; }
.nx-top {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
  backdrop-filter: saturate(1.4) blur(18px);
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 9%, transparent);
}
.nx-top-in {
  width: min(1400px, calc(100% - 32px)); margin: 0 auto; height: 58px;
  display: flex; align-items: center; gap: 24px;
}
.nx-logo { display: inline-flex; align-items: center; gap: 9px; flex: none; min-width: 156px; }
.nx-logo img { width: 26px; height: 26px; }
.nx-word { font-family: var(--serif); font-size: 21px; letter-spacing: -.01em; white-space: nowrap; }
.nx-word i { font-style: normal; color: var(--accent); }
.nx-nav { display: flex; align-items: center; gap: 3px; position: relative; }
.nx-nav > a, .nx-nav > button {
  border: 0; background: transparent; padding: 7px 11px; border-radius: 8px;
  font-size: 13.5px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.nx-nav > a:hover, .nx-nav > button:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); }
.nx-nav > a[aria-current], .nx-nav > button[aria-expanded="true"] { color: var(--ink); font-weight: 600; background: color-mix(in srgb, var(--ink) 6%, transparent); }
.nx-chev { opacity: .55; }
.nx-spacer { flex: 1 1 auto; }
.nx-search {
  display: flex; align-items: center; gap: 8px; width: 236px; height: 34px; padding: 0 9px;
  border: 1px solid var(--line); border-radius: 9px; background: color-mix(in srgb, var(--surface) 64%, transparent);
  color: var(--muted); text-align: left;
}
.nx-search:hover { border-color: var(--line-strong); color: var(--ink-2); }
.nx-search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; font-size: 12.5px; color: var(--ink); pointer-events: none; }
.nx-kbd { font-family: var(--mono); font-size: 10.5px; color: var(--faint); background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.nx-iconbtn {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; border-radius: 9px; color: var(--ink-2);
}
.nx-iconbtn:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); }
.nx-lang {
  display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 8px;
  border: 0; background: transparent; border-radius: 9px; font-size: 12.5px; color: var(--ink-2);
}
.nx-lang:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.nx-account { font-size: 12.5px; color: var(--ink-2); padding: 7px 9px; border-radius: 8px; white-space: nowrap; }
.nx-account:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.nx-cta {
  height: 36px; padding: 0 16px; border-radius: 9px; border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper); font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 1px 2px rgba(0,0,0,.18);
}
.nx-cta:hover { filter: brightness(1.12); }
.nx-menu-btn { display: none; width: 36px; height: 36px; border: 0; background: transparent; border-radius: 9px; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--ink-2); }
.nx-menu-btn i { width: 16px; height: 1.5px; background: currentColor; border-radius: 2px; display: block; }
.nx-menu-btn:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }

.nx-mega {
  position: absolute; top: calc(100% + 10px); left: 210px; z-index: 70;
  width: min(780px, calc(100vw - 48px)); padding: 16px;
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-2);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
}
.nx-mega[hidden] { display: none; }
.nx-mega-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px 18px; }
.nx-mega h3 { margin: 4px 8px 6px; font-size: 10.5px; font-weight: 500; color: var(--faint); }
.nx-mega a { display: block; padding: 7px 8px; border-radius: 8px; font-size: 12.5px; color: var(--ink); }
.nx-mega a:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.nx-mega a span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 1px; line-height: 1.4; }
.nx-mega-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 10px 8px 2px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); }

.nx-lang-pop {
  position: absolute; right: 120px; top: calc(100% + 10px); z-index: 70; width: 220px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-2); padding: 6px;
}
.nx-lang-pop[hidden] { display: none; }
.nx-lang-pop a { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; }
.nx-lang-pop a:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.nx-lang-pop small { color: var(--muted); font-size: 10.5px; }

/* mobile sheet */
.nx-sheet { position: fixed; inset: 0; z-index: 120; background: rgba(20,22,26,.32); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.nx-sheet[hidden] { display: none; }
.nx-sheet-panel { width: min(460px, 100%); margin: 0 auto; background: var(--paper); border-radius: 0 0 20px 20px; padding: 18px 20px 24px; box-shadow: var(--shadow-2); }
.nx-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.nx-sheet-head b { font-family: var(--serif); font-size: 22px; font-weight: 400; }
.nx-sheet-close { width: 34px; height: 34px; border: 0; background: color-mix(in srgb, var(--ink) 6%, transparent); border-radius: 9px; font-size: 18px; color: var(--ink-2); }
.nx-sheet-primary { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 14px; }
.nx-sheet-primary a { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 15px; font-weight: 500; }
.nx-sheet-links { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.nx-sheet-links a { font-size: 13px; color: var(--ink-2); padding: 8px 2px; }
.nx-sheet-lang { display: flex; gap: 6px; margin-top: 14px; }
.nx-sheet-lang a { flex: 1; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 12px; color: var(--ink-2); }
.nx-sheet-lang a.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.nx-sheet-login { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; font-size: 13px; color: var(--ink-2); }
.nx-sheet-login a { color: var(--blue); }

/* command palette */
.nx-cmd { position: fixed; inset: 0; z-index: 140; display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; background: rgba(20,22,26,.34); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.nx-cmd[hidden] { display: none; }
.nx-cmd-box { width: min(640px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-2); overflow: hidden; }
.nx-cmd-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.nx-cmd-input input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 15px; color: var(--ink); }
.nx-cmd-list { max-height: 52vh; overflow: auto; padding: 6px; }
.nx-cmd-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border-radius: 8px; font-size: 13px; }
.nx-cmd-item.sel, .nx-cmd-item:hover { background: var(--blue-soft); }
.nx-cmd-item small { display: block; color: var(--muted); font-size: 11px; margin-top: 1px; }
.nx-cmd-kind { font-size: 10.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; white-space: nowrap; }
.nx-cmd-foot { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); color: var(--faint); font-size: 10.5px; }

/* footer */
.nx-foot { border-top: 1px solid var(--line); margin-top: 40px; background: var(--paper-2); }
.nx-foot-in { width: min(1280px, calc(100% - 48px)); margin: 0 auto; padding: 30px 0 18px; }
.nx-foot-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 28px; }
.nx-foot-brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 22px; }
.nx-foot-brand img { width: 28px; height: 28px; }
.nx-foot p { margin: 8px 0 0; font-size: 11.5px; line-height: 1.7; color: var(--muted); max-width: 270px; }
.nx-foot-col b { display: block; font-size: 10.5px; letter-spacing: .06em; color: var(--faint); font-weight: 500; margin-bottom: 7px; }
.nx-foot-col a { display: block; padding: 3px 0; font-size: 12px; color: var(--ink-2); }
.nx-foot-col a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.nx-foot-bottom { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); margin-top: 24px; padding-top: 12px; font-size: 10.5px; color: var(--faint); flex-wrap: wrap; }

/* ============================================================ shared components */
.nx-wrap { width: min(1280px, calc(100% - 48px)); margin: 0 auto; }
.nx-eyebrow { font-size: 11.5px; color: var(--muted); }
.nx-mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.nx-pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); white-space: nowrap; }
.nx-pill.live { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 30%, var(--line)); color: var(--green); }
.nx-pill.merchant { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 30%, var(--line)); color: var(--blue); }
.nx-pill.folk { background: var(--paper-2); color: var(--muted); }
.nx-pill.warn { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 30%, var(--line)); color: var(--amber); }
.nx-btn {
  height: 38px; padding: 0 15px; border-radius: 9px; border: 1px solid var(--line-strong);
  background: var(--surface); font-size: 13px; font-weight: 500; display: inline-flex;
  align-items: center; justify-content: center; gap: 7px; white-space: nowrap;
}
.nx-btn:hover { border-color: var(--faint); }
.nx-btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); font-weight: 600; }
.nx-btn.primary:hover { filter: brightness(1.14); }
.nx-btn.soft { background: transparent; border-color: transparent; color: var(--ink-2); }
.nx-btn.soft:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.nx-btn.sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.nx-btn:disabled { opacity: .5; cursor: not-allowed; }
.nx-input { height: 40px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); display: flex; align-items: center; gap: 8px; padding: 0 11px; }
.nx-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 14%, transparent); background: var(--surface); }
.nx-input input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 13px; }
.nx-chip { height: 30px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 12px; display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); white-space: nowrap; }
.nx-chip:hover { border-color: var(--line-strong); }
.nx-chip.on { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 40%, var(--line)); color: var(--blue); }
.nx-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: var(--shadow-1); }
.nx-sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.nx-sec-head h2 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.nx-sec-head p { margin: 0; font-size: 12px; color: var(--muted); max-width: 480px; line-height: 1.6; }
.nx-table { width: 100%; border-collapse: collapse; }
.nx-table th { font-size: 10.5px; font-weight: 500; color: var(--muted); text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.nx-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 12px; vertical-align: middle; }
.nx-table tr:last-child td { border-bottom: 0; }
.nx-table tbody tr:hover { background: color-mix(in srgb, var(--ink) 2.5%, transparent); }
.nx-table .num { font-family: var(--mono); font-size: 11.5px; white-space: nowrap; }
.nx-table .site b { display: block; font-size: 12.5px; font-weight: 500; }
.nx-table .site small { display: block; font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.nx-empty { padding: 26px 18px; text-align: center; color: var(--muted); font-size: 12.5px; }
.nx-empty b { display: block; color: var(--ink); font-size: 14px; margin-bottom: 4px; }

/* ============================================================ homepage */
.nx-home { padding: 46px 0 0; }
.nx-home-hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(360px, .7fr); gap: 40px; align-items: start; }
.nx-home-hero > * { min-width: 0; }
.nx-live-line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 17px; flex-wrap: wrap; }
.nx-live-line .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); display: inline-block; }
.nx-home h1 { margin: 0 0 14px; font-size: clamp(38px, 4.5vw, 62px); line-height: 1.02; letter-spacing: -.04em; font-weight: 600; max-width: 720px; }
.nx-home h1 em { font-family: var(--serif); font-style: normal; font-weight: 400; letter-spacing: -.015em; }
.nx-lede { margin: 0 0 22px; color: var(--ink-2); font-size: 14.5px; line-height: 1.7; max-width: 560px; }
.nx-quicktest { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 17px; max-width: 650px; box-shadow: var(--shadow-1); }
.nx-qt-label { font-size: 11px; color: var(--muted); margin: 0 0 6px; font-weight: 500; }
.nx-qt-endpoint { display: flex; gap: 8px; }
.nx-qt-models { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.nx-qt-models .nx-eyebrow { margin-right: 2px; flex: none; white-space: nowrap; }
.nx-qt-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.nx-qt-foot a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.nx-freshness { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); margin-top: 12px; flex-wrap: wrap; }
.nx-freshness .nx-pill { height: 20px; font-size: 10.5px; }
.nx-home-panel { background: color-mix(in srgb, var(--surface) 64%, transparent); border: 1px solid var(--line); border-radius: var(--radius-l); box-shadow: var(--shadow-1); overflow: hidden; }
.nx-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 15px 11px; }
.nx-panel-head h2 { margin: 0; font-size: 13.5px; font-weight: 600; }
.nx-board-mini { padding: 0 7px 7px; }
.nx-brow { display: grid; grid-template-columns: 22px minmax(0, 1fr) 58px; align-items: center; gap: 8px; padding: 9px 8px; border-radius: 8px; }
.nx-brow:hover { background: color-mix(in srgb, var(--ink) 4.5%, transparent); }
.nx-brow .rk { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.nx-brow .nm { font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-brow .nm small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 400; margin-top: 1px; }
.nx-brow .sc { font-family: var(--mono); font-size: 12px; text-align: right; }
.nx-panel-foot { border-top: 1px solid var(--line); padding: 10px 15px; font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.nx-panel-foot a { color: var(--ink-2); }
.nx-task-strip { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 36px; }
.nx-task { padding: 17px 24px 19px; border-right: 1px solid var(--line); display: block; }
.nx-task:last-child { border-right: 0; }
.nx-task:hover { background: color-mix(in srgb, var(--surface) 60%, transparent); }
.nx-task .tp { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.nx-task b { font-size: 14px; font-weight: 600; }
.nx-task .n { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.nx-task p { margin: 5px 0 0; font-size: 12px; color: var(--muted); line-height: 1.55; }
.nx-home-section { padding: 34px 0 0; }
.nx-site-list { border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; background: var(--surface); }
.nx-site-list .nx-table th:first-child, .nx-site-list .nx-table td:first-child { padding-left: 16px; }
.nx-site-list .nx-table th:last-child, .nx-site-list .nx-table td:last-child { padding-right: 16px; }
.nx-home-footnote { display: flex; justify-content: space-between; gap: 14px; margin-top: 10px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }

/* ============================================================ detect */
.nx-detect { padding: 30px 0 80px; }
.nx-detect-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 18px; }
.nx-detect-head h1 { margin: 0; font-size: 32px; letter-spacing: -.03em; }
.nx-detect-head p { margin: 5px 0 0; color: var(--muted); font-size: 12.5px; }
.nx-detect-grid { display: grid; grid-template-columns: 318px minmax(0, 1fr) 254px; gap: 15px; align-items: start; }
.nx-detect-grid > * { min-width: 0; }
.nx-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: var(--shadow-1); }
.nx-panel-pad { padding: 15px; }
.nx-panel-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.nx-panel-title h2 { margin: 0; font-size: 13px; font-weight: 600; }
.nx-panel-title span { font-size: 10.5px; color: var(--muted); }
.nx-field { margin-bottom: 12px; }
.nx-field > label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.nx-field .nx-input { height: 38px; }
.nx-hint { font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.nx-combo { position: relative; }
.nx-combo .nx-input { height: 40px; }
.nx-combo-pop { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-2); overflow: hidden; }
.nx-combo-pop[hidden] { display: none; }
.nx-combo-group { padding: 5px 5px 2px; }
.nx-combo-group b { display: block; padding: 4px 7px; font-size: 10px; font-weight: 500; color: var(--faint); }
.nx-opt { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px; border-radius: 7px; font-size: 12px; border: 0; background: transparent; width: 100%; text-align: left; }
.nx-opt:hover, .nx-opt.active { background: var(--blue-soft); }
.nx-opt small { display: block; color: var(--muted); font-size: 10.5px; margin-top: 1px; }
.nx-opt .price { font-family: var(--mono); font-size: 10.5px; color: var(--ink-2); }
.nx-combo-empty { padding: 10px; color: var(--muted); font-size: 11.5px; }
.nx-combo-foot { border-top: 1px solid var(--line); padding: 7px 10px; display: flex; justify-content: space-between; font-size: 10px; color: var(--faint); }
.nx-seg { display: flex; padding: 3px; background: var(--paper-2); border-radius: 8px; gap: 2px; }
.nx-seg button { flex: 1; height: 27px; border: 0; background: transparent; border-radius: 6px; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.nx-seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(20,22,26,.08); }
.nx-adv { display: flex; align-items: center; justify-content: space-between; padding: 9px 0 0; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 2px; }
.nx-runbar { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
.nx-runbar .sum { flex: 1; min-width: 0; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-checks { padding: 7px 7px 9px; }
.nx-check { display: grid; grid-template-columns: 24px minmax(0, 1fr) 92px; gap: 10px; align-items: center; padding: 9px 8px; border-radius: 8px; }
.nx-check:hover { background: var(--surface-2); }
.nx-check .ic { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--paper-2); color: var(--faint); }
.nx-check.done .ic { background: var(--green-soft); color: var(--green); }
.nx-check.run .ic { background: var(--blue-soft); color: var(--blue); }
.nx-check b { display: block; font-size: 12.5px; font-weight: 500; }
.nx-check small { display: block; font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.nx-check .st { font-size: 10.5px; text-align: right; color: var(--muted); }
.nx-check.done .st { color: var(--green); }
.nx-check.run .st { color: var(--blue); }
.nx-evidence { margin: 4px 7px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); padding: 10px 11px; }
.nx-evidence .eh { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 10.5px; color: var(--muted); }
.nx-evidence pre { margin: 7px 0 0; font-family: var(--mono); font-size: 10.5px; line-height: 1.6; color: var(--ink-2); white-space: pre-wrap; }
.nx-side-block { padding: 13px 15px; border-bottom: 1px solid var(--line); }
.nx-side-block:last-child { border-bottom: 0; }
.nx-side-block h3 { margin: 0 0 7px; font-size: 12px; font-weight: 600; }
.nx-recent-run { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 6px 0; font-size: 11.5px; border-bottom: 1px solid var(--line); }
.nx-recent-run:last-child { border-bottom: 0; }
.nx-recent-run b { font-weight: 500; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-recent-run span { color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.nx-side-list { margin: 0; padding: 0; list-style: none; }
.nx-side-list li { display: flex; gap: 8px; padding: 4px 0; font-size: 11.5px; color: var(--ink-2); }
.nx-side-list li span { color: var(--muted); }
.nx-privacy { font-size: 11px; color: var(--muted); line-height: 1.6; }
.nx-empty-result { padding: 24px 18px; }
.nx-empty-result .nx-eyebrow { display: block; margin-bottom: 4px; }
.nx-empty-result h2 { margin: 0 0 6px; font-size: 18px; }
.nx-empty-result p { margin: 0 0 8px; font-size: 12px; color: var(--muted); line-height: 1.65; }
.nx-empty-result ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 11.5px; line-height: 1.85; }

/* detect result uses classes emitted by detect-app.js */
.nx-result-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 15px; border-bottom: 1px solid var(--line); }
.nx-result-head h2 { margin: 3px 0 0; font-size: 20px; }
.nx-result-head p { margin: 4px 0 0; color: var(--muted); font-size: 11.5px; }
.nx-verdict { text-align: right; border: 1px solid var(--line); border-radius: 10px; padding: 8px 13px; min-width: 90px; }
.nx-verdict b { display: block; font-size: 18px; }
.nx-verdict span { font-size: 10px; color: var(--muted); }
.nx-verdict.pass { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 35%, var(--line)); color: var(--green); }
.nx-verdict.suspect { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 35%, var(--line)); color: var(--amber); }
.nx-verdict.fail { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); color: var(--danger); }
.nx-result-items { padding: 7px; }
.nx-check-result { padding: 10px 9px; border-bottom: 1px solid var(--line); }
.nx-check-result:last-child { border-bottom: 0; }
.nx-check-result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12.5px; }
.nx-stamp { font-size: 10.5px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.nx-stamp.pass { background: var(--green-soft); color: var(--green); border-color: transparent; }
.nx-stamp.suspect { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.nx-stamp.fail { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.nx-check-result ul { margin: 7px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 11px; line-height: 1.7; }
.nx-json { margin: 0 15px 15px; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; background: var(--surface-2); }
.nx-json summary { cursor: pointer; font-size: 11.5px; color: var(--muted); }
.nx-json pre { margin: 8px 0 0; max-height: 320px; overflow: auto; font-family: var(--mono); font-size: 10.5px; line-height: 1.55; white-space: pre-wrap; }
.nx-result-actions { display: flex; gap: 7px; flex-wrap: wrap; padding: 0 15px 15px; }
.nx-official { margin: 0 15px 12px; font-size: 11px; color: var(--muted); }

/* ============================================================ board */
.nx-board { padding: 34px 0 0; }
.nx-board-hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr); gap: 34px; align-items: start; }
.nx-board h1 { margin: 3px 0 10px; font-size: clamp(32px, 4vw, 48px); letter-spacing: -.035em; line-height: 1.05; }
.nx-board h1 em { font-family: var(--serif); font-style: normal; font-weight: 400; }
.nx-board-lead { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.7; max-width: 620px; }
.nx-board-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; }
.nx-stat { border: 1px solid var(--line); border-radius: 10px; padding: 12px 13px; background: var(--surface); }
.nx-stat b { display: block; font-family: var(--mono); font-size: 22px; font-weight: 500; }
.nx-stat span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.nx-board-status { border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); box-shadow: var(--shadow-1); padding: 17px; }
.nx-board-status h2 { margin: 0 0 6px; font-size: 14px; }
.nx-board-status p { margin: 0; font-size: 11.5px; line-height: 1.65; color: var(--muted); }
.nx-board-empty { border: 1px dashed var(--line-strong); border-radius: 12px; padding: 24px 20px; margin-top: 16px; }
.nx-board-empty b { display: block; font-size: 15px; margin-bottom: 5px; }
.nx-board-empty p { margin: 0 0 10px; font-size: 12px; color: var(--muted); line-height: 1.65; }
.nx-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 24px; }
.nx-step { border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; background: var(--surface); }
.nx-step b { display: block; font-size: 12px; }
.nx-step span { display: block; margin-top: 3px; font-size: 10.5px; color: var(--muted); line-height: 1.5; }
.nx-board-body { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .65fr); gap: 18px; margin-top: 30px; align-items: start; }
.nx-board-table { overflow: hidden; }
.nx-board-note { padding: 13px 15px; border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); line-height: 1.65; }
.nx-board-note b { color: var(--ink-2); font-weight: 500; }
.nx-board-side { display: grid; gap: 12px; }
.nx-side-card { border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); padding: 15px; }
.nx-side-card h3 { margin: 0 0 7px; font-size: 12.5px; }
.nx-side-card p, .nx-side-card li { font-size: 11.5px; color: var(--muted); line-height: 1.65; }
.nx-side-card ul { margin: 0; padding-left: 17px; }
.nx-side-card a { color: var(--blue); }

/* ============================================================ directory */
.nx-dir { padding: 30px 0 60px; }
.nx-dir-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.nx-dir-head h1 { margin: 3px 0 6px; font-size: 32px; letter-spacing: -.03em; }
.nx-dir-head p { margin: 0; color: var(--muted); font-size: 12.5px; max-width: 660px; line-height: 1.6; }
.nx-dir-stats { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; font-size: 11px; color: var(--muted); }
.nx-dir-stats b { color: var(--ink); font-family: var(--mono); font-size: 14px; font-weight: 500; margin-right: 3px; }
.nx-dir-toolbar { display: flex; align-items: center; gap: 8px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius-m) var(--radius-m) 0 0; background: var(--surface); flex-wrap: wrap; }
.nx-dir-search { display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--muted); flex: 1; min-width: 190px; }
.nx-dir-search input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 12px; }
.nx-select { height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 11.5px; color: var(--ink-2); }
.nx-dir-count { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; }
.nx-dir-table-wrap { border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius-m) var(--radius-m); overflow: auto; background: var(--surface); }
.nx-dir-table { min-width: 820px; }
.nx-dir-table th button { border: 0; background: transparent; padding: 0; font: inherit; color: inherit; }
.nx-dir-note { margin: 10px 0 0; font-size: 11px; color: var(--muted); line-height: 1.6; }
.nx-dir-note b { color: var(--ink-2); font-weight: 500; }
.nx-dir-empty { padding: 30px 18px; text-align: center; font-size: 12px; color: var(--muted); }
.nx-dir-type { display: inline-flex; align-items: center; gap: 4px; }
.nx-dir-type i { width: 5px; height: 5px; border-radius: 50%; background: var(--faint); }
.nx-dir-type.official i { background: var(--blue); }

/* ============================================================ tools */
.nx-tool { padding: 34px 0 60px; }
.nx-tool h1 { margin: 3px 0 7px; font-size: 32px; letter-spacing: -.03em; }
.nx-tool-lead { margin: 0 0 18px; color: var(--muted); font-size: 13px; max-width: 640px; line-height: 1.65; }
.nx-tool-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.nx-tool-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: var(--shadow-1); padding: 16px; }
.nx-tool-panel h2 { margin: 0 0 12px; font-size: 14px; }
.nx-tool-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nx-tool-result { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; font-size: 13px; }
.nx-tool-result pre { margin: 8px 0 0; padding: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; font-family: var(--mono); font-size: 11px; line-height: 1.6; white-space: pre-wrap; overflow: auto; }
.nx-tool-table { margin-top: 12px; overflow: auto; }
.nx-tool-table table { min-width: 560px; }
.nx-tool-side { display: grid; gap: 12px; }
.nx-tool-side .nx-side-card h3 { margin-bottom: 5px; }
.nx-tool-index { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.nx-tool-card { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 15px; display: block; }
.nx-tool-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.nx-tool-card b { display: block; font-size: 14px; margin-bottom: 4px; }
.nx-tool-card p { margin: 0; font-size: 11.5px; color: var(--muted); line-height: 1.55; }
.nx-tool-card span { display: block; margin-top: 8px; font-size: 11px; color: var(--blue); }
.nx-key-status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
.nx-key-status.ok { color: var(--green); }
.nx-key-status.bad { color: var(--danger); }
.nx-key-status.warn { color: var(--amber); }

/* ============================================================ legacy page restyle */
.wt-page, .detail-page, .dossier, .dir-page, .model-page, .tools-page, .content-page, .report-page {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
  padding-top: 24px;
}
.wt-hero, .detail-hero, .dossier-hero, .dir-hero, .model-hero, .rb-head, .section-head { border-color: var(--line); }
.wt-hero h1, .detail-hero h1, .dossier h1, .dir-hero h1, .model-hero h1, .report-hero h1 {
  font-family: var(--sans); font-weight: 600; letter-spacing: -.035em; line-height: 1.12; color: var(--ink);
}
.wt-hero h1 em, .detail-hero h1 em, .dossier h1 em, .dir-hero h1 em, .model-hero h1 em, .report-hero h1 em {
  font-family: var(--serif); font-style: normal; font-weight: 400; color: var(--ink);
}
.wt-kicker, .detail-kicker, .dir-kicker, .model-kicker, .head-latin, .kicker {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .05em; text-transform: none; color: var(--muted);
}
.wt-page p, .detail-page p, .dossier p, .dir-page p, .model-page p, .content-page p, .report-page p { color: var(--ink-2); }
.wt-note, .detail-note, .ds-note, .dir-note, .model-note { color: var(--muted); font-size: 11.5px; line-height: 1.65; }
.wt-table-wrap, .detail-table-wrap, .dir-table-wrap, .model-table-wrap, .wt-table, .detail-table, .dir-table, .model-table { border-color: var(--line); }
.wt-table th, .detail-table th, .dir-table th, .model-table th { background: var(--surface-2); color: var(--muted); font-family: var(--sans); font-size: 10.5px; font-weight: 500; }
.wt-table td, .detail-table td, .dir-table td, .model-table td { border-color: var(--line); color: var(--ink-2); font-size: 12px; }
.wt-card, .detail-card, .pick-card, .path, .dossier-section, .ds-empty, .model-card, .tool-card {
  background: var(--surface); border-color: var(--line); box-shadow: none; border-radius: 12px;
}
.wt-section, .dossier-section { border-color: var(--line); }
.wt-section-head h2, .rb-head h2, .section-head h2 { font-family: var(--sans); font-weight: 600; letter-spacing: -.02em; }
.wt-section-head h2 em, .rb-head h2 em, .section-head h2 em { font-family: var(--serif); color: var(--ink); }
.wt-pill, .grade-pill, .risk-pill, .tag { border-radius: 999px; }
.wt-pill.a, .grade-pill.a { background: var(--green-soft); color: var(--green); }
.wt-pill.b { background: var(--amber-soft); color: var(--amber); }
.wt-pill.c { background: var(--paper-2); color: var(--muted); }
.btn, .btn-primary, .btn-soft, .nav-cta { border-radius: 9px; font-weight: 500; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--paper); box-shadow: none; }
.btn-primary:hover { background: var(--ink); filter: brightness(1.12); }
.btn-soft { background: var(--surface); border-color: var(--line-strong); color: var(--ink-2); }
.btn-soft:hover { background: var(--surface-2); }
.proto-btn, .mode-btn, .combo-option, .model-chip, .chip, .filter-select, .filter {
  border-color: var(--line); background: var(--surface); color: var(--ink-2); border-radius: 8px;
}
.proto-btn.on, .mode-btn.on, .chip.on, .model-chip.on { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }
.combo-list, .combo-pop, .model-drawer .model-panel { background: var(--surface); border-color: var(--line); }
.dossier-metric, .dir-stats > div, .model-stats > div { border-color: var(--line); }
.dossier-metric b, .dir-stats b, .model-stats b { color: var(--ink); }
.gc-grade, .grade-stamp { border-color: var(--line); color: var(--ink); }
.ds-links a, .detail-crumb a, .dossier-crumb a, .wt-crumb a { color: var(--blue); }
.wt-crumb, .detail-crumb, .dossier-crumb { color: var(--muted); font-size: 11.5px; }

/* generic content typography: kill the newspaper look on product pages */
.wt-page, .detail-page, .dir-page, .model-page, .tools-page, .content-page, .report-page, .dossier { font-family: var(--sans); }
.wt-page h2, .detail-page h2, .dir-page h2, .model-page h2, .content-page h2, .report-page h2 { font-family: var(--sans); font-weight: 600; letter-spacing: -.02em; }
.wt-page .serif, .detail-page .serif { font-family: var(--serif); }

@media (max-width: 1180px) {
  .nx-home-hero, .nx-board-hero { grid-template-columns: 1fr; gap: 26px; }
  .nx-detect-grid { grid-template-columns: 300px minmax(0, 1fr); }
  .nx-detect-grid .nx-rail { display: none; }
  .nx-search { display: none; }
  .nx-account { display: none; }
  .nx-mega { left: 0; }
}
@media (max-width: 980px) {
  .nx-nav > a, .nx-nav > button { padding: 7px 8px; }
  .nx-logo { min-width: 0; }
  .nx-word { font-size: 19px; }
  .nx-tool-grid, .nx-board-body { grid-template-columns: 1fr; }
  .nx-tool-index { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .nx-top-in { width: calc(100% - 24px); height: 54px; gap: 8px; }
  .nx-nav, .nx-search, .nx-lang, .nx-account { display: none; }
  .nx-menu-btn { display: flex; }
  .nx-cta { padding: 0 12px; }
  .nx-word { font-size: 18px; }
  .nx-home { padding-top: 30px; }
  .nx-home h1 { font-size: 40px; }
  .nx-home-hero, .nx-detect, .nx-board, .nx-dir, .nx-tool { padding-left: 0; padding-right: 0; }
  .nx-wrap { width: calc(100% - 32px); }
  .nx-task-strip { grid-template-columns: 1fr; }
  .nx-task { border-right: 0; border-bottom: 1px solid var(--line); padding: 14px 18px; }
  .nx-detect-grid { grid-template-columns: 1fr; }
  .nx-detect-head, .nx-dir-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .nx-detect-head h1, .nx-dir-head h1, .nx-tool h1 { font-size: 28px; }
  .nx-qt-endpoint { flex-direction: column; }
  .nx-qt-endpoint .nx-btn { width: 100%; }
  .nx-qt-models { flex-wrap: wrap; overflow: visible; padding-bottom: 2px; }
  .nx-qt-models .nx-input { width: 100% !important; }
  .nx-combo-pop { position: static; margin-top: 6px; box-shadow: none; }
  .nx-board-stats, .nx-tool-row { grid-template-columns: 1fr 1fr; }
  .nx-steps { grid-template-columns: 1fr; }
  .nx-board-body { grid-template-columns: 1fr; }
  .nx-foot-in { width: calc(100% - 32px); }
  .nx-foot-grid { grid-template-columns: 1fr 1fr; }
  .nx-foot-brand { grid-column: 1 / -1; }
  .nx-tool-index { grid-template-columns: 1fr; }
  .wt-page, .detail-page, .dossier, .dir-page, .model-page, .tools-page, .content-page, .report-page { width: calc(100% - 32px); }
}
