/* Shared visual language: two typefaces, one warm palette, three corner sizes. */
:root {
  --font-ui: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-book: "Source Serif 4", Georgia, serif;
  --radius-page: 24px;
  --radius-card: 16px;
  --radius-control: 10px;
  --frame: 18px;
  --lift: 0 3px 14px rgb(51 41 29 / 3%);
}
* { box-sizing: border-box; }
html { background: var(--mat); scroll-behavior: smooth; }
body {
  margin: 0;
  padding: var(--frame);
  color: var(--ink);
  background: var(--mat);
  font: 15px/1.6 var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
.page {
  position: relative;
  min-height: calc(100dvh - 2 * var(--frame));
  background: var(--paper);
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: var(--radius-page);
  overflow: clip;
}
a { color: inherit; text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-deep); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
::selection { background: var(--fill); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 4px; }
[hidden] { display: none !important; }
.site-header {
  min-height: 88px;
  margin: 0 38px;
  border-bottom: 1px solid var(--edge);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  position: relative;
  z-index: 10;
}
.mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.mark-text { display: flex; flex-direction: column; gap: 3px; }
.mark-name { font: 500 27px/1 var(--font-book); letter-spacing: -.06em; }
.mark-version {
  font: 500 11px/1 var(--font-ui);
  letter-spacing: .04em;
  color: var(--ink-soft);
}
.brand { width: 30px; height: 32px; object-fit: contain; }
.brand-dot { color: var(--accent-deep); }
.account-nav { display: flex; align-items: center; gap: 26px; font-size: 13px; }
.account-nav a { text-decoration: none; padding: 10px 0; color: var(--ink-soft); }
.account-nav a[aria-current] { color: var(--ink); box-shadow: 0 1px var(--accent-deep); }
.account-nav .nav-signin { display: inline-flex; align-items: center; gap: 20px; color: var(--ink); }
.page .account-nav .nav-button {
  background: none; color: var(--ink-soft); border: 0; padding: 10px 0;
  min-height: 44px; box-shadow: none; font: inherit; border-radius: 0;
  opacity: 1; transform: none; cursor: pointer;
}
.page .account-nav .nav-button:hover { color: var(--accent-deep); background: none; }
.page .stage { padding: 64px 26px 88px; }
.page .well { max-width: 680px; }
.page h1 { font-family: var(--font-book); font-weight: 400; letter-spacing: -.04em; color: var(--ink); line-height: 1.15; }
.page h2 { font-family: var(--font-ui); }
.page .script, .page .sub { font-family: var(--font-book); }
.page .eyebrow, .page .said .cap {
  color: var(--ink-soft); font: 500 11px/1.6 var(--font-ui);
  letter-spacing: .13em; text-transform: uppercase;
}
.page :is(.sheet, .card, .panel, .slab, .receipt, .addsheet, .pick) {
  border: 1px solid var(--edge);
  border-radius: var(--radius-card);
  background: var(--paper-lit);
  box-shadow: none;
}
.page :is(.slab, .card .head) { padding: 22px 24px; }
.page .addsheet:focus-within { border-color: var(--accent-deep); }
.page .person .who, .page .card .head b { font-family: var(--font-book); letter-spacing: -.025em; }
.page .pick { padding: 20px 24px; }
.page .pick.on { background: var(--paper-sunk); border-color: var(--accent-deep); box-shadow: none; }
.page .pick::before { display: none; }
.page .flag, .page .stand { border-radius: 5px; font-weight: 500; }
.page .val.assumed { color: var(--accent-deep); }
.page :is(.k .hint, .v .note, .count, .meter, .label, .foot, .revstat) { color: var(--ink-soft); }
.page :is(.prose, .v, .said .body) { line-height: 1.75; }
.page .receipt .total { background: var(--paper-sunk); border-radius: 0 0 16px 16px; }
.page :is(.gate button, .pickbar button, .tail button, .pay button, .beta button, .beta .button, .cta a, .sheet button) {
  display: inline-flex; align-items: center; justify-content: center; gap: 22px;
  min-height: 46px; padding: 12px 22px; border-radius: var(--radius-control);
  background: var(--accent); border: 1px solid transparent; color: var(--ink);
  font: 500 13px/1.5 var(--font-ui); letter-spacing: 0; text-decoration: none;
  box-shadow: none; cursor: pointer; transition: background .16s ease, border-color .16s ease;
}
.page :is(.gate button, .pickbar button, .tail button, .pay button, .beta button, .beta .button, .cta a, .sheet button):hover:not(:disabled) {
  background: var(--accent-deep); color: var(--paper-lit);
}
.page button:disabled { opacity: .5; cursor: not-allowed; }
.page .beta button.secondary { background: transparent; border-color: var(--edge-strong); color: var(--ink); }
.page .beta button.secondary:hover { background: var(--paper-sunk); color: var(--ink); }
.divider { display: flex; align-items: center; justify-content: center; gap: 15px; height: 14px; width: 120px; margin: 30px auto; }
.divider::before, .divider::after { content: ""; width: 42px; height: 1px; background: var(--edge-strong); }
/* Book chrome: the title of the book in hand, on every /b/{id} page. */
.book-chrome {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 16px;
  margin: 0 38px; padding: 14px 0; border-bottom: 1px solid var(--edge);
  position: relative; z-index: 9;
}
.book-chrome-cap {
  color: var(--ink-soft); font: 500 10.5px/1.6 var(--font-ui);
  letter-spacing: .13em; text-transform: uppercase;
}
.book-chrome-title {
  flex: 1 1 auto; min-width: 0; font: 400 21px/1.3 var(--font-book);
  letter-spacing: -.02em; color: var(--ink); overflow-wrap: anywhere;
}
.book-chrome-nav { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; }
.book-chrome-nav a { text-decoration: none; color: var(--ink-soft); padding: 4px 0; }
.book-chrome-nav a[aria-current] { color: var(--ink); box-shadow: 0 1px var(--accent-deep); }
/* Characters: the cast page and each sheet. */
.page .cast-well { max-width: 860px; }
.page .sheet-well { max-width: 900px; }
.page .cast-h1 { font-size: clamp(32px, 4.6vw, 48px); margin: 6px 0 10px; }
.cast-sub { font-size: 16.5px; line-height: 1.6; color: var(--ink-soft); margin: 0 0 26px; max-width: 36em; }
.cast-build {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; margin: 0 0 22px; border: 1px solid var(--edge);
  border-radius: var(--radius-card); background: var(--paper-sunk);
  font: italic 15.5px/1.5 var(--font-book); color: var(--accent-deep);
}
.cast-build.bad { color: var(--clay); font-style: normal; font-family: var(--font-ui); font-size: 13.5px; }
.cast-build.bad .cast-dots { display: none; }
.cast-dots { display: inline-flex; gap: 5px; }
.cast-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: cast-ink 1.2s infinite ease-in-out; }
.cast-dots i:nth-child(2) { animation-delay: .16s; }
.cast-dots i:nth-child(3) { animation-delay: .32s; }
@keyframes cast-ink { 0%, 80%, 100% { opacity: .28; } 40% { opacity: 1; } }
.cast-note { font-size: 13px; line-height: 1.7; color: var(--ink-soft); margin: 0 0 16px; }
.cast-grid {
  list-style: none; margin: 0 0 18px; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px;
}
.cast-card {
  display: flex; gap: 14px; align-items: flex-start; height: 100%;
  padding: 14px; border: 1px solid var(--edge); border-radius: var(--radius-card);
  background: var(--paper-lit); text-decoration: none; color: var(--ink);
  transition: border-color .16s ease;
}
.cast-card:hover { border-color: var(--accent-deep); color: var(--ink); }
.cast-portrait {
  position: relative; flex: none; width: 84px; aspect-ratio: 1; overflow: hidden;
  border-radius: var(--radius-control); background: var(--fill);
  display: inline-flex; align-items: center; justify-content: center;
  font: 400 26px/1 var(--font-book); color: var(--accent-deep);
}
.cast-portrait img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cast-portrait.big { width: 100%; max-width: 320px; font-size: 64px; }
.cast-busy {
  position: absolute; inset: auto 0 0 0; padding: 3px 0; text-align: center;
  background: color-mix(in srgb, var(--ink) 62%, transparent); color: var(--paper-lit);
  font: 500 10.5px/1.4 var(--font-ui);
}
.cast-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cast-body b { font: 400 20px/1.25 var(--font-book); letter-spacing: -.02em; }
.cast-role { font: 500 10.5px/1.5 var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.cast-who { font: 400 14px/1.5 var(--font-book); color: var(--ink-soft); }
.cast-chip {
  align-self: flex-start; margin-top: 4px; padding: 1px 8px; border-radius: 5px;
  border: 1px solid var(--clay); color: var(--clay); font: 500 10.5px/1.6 var(--font-ui);
}
.cast-chip.saved { border-color: var(--edge-strong); color: var(--ink-soft); }
.cast-actions { margin: 0 0 30px; }
.page .cast-link {
  background: none; border: 0; padding: 6px 0; min-height: 0; color: var(--accent-deep);
  font: 500 13px/1.5 var(--font-ui); cursor: pointer; text-decoration: underline;
  text-underline-offset: 4px;
}
.page .cast-link:hover { color: var(--ink); background: none; }
.cast-next { text-align: center; border-top: 1px solid var(--edge); padding-top: 26px; }
.page :is(.cast-next button, .sheet-bar button[type=submit]) {
  min-height: 46px; padding: 12px 24px; border-radius: var(--radius-control);
  background: var(--accent); border: 1px solid transparent; color: var(--ink);
  font: 500 13.5px/1.5 var(--font-ui); cursor: pointer;
}
.page :is(.cast-next button, .sheet-bar button[type=submit]):hover:not(:disabled) { background: var(--accent-deep); color: var(--paper-lit); }
.cast-back { display: inline-block; margin: 0 0 22px; font-size: 13px; color: var(--ink-soft); text-decoration: none; }
.sheet-grid { display: grid; grid-template-columns: minmax(200px, 320px) 1fr; gap: 34px; align-items: start; }
.sheet-portrait { margin: 0; position: sticky; top: 20px; }
.sheet-portrait figcaption { margin-top: 10px; font-size: 12.5px; color: var(--ink-soft); }
.sheet-portrait figcaption.bad { color: var(--clay); }
.sheet-form label { display: block; margin: 16px 0 6px; font: 500 12px/1.5 var(--font-ui); }
.sheet-form label small { font-weight: 400; color: var(--ink-soft); margin-left: 6px; }
.sheet-form :is(input, textarea) {
  width: 100%; padding: 11px 13px; border: 1px solid var(--edge-strong);
  border-radius: var(--radius-control); background: var(--paper-lit); color: var(--ink);
  font: 400 16px/1.55 var(--font-book); caret-color: var(--accent-deep);
}
.sheet-form textarea { resize: vertical; min-height: 110px; }
.sheet-form :is(input, textarea):disabled { opacity: .7; }
.sheet-form .eyebrow { margin: 0; }
.sheet-bar { display: flex; align-items: center; gap: 20px; margin-top: 22px; }
.revstat.bad { color: var(--clay); }
/* Card approval: the cast as saved on the character page. */
.cast-strip { border-top: 1px solid var(--edge); padding: 14px 24px 16px; }
.cast-strip-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.cast-strip-head a { font-size: 12.5px; color: var(--accent-deep); }
.cast-strip ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cast-strip li { display: flex; gap: 12px; align-items: flex-start; }
.cast-strip .cast-portrait { width: 52px; font-size: 18px; }
.cast-strip .cast-who { font-size: 13.5px; }
.lockwarn { display: block; font-size: 11.5px; color: var(--clay); margin-top: 4px; }
@media (max-width: 700px) {
  .sheet-grid { grid-template-columns: 1fr; gap: 18px; }
  .sheet-portrait { position: static; max-width: 220px; }
}
/* Landing page */
.home-stage { padding: clamp(42px, 7vh, 82px) 24px 50px; }
.home-well { width: 100%; max-width: 660px; margin: auto; }
.hero { text-align: center; margin-bottom: 34px; }
.hero .eyebrow { margin: 0 0 20px; }
.page .hero .display { margin: 0; font-size: clamp(40px, 5.5vw, 72px); line-height: 1.09; letter-spacing: -.055em; }
.display em { color: var(--accent-deep); font-weight: 400; }
.home-intro { margin: 22px 0 0; font-size: 14px; line-height: 1.85; color: var(--ink-soft); }
.home-stage .sheet { transition: border-color .18s ease; }
.home-stage .sheet:focus-within { border-color: var(--accent-deep); }
.sheet-gate { position: relative; }
.sheet-gate.is-locked .sheet {
  pointer-events: none;
  user-select: none;
  filter: blur(1.5px);
  opacity: .72;
}
.sheet-lock {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--paper) 55%, transparent);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--edge-strong) 70%, transparent);
}
.sheet-lock-card {
  max-width: 320px;
  text-align: center;
}
.sheet-lock-eyebrow {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font: 500 11px/1.6 var(--font-ui);
  letter-spacing: .13em;
  text-transform: uppercase;
}
.sheet-lock-card h2 {
  margin: 0;
  font: 400 28px/1.2 var(--font-book);
  letter-spacing: -.03em;
  color: var(--ink);
}
.sheet-lock-card p {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-soft);
}
.page .sheet-lock-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 46px;
  margin-top: 18px;
  padding: 12px 22px;
  border-radius: var(--radius-control);
  background: var(--accent);
  color: var(--ink);
  font: 500 13px/1.5 var(--font-ui);
  text-decoration: none;
  transition: background .16s ease, color .16s ease;
}
.page .sheet-lock-cta:hover {
  background: var(--accent-deep);
  color: var(--paper-lit);
}
.sheet-label { display: block; padding: 24px 26px 0; font-size: 12px; font-weight: 500; }
.home-stage textarea {
  display: block; width: 100%; min-height: 142px; padding: 14px 26px 20px;
  border: 0; border-radius: var(--radius-card); background: transparent; resize: vertical;
  color: var(--ink); font: 400 21px/1.65 var(--font-book); caret-color: var(--accent-deep);
}
.home-stage textarea::placeholder { color: var(--ink-soft); opacity: .8; }
.home-stage textarea:focus-visible { outline: 0; }
.tray { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 0 18px 18px 26px; }
.count { font-size: 11px; font-variant-numeric: tabular-nums; opacity: 0; }
.count.on { opacity: 1; }
.footnote { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 22px 0 0; color: var(--ink-soft); font-size: 11px; text-align: center; }
.small-diamond { flex: none; width: 5px; height: 5px; background: var(--clay); transform: rotate(45deg); }
/* Accounts and the owner workspace use the same type and controls as the book flow. */
.page .beta { max-width: 1180px; padding: 52px 38px 80px; }
.page .beta.narrow { max-width: 480px; padding-top: 72px; padding-bottom: 100px; }
.page .beta h1 { font-size: clamp(32px, 4vw, 44px); margin-bottom: 14px; }
.page .beta h2 { font: 400 27px/1.3 var(--font-book); letter-spacing: -.025em; margin: 44px 0 16px; text-transform: none; }
.page .beta p { font-size: 14px; line-height: 1.8; }
.page .beta label { font: 500 11px/1.6 var(--font-ui); margin: 12px 0 7px; color: var(--ink-soft); }
.page .beta :is(input:not([type=radio]):not([type=checkbox]),select) {
  min-height: 44px; border: 1px solid var(--edge-strong); border-radius: var(--radius-control);
  background: var(--paper-lit); padding: 11px 12px; font: 400 13px/1.5 var(--font-ui);
}
.page .beta :is(input:not([type=radio]):not([type=checkbox]),select):focus-visible { outline-offset: 2px; }
.page .beta.narrow form { margin-top: 28px; }
.page .beta.narrow form button { width: 100%; margin-top: 12px; }
.page .beta.narrow > small { line-height: 1.7; }
.page .beta > nav { padding: 12px 0 18px; border-bottom: 1px solid var(--edge); font-size: 12px; word-spacing: 8px; }
.page .beta > nav a { text-decoration: none; word-spacing: normal; }
.page .beta .metrics { padding: 12px 0 24px; margin: 24px 0 0; gap: 54px; }
.page .beta .metrics strong { font: 400 36px/1.3 var(--font-book); letter-spacing: -.04em; }
.page .beta .metrics small { font-size: 11px; }
.page .beta .notice { border: 1px solid var(--edge); border-radius: var(--radius-card); background: var(--paper-sunk); padding: 18px 22px; font-size: 13px; }
.page .beta .notice.error { border-color: var(--clay); }
.page .beta .scroll { border: 1px solid var(--edge); border-radius: var(--radius-card); background: var(--paper-lit); }
.page .beta th { background: var(--paper-sunk); font-size: 11px; font-weight: 500; }
.page .beta :is(th,td) { padding: 14px 16px; }
.page .beta tr:last-child td { border-bottom: 0; }
.page .beta td { font-size: 12px; }
.page .beta .model-row { gap: 28px; padding: 22px 0; }
.page .beta .model-row > div { min-width: 0; }
.page .beta .model-row > div:first-child { padding-top: 12px; }
.page .beta .model-row b { font-size: 13px; font-weight: 500; text-transform: capitalize; }
.page .beta .savebar { border: 1px solid var(--edge); border-radius: var(--radius-card); margin-top: 20px; padding: 18px 22px; bottom: 12px; background: var(--paper-lit); }
.page .beta .savebar small { margin-top: 8px; }
.page .beta .row { overflow: visible; }
@media (max-width: 700px) {
  :root { --frame: 8px; --radius-page: 18px; }
  .site-header { min-height: 74px; margin: 0 20px; gap: 12px; }
  .mark { gap: 6px; }
  .mark-name { font-size: 23px; }
  .mark-version { font-size: 10px; }
  .brand { width: 24px; height: 27px; }
  .account-nav { gap: 14px; font-size: 11px; }
  .book-chrome { margin: 0 20px; padding: 10px 0; }
  .book-chrome-title { font-size: 18px; flex-basis: 100%; }
  .book-chrome-nav { gap: 14px; font-size: 11.5px; }
  .page .stage { padding: 38px 18px 60px; }
  .home-stage { padding: 40px 18px; }
  .hero .eyebrow { font-size: 9px; letter-spacing: .1em; margin-bottom: 18px; }
  .home-intro { font-size: 13px; margin-top: 18px; }
  .desktop-break { display: none; }
  .sheet-label { padding: 20px 20px 0; font-size: 11px; }
  .home-stage textarea { padding: 12px 20px 20px; font-size: 18px; min-height: 150px; }
  .tray { padding: 0 14px 14px 20px; }
  .footnote { font-size: 10px; align-items: baseline; }
  .page .beta { padding: 36px 20px 60px; }
  .page .beta.narrow { padding-top: 48px; }
  .page .beta .metrics { gap: 24px; }
  .page .beta .metrics strong { font-size: 30px; }
  .page .beta .model-row { grid-template-columns: 1fr; gap: 8px; }
  .page .beta .row { gap: 12px; }
  .page .beta .row > input { flex-basis: 100%; }
  .page .beta .notice button { margin: 4px 0; }
}
@media (max-width: 380px) {
  .site-header { margin: 0 14px; }
  .account-nav { gap: 10px; }
  .page .hero .display { font-size: 36px; }
  .mark-name { font-size: 20px; }
  .brand { width: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
