/* The creator docs (2026-11-08): the Creator Guide and the Tool Manual on the
   site's paper. Tokens, faces, the header, the footer, buttons and the
   language picker come from site.css; this file is the reading room: a
   contents column beside a column of text, the editor's own screens as
   white sheets on the paper, the guide's Saint Shana examples in boxes of
   their own. Ink type, berry for links and labels, sakura only as a fill.
   Hard edges (3 to 8), no shadows, no gradients. Nothing moves. */

.docs { padding: calc(var(--top-h) + clamp(28px, 4vw, 56px)) 0 clamp(80px, 10vw, 128px); }

/* the header's way back to the docs, beside the wordmark */
.top .crumb {
  display: none; margin-left: 14px; padding-left: 14px; border-left: 1px solid var(--border-2);
  font-family: var(--mono); font-weight: 500; font-size: 12px; line-height: 1.2; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-2); text-decoration: none; white-space: nowrap;
}
.top .crumb:hover { color: var(--accent); }
@media (min-width: 600px) { .top .crumb { display: inline-block; } }

.kicker-s, .docs-kicker, .updated {
  font-family: var(--mono); font-weight: 500; font-size: 12px; line-height: 1.3;
  letter-spacing: 0.16em; text-transform: uppercase;
}
.kicker-s { color: var(--muted); }
/* the mono labels' wide tracking and wide spaces are for Latin capitals; Chinese, Japanese and Korean set them close, in the text face */
.l10n:is([lang="ja"], [lang="ko"], [lang="zh"], [lang="zh-Hant"]) :is(.kicker-s, .docs-kicker, .updated, .step-label, .prompt-label, .maps-to, th, .docs-home, .docs-toc-m summary, .example .label),
html:is([lang="ja"], [lang="ko"], [lang="zh"], [lang="zh-Hant"]) .top .crumb { letter-spacing: 0.04em; font-family: var(--ui); }
.docs-kicker { display: flex; align-items: center; gap: 10px; color: var(--text-2); }
.docs-kicker::before { content: ''; width: 8px; height: 8px; background: var(--pink); flex: none; }
.updated { color: var(--muted); }
.lang-note { margin-top: 18px; font-size: 15px; line-height: 1.5; color: var(--text-2); }
html[data-lang='en'] .lang-note, html:not([data-lang]) .lang-note { display: none; }

/* ── the two columns ────────────────────────────────────────────────── */
.docs-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
@media (min-width: 1040px) {
  .docs-grid { grid-template-columns: 232px minmax(0, 760px); gap: 72px; align-items: start; }
  .docs-side {
    position: sticky; top: calc(var(--top-h) + 32px);
    max-height: calc(100vh - var(--top-h) - 48px); overflow-y: auto; overscroll-behavior: contain;
    padding-bottom: 24px; scrollbar-width: thin;
  }
}

/* which document: the docs' home, then the two, the open one lit like the legal pages' list */
.docs-switch { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.docs-switch a {
  position: relative; padding: 13px 0 13px 16px; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 15px; line-height: 1.3; color: var(--text-2); text-decoration: none;
}
.docs-switch a:hover { color: var(--text); }
.docs-switch a[aria-current='page'] { color: var(--text); }
.docs-switch a[aria-current='page']::before { content: ''; position: absolute; left: 0; top: 13px; bottom: 13px; width: 3px; background: var(--pink); }
.docs-switch .docs-home {
  padding-left: 0; font-family: var(--mono); font-weight: 500; font-size: 12px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted);
}

/* on this page: the sections; the open one shows its own */
.docs-toc { margin-top: 32px; }
.docs-toc .kicker-s { margin-bottom: 14px; }
.toc-list, .toc-list ol { list-style: none; margin: 0; padding: 0; }
.toc-list { display: grid; gap: 2px; }
.toc-list a {
  display: block; padding: 5px 0 5px 12px; border-left: 2px solid transparent;
  font-size: 14px; line-height: 1.35; color: var(--muted); text-decoration: none;
}
.toc-list a:hover { color: var(--text); }
.toc-list a.is-here { color: var(--text); border-left-color: var(--pink); }
.toc-list ol { display: none; margin: 2px 0 6px; }
.toc-list ol a { padding-left: 24px; font-size: 13px; }
.toc-list li.is-open > ol { display: block; }
html:not(.js) .toc-list ol { display: none; }

/* a phone: the two documents as chips, the contents folded at the top */
.docs-toc-m { display: none; }
@media (max-width: 1039px) {
  .docs-switch { flex-direction: row; flex-wrap: wrap; gap: 8px; border: 0; }
  .docs-switch a { flex: 0 0 auto; padding: 10px 14px; border: 1px solid var(--border-2); border-radius: 3px; font-size: 14px; white-space: nowrap; }
  .docs-switch a[aria-current='page'] { background: var(--pink); border-color: var(--pink); color: var(--on-pink); }
  .docs-switch a[aria-current='page']::before { display: none; }
  .docs-switch .docs-home { border-color: transparent; padding-left: 0; padding-right: 6px; align-self: center; }
  .docs-toc { display: none; }
  .docs-toc-m {
    display: block; margin-top: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  }
  .docs-toc-m summary {
    list-style: none; cursor: pointer; padding: 14px 16px;
    font-family: var(--mono); font-weight: 500; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-2);
    display: flex; align-items: center; justify-content: space-between;
  }
  .docs-toc-m summary::-webkit-details-marker { display: none; }
  .docs-toc-m summary::after {
    content: ''; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
    transform: translateY(-2px) rotate(45deg);
  }
  .docs-toc-m[open] summary::after { transform: translateY(2px) rotate(-135deg); }
  .docs-toc-m .toc-list { padding: 0 16px 14px; }
  .docs-toc-m .toc-list ol { display: none !important; }
}

/* ── the document ───────────────────────────────────────────────────── */
.docs-head h1 {
  margin-top: 18px; font-weight: 900; letter-spacing: -0.035em; line-height: 1.02; text-wrap: balance;
  font-size: clamp(40px, 5.4vw, 68px);
}
.docs-head .updated { margin-top: 18px; }
/* the kicker and the date are labels, not prose: .docs-body p would set them at reading size */
.docs-head .docs-kicker, .docs-head .updated { font-size: 13px; line-height: 1.3; }
.docs-body { min-width: 0; }
.docs-body .doc-section { scroll-margin-top: calc(var(--top-h) + 16px); }
.docs-body h2 {
  margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--border-2);
  font-weight: 800; font-size: clamp(25px, 2.5vw, 31px); line-height: 1.2; letter-spacing: -0.02em;
  color: var(--text); text-wrap: balance;
}
.docs-body h3 {
  margin-top: 44px; font-weight: 800; font-size: 20px; line-height: 1.3; letter-spacing: -0.01em; color: var(--text);
  scroll-margin-top: calc(var(--top-h) + 20px); text-wrap: balance;
}
.docs-body h2 + h3 { margin-top: 28px; }
.docs-body .anchor {
  margin-left: 10px; font-weight: 500; font-size: 0.8em; color: var(--faint); text-decoration: none; opacity: 0;
}
.docs-body h2:hover .anchor, .docs-body h3:hover .anchor, .docs-body .anchor:focus-visible { opacity: 1; }
.docs-body .anchor:hover { color: var(--accent); }
@media (hover: none) { .docs-body .anchor { display: none; } }

.docs-body p, .docs-body li { font-size: 16px; line-height: 1.75; color: var(--text-2); }
@media (min-width: 720px) { .docs-body p, .docs-body li { font-size: 17px; } }
.docs-body p { margin-top: 16px; }
.docs-body h2 + p, .docs-body h3 + p { margin-top: 14px; }
.docs-body strong { color: var(--text); font-weight: 700; }
.docs-body em { font-style: italic; }
.docs-body a:not(.btn):not(.shot):not(.anchor):not(.docs-next) {
  color: var(--text); text-decoration: underline; text-decoration-color: var(--accent);
  text-decoration-thickness: 1px; text-underline-offset: 3px;
}
.docs-body a:not(.btn):not(.shot):not(.anchor):not(.docs-next):hover { color: var(--accent); }

.docs-body .minihead { margin-top: 30px; }
.docs-body .minihead strong { font-size: 17px; }

/* lists: square marks, like everything here that is not a person */
.docs-body ul, .docs-body ol { margin: 16px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.docs-body ul ul, .docs-body ol ul { margin-top: 10px; }
.docs-body ul > li { position: relative; padding-left: 22px; }
.docs-body ul > li::before { content: ''; position: absolute; left: 2px; top: calc(0.875em - 3px); width: 6px; height: 6px; background: var(--faint); }
.docs-body ol { counter-reset: n; }
.docs-body ol > li { position: relative; padding-left: 34px; counter-increment: n; }
.docs-body ol > li::before {
  content: counter(n); position: absolute; left: 0; top: 0.2em;
  font-family: var(--mono); font-weight: 500; font-size: 13px; line-height: 1.7; color: var(--accent);
}
/* the quick start's five steps, on sakura */
.docs-body ol.qs-steps { gap: 14px; margin-top: 22px; }
.docs-body ol.qs-steps > li { padding-left: 46px; }
.docs-body ol.qs-steps > li::before {
  top: 0.15em; width: 28px; height: 28px; display: grid; place-items: center;
  background: var(--pink); color: var(--on-pink); font-size: 14px; line-height: 1;
}
/* the ladders of questions in Part 1 */
.docs-body ol.ladder > li::before { content: counter(n) '.'; }

/* the checklist: boxes to tick in your head */
.docs-body ul.checklist > li { padding-left: 32px; }
.docs-body ul.checklist > li::before {
  top: 0.32em; left: 0; width: 16px; height: 16px; background: transparent;
  border: 1.5px solid var(--text-2); border-radius: 3px;
}

/* the worksheet: blanks to fill */
.docs-body ul.worksheet { gap: 12px; }
.docs-body .blank {
  display: inline-block; min-width: 9em; height: 1.1em; vertical-align: baseline;
  border-bottom: 1px solid var(--border-2); color: transparent; overflow: hidden; user-select: all;
}
.docs-body .maps-to {
  display: inline-block; margin-left: 6px; padding: 3px 8px; vertical-align: 0.15em;
  font-family: var(--mono); font-weight: 500; font-size: 12px; line-height: 1.3; letter-spacing: 0.02em;
  color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: 3px;
}
.docs-body .copy-sheet { margin-top: 20px; }

/* Saint Shana: the guide's running example, in boxes of its own */
.docs-body .example {
  margin-top: 22px; padding: 4px 22px 18px; background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--pink); border-radius: 0 6px 6px 0;
}
.docs-body .example p { font-size: 16px; line-height: 1.7; margin-top: 14px; }
.docs-body .example .label {
  display: block; margin-bottom: 2px; font-family: var(--mono); font-weight: 500; font-size: 12px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent);
}
/* the opening of The Last Harvest, as a page of the story */
.docs-body .example.fiction { background: var(--surface-2); padding: 10px 26px 24px; }
.docs-body .example.fiction p { font-family: var(--fic); font-size: 18px; line-height: 1.75; color: var(--text); }
.docs-body .step-label {
  display: flex; align-items: center; gap: 10px; margin-top: 34px;
  font-family: var(--mono); font-weight: 500; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent);
}
.docs-body .step-label::before { content: ''; width: 8px; height: 8px; background: var(--pink); flex: none; }
.docs-body .step-label strong { color: inherit; font-weight: 500; }
.docs-body .step-label + .example, .docs-body .step-label + .table-wrap { margin-top: 12px; }

/* a prompt to paste into an AI chat */
.docs-body .prompt { margin-top: 24px; padding: 16px 20px 20px; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 6px; }
.docs-body .prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.docs-body .prompt-label { font-family: var(--mono); font-weight: 500; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }
.docs-body .prompt-text { margin-top: 10px; color: var(--text); }
.docs-body .copy { height: 34px; padding: 0 14px; font-size: 13px; }
.docs-body .copy.is-done { border-color: var(--text-2); }

/* ── tables: rules, no fills ────────────────────────────────────────── */
.docs-body .table-wrap { margin-top: 22px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.docs-body table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.55; }
.docs-body th {
  padding: 0 14px 10px 0; text-align: left; vertical-align: bottom; border-bottom: 1.5px solid var(--text-2);
  font-family: var(--mono); font-weight: 500; font-size: 11.5px; line-height: 1.35; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-2);
}
.docs-body td { padding: 12px 14px 12px 0; vertical-align: top; border-bottom: 1px solid var(--border); color: var(--text-2); }
@media (min-width: 640px) { .docs-body th { white-space: nowrap; } }
.docs-body td:first-child { color: var(--text); font-weight: 700; }
.docs-body .versus td:first-child { font-weight: 400; color: var(--text-2); }
.docs-body .versus td { width: 50%; }
.docs-body .limits td:last-child { font-family: var(--mono); font-size: 14px; color: var(--text); }
.docs-body td .yes { color: var(--text); font-weight: 700; }
.docs-body td .no { color: var(--muted); }
.docs-body .ai-only {
  display: inline-flex; align-items: center; gap: 4px; margin-right: 2px; padding: 2px 7px 2px 6px; white-space: nowrap;
  font-size: 12.5px; font-weight: 500; line-height: 1.35; color: var(--text-2);
  background: var(--surface-3); border-radius: 3px; vertical-align: 1px;
}
.docs-body .ai-only .ico { font-size: 11px; }
/* a phone: each row of a wide table becomes a card, its labels beside the values */
@media (max-width: 639px) {
  .docs-body .cards thead { display: none; }
  .docs-body .cards, .docs-body .cards tbody, .docs-body .cards tr, .docs-body .cards td { display: block; width: 100%; }
  .docs-body .cards tr { padding: 12px 0; border-bottom: 1px solid var(--border); }
  .docs-body .cards td { padding: 3px 0; border: 0; }
  .docs-body .cards td:first-child { font-size: 16px; padding-bottom: 6px; }
  .docs-body .cards td:not(:first-child) { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 10px; align-items: baseline; }
  .docs-body .cards td .v { min-width: 0; }
  .docs-body .cards td:not(:first-child)::before {
    content: attr(data-label); font-family: var(--mono); font-size: 11px; line-height: 2; letter-spacing: 0.1em;
    text-transform: uppercase; color: var(--muted);
  }
  .docs-body .cards tr:first-child { border-top: 1.5px solid var(--text-2); }
}

/* ── the editor's screens: white sheets on the paper ───────────────── */
.docs-body .fig { margin: 28px 0 8px; }
.docs-body .fig .shot {
  display: block; margin: 0 auto; background: #fff; border: 1px solid var(--border-2); border-radius: 8px;
  overflow: hidden; cursor: zoom-in;
}
.docs-body .fig .shot + .shot { margin-top: 14px; }
.docs-body .fig .shot.narrow { width: 100%; }
.docs-body .fig img { width: 100%; height: auto; }
.docs-body figcaption {
  margin-top: 12px; text-align: center; font-size: 14px; line-height: 1.5; color: var(--muted); text-wrap: balance;
}
.docs-body .fig.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.docs-body .fig.gallery .shot { margin: 0; }
.docs-body .fig.gallery .shot:nth-child(3) { grid-column: 1 / -1; }
.docs-body .fig.gallery figcaption { grid-column: 1 / -1; margin-top: 0; }
@media (max-width: 559px) {
  .docs-body .fig.gallery { grid-template-columns: minmax(0, 1fr); }
}

/* the story map, in the site's ink; the Tower lit in sakura */
.docs-body .story-map { margin-top: 26px; padding: 22px 22px 18px; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 8px; }
.docs-body .story-map .map-title { margin: 0 0 16px; font-weight: 800; font-size: 17px; line-height: 1.3; color: var(--text); }
.docs-body .story-map svg { display: block; width: 100%; height: auto; }
.docs-body .story-map .map-tall { display: none; max-width: 380px; margin: 0 auto; }
@media (max-width: 639px) {
  .docs-body .story-map .map-wide { display: none; }
  .docs-body .story-map .map-tall { display: block; }
}
.docs-body .story-map rect { fill: #fff; stroke: var(--border-2); stroke-width: 1.5; }
.docs-body .story-map .lit rect { fill: var(--pink); stroke: var(--text); }
.docs-body .story-map text { font-family: var(--ui); text-anchor: middle; fill: var(--text); }
.docs-body .story-map .t { font-weight: 700; font-size: 15px; }
.docs-body .story-map .s { font-size: 13px; fill: var(--muted); }
.docs-body .story-map .lit .s { fill: var(--text-2); }
.docs-body .story-map figcaption { margin-top: 14px; }

/* the way on: the rest of the docs, however many there are, then all of them */
.docs-more { margin-top: 72px; padding-top: 28px; border-top: 1px solid var(--border-2); display: grid; gap: 12px; }
.docs-more > .kicker-s { margin-bottom: 4px; }
.docs-more .docs-all {
  justify-self: start; margin-top: 6px; font-size: 15px; color: var(--text);
  text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px;
}
.docs-more .docs-all:hover { color: var(--accent); }
.docs-next {
  position: relative; display: grid; gap: 6px; padding: 22px 64px 24px 24px;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: 8px; text-decoration: none; color: var(--text);
}
.docs-next:hover { border-color: var(--text-2); }
.docs-next .next-title { font-weight: 900; font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.03em; line-height: 1.1; }
.docs-next .next-desc { font-size: 15px; line-height: 1.55; color: var(--text-2); max-width: 36em; }
.docs-next .ico { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); font-size: 24px; color: var(--accent); }

/* ── the docs' home ─────────────────────────────────────────────────── */
.hub-head { max-width: 860px; }
.hub-head h1 {
  margin-top: 20px; font-weight: 900; letter-spacing: -0.04em; line-height: 1.02; text-wrap: balance;
  font-size: clamp(42px, 6.4vw, 88px);
}
.hub-sub { margin-top: 22px; font-size: clamp(17px, 1.55vw, 20px); line-height: 1.55; color: var(--text-2); max-width: 38em; }
.doc-cards {
  margin-top: clamp(36px, 5vw, 56px); display: grid; gap: 24px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr));
}
.doc-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-2); border-radius: 8px; overflow: hidden; }
.doc-card-art { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #fff; border-bottom: 1px solid var(--border-2); }
.doc-card-art img { width: 100%; height: 100%; object-fit: cover; }
.doc-card-art img[src$='saint-shana-cover.webp'] { object-position: 50% 42%; }
.doc-card-art img[src$='editor-overview.webp'] { object-position: 0 0; }
.doc-card-body { padding: 24px 24px 28px; display: flex; flex-direction: column; flex: 1; }
.doc-card h2 { margin-top: 14px; font-weight: 900; font-size: clamp(30px, 3.4vw, 40px); letter-spacing: -0.035em; line-height: 1.05; }
.doc-card h2 a { color: var(--text); text-decoration: none; }
.doc-card h2 a:hover { color: var(--accent); }
.doc-card-desc { margin-top: 12px; font-size: 16px; line-height: 1.6; color: var(--text-2); }
.doc-card .updated { margin-top: 14px; }
.doc-card .btn { margin-top: 22px; align-self: flex-start; }
.doc-card-toc { margin: 26px 0 0; padding: 18px 0 0; border-top: 1px solid var(--border); list-style: none; column-gap: 24px; }
.doc-card-toc li { break-inside: avoid; }
@media (min-width: 560px) { .doc-card-toc { columns: 2; } }
.doc-card-toc a { display: block; padding: 5px 0; font-size: 14px; line-height: 1.35; color: var(--text-2); text-decoration: none; }
.doc-card-toc a:hover { color: var(--accent); }
/* under the documents, the rest of what is official, in two named groups (#help, #policies): the app's
   account menu links to /docs#policies, so that id is an address, never renamed */
.hub-more {
  margin-top: clamp(40px, 5vw, 64px); display: grid; gap: 32px 24px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr));
}
.hub-group { scroll-margin-top: calc(var(--top-h) + 24px); }
.hub-group ul { margin: 14px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 10px 26px; }
html:is([lang="ja"], [lang="ko"], [lang="zh"], [lang="zh-Hant"]) .hub-more .docs-kicker { letter-spacing: 0.04em; font-family: var(--ui); }
.hub-more a {
  font-size: 15px; color: var(--text); text-decoration: underline; text-decoration-color: var(--accent);
  text-decoration-thickness: 1px; text-underline-offset: 3px;
}
.hub-more a:hover { color: var(--accent); }

/* ── a picture full size ────────────────────────────────────────────── */
.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 24px; border: 0;
  background: rgba(36, 33, 34, 0.9); cursor: zoom-out;
}
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: transparent; }
.lightbox img { max-width: min(100%, 1480px); max-height: calc(100vh - 48px); width: auto; height: auto; background: #fff; border-radius: 8px; }
.lightbox-close {
  position: fixed; top: 16px; right: 16px; width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, 0.35); border-radius: 3px;
  background: transparent; color: #fff; font-size: 26px; line-height: 1;
}

/* ── on paper: the document alone ───────────────────────────────────── */
@media print {
  body { background: #fff; color: #111; }
  .top, .foot, .docs-side, .docs-toc-m, .skip, .docs-next, .anchor, .copy, .lightbox { display: none !important; }
  .docs { padding: 0; }
  .docs-grid { display: block; }
  .docs-body .fig, .docs-body .example, .docs-body table, .docs-body .story-map { break-inside: avoid; }
}
