/* Bookdesign — the app around the book: library, wizard, editor, credits.
   The book's own pages are styled in book.css. */

:root {
  --paper: #F6F1E8;
  --card: #FFFDF9;
  --ink: #1E1A16;
  --muted: #6E655B;
  --faint: #A69C90;
  --line: #E4DCCF;
  --line-strong: #D3C8B8;
  --accent: #B5532F;
  --accent-ink: #FFFFFF;
  --accent-soft: #F3E1D7;
  --green: #2F6B4F;
  --danger: #A33A2C;
  --shadow: 0 1px 2px rgba(40,30,20,.06), 0 8px 24px rgba(40,30,20,.08);
  --shadow-lg: 0 2px 4px rgba(40,30,20,.06), 0 24px 60px rgba(40,30,20,.16);
  --radius: 14px;
  --display: "Fraunces", Georgia, serif;
  --ui: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--ink); font: 15px/1.5 var(--ui); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ── controls ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--card); cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #000; }
.btn.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.accent:hover { background: #9E4626; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(0,0,0,.05); }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn .cost { font-weight: 500; opacity: .75; font-size: .92em; }

.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.field small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.input, textarea.input, select.input {
  width: 100%; border: 1px solid var(--line-strong); background: #fff; border-radius: 10px;
  padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { resize: vertical; min-height: 84px; line-height: 1.5; }
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(30,26,22,.08); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  border: 1px solid var(--line-strong); background: #fff; border-radius: 999px; padding: 6px 12px;
  cursor: pointer; font-size: 13px; font-weight: 600;
}
.seg button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.switch { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.switch input { margin-top: 3px; accent-color: var(--ink); }

.pill {
  white-space: nowrap; flex: none;
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px;
  background: var(--accent-soft); color: #6A2D16; font-weight: 700; font-size: 13px; border: 0; cursor: pointer;
}
.pill svg { width: 15px; height: 15px; }

.muted { color: var(--muted); }
.tiny { font-size: 12.5px; }
.error-text { color: var(--danger); }

/* ── shell ── */
.top {
  position: sticky; top: 0; z-index: 20; height: 60px; display: flex; align-items: center; gap: 12px;
  padding: 0 20px; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 20px/1 var(--display); letter-spacing: -.01em; }
.brand-mark { width: 26px; height: 26px; }
.spacer { flex: 1; }
.who { font-size: 13px; color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── sign in ── */
.gate { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.gate-art { position: relative; overflow: hidden; background: #E9DFCF; }
.gate-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gate-art figcaption { position: absolute; left: 28px; bottom: 24px; color: #fff; font: italic 15px var(--display); text-shadow: 0 1px 8px rgba(0,0,0,.35); }
.gate-box { display: flex; flex-direction: column; justify-content: center; padding: 48px clamp(24px, 6vw, 80px); }
.gate-box h1 { font: 500 clamp(32px, 4vw, 46px)/1.05 var(--display); letter-spacing: -.02em; margin: 18px 0 12px; }
.gate-box p { color: var(--muted); margin: 0 0 26px; max-width: 420px; }
sb-signin {
  --sb-accent: #1E1A16; --sb-radius: 12px; --sb-font: "DM Sans", system-ui, sans-serif;
  display: block; max-width: 400px;
}

/* ── library ── */
.page-wrap { max-width: 1180px; margin: 0 auto; padding: 36px 24px 80px; }
.lib-head { display: flex; align-items: end; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.lib-head h1 { font: 500 38px/1.05 var(--display); letter-spacing: -.02em; margin: 0; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 28px 22px; }
.book-card { cursor: pointer; text-align: left; background: none; border: 0; padding: 0; position: relative; }
.book-card .cover {
  aspect-ratio: 1 / 1; border-radius: 4px 10px 10px 4px; overflow: hidden; background: #E6DCCB;
  box-shadow: var(--shadow); position: relative; transition: transform .2s, box-shadow .2s;
  display: flex; align-items: center; justify-content: center;
}
.book-card .cover::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 6%; background: linear-gradient(90deg, rgba(0,0,0,.14), rgba(0,0,0,0)); z-index: 1; }
.book-card .cover.portrait { aspect-ratio: 2 / 3; }
.book-card .cover.landscape { aspect-ratio: 5 / 4; }
.book-card:hover .cover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.book-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.book-card .cover .t { font: 500 20px/1.1 var(--display); padding: 18px; text-align: center; color: #4A3B2C; }
.book-card h3 { font: 600 15px/1.3 var(--ui); margin: 12px 0 2px; }
.book-card .meta { font-size: 12.5px; color: var(--muted); }
.book-card.new .cover { background: transparent; border: 1.5px dashed var(--line-strong); box-shadow: none; flex-direction: column; gap: 10px; color: var(--muted); font-weight: 600; }
.book-card.new .cover::before { display: none; }
.book-card.new:hover .cover { border-color: var(--ink); color: var(--ink); }
.plus { width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 26px; font-weight: 300; }
.card-menu { position: absolute; top: 8px; right: 8px; z-index: 2; opacity: 0; transition: opacity .15s; }
.book-card:hover .card-menu, .card-menu:focus-within { opacity: 1; }
.card-menu button { width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); cursor: pointer; box-shadow: var(--shadow); }

.empty { text-align: center; padding: 60px 20px; border: 1px solid var(--line); border-radius: 22px; background: var(--card); }
.empty h2 { font: 500 30px/1.15 var(--display); margin: 10px 0; }
.empty p { color: var(--muted); max-width: 520px; margin: 0 auto 22px; }

/* ── menus, dialogs, toasts ── */
.menu { position: fixed; z-index: 60; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 180px; }
.menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none; border-radius: 8px; cursor: pointer; font-weight: 500; }
.menu button:hover { background: var(--paper); }
.menu button.danger { color: var(--danger); }

.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(30,24,18,.42); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s; }
@keyframes fade { from { opacity: 0 } }
.dialog { background: var(--card); border-radius: 20px; box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 28px; position: relative; }
.dialog.wide { width: min(980px, 100%); padding: 0; }
.dialog h2 { font: 500 28px/1.15 var(--display); margin: 0 0 8px; letter-spacing: -.01em; }
.dialog .close { position: absolute; top: 14px; right: 14px; }
.dialog-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; box-shadow: var(--shadow-lg); font-weight: 500; font-size: 14px; animation: rise .2s; max-width: 92vw; }
.toast.bad { background: var(--danger); }
@keyframes rise { from { transform: translateY(8px); opacity: 0 } }

/* ── wizard ── */
.wiz { display: grid; grid-template-columns: 250px 1fr; min-height: 560px; }
.wiz-side { background: #EFE7DA; padding: 28px 22px; border-radius: 20px 0 0 20px; }
.wiz-side h2 { font-size: 24px; }
.steps { list-style: none; padding: 0; margin: 22px 0 0; }
.steps li { display: flex; gap: 10px; align-items: center; padding: 9px 0; color: var(--muted); font-weight: 600; }
.steps li b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #fff; font-size: 12px; color: var(--muted); }
.steps li.on { color: var(--ink); }
.steps li.on b { background: var(--ink); color: #fff; }
.steps li.done b { background: var(--green); color: #fff; }
.wiz-main { padding: 30px 32px 24px; display: flex; flex-direction: column; }
.wiz-main h3 { font: 500 24px/1.2 var(--display); margin: 0 0 4px; }
.wiz-main .lede { color: var(--muted); margin: 0 0 20px; }
.wiz-body { flex: 1; }
.wiz-foot { display: flex; gap: 10px; align-items: center; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.styles-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.style-opt { border: 2px solid transparent; border-radius: 12px; overflow: hidden; background: #fff; cursor: pointer; padding: 0; text-align: left; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.style-opt:hover { transform: translateY(-2px); }
.style-opt.on { border-color: var(--ink); }
.style-opt img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.style-opt div { padding: 8px 10px 10px; }
.style-opt b { display: block; font-size: 13.5px; }
.style-opt small { color: var(--muted); font-size: 12px; line-height: 1.3; display: block; }
.type-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.type-opt { border: 2px solid var(--line); border-radius: 12px; padding: 10px; background: #fff; cursor: pointer; text-align: left; }
.type-opt.on { border-color: var(--ink); }
.type-opt .s1 { font-size: 22px; line-height: 1.1; }
.type-opt .s2 { font-size: 12.5px; color: var(--muted); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line-strong); cursor: pointer; }
.swatch.on { outline: 2px solid var(--ink); outline-offset: 2px; }
.char-row { display: grid; grid-template-columns: 150px 1fr 32px; gap: 8px; margin-bottom: 8px; align-items: start; }
.char-row textarea { min-height: 44px; }
.count-badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: #6A2D16; margin-left: 6px; }

/* ── editor ── */
.ed { display: grid; grid-template-columns: 210px minmax(0, 1fr) 380px; height: calc(100vh - 60px); }
.ed-rail { border-right: 1px solid var(--line); overflow: auto; padding: 14px 12px 40px; background: #F1EBE0; }
.rail-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 14px 4px 8px; }
.thumb { display: block; width: 100%; border: 0; background: none; padding: 6px; border-radius: 10px; cursor: pointer; text-align: left; position: relative; }
.thumb:hover { background: rgba(0,0,0,.04); }
.thumb.on { background: #fff; box-shadow: var(--shadow); }
.thumb .bk-frame { margin: 0 auto; box-shadow: 0 1px 3px rgba(0,0,0,.18); border-radius: 2px; }
.thumb .cap { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 6px; padding: 0 2px; }
.thumb .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); align-self: center; }
.thumb .dot.ok { background: var(--green); }
.add-page { margin: 8px 6px; }

.ed-stage { overflow: auto; display: flex; flex-direction: column; align-items: center; padding: 28px 24px 24px; gap: 18px; background:
  radial-gradient(circle at 50% 30%, #FBF8F2, var(--paper) 70%); }
.stage-page { display: flex; align-items: center; gap: 14px; }
.stage-page .bk-frame { box-shadow: 0 2px 6px rgba(0,0,0,.08), 0 18px 50px rgba(60,40,20,.18); border-radius: 2px; }
.nav-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--card); cursor: pointer; font-size: 18px; flex: none; }
.nav-btn:disabled { opacity: .3; cursor: default; }
.variations { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; max-width: 100%; }
.variations .lbl { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.var { width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: #ddd; }
.var.on { border-color: var(--ink); }
.var img { width: 100%; height: 100%; object-fit: cover; display: block; }

.ed-side { border-left: 1px solid var(--line); background: var(--card); display: flex; flex-direction: column; min-height: 0; }
.tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 10px; flex: none; }
.tabs button { flex: 1; border: 0; background: none; padding: 14px 6px 12px; font-weight: 600; font-size: 13.5px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--ink); }
.side-body { overflow: auto; padding: 20px 20px 40px; flex: 1; }
.side-body h4 { font: 500 20px/1.2 var(--display); margin: 0 0 14px; }
.side-actions { position: sticky; bottom: 0; background: var(--card); border-top: 1px solid var(--line); padding: 14px 20px; flex: none; }
.side-actions .row { display: flex; gap: 8px; align-items: center; }
.quality { display: flex; gap: 6px; margin-bottom: 10px; }
.quality button { flex: 1; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; padding: 7px 8px; cursor: pointer; text-align: left; font-size: 12.5px; }
.quality button b { display: block; font-size: 13px; }
.quality button.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-strong); background: #fff; padding: 5px 10px; border-radius: 999px; font-size: 13px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .auto { font-size: 10.5px; opacity: .7; }
.lay-opts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.lay-opt { border: 1.5px solid var(--line-strong); border-radius: 8px; background: #fff; padding: 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10.5px; color: var(--muted); }
.lay-opt.on { border-color: var(--ink); color: var(--ink); }
.lay-opt svg { width: 34px; height: 34px; }
.char-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 14px; background: #fff; }
.char-card .sheet { width: 100%; aspect-ratio: 3 / 2; border-radius: 10px; overflow: hidden; background: var(--paper); margin-bottom: 10px; display: grid; place-items: center; color: var(--faint); font-size: 13px; position: relative; }
.char-card .sheet img { width: 100%; height: 100%; object-fit: cover; }
.char-card .sheet .busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255,255,255,.7); font-weight: 600; color: var(--ink); }
.mini-styles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini-styles .style-opt img { aspect-ratio: 4 / 3; }
.mini-styles .style-opt div { padding: 5px 7px 7px; }
.mini-styles .style-opt b { font-size: 12px; }
.mini-styles .style-opt small { display: none; }
.guide { background: #F6EFE4; border: 1px solid #EBDDC7; border-radius: 14px; padding: 14px 16px; margin-bottom: 18px; }
.guide h5 { margin: 0 0 8px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: #8A5A2B; }
.guide ol { margin: 0; padding-left: 18px; font-size: 13.5px; }
.guide li { margin: 3px 0; }
.guide li.done { color: var(--muted); text-decoration: line-through; }
.hr { height: 1px; background: var(--line); margin: 18px 0; }

.ed-title { font: 600 16px var(--ui); border: 1px solid transparent; background: none; border-radius: 8px; padding: 6px 8px; min-width: 120px; max-width: 34vw; }
.ed-title:hover { border-color: var(--line); }
.ed-title:focus { border-color: var(--ink); outline: none; background: #fff; }
.save-state { font-size: 12.5px; color: var(--faint); min-width: 60px; }
.banner { background: #FBE7DF; color: #6A2D16; padding: 10px 20px; font-weight: 600; font-size: 14px; display: flex; gap: 12px; align-items: center; }

/* ── download ── */
.dl-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.dl-opt { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: #fff; display: flex; flex-direction: column; gap: 6px; }
.dl-opt b { font-size: 15px; }
.dl-opt p { flex: 1; margin: 0 0 8px; }
@media (max-width: 560px) { .dl-opts { grid-template-columns: 1fr; } }

/* ── credits and plans ── */
.balance { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 18px; }
.balance b { font: 500 54px/1 var(--display); }
.packs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 10px 0 18px; }
.pack { border: 1.5px solid var(--line-strong); border-radius: 14px; padding: 14px; background: #fff; text-align: left; cursor: pointer; }
.pack:hover { border-color: var(--ink); }
.pack b { font: 500 26px/1 var(--display); display: block; }
.pack span { color: var(--muted); font-size: 13px; }
.ledger { list-style: none; margin: 0; padding: 0; font-size: 13.5px; max-height: 220px; overflow: auto; border-top: 1px solid var(--line); }
.ledger li { display: flex; justify-content: space-between; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.ledger .plus-d { color: var(--green); font-weight: 700; }
.ledger .minus-d { color: var(--muted); font-weight: 700; }
.redeem { display: flex; gap: 8px; }
.price-note { background: var(--paper); border-radius: 12px; padding: 12px 14px; font-size: 13.5px; color: var(--muted); margin-bottom: 16px; }
.price-note b { color: var(--ink); }
.pill.premium { background: var(--ink); color: #fff; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: #6A2D16; margin-left: 6px; vertical-align: 1px; }
.plans { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; margin: 10px 0 18px; }
.plan { border: 1.5px solid var(--line-strong); border-radius: 14px; padding: 14px; background: #fff; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.plan.on { border-color: var(--ink); }
.plan p { margin: 0; }
.plan .tag { margin-left: 0; }
.plan .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.plan-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; width: 100%; }
.plan-head b { font: 500 20px/1.1 var(--display); }
.plan-price { font-weight: 700; font-size: 13px; white-space: nowrap; }
.perks { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--muted); }
.perks b { color: var(--ink); }
.bird { background: var(--accent-soft); color: #6A2D16; border-radius: 12px; padding: 10px 14px; font-size: 13.5px; margin: -6px 0 16px; }
.pack .pack-price { display: block; color: var(--ink); font-weight: 700; margin-top: 6px; }
.pack s { font-weight: 400; }
.pack small { display: block; font-size: 11.5px; margin-top: 2px; }
.pack small.was { display: inline; }
.quality button.locked { color: var(--muted); }
.quality button.locked b { color: var(--muted); }
.dl-opt.locked p { color: var(--muted); }
@media (max-width: 560px) { .plans { grid-template-columns: 1fr; } .packs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── small screens ── */
@media (max-width: 1100px) {
  .ed { grid-template-columns: 170px minmax(0, 1fr) 340px; }
}
@media (max-width: 860px) {
  .gate { grid-template-columns: 1fr; }
  .gate-art { height: 34vh; }
  .ed { display: flex; flex-direction: column; height: auto; }
  .ed-rail { display: flex; gap: 6px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px; }
  .ed-rail .rail-label { display: none; }
  .ed-rail .thumb { width: 96px; flex: none; }
  .add-page { flex: none; align-self: center; }
  .ed-stage { padding: 18px 10px; }
  .ed-side { border-left: 0; border-top: 1px solid var(--line); }
  .wiz { grid-template-columns: 1fr; }
  .wiz-side { border-radius: 20px 20px 0 0; padding: 20px; }
  .steps { display: flex; gap: 14px; margin-top: 10px; }
  .steps li span { display: none; }
  .styles-grid { grid-template-columns: repeat(2, 1fr); }
  .type-opts { grid-template-columns: repeat(2, 1fr); }
  .char-row { grid-template-columns: 1fr 32px; }
  .char-row textarea { grid-column: 1 / -1; grid-row: 2; }
  .top { padding: 0 12px; gap: 8px; }
  .who, .hide-sm { display: none; }
  .ed .brand-name, .top:has(.ed-title) .brand-name { display: none; }
  .top { overflow: hidden; }
  .ed-title { max-width: 34vw; min-width: 60px; font-size: 14px; }
  .ed-side .side-actions { position: static; }
  .top:has(.ed-title) .signout { display: none; }
  .top:has(.ed-title) #tok-count { font-size: 0; }
  .top:has(.ed-title) #tok-count::before { content: attr(data-n); font-size: 13px; }
  .top > div:has(.ed-title) { flex: 1 1 auto; min-width: 0; }
  .top .btn.small { padding: 0 10px; }
  .ed-rail .thumb .cap { font-size: 11px; }
  .thumb .bk-frame { margin: 0; }
  .dialog { padding: 22px; }
  .wiz-main { padding: 20px; }
}
