/* ===================================================================
   Quest Council — a gothic, medieval interface.

   Two worlds, deliberately: the chrome is a dark cathedral (slate, oxblood,
   aged gold, pointed arches) and the content sits on parchment. Anything the
   GM reads or writes goes on the off-white; anything that frames it goes in
   the dark. That split is what keeps long generated text readable inside a
   heavily themed shell.
   =================================================================== */

:root {
  /* Night: stone, shadow, and the inside of a cathedral */
  --ink:        #13111a;
  --ink-2:      #1b1825;
  --ink-3:      #262232;
  --ink-4:      #332d42;
  --ink-line:   #413a53;

  /* Parchment: everything the GM actually reads */
  --parch:      #f5eedc;
  --parch-2:    #ece2c9;
  --parch-3:    #ddd0b0;
  --parch-edge: #c9b88f;
  --parch-ink:  #2b2218;
  --parch-ink-2:#5d5038;
  --parch-ink-3:#857452;

  /* Gilt and pigment, as an illuminator would have had them */
  --gold:       #c9a227;
  --gold-lit:   #e8cd7a;
  --gold-deep:  #8a6d16;
  --oxblood:    #6d1f24;
  --oxblood-lit:#9c3238;
  --verdigris:  #3f6b62;
  --lapis:      #2f4a7a;
  --amethyst:   #58407a;

  --text:       #ede7d8;
  --text-dim:   #b2a894;
  --text-faint: #7d7566;

  --ok:         #5f8f63;
  --warn:       #b8862f;
  --bad:        #a24a3f;

  --r-sm: 3px;
  --r-md: 5px;
  /* A lancet curve, not a dome. CSS cannot make a true pointed arch, so the
     curve stays shallow and a finial supplies the point. */
  --arch: 26% 26% 5px 5px / 13% 13% 5px 5px;

  --shadow-deep: 0 28px 70px -24px rgba(0, 0, 0, .8);
  --shadow-page: 0 2px 0 rgba(0,0,0,.18), 0 18px 40px -18px rgba(0,0,0,.55);

  --serif: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --roman: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --black: 'UnifrakturMaguntia', 'Cinzel', Georgia, serif;
  --sans:  'Inter', system-ui, -apple-system, sans-serif;

  --maxw: 1140px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* Vaulted stone: a faint groin-vault suggestion behind everything, plus a
   vignette so the page reads as lit from above like a nave. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 120% 70% at 50% -10%, rgba(201,162,39,.09), transparent 60%),
    radial-gradient(ellipse 90% 60% at 50% 110%, rgba(109,31,36,.13), transparent 65%),
    var(--ink);
}

/* Faint parchment tooth over the whole window, so flat fills never look flat */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .035;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 2px, rgba(255,255,255,.4) 2px 3px),
    repeating-linear-gradient(90deg, transparent 0 3px, rgba(255,255,255,.3) 3px 4px);
}

.u-hidden { display: none !important; }
.u-sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

svg.ico {
  width: 1.15em; height: 1.15em;
  flex: none;
  vertical-align: -.17em;
}

/* ── Type ──────────────────────────────────────────────────────────── */

h1, h2, h3, h4 {
  font-family: var(--roman);
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.22;
  margin: 0;
}

.wordmark {
  font-family: var(--black);
  font-weight: 400;
  font-size: 1.62rem;
  letter-spacing: .01em;
  color: var(--gold-lit);
  line-height: 1;
}

.rubric {
  font-family: var(--sans);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .19em;
  text-transform: uppercase;
  color: var(--gold);
}

.aside {
  font-style: italic;
  color: var(--text-dim);
}

/* Illuminated initial, as on a page of manuscript */
.drop-cap::first-letter {
  float: left;
  font-family: var(--black);
  font-size: 3.3em;
  line-height: .78;
  padding: .06em .12em 0 0;
  color: var(--oxblood);
}

/* ── Ornament ──────────────────────────────────────────────────────── */

.rule {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gold-deep);
  margin: 20px 0;
}
.rule::before, .rule::after {
  content: '';
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, var(--gold-deep), transparent);
}
.rule .fleuron { font-size: 1rem; color: var(--gold); line-height: 1; }

/* ── Shell ─────────────────────────────────────────────────────────── */

.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 22px;
  background: linear-gradient(180deg, rgba(19,17,26,.97), rgba(19,17,26,.86));
  border-bottom: 1px solid var(--ink-line);
  backdrop-filter: blur(8px);
}
.masthead .brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.masthead .brand .seal { width: 30px; height: 30px; color: var(--gold); flex: none; }
.masthead .spacer { flex: 1; }
.masthead .who {
  font-family: var(--sans); font-size: .78rem; color: var(--text-faint);
  display: flex; align-items: center; gap: 10px;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 30px 22px 90px; }

/* ── Parchment surfaces ────────────────────────────────────────────── */

/* The scroll: an off-white sheet with curled, deckled edges. The two
   pseudo-elements are the curl at top and bottom; the inset shadows are the
   thickness of the sheet. */
.scroll {
  position: relative;
  background:
    radial-gradient(ellipse 80% 40% at 20% 0%, rgba(255,255,255,.55), transparent 70%),
    linear-gradient(176deg, var(--parch) 0%, var(--parch-2) 52%, var(--parch-3) 100%);
  color: var(--parch-ink);
  border: 1px solid var(--parch-edge);
  border-radius: var(--r-md);
  padding: 26px 30px;
  box-shadow: var(--shadow-page),
              inset 0 1px 0 rgba(255,255,255,.7),
              inset 0 -18px 28px -22px rgba(120,96,50,.55);
  font-family: var(--serif);
}

/* Fibres in the sheet */
.scroll::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  border-radius: inherit;
  opacity: .5;
  background-image:
    repeating-linear-gradient(94deg, transparent 0 7px, rgba(150,120,70,.055) 7px 8px),
    repeating-linear-gradient(2deg, transparent 0 11px, rgba(150,120,70,.04) 11px 12px);
}

/* Curled top and bottom, for the full-scroll treatment */
.scroll--curled { border-radius: 2px; margin: 16px 0; }
.scroll--curled::before {
  content: '';
  position: absolute; left: -1px; right: -1px; top: -11px; height: 13px;
  background: linear-gradient(180deg, var(--parch-3), var(--parch-2));
  border: 1px solid var(--parch-edge);
  border-radius: 50% 50% 2px 2px / 90% 90% 2px 2px;
  box-shadow: inset 0 -5px 8px -5px rgba(120,96,50,.6);
}

.scroll h1, .scroll h2, .scroll h3, .scroll h4 { color: var(--parch-ink); }
.scroll .aside { color: var(--parch-ink-2); }
.scroll .rubric { color: var(--gold-deep); }
.scroll .rule { color: var(--parch-edge); }
.scroll .rule .fleuron { color: var(--gold-deep); }
.scroll a { color: var(--oxblood); }

/* Inline quotation on parchment — a boxed read-aloud */
.scroll blockquote {
  margin: 14px 0;
  padding: 12px 18px;
  border-left: 3px double var(--oxblood);
  background: rgba(255,255,255,.4);
  font-style: italic;
  color: var(--parch-ink-2);
}
.scroll table { border-collapse: collapse; width: 100%; margin: 14px 0; font-size: .95em; }
.scroll th, .scroll td { border: 1px solid var(--parch-edge); padding: 7px 10px; text-align: left; }
.scroll th {
  background: var(--parch-3); font-family: var(--sans);
  font-size: .78rem; text-transform: uppercase; letter-spacing: .08em;
}
.scroll code {
  font-size: .9em; background: rgba(120,96,50,.13);
  padding: 1px 5px; border-radius: 2px;
}
.scroll hr { border: 0; border-top: 1px solid var(--parch-edge); margin: 22px 0; }

/* ── Dark panels ───────────────────────────────────────────────────── */

.panel {
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  border: 1px solid var(--ink-line);
  border-radius: var(--r-md);
  padding: 20px 22px;
  box-shadow: var(--shadow-deep);
}

/* A panel crowned with a pointed arch — the gothic note in the chrome */
.panel--arched {
  border-radius: var(--arch);
  padding-top: 34px;
  position: relative;
}
/* The finial: a small gilt lozenge at the apex, which is what actually reads
   as "gothic arch" once the curve beneath it is shallow. */
.panel--arched::before {
  content: '';
  position: absolute;
  top: 9px; left: 50%;
  width: 7px; height: 7px;
  transform: translateX(-50%) rotate(45deg);
  background: linear-gradient(135deg, var(--gold-lit), var(--gold-deep));
  border-radius: 1px;
}
.panel--arched::after {
  content: '';
  position: absolute;
  top: 21px; left: 50%; transform: translateX(-50%);
  width: 58px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-deep), transparent);
}

/* ── Buttons ───────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-size: .84rem; font-weight: 600;
  letter-spacing: .04em;
  padding: 9px 17px;
  border: 1px solid var(--ink-line);
  border-radius: var(--r-sm);
  background: linear-gradient(180deg, var(--ink-3), var(--ink-2));
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s, color .15s, transform .08s, background .15s;
}
.btn:hover:not(:disabled) { border-color: var(--gold-deep); color: var(--gold-lit); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Gilt: the one action a screen is actually for */
.btn--gilt {
  background: linear-gradient(180deg, var(--gold-lit), var(--gold));
  border-color: var(--gold-deep);
  color: #2a2008;
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}
.btn--gilt:hover:not(:disabled) {
  color: #2a2008;
  filter: brightness(1.07);
  border-color: var(--gold-lit);
}

.btn--quiet { background: none; border-color: transparent; color: var(--text-dim); }
.btn--quiet:hover:not(:disabled) { border-color: var(--ink-line); }

.btn--danger:hover:not(:disabled) { border-color: var(--bad); color: #e4a79c; }

.btn--sm { font-size: .76rem; padding: 6px 11px; }
.btn--wide { width: 100%; }

/* On parchment, buttons invert */
.scroll .btn {
  background: linear-gradient(180deg, #fff9ea, var(--parch-2));
  border-color: var(--parch-edge);
  color: var(--parch-ink);
}
.scroll .btn:hover:not(:disabled) { border-color: var(--gold-deep); color: var(--oxblood); }
.scroll .btn--gilt {
  background: linear-gradient(180deg, var(--gold-lit), var(--gold));
  color: #2a2008;
}

/* ── Fields ────────────────────────────────────────────────────────── */

.field { display: block; margin-bottom: 15px; }
.field > .label {
  display: block;
  font-family: var(--sans); font-size: .7rem; font-weight: 600;
  letter-spacing: .15em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 6px;
}
.field > .hint {
  font-size: .86rem; font-style: italic; color: var(--text-faint);
  margin: 5px 0 0;
}

input[type=text], input[type=search], input[type=email], input[type=password], input[type=number],
textarea, select {
  width: 100%;
  font-family: var(--serif); font-size: 1rem;
  color: var(--parch-ink);
  background:
    linear-gradient(180deg, #fffaf0, var(--parch));
  border: 1px solid var(--parch-edge);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  box-shadow: inset 0 1px 3px rgba(120,96,50,.18);
}
textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--gold);
  outline-offset: 0;
  border-color: var(--gold-deep);
}
input::placeholder, textarea::placeholder { color: var(--parch-ink-3); font-style: italic; }

.scroll .field > .label { color: var(--gold-deep); }
.scroll .field > .hint { color: var(--parch-ink-2); }

/* Chips — selectable tokens for tone, themes, and such */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  font-family: var(--sans); font-size: .79rem;
  padding: 6px 12px;
  border: 1px solid var(--ink-line);
  border-radius: 999px;
  background: var(--ink-2);
  color: var(--text-dim);
  cursor: pointer;
  transition: all .14s;
}
.chip:hover { border-color: var(--gold-deep); color: var(--text); }
.chip[aria-pressed=true] {
  background: linear-gradient(180deg, rgba(201,162,39,.24), rgba(201,162,39,.1));
  border-color: var(--gold);
  color: var(--gold-lit);
}
.scroll .chip { background: rgba(255,255,255,.45); border-color: var(--parch-edge); color: var(--parch-ink-2); }
.scroll .chip[aria-pressed=true] {
  background: linear-gradient(180deg, rgba(201,162,39,.3), rgba(201,162,39,.14));
  border-color: var(--gold-deep); color: var(--parch-ink);
}

/* Sliders for the balance of play */
.mix { display: grid; gap: 11px; }
.mix-row { display: grid; grid-template-columns: 8.5rem 1fr 2.6rem; align-items: center; gap: 12px; }
.mix-row .name { font-family: var(--sans); font-size: .8rem; color: var(--text-dim); text-transform: capitalize; }
.mix-row output { font-family: var(--sans); font-size: .78rem; color: var(--gold); text-align: right; }
input[type=range] {
  -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--gold-deep), var(--ink-4));
  box-shadow: none; border: 0; padding: 0;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 15px; height: 15px; border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-lit), var(--gold));
  border: 1px solid var(--gold-deep);
  cursor: pointer;
}
input[type=range]::-moz-range-thumb {
  width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--gold-deep);
  background: var(--gold); cursor: pointer;
}

/* On parchment the mix controls need parchment colours, or the labels wash
   out to near-invisible grey and the unfilled track reads as a dark bar. */
.scroll .mix-row .name { color: var(--parch-ink-2); }
.scroll .mix-row output { color: var(--gold-deep); font-weight: 600; }
.scroll input[type=range] {
  background: linear-gradient(90deg, var(--gold-deep), var(--parch-edge));
}

/* ── The specialist roster ─────────────────────────────────────────── */

.phase { margin-bottom: 26px; }
.phase-head {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--ink-line);
}
.phase-head .numeral {
  font-family: var(--roman); font-size: .84rem;
  color: var(--gold-deep);
  border: 1px solid var(--gold-deep);
  border-radius: 2px;
  padding: 1px 7px;
}
.phase-head h3 { font-size: 1.04rem; color: var(--text); }
.phase-head .count { font-family: var(--sans); font-size: .73rem; color: var(--text-faint); margin-left: auto; }

.experts { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 10px; }

/* Each specialist is a niche in the wall: arched top, icon, name, state */
.expert {
  position: relative;
  display: flex; align-items: flex-start; gap: 11px;
  text-align: left;
  width: 100%;
  padding: 13px 14px 12px;
  font: inherit;
  color: var(--text);
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  border: 1px solid var(--ink-line);
  border-radius: 20% 20% var(--r-sm) var(--r-sm) / 11% 11% var(--r-sm) var(--r-sm);
  cursor: pointer;
  transition: border-color .16s, transform .1s, box-shadow .16s;
}
.expert:hover:not(:disabled) {
  border-color: var(--gold-deep);
  box-shadow: 0 0 0 1px rgba(201,162,39,.18), 0 10px 26px -14px rgba(0,0,0,.8);
}
.expert:active:not(:disabled) { transform: translateY(1px); }
.expert:disabled { opacity: .42; cursor: not-allowed; }
.expert:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.expert .glyph {
  width: 30px; height: 30px;
  flex: none;
  display: grid; place-items: center;
  color: var(--gold);
  border: 1px solid var(--ink-line);
  border-radius: 50% 50% 4px 4px / 40% 40% 4px 4px;
  background: radial-gradient(circle at 50% 30%, rgba(201,162,39,.16), transparent 70%);
}
.expert .glyph svg { width: 19px; height: 19px; }
.expert .body { min-width: 0; flex: 1; }
.expert .title {
  font-family: var(--roman); font-size: .9rem; font-weight: 600;
  display: block; line-height: 1.25;
}
.expert .makes {
  font-family: var(--sans); font-size: .69rem; letter-spacing: .05em;
  text-transform: uppercase; color: var(--text-faint);
  display: block; margin-top: 3px;
}
.expert .state {
  position: absolute; top: 9px; right: 10px;
  width: 15px; height: 15px; color: var(--text-faint);
}

.expert[data-state=locked] { border-color: var(--ink-3); }
.expert[data-state=locked] .glyph { color: var(--text-faint); }
.expert[data-state=running] { border-color: var(--gold); }
.expert[data-state=running] .glyph {
  color: var(--gold-lit);
  animation: emberPulse 1.7s ease-in-out infinite;
}
.expert[data-state=done] { border-color: rgba(95,143,99,.55); }
.expert[data-state=done] .state { color: var(--ok); }
.expert[data-state=error] { border-color: rgba(162,74,63,.6); }
.expert[data-state=error] .state { color: var(--bad); }

@keyframes emberPulse {
  0%, 100% { opacity: .55; }
  50%      { opacity: 1; filter: drop-shadow(0 0 6px rgba(232,205,122,.55)); }
}

/* ── Progress ──────────────────────────────────────────────────────── */

.progress { margin: 18px 0 10px; }
.progress .track {
  height: 7px; border-radius: 4px; overflow: hidden;
  background: var(--ink-3);
  border: 1px solid var(--ink-line);
}
.progress .fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--oxblood), var(--gold));
  transition: width .5s ease;
}
.progress .caption {
  font-family: var(--sans); font-size: .76rem; color: var(--text-faint);
  margin-top: 7px; display: flex; justify-content: space-between; gap: 12px;
}

.activity { font-style: italic; color: var(--gold-lit); min-height: 1.5em; }

/* ── Entries: generated content on parchment ───────────────────────── */

.entry { position: relative; }
.entry + .entry { margin-top: 12px; }
.entry-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px; padding-bottom: 7px;
  border-bottom: 1px solid var(--parch-edge);
}
.entry-head .id {
  font-family: var(--sans); font-size: .68rem; font-weight: 600;
  letter-spacing: .1em;
  color: var(--parch-ink-3);
  border: 1px solid var(--parch-edge);
  border-radius: 2px; padding: 2px 6px;
}
.entry-head .name { font-family: var(--roman); font-size: 1.02rem; flex: 1; min-width: 0; }
.entry-head .tools { display: flex; gap: 5px; }

.entry-body h1, .entry-body h2, .entry-body h3 { margin: 16px 0 7px; }
.entry-body h1 { font-size: 1.4rem; }
.entry-body h2 { font-size: 1.2rem; }
.entry-body h3 { font-size: 1.06rem; }
.entry-body p { margin: 9px 0; }
.entry-body ul, .entry-body ol { margin: 9px 0; padding-left: 22px; }
.entry-body li { margin: 3px 0; }
.entry-body strong { color: #1d1710; }

/* State ribbon down the left edge of an entry */
.entry[data-state=approved] { border-left: 3px solid var(--ok); padding-left: 14px; }
.entry[data-state=locked]   { border-left: 3px solid var(--gold-deep); padding-left: 14px; }
.entry[data-state=draft]    { border-left: 3px dashed var(--parch-edge); padding-left: 14px; }

/* ── Findings ──────────────────────────────────────────────────────── */

.finding {
  display: grid; grid-template-columns: auto 1fr; gap: 11px;
  padding: 10px 12px;
  border: 1px solid var(--ink-line);
  border-left-width: 3px;
  border-radius: var(--r-sm);
  background: var(--ink-2);
  margin-bottom: 7px;
  font-size: .93rem;
}
.finding[data-severity=high]   { border-left-color: var(--bad); }
.finding[data-severity=medium] { border-left-color: var(--warn); }
.finding[data-severity=low]    { border-left-color: var(--ink-4); }
.finding .where {
  font-family: var(--sans); font-size: .7rem; font-weight: 600;
  letter-spacing: .06em; color: var(--gold);
}
.finding .what { color: var(--text-dim); }

/* ── Sign-in gate ──────────────────────────────────────────────────── */

.gate {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  padding: 24px;
  background: rgba(10, 9, 14, .93);
  backdrop-filter: blur(7px);
}
.gate .card { width: min(392px, 93vw); }
.gate .seal { width: 46px; height: 46px; color: var(--gold); margin: 0 auto 10px; display: block; }
.gate h1 { font-size: 1.32rem; text-align: center; }
.gate .aside { text-align: center; margin: 5px 0 18px; font-size: .9rem; }
.alert {
  border: 1px solid var(--oxblood-lit);
  background: rgba(109,31,36,.22);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: .89rem;
  color: #f0c9c4;
  margin-bottom: 12px;
}

/* ── Toast ─────────────────────────────────────────────────────────── */

.toasts {
  position: fixed; bottom: 18px; right: 18px; z-index: 80;
  display: flex; flex-direction: column; gap: 8px; max-width: 360px;
}
.toast {
  font-family: var(--sans); font-size: .84rem;
  padding: 11px 14px;
  border: 1px solid var(--ink-line);
  border-left: 3px solid var(--gold);
  border-radius: var(--r-sm);
  background: var(--ink-2);
  box-shadow: var(--shadow-deep);
  animation: toastIn .22s ease;
}
.toast[data-kind=error] { border-left-color: var(--bad); }
.toast[data-kind=ok]    { border-left-color: var(--ok); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ── Layout helpers ────────────────────────────────────────────────── */

.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row--end { justify-content: flex-end; }
.stack { display: grid; gap: 14px; }
.cols { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 900px) {
  .cols--sidebar { grid-template-columns: minmax(0, 1fr) 306px; align-items: start; }
  .cols--halves  { grid-template-columns: 1fr 1fr; }
}
.sticky { position: sticky; top: 74px; }

/* ── Print: the parchment is the page ──────────────────────────────── */

@media print {
  body { background: #fff; color: #000; }
  body::before, body::after { display: none; }
  .masthead, .toasts, .gate, .btn, .tools { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .scroll {
    box-shadow: none; border: 0; background: #fff;
    padding: 0; border-radius: 0;
  }
  .scroll::after, .scroll--curled::before { display: none; }
  .entry { break-inside: avoid; }
  h1, h2, h3 { break-after: avoid; }
  body:has(.sb-modal) > :not(.sb-modal) { display: none !important; }
  body .sb-modal { position: static; display: block; background: none; padding: 0; }
  body .sb-modal-panel { max-height: none; overflow: visible; width: auto; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

/* ===================================================================
   Storyboard.

   The canvas is the one place the dark/parchment split inverts: the
   board itself is dark (a table under candlelight) and every node is a
   small parchment card on it. Reading happens on the cards; the space
   between them is shadow.
   =================================================================== */

.sb {
  display: grid;
  grid-template-columns: 1fr 300px;
  grid-template-rows: auto 1fr;
  gap: 10px;
  height: calc(100vh - 150px);
  min-height: 520px;
}

.sb-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 10px;
  background: linear-gradient(180deg, var(--ink-3), var(--ink-2));
  border: 1px solid var(--ink-line);
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.sb-sep {
  width: 1px;
  height: 22px;
  margin: 0 6px;
  background: var(--ink-line);
}

.sb-spacer { flex: 1; }

.sb-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 30px;
  padding: 0;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  transition: color .12s, background .12s, border-color .12s;
}

.sb-tool:hover {
  color: var(--gold-lit);
  border-color: var(--ink-line);
  background: rgba(0, 0, 0, .25);
}

.sb-tool.is-on {
  color: var(--ink);
  background: var(--gold);
  border-color: var(--gold-deep);
}

.sb-tool svg { width: 18px; height: 18px; }

.sb-select {
  max-width: 190px;
  padding: 5px 8px;
  font-family: var(--serif, inherit);
  font-size: .92rem;
  color: var(--text);
  background: var(--ink);
  border: 1px solid var(--ink-line);
  border-radius: 2px;
}

.sb-findwrap { position: relative; }

.sb-find {
  width: 210px;
  padding: 5px 9px;
  font-size: .9rem;
  color: var(--text);
  background: var(--ink);
  border: 1px solid var(--ink-line);
  border-radius: 2px;
}

.sb-results {
  position: absolute;
  z-index: 40;
  top: calc(100% + 5px);
  right: 0;
  width: 290px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--ink-2);
  border: 1px solid var(--ink-line);
  border-radius: 3px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .55);
}

.sb-result {
  display: flex;
  gap: 8px;
  align-items: baseline;
  width: 100%;
  padding: 7px 10px;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink-3);
  cursor: pointer;
}

.sb-result:hover { background: var(--ink-3); color: var(--gold-lit); }
.sb-result-title { flex: 1; }

.sb-result-id {
  font-family: ui-monospace, monospace;
  font-size: .72rem;
  letter-spacing: .04em;
  color: var(--text-faint);
}

/* ── The canvas ─────────────────────────────────────────────────── */

.sb-stage {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, rgba(201, 162, 39, .05), transparent 60%),
    repeating-linear-gradient(0deg, transparent 0 39px,
      rgba(255, 255, 255, .022) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px,
      rgba(255, 255, 255, .022) 39px 40px),
    var(--ink);
  border: 1px solid var(--ink-line);
  border-radius: 3px;
}

.sb-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.sb-stage[data-tool="select"] .sb-canvas { cursor: default; }
.sb-stage[data-tool="link"]   .sb-canvas { cursor: crosshair; }
.sb-stage[data-tool="ink"]    .sb-canvas,
.sb-stage[data-tool="arrow"]  .sb-canvas,
.sb-stage[data-tool="rect"]   .sb-canvas,
.sb-stage[data-tool="text"]   .sb-canvas { cursor: crosshair; }
.sb-stage[data-tool="note"]   .sb-canvas,
.sb-stage[data-tool="frame"]  .sb-canvas { cursor: copy; }

/* ── Nodes ───────────────────────────────────────────────────────── */

.sb-node { cursor: grab; }
.sb-node:active { cursor: grabbing; }

.sb-card {
  fill: var(--parch);
  stroke: var(--parch-edge);
  stroke-width: 1;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .5));
}

.sb-node--note .sb-card {
  fill: var(--parch-2);
  stroke: var(--gold-deep);
  stroke-dasharray: 3 2;
}

.sb-node.is-selected .sb-card {
  stroke: var(--gold);
  stroke-width: 2;
}

/* Fogged: revealed to nobody. Deliberately legible as "there is something
   here" without being legible as what. */
.sb-node.is-fogged .sb-card {
  fill: var(--ink-3);
  stroke: var(--ink-line);
  stroke-dasharray: 4 3;
}

.sb-node.is-fogged .sb-node-title { fill: var(--text-faint); font-style: italic; }
.sb-node.is-fogged .sb-glyph { color: var(--text-faint); }

.sb-glyph { color: var(--oxblood); }

.sb-node-title {
  font-family: 'Cinzel', serif;
  font-size: 12.5px;
  font-weight: 600;
  fill: var(--parch-ink);
}

.sb-node-sum {
  font-family: 'EB Garamond', serif;
  font-size: 11.5px;
  fill: var(--parch-ink-2);
}

.sb-node-id {
  font-family: ui-monospace, monospace;
  font-size: 8.5px;
  letter-spacing: .05em;
  fill: var(--parch-ink-3);
}

.sb-flag--seen { color: var(--verdigris); }

.sb-badge circle { stroke: var(--parch); stroke-width: 1.5; }
.sb-badge text {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  fill: var(--parch);
}
.sb-badge--high circle   { fill: var(--bad); }
.sb-badge--medium circle { fill: var(--warn); }
.sb-badge--low circle    { fill: var(--parch-ink-3); }

.sb-note-text {
  font-family: 'EB Garamond', serif;
  font-size: 12.5px;
  fill: var(--parch-ink);
}

.sb-frame rect {
  fill: rgba(201, 162, 39, .04);
  stroke: var(--gold-deep);
  stroke-width: 1;
  stroke-dasharray: 8 5;
}

.sb-frame.is-selected rect { stroke: var(--gold); stroke-width: 2; }

.sb-frame-title {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  fill: var(--gold-lit);
}

/* ── Edges ───────────────────────────────────────────────────────── */

/* The distinction that carries the whole feature: what canon says is thin,
   cool and dashed; what the GM drew is gilt and solid. */
.sb-edge path { fill: none; }

.sb-edge--derived path {
  stroke: var(--parch-ink-3);
  stroke-width: 1.2;
  stroke-dasharray: 5 4;
  opacity: .7;
}

.sb-edge--drawn path {
  stroke: var(--gold);
  stroke-width: 1.8;
  cursor: pointer;
}

.sb-edge--drawn:hover path { stroke: var(--gold-lit); stroke-width: 2.6; }

.sb-edge-label {
  font-family: 'Inter', sans-serif;
  font-size: 9.5px;
  letter-spacing: .04em;
  fill: var(--text-dim);
  paint-order: stroke;
  stroke: var(--ink);
  stroke-width: 3px;
}

.sb-edge--drawn .sb-edge-label { fill: var(--gold-lit); }

/* ── Shapes ──────────────────────────────────────────────────────── */

.sb-shape path {
  fill: none;
  stroke: var(--gold-lit);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sb-shape--rect path { stroke: var(--oxblood-lit); }
.sb-shape--highlight path { stroke: rgba(201, 162, 39, .3); stroke-width: 14; }
.sb-shape--preview path,
.sb-shape--preview { opacity: .6; stroke-dasharray: 4 3; }

.sb-shape-text {
  font-family: 'EB Garamond', serif;
  font-size: 15px;
  fill: var(--gold-lit);
}

/* ── Inspector ───────────────────────────────────────────────────── */

.sb-inspector {
  overflow-y: auto;
  padding-right: 2px;
}

.sb-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.sb-stat {
  padding: 8px 4px;
  text-align: center;
  background: var(--ink-2);
  border: 1px solid var(--ink-line);
  border-radius: 2px;
}

.sb-stat strong {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  color: var(--gold-lit);
}

.sb-stat span {
  font-size: .7rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.sb-fognote {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-bottom: 10px;
  padding: 7px 9px;
  font-size: .82rem;
  color: var(--text-dim);
  background: rgba(63, 107, 98, .14);
  border: 1px solid var(--verdigris);
  border-radius: 2px;
}

.sb-fognote svg { width: 16px; height: 16px; flex: none; }

.sb-detail h3 { margin-top: 0; }

.sb-finding {
  display: grid;
  gap: 2px;
  margin: 6px 0;
  padding: 6px 8px;
  font-size: .82rem;
  background: var(--parch-2);
  border-left: 3px solid var(--parch-ink-3);
  border-radius: 2px;
}

.sb-finding strong {
  font-family: ui-monospace, monospace;
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.sb-finding--high   { border-left-color: var(--bad); }
.sb-finding--medium { border-left-color: var(--warn); }

/* ── Picker ──────────────────────────────────────────────────────── */

.sb-modal {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 8, 14, .74);
  backdrop-filter: blur(2px);
}

.sb-modal-panel {
  width: min(560px, 100%);
  max-height: 78vh;
  overflow-y: auto;
}

.sb-modal-panel input[type="search"] {
  width: 100%;
  margin-bottom: 10px;
}

.sb-picker-list { display: grid; gap: 4px; }

.sb-picker-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  padding: 8px 10px;
  text-align: left;
  background: var(--parch-2);
  border: 1px solid var(--parch-edge);
  border-radius: 2px;
  cursor: pointer;
}

.sb-picker-row:hover { background: var(--parch-3); }

.sb-picker-blurb {
  grid-column: 1 / -1;
  font-size: .82rem;
  color: var(--parch-ink-2);
}

.sb-picker-blurb mark {
  padding: 0 1px;
  color: var(--parch-ink);
  background: rgba(201, 162, 39, .38);
}

@media (max-width: 900px) {
  .sb { grid-template-columns: 1fr; height: auto; }
  .sb-stage { height: 62vh; }
}

/* A region's biome, as a band down the card's edge rather than a fill: the
   card still has to be readable, and tinting the parchment makes the text
   fight the colour. */
.sb-biome { opacity: .85; }

.sb-geo {
  margin-bottom: 10px;
  padding: 8px 10px;
  background: var(--ink-2);
  border: 1px solid var(--ink-line);
  border-radius: 2px;
}

.sb-geo p { margin: 0 0 6px; }
.sb-geo .sb-fognote { margin: 0; }

/* ===================================================================
   Live session.

   Used with the GM's attention on the table, not the screen. Targets are
   large, state is legible from a metre away, and nothing needs saving.
   =================================================================== */

.live { display: grid; gap: 12px; }

.live-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 16px;
  align-items: center;
  padding: 14px 16px;
  background: linear-gradient(180deg, var(--ink-3), var(--ink-2));
  border: 1px solid var(--ink-line);
  border-radius: 3px;
}

.live-head h2 { margin: 0; }
.live-head p { margin: 2px 0 0; }

.live-bar {
  grid-column: 1 / -1;
  height: 6px;
  overflow: hidden;
  background: var(--ink);
  border: 1px solid var(--ink-line);
  border-radius: 3px;
}

.live-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold));
  transition: width .25s ease;
}

.live-cols {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 12px;
  align-items: start;
}

.live-beats { display: grid; gap: 8px; }

.live-beat {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  background: var(--parch);
  border: 1px solid var(--parch-edge);
  border-left: 4px solid var(--parch-edge);
  border-radius: 3px;
  color: var(--parch-ink);
}

.live-beat.is-landed {
  border-left-color: var(--ok);
  opacity: .72;
}

.live-beat.is-landed .live-beat-text p { text-decoration: line-through; }

.live-beat.is-skipped {
  border-left-color: var(--parch-ink-3);
  opacity: .5;
}

.live-beat.is-skipped .live-beat-text p { font-style: italic; }

/* Deliberately large: a mis-tap here is a beat marked that did not happen. */
.live-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  background: var(--parch-2);
  border: 1px solid var(--parch-edge);
  border-radius: 50%;
  cursor: pointer;
}

.live-mark:hover { background: var(--parch-3); }
.live-mark svg { width: 22px; height: 22px; color: var(--oxblood); }
.live-beat.is-landed .live-mark { background: var(--ok); border-color: var(--ok); }
.live-beat.is-landed .live-mark svg { color: var(--parch); }

.live-beat-text p { margin: 4px 0 0; font-size: 1.02rem; line-height: 1.45; }

.live-beat-meta {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.live-beat-order {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  color: var(--parch-ink-2);
}

.live-tag {
  padding: 1px 7px;
  font-size: .68rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--parch-ink-2);
  background: var(--parch-3);
  border-radius: 2px;
}

.live-uses { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }

.live-chip {
  padding: 3px 8px;
  font-family: ui-monospace, monospace;
  font-size: .72rem;
  color: var(--parch-ink-2);
  background: var(--parch-2);
  border: 1px dashed var(--parch-edge);
  border-radius: 2px;
  cursor: pointer;
}

.live-chip:hover {
  color: var(--parch);
  background: var(--verdigris);
  border-style: solid;
}

.live-skip {
  align-self: center;
  padding: 6px 10px;
  font-size: .76rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--parch-ink-3);
  background: transparent;
  border: 1px solid var(--parch-edge);
  border-radius: 2px;
  cursor: pointer;
}

.live-skip:hover { color: var(--parch-ink); background: var(--parch-2); }

.live-aside { display: grid; gap: 10px; }

.live-clock {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--ink-3);
}

.live-clock-label { display: grid; }
.live-clock-label strong { font-size: .92rem; }

.live-pips { display: flex; gap: 3px; }

.pip {
  width: 11px;
  height: 11px;
  background: var(--ink);
  border: 1px solid var(--ink-line);
  border-radius: 50%;
}

.pip.is-on { background: var(--gold); border-color: var(--gold-deep); }

.live-branch {
  display: grid;
  gap: 2px;
  width: 100%;
  margin-bottom: 5px;
  padding: 8px 10px;
  text-align: left;
  color: var(--text);
  background: var(--ink-2);
  border: 1px solid var(--ink-line);
  border-radius: 2px;
  cursor: pointer;
}

.live-branch:hover { border-color: var(--oxblood-lit); }
.live-branch strong {
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold-lit);
}
.live-branch span { font-size: .86rem; color: var(--text-dim); }

.live-note-form { margin-bottom: 8px; }
.live-note-form input { width: 100%; }

.live-note {
  margin: 0 0 6px;
  padding: 6px 9px;
  font-size: .88rem;
  background: var(--parch-2);
  border-left: 3px solid var(--gold-deep);
  border-radius: 2px;
  color: var(--parch-ink);
}

.live-pick {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  color: var(--parch-ink);
  background: var(--parch);
  border: 1px solid var(--parch-edge);
  border-radius: 3px;
  cursor: pointer;
}

.live-pick:hover { background: var(--parch-2); }
.live-pick svg { width: 22px; height: 22px; color: var(--oxblood); }
.live-pick-text { display: grid; gap: 2px; }

@media (max-width: 900px) {
  .live-cols { grid-template-columns: 1fr; }
}

/* The prep queue. Advice, not a report: ranked, short, and each item able to
   show the arithmetic that placed it. */
.prep-head { display: flex; gap: 8px; align-items: center; }
.prep-head h3 { margin: 0; }
.prep-head svg { width: 18px; height: 18px; color: var(--gold); }

.prep-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--ink-3);
}

.prep-rank {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  font-family: 'Cinzel', serif;
  font-size: .82rem;
  color: var(--ink);
  background: var(--gold);
  border-radius: 50%;
}

.prep-item--rehearse .prep-rank { background: var(--oxblood-lit); color: var(--text); }
.prep-item--generate .prep-rank { background: var(--verdigris); color: var(--text); }

.prep-title { margin: 0 0 4px; font-size: .92rem; line-height: 1.4; }
.prep-meta { display: flex; gap: 7px; align-items: baseline; }

.prep-where {
  font-family: ui-monospace, monospace;
  font-size: .72rem;
  color: var(--text-faint);
}

.prep-why { margin-top: 5px; }
.prep-why summary {
  font-size: .74rem;
  color: var(--text-faint);
  cursor: pointer;
}
.prep-why p { margin: 4px 0 0; font-size: .8rem; color: var(--text-dim); }

/* The wordmark and its subtag. The subtag is a second line rather than a
   parenthetical: it says what the thing is, and at masthead size a blackletter
   wordmark alone does not. Hidden on narrow screens, where the name has to
   carry it alone. */
.brandtext {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.05;
}

.subtag {
  font-family: 'Cinzel', serif;
  font-size: .62rem;
  font-weight: 500;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--gold-deep);
  white-space: nowrap;
}

@media (max-width: 620px) {
  .subtag { display: none; }
}

/* ===================================================================
   Public pages.

   Long-form reading, so the measure is narrower than the app's and the
   parchment does more of the work. Same materials as the studio: someone
   arriving here and then signing in should not feel they changed product.
   =================================================================== */

.pub { max-width: 860px; }

.pubnav {
  display: flex;
  gap: 18px;
  align-items: center;
  font-family: 'Cinzel', serif;
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.pubnav a { color: var(--text-dim); text-decoration: none; }
.pubnav a:hover { color: var(--gold-lit); }
.pubnav a.is-here { color: var(--gold); }
.pubnav .btn { text-transform: none; letter-spacing: .02em; }

.masthead .brand { text-decoration: none; color: inherit; }

.pub .scroll { margin-bottom: 18px; }
.pub .scroll h1 { margin-top: 0; }

.pub .scroll h2 {
  margin-top: 1.6em;
  padding-top: .7em;
  border-top: 1px solid var(--parch-edge);
}
.pub .scroll h2:first-of-type { margin-top: .6em; border-top: 0; padding-top: 0; }
.pub-hero .scroll h2 { border-top: 0; }

.pub p { font-size: 1.04rem; line-height: 1.62; }

.lede {
  font-size: 1.16rem !important;
  line-height: 1.55 !important;
  color: var(--parch-ink-2);
}

/* A claim the page wants to land on. Set as a statement, not a decoration. */
.pull {
  margin: 1.4em 0;
  padding: .2em 0 .2em 1.1em;
  font-family: 'Cinzel', serif;
  font-size: 1.08rem !important;
  line-height: 1.45 !important;
  color: var(--parch-ink);
  border-left: 3px solid var(--gold-deep);
}

.pub ul { font-size: 1.02rem; line-height: 1.6; }
.pub li { margin-bottom: .35em; }

.pubtable { width: 100%; border-collapse: collapse; margin-top: .8em; }

.pubtable th {
  padding: 8px 10px;
  font-family: 'Cinzel', serif;
  font-size: .76rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: left;
  color: var(--parch-ink-2);
  border-bottom: 2px solid var(--parch-edge);
}

.pubtable td {
  padding: 9px 10px;
  font-size: .95rem;
  line-height: 1.5;
  vertical-align: top;
  border-bottom: 1px solid var(--parch-edge);
}

.pubtable tr td:first-child {
  width: 30%;
  font-weight: 600;
  color: var(--parch-ink);
}

.pub-foot { text-align: center; }
.pub-foot h2 { border-top: 0 !important; margin-top: .3em; }
.pub-foot .aside { max-width: 56ch; margin: 0 auto 1.2em; }

@media (max-width: 720px) {
  .pubnav { gap: 12px; font-size: .68rem; }
  .pubtable tr td:first-child { width: 40%; }
}

/* Someone who lands on the studio without an account should still be able to
   read what it is, rather than facing a password box and nothing else. */
.gatelinks {
  margin: 2px 0 14px;
  font-size: .82rem;
  color: var(--parch-ink-3);
}
.gatelinks a { color: var(--parch-ink-2); }
.gatelinks a:hover { color: var(--oxblood); }

/* ── Tools: exports, share links, artwork ─────────────────────────── */

.tool-list { gap: 4px; }

.tool-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  text-decoration: none;
  color: var(--text);
  background: var(--ink-2);
  border: 1px solid var(--ink-line);
  border-radius: 2px;
}

.tool-row:hover { border-color: var(--gold-deep); background: var(--ink-3); }
.tool-row svg { width: 18px; height: 18px; color: var(--gold); }
.tool-text { display: grid; gap: 1px; min-width: 0; }
.tool-text .aside { font-size: .78rem; }

.share-new {
  display: grid;
  gap: 6px;
  padding: 10px;
  background: rgba(201, 162, 39, .1);
  border: 1px solid var(--gold-deep);
  border-radius: 2px;
}

.share-url {
  width: 100%;
  font-family: ui-monospace, monospace;
  font-size: .78rem;
}

.share-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--ink-3);
}

.art-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 6px;
  margin: 8px 0;
}

.art-cell {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--ink);
  border: 1px solid var(--ink-line);
  border-radius: 2px;
}

.art-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art-cell.is-failed { border-color: var(--bad); }

.art-wait {
  display: grid;
  place-items: center;
  height: 100%;
  font-size: .7rem;
  color: var(--text-faint);
}

.art-label {
  position: absolute;
  right: 0; bottom: 0; left: 0;
  padding: 2px 4px;
  font-family: ui-monospace, monospace;
  font-size: .62rem;
  color: var(--text-dim);
  background: rgba(0, 0, 0, .68);
}

/* ── The table screen ─────────────────────────────────────────────── */

.table-session {
  padding: 11px 0;
  border-bottom: 1px solid var(--parch-edge);
}

.table-session-head { display: flex; gap: 8px; align-items: baseline; }
.table-session .row { margin-top: 7px; }

.packet-read {
  margin: 8px 0;
  padding: 9px 12px;
  font-style: italic;
  background: var(--parch-2);
  border-left: 3px solid var(--gold-deep);
}

.packet-beat { margin-bottom: 10px; }
.packet-beat p { margin: 3px 0 0; }

.party-row {
  display: grid;
  gap: 1px;
  padding: 6px 0;
  border-bottom: 1px solid var(--ink-3);
}

.after-choice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
  margin-bottom: 5px;
  font-size: .9rem;
}

/* ── Regeneration diff ────────────────────────────────────────────── */

.diff-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  padding: 9px 0;
  border-bottom: 1px solid var(--parch-edge);
}

.diff-text { display: grid; gap: 3px; min-width: 0; }
.diff-text strong { font-size: .76rem; letter-spacing: .05em; text-transform: uppercase; }

.diff-was, .diff-now {
  margin: 0;
  padding: 5px 8px;
  font-size: .86rem;
  border-radius: 2px;
}

.diff-was {
  color: var(--parch-ink-2);
  background: rgba(162, 74, 63, .13);
  text-decoration: line-through;
}

.diff-now { color: var(--parch-ink); background: rgba(95, 143, 99, .16); }

/* ── Features page ────────────────────────────────────────────────── */

.feat-head { display: flex; gap: 10px; align-items: center; }
.feat-head h2 { margin: 0; border-top: 0 !important; padding-top: 0 !important; }
.feat-ico { width: 22px; height: 22px; color: var(--oxblood); flex: none; }

.feat-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 4px 26px;
  margin-top: .9em;
}

.feat { padding: 9px 0; border-top: 1px solid var(--parch-edge); }

.feat h3 {
  margin: 0 0 3px;
  font-size: .98rem;
  letter-spacing: .01em;
}

.feat p { margin: 0; font-size: .93rem !important; line-height: 1.52 !important; }
