/* AI directory — Ink & Paper. */
:root {
  --paper: #f3efe6;
  --paper-elev: #fbf8f2;
  --ink: #171512;
  --muted: #5a554c;
  --faint: #8a8478;
  --line: #d8d0c0;
  --line-strong: #b7ad9a;
  --accent: #1c3f62;
  --accent-hover: #0f2a44;
  --accent-soft: #e4ebf2;
  --warn: #7a3e12;
  --warn-soft: #f3e4d2;
  --ok: #1d4d36;
  --ok-soft: #dceadf;
  --draft: #3c2a0a;
  --draft-bg: #ecdaa6;
  --max: 74rem;
  --measure: 44rem;
  --font-sans: "IBM Plex Sans", "Noto Sans CJK SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-serif: "Fraunces", "IBM Plex Serif", "Noto Serif CJK SC", "Songti SC", "Noto Serif SC", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", "Noto Sans Mono CJK SC", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  font-feature-settings: "ss01" 0, "kern" 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { color: var(--accent-hover); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.skip {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.4rem 0.7rem;
  z-index: 20;
}
.skip:focus { top: 0.75rem; }

.site-bar, .draft-bar {
  background: var(--draft-bg);
  color: var(--draft);
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
  padding: 0.45rem 1.25rem;
  text-align: center;
  border-bottom: 1px solid #d9bf74;
}
.site-bar strong, .draft-bar strong { font-weight: 600; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper-elev);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.brand-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}
.brand-name {
  font-family: var(--font-serif);
  font-weight: 560;
  font-size: 1.15rem;
  line-height: 1.2;
  font-variation-settings: "opsz" 40, "SOFT" 0, "WONK" 0;
}
.brand-name .tbc { color: var(--warn); font-style: italic; font-weight: 500; }
.header-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  font-size: 0.92rem;
}
.nav a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 0.05rem;
}
.nav a:hover, .nav a[aria-current="page"] {
  border-bottom-color: var(--ink);
  color: var(--ink);
}
.lang-switch {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
  font-size: 0.8rem;
}
.lang-switch a {
  text-decoration: none;
  color: var(--muted);
  padding: 0.2rem 0.65rem;
}
.lang-switch a[aria-current="true"] {
  background: var(--ink);
  color: var(--paper);
}

main { flex: 1; width: 100%; min-width: 0; }
.wrap {
  width: min(var(--max), calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 2rem 0 3.5rem;
  min-width: 0;
  max-width: 100%;
}
.prose { min-width: 0; max-width: 100%; }
.wrap.narrow { width: min(var(--measure), calc(100% - 2.5rem)); }

.hero { padding: 0.5rem 0 1.75rem; max-width: 42rem; }
.hero h1 {
  font-family: var(--font-serif);
  font-weight: 560;
  font-size: clamp(1.8rem, 3.4vw, 2.7rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  font-variation-settings: "opsz" 72, "SOFT" 20, "WONK" 0.4;
}
.lede { font-size: 1.12rem; color: var(--ink); margin: 0 0 1.25rem; }
.hero-actions, .cta-row { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 1rem 0; }
.meta-line { color: var(--muted); font-size: 0.9rem; margin: 0.8rem 0 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.55rem 1.05rem;
  font-size: 0.95rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper-elev);
  line-height: 1.3;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-ghost {
  background: transparent;
  color: var(--ink);
}
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-hover); }
.btn[disabled], .btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 560;
  line-height: 1.25;
  letter-spacing: -0.015em;
  font-variation-settings: "opsz" 36, "SOFT" 0;
}
h2 { font-size: 1.55rem; margin: 2.2rem 0 0.8rem; }
h3 { font-size: 1.2rem; margin: 1.6rem 0 0.6rem; }
h4 { font-size: 1.05rem; margin: 1.2rem 0 0.4rem; }
p { margin: 0 0 0.95rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.25rem; }
li { margin: 0.25rem 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }

.section-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 0.35rem;
}

.tool-toolbar, .table-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin: 0 0 1rem;
}
.tool-toolbar input[type="search"], .table-toolbar input[type="search"] {
  flex: 1 1 14rem;
  min-width: 12rem;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.4rem;
  background: var(--paper-elev);
  color: var(--ink);
}
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip {
  font: inherit;
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.chip[aria-pressed="true"], .chip.is-on {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
  gap: 0.85rem;
}
.card {
  background: var(--paper-elev);
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  padding: 1rem 1.05rem 1.1rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 100%;
}
a.card:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.card h3 { margin: 0; font-size: 1.15rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.92rem; flex: 1; }
.card-meta { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.4rem; }

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  border: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  white-space: nowrap;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: #b7d4c3; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: #e0c39a; }
.badge-muted { background: #eeeae1; color: var(--muted); }

.panel {
  background: var(--paper-elev);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: 1.2rem 1.3rem 1.3rem;
  margin: 1.25rem 0;
}
.panel h2 { margin-top: 0; }
.note, blockquote {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  margin: 1rem 0;
  padding: 0.7rem 0.9rem;
  color: var(--ink);
}
blockquote { font-style: normal; }
.note.warning, .callout-warn {
  background: var(--warn-soft);
  border-left-color: var(--warn);
}

.prose table, .table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--paper-elev);
}
.prose th, .prose td, .table-wrap th, .table-wrap td {
  border-bottom: 1px solid var(--line);
  padding: 0.5rem 0.6rem;
  vertical-align: top;
  text-align: left;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.prose thead th, .table-wrap thead th {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: none;
  font-weight: 600;
  background: #ece6d8;
  position: sticky;
  /* Must be 0 inside overflow-x containers: top: 3.6rem painted the
     header over the first body row (the wrap becomes a scrollport). */
  top: 0;
  z-index: 2;
}
.prose tbody th, .table-wrap tbody th { font-weight: 600; }
.num, td.num { font-family: var(--font-mono); font-size: 0.84rem; font-variant-numeric: tabular-nums; text-align: right; }
.table-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  margin: 1rem 0 0.4rem;
  background: var(--paper-elev);
  -webkit-overflow-scrolling: touch;
}
.table-hint { font-size: 0.82rem; color: var(--muted); margin: 0 0 0.8rem; }
.table-wrap table { min-width: 36rem; width: max-content; }
.table-wrap.compact table { min-width: 32rem; }
.table-wrap th, .table-wrap td { max-width: 14rem; overflow-wrap: anywhere; word-break: break-word; }
.table-wrap th:nth-child(1), .table-wrap td:nth-child(1),
.table-wrap th:nth-child(1) { position: sticky; left: 0; z-index: 1; background: var(--paper-elev); box-shadow: 1px 0 0 var(--line); min-width: 7.5rem; max-width: 9rem; }
.table-wrap thead th:nth-child(1) { z-index: 3; background: #ece6d8; }
.table-wrap th:nth-child(2), .table-wrap td:nth-child(2) { min-width: 9rem; max-width: 13rem; }
.table-wrap th:nth-child(3), .table-wrap td:nth-child(3),
.table-wrap th:nth-child(4), .table-wrap td:nth-child(4),
.table-wrap th:nth-child(5), .table-wrap td:nth-child(5) { min-width: 7rem; max-width: 13rem; }
.table-wrap th:nth-child(9), .table-wrap td:nth-child(9) { white-space: nowrap; max-width: none; }
.table-wrap th:nth-child(11), .table-wrap td:nth-child(11) { max-width: 16rem; }
.sortable th[data-sort] { cursor: pointer; user-select: none; white-space: nowrap; }
.sortable th[data-sort]::after { content: " \2195"; color: var(--faint); font-weight: 400; }
.sortable th[data-sort].sort-asc::after { content: " \2191"; color: var(--accent); }
.sortable th[data-sort].sort-desc::after { content: " \2193"; color: var(--accent); }
tr.is-hidden { display: none; }
.cell-tbc { color: var(--warn); font-style: italic; }
.source a { word-break: break-all; }

.tool-head { margin-bottom: 1.2rem; }
.tool-head h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  margin: 0.2rem 0 0.6rem;
  font-variation-settings: "opsz" 60, "SOFT" 10;
}
.official-links { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; margin: 0 0 1rem; }

.subscribe label { display: block; margin: 0.7rem 0 0.3rem; font-size: 0.92rem; }
.subscribe input[type="email"] {
  width: 100%;
  max-width: 28rem;
  font: inherit;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.4rem;
  background: #fff;
}
.consent { display: flex !important; gap: 0.5rem; align-items: flex-start; max-width: 36rem; }
.consent input { margin-top: 0.35rem; }
.form-disabled-note { color: var(--warn); font-size: 0.9rem; }

.issue-card {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1rem 0;
}
.issue-card h3 { margin-top: 0; }

.site-footer {
  border-top: 1px solid var(--line);
  background: #ece7db;
  padding: 1.4rem 1.5rem 2rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.footer-inner { width: min(var(--max), calc(100% - 0rem)); margin: 0 auto; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.7rem 1.1rem; margin: 0 0 0.8rem; }
.footer-nav a { color: var(--ink); }
.disclaimer { margin: 0 0 0.4rem; max-width: 46rem; }

.lang-chooser {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}
.lang-chooser a.card h2 { margin: 0 0 0.4rem; }

.prose .footnotes, .tiny { font-size: 0.85rem; color: var(--muted); }
.price-checked { margin: 0.35rem 0 1.1rem; }
[hidden] { display: none !important; }


.nav-reserved {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.9rem;
  padding: 0.45rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  font-size: 0.84rem;
}
.footer-inner .nav-reserved {
  padding: 0.6rem 0 0;
  border-bottom: 0;
  background: transparent;
}
.nav-reserved-label {
  color: var(--muted);
  margin-right: 0.2rem;
}
.nav-reserved a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.nav-reserved a:hover, .nav-reserved a[aria-current="page"] {
  border-bottom-color: var(--ink);
}
.reserved-home { margin: 0 0 2rem; }

@media (max-width: 720px) {
  .site-header { flex-direction: column; align-items: flex-start; position: static; }
  .header-right { justify-content: flex-start; }
  .wrap, .wrap.narrow { width: calc(100% - 1.6rem); padding-top: 1.4rem; }
  .prose thead th, .table-wrap thead th { top: 0; }
  .lang-chooser { grid-template-columns: 1fr; }
  body { font-size: 1rem; }
}

/* GEO revamp: byline, lead, FAQ, charts, compact/card tables */
.byline {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0 0 0.8rem;
}
.lead-answer {
  font-size: 1.05rem;
  max-width: 40rem;
  margin: 0 0 1rem;
}
figure.chart {
  margin: 1rem 0 1.4rem;
  padding: 0.6rem 0.2rem 0.2rem;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  max-width: 100%;
}
figure.chart img,
figure.chart svg {
  width: 100%;
  height: auto;
  background: #fff;
  border: 1px solid var(--line);
}
@media (max-width: 40rem) {
  figure.chart img,
  figure.chart svg {
    width: auto;
    min-width: 32rem;
    max-width: none;
  }
}
figure.chart figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.45rem 0 0.6rem;
  max-width: 46rem;
}
.faq { margin: 2rem 0 1.5rem; max-width: 44rem; }
.faq-item { border-top: 1px solid var(--line); padding: 0.7rem 0; }
.faq-item h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.faq-item p { margin: 0; }
.meta-line { color: var(--muted); font-size: 0.9rem; }

@media (max-width: 40rem) {
  .table-wrap.cards table { min-width: 0; width: 100%; }
  .table-wrap.cards thead { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
  .table-wrap.cards tbody, .table-wrap.cards tbody tr {
    display: block;
  }
  .table-wrap.cards tbody tr {
    border: 1px solid var(--line-strong);
    border-radius: 0.4rem;
    background: var(--paper-elev);
    margin: 0 0 0.8rem;
    padding: 0.35rem 0.6rem 0.5rem;
  }
  .table-wrap.cards tbody th,
  .table-wrap.cards tbody td {
    display: grid;
    grid-template-columns: minmax(5.5rem, 30%) minmax(0, 1fr);
    gap: 0.5rem;
    position: static;
    min-width: 0 !important;
    max-width: none !important;
    width: 100%;
    box-shadow: none;
    background: transparent !important;
    border-bottom: 1px solid var(--line);
    padding: 0.35rem 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .table-wrap.cards tbody th::before,
  .table-wrap.cards tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
  }
  .table-wrap.cards tbody tr :last-child { border-bottom: 0; }
}

.weekly-models { margin: 0 0 2rem; }
.weekly-models ul { list-style: none; padding: 0; margin: 0.8rem 0 0; }
.weekly-models li { padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.weekly-models li:last-child { border-bottom: 0; }
.weekly-models .meta { color: var(--muted); font-size: 0.9rem; }
.ablit-disc, .ablit-source { font-size: 0.9rem; color: var(--muted); }
.table-wrap.ablit-table table { min-width: 44rem; }
.table-wrap.ablit-table th:nth-child(1),
.table-wrap.ablit-table td:nth-child(1) { min-width: 10rem; max-width: 16rem; }

.release-list { list-style: none; padding: 0; margin: 0.8rem 0 1.2rem; }
.release-list li { margin: 0 0 1.1rem; padding: 0 0 1.1rem; border-bottom: 1px solid var(--line); }
.release-list li:last-child { border-bottom: 0; }
.release-list h3 { margin: 0 0 0.3rem; font-size: 1.05rem; }
.release-notes { white-space: pre-wrap; font-family: inherit; font-size: 0.9rem; color: var(--muted); background: transparent; border: 0; padding: 0.3rem 0 0; margin: 0; }
.weekly-models h3 { margin: 1.1rem 0 0.4rem; font-size: 1.05rem; }

.age-gate { margin: 1.2rem 0; padding: 1rem 1.1rem; border: 1px solid var(--line); background: var(--paper-elev, #fff); }
.age-gate p { margin: 0 0 0.8rem; }
.age-enter { margin: 1rem 0 0; }
.footer-policy { margin: 0.6rem 0 0; }
.policy-langs a { margin-right: 0.8rem; }

.affiliate-disclosure { margin: 0; padding: 0.45rem 1.1rem; font-size: 0.85rem; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--paper-elev, #fff); }
