/* Anvil: a leaf of Argo's paper. Builder = steps / choices / live summary; sheet = the 2024 sections in Argo dress. */
:root {
  --ground: #f0ede6; --raised: #f7f5f0; --sunk: #e6e0d4; --wash: #ebddd8;
  --ink: #3b1a1e; --soft: #6b4447; --accent: #8c363f; --logo: #8c363f;
  --rule: #d8ccbf; --rule-strong: #a0807c; --fill: #8c363f; --on-fill: #f0ede6; --focus: #5e2329;
  --danger: #8c363f; --good: #3f5a34; --gold: #8a6526;
  --shadow: 0 1px 0 rgba(59,26,30,.10), 0 6px 18px rgba(59,26,30,.08);
  --display: "Marcellus", "Trajan Pro", "Times New Roman", serif;
  --text: "Newsreader", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --ground: #2a1416; --raised: #341b1e; --sunk: #211012; --wash: #43242a; --ink: #f0ede6; --soft: #cdb9b4; --accent: #e09a9f; --logo: #f0ede6;
  --rule: #4a2c30; --rule-strong: #8a6266; --fill: #f0ede6; --on-fill: #5e2329; --focus: #f0ede6; --danger: #e09a9f; --good: #b9d3a8; --gold: #d9b067;
  --shadow: 0 1px 0 rgba(0,0,0,.3), 0 10px 28px rgba(0,0,0,.45); color-scheme: dark; } }
:root[data-theme="dark"] {
  --ground: #2a1416; --raised: #341b1e; --sunk: #211012; --wash: #43242a; --ink: #f0ede6; --soft: #cdb9b4; --accent: #e09a9f; --logo: #f0ede6;
  --rule: #4a2c30; --rule-strong: #8a6266; --fill: #f0ede6; --on-fill: #5e2329; --focus: #f0ede6; --danger: #e09a9f; --good: #b9d3a8; --gold: #d9b067;
  --shadow: 0 1px 0 rgba(0,0,0,.3), 0 10px 28px rgba(0,0,0,.45); color-scheme: dark; }
body.t-sailcloth { --ground: #f0ede6; --raised: #f7f5f0; --sunk: #e6e0d4; --wash: #ebddd8; --ink: #3b1a1e; --soft: #6b4447; --accent: #8c363f; --logo: #8c363f;
  --rule: #d8ccbf; --rule-strong: #a0807c; --fill: #8c363f; --on-fill: #f0ede6; --focus: #5e2329; --danger: #8c363f; --good: #3f5a34; --shadow: 0 1px 0 rgba(59,26,30,.10), 0 6px 18px rgba(59,26,30,.08); color-scheme: light; }
body.t-night { --ground: #2a1416; --raised: #341b1e; --sunk: #211012; --wash: #43242a; --ink: #f0ede6; --soft: #cdb9b4; --accent: #e09a9f; --logo: #f0ede6;
  --rule: #4a2c30; --rule-strong: #8a6266; --fill: #f0ede6; --on-fill: #5e2329; --focus: #f0ede6; --danger: #e09a9f; --good: #b9d3a8; --gold: #d9b067; --shadow: 0 1px 0 rgba(0,0,0,.3), 0 10px 28px rgba(0,0,0,.45); color-scheme: dark; }
body.t-canopus { --ground: #000; --raised: #120a0b; --sunk: #000; --wash: #2a1416; --ink: #f0ede6; --soft: #c4b2ae; --accent: #f0ede6; --logo: #f0ede6;
  --rule: #2b1c1e; --rule-strong: #7a5f63; --fill: #f0ede6; --on-fill: #5e2329; --focus: #f0ede6; --danger: #e09a9f; --good: #b9d3a8; --gold: #d9b067; --shadow: 0 0 0 1px rgba(240,237,230,.08); color-scheme: dark; }

* { box-sizing: border-box; }
html, body { background: var(--ground); }
body { color: var(--ink); font-family: var(--text); font-size: 17px; line-height: 27px; font-variant-numeric: lining-nums tabular-nums; margin: 0; }
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
#app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
button, input, select, textarea { font: inherit; color: inherit; font-variant-numeric: lining-nums tabular-nums; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
h1 { font: 400 40px/46px var(--display); color: var(--accent); margin: 0 0 8px; text-wrap: balance; }
h2 { font: 400 21px/27px var(--display); color: var(--accent); margin: 28px 0 10px; text-wrap: balance; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
h3 { font: 400 17px/22px var(--display); letter-spacing: .06em; margin: 0; color: var(--accent); }
p { margin: 0 0 10px; }
.eyebrow, .label { font: 400 12px/16px var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--soft); margin: 0 0 6px; }
.lead { font-size: 19px; line-height: 29px; color: var(--soft); max-width: 62ch; }
.sub { color: var(--soft); }
.small { font-size: 15px; line-height: 22px; }
.tag { font: 400 11px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; border: 1px solid var(--rule-strong); border-radius: 999px; padding: 3px 8px 2px; color: var(--soft); }
.good { color: var(--good); }
.count { font: 400 13px/18px var(--text); color: var(--soft); border: 1px solid var(--rule); border-radius: 999px; padding: 1px 9px; letter-spacing: 0; text-transform: none; }

/* buttons & fields */
.btn { border: 1px solid var(--rule-strong); background: var(--raised); color: var(--ink); border-radius: 3px; padding: 7px 14px; cursor: pointer; font-weight: 600; font-size: 16px; line-height: 22px; min-height: 40px; }
.btn:hover { background: var(--wash); }
.btn.primary { background: var(--fill); color: var(--on-fill); border-color: var(--fill); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--wash); }
.btn.danger { color: var(--danger); }
.btn.danger-fill { background: var(--danger); border-color: var(--danger); color: var(--ground); }
.btn.big { padding: 11px 20px; font-size: 17px; }
.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; text-align: left; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; margin: 0 0 12px; }
.field > span:first-child { font: 400 12px/16px var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--soft); }
input:not([type=checkbox]):not([type=radio]), select, textarea { background: var(--raised); border: 1px solid var(--rule-strong); border-radius: 3px; padding: 8px 10px; min-height: 42px; width: 100%; max-width: 100%; }
textarea { resize: vertical; line-height: 25px; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; flex: none; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.form-grid.add { align-items: end; grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) auto; }
.form-grid.add .btn { margin-bottom: 12px; }
.field-row { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; margin-top: 18px; }
.stepper { display: inline-flex; align-items: center; gap: 8px; }
.stepper output { min-width: 34px; text-align: center; font: 400 22px/1 var(--display); }
.stepper .btn { min-width: 40px; padding: 6px 0; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--rule-strong); border-radius: 3px; overflow: hidden; margin: 4px 0 14px; }
.seg button { border: 0; border-right: 1px solid var(--rule); background: var(--raised); padding: 8px 14px; cursor: pointer; min-height: 40px; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--fill); color: var(--on-fill); }
.seg.seg-wrap { display: flex; width: fit-content; max-width: 100%; }

/* top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--rule); background: var(--ground); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; flex-wrap: wrap; }
.brand { background: none; border: 0; padding: 0; cursor: pointer; color: var(--logo); display: flex; }
.brand svg { height: 56px; width: auto; display: block; }
.top-right { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.theme-menu { position: relative; }
.theme-btn { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 12px; }
.ticon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; color: var(--accent); }
.ticon .fill { fill: currentColor; }
.caret, .tick { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.caret { color: var(--soft); }
.theme-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--raised); border: 1px solid var(--rule-strong); border-radius: 6px; box-shadow: var(--shadow); padding: 6px; width: 250px; display: flex; flex-direction: column; gap: 2px; }
.theme-list[hidden] { display: none; }
.theme-item { display: grid; grid-template-columns: 24px 1fr 18px; align-items: center; gap: 10px; background: none; border: 0; border-radius: 3px; padding: 8px 10px; text-align: left; cursor: pointer; color: var(--ink); min-height: 44px; }
.theme-item:hover, .theme-item:focus-visible { background: var(--wash); }
.theme-item.on { background: var(--wash); }
.theme-item b { display: block; font-weight: 600; font-size: 16px; line-height: 21px; }
.theme-item i { display: block; font-style: normal; font-size: 13px; line-height: 18px; color: var(--soft); }
.theme-item .tick { color: var(--accent); }
@media (max-width: 480px) { .theme-name { display: none; } }

.wrap { max-width: 1120px; width: 100%; margin: 0 auto; padding-inline: 16px; padding-block: 28px 48px; flex: 1; }
.foot { border-top: 1px solid var(--rule); padding: 18px 16px 28px; text-align: center; color: var(--soft); font-size: 14px; line-height: 20px; }
.foot p { margin: 0 0 4px; }

/* library */
.lib-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.card { background: var(--raised); border: 1px solid var(--rule); border-radius: 3px; box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card h2 { margin: 0 0 4px; font-size: 26px; line-height: 31px; color: var(--ink); }
.card .sub { margin: 0; }
.card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.confirm { border-top: 1px solid var(--rule); padding-top: 10px; }
.mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 10px 0; }
.mini.wide { grid-template-columns: repeat(3, 1fr); }
.mini div { text-align: center; }
.mini dt { font: 400 11px/14px var(--display); letter-spacing: .12em; color: var(--soft); text-transform: uppercase; }
.mini dd { margin: 0; font: 400 24px/30px var(--display); color: var(--ink); }
.lib-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.empty { text-align: center; padding: 24px 0 40px; color: var(--logo); }
.empty svg { width: 200px; height: auto; margin: 0 auto 10px; display: block; }
.empty .lead { margin: 0 auto 24px; color: var(--ink); }
.empty-actions { display: flex; flex-direction: column; align-items: stretch; gap: 12px; width: 100%; max-width: 340px; margin: 0 auto; }

/* builder */
.build { display: grid; grid-template-columns: 210px minmax(0, 1fr) 300px; gap: 24px; max-width: 1280px; width: 100%; margin: 0 auto; padding: 24px 16px 40px; flex: 1; align-items: start; }
.steps { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 84px; }
.step { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; text-align: left; background: none; border: 1px solid transparent; border-radius: 3px; padding: 8px 10px; cursor: pointer; color: var(--ink); min-height: 44px; }
.step .num { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--rule-strong); display: grid; place-items: center; font: 400 14px/1 var(--display); }
.step.done .num { background: var(--wash); }
.step .mark { color: var(--good); font-size: 15px; }
.step.on { background: var(--raised); border-color: var(--rule); box-shadow: var(--shadow); }
.step.on .num { background: var(--fill); color: var(--on-fill); border-color: var(--fill); }
.step:hover { background: var(--raised); }
.panel { background: var(--raised); border: 1px solid var(--rule); border-radius: 6px; box-shadow: var(--shadow); padding: 24px; min-width: 0; }
.panel h1 { font-size: 32px; line-height: 38px; }
.nav-row { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--rule); margin-top: 24px; padding-top: 16px; }
.summary { background: var(--raised); border: 1px solid var(--rule); border-radius: 6px; padding: 18px; position: sticky; top: 84px; min-width: 0; }
.sum-name { margin: 0 0 4px; font-size: 24px; line-height: 29px; color: var(--ink); }
.summary .sub { margin: 0 0 2px; }
.summary .mini { margin: 12px 0; }
.abrow { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 0 0 12px; }
.abrow div { text-align: center; border: 1px solid var(--rule); border-radius: 3px; padding: 4px 0; display: flex; flex-direction: column; }
.abrow span { font: 400 10px/13px var(--display); letter-spacing: .1em; color: var(--soft); }
.abrow b { font: 400 18px/22px var(--display); }
.abrow i { font-style: normal; font-size: 13px; color: var(--soft); line-height: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--rule-strong); border-radius: 999px; padding: 1px 10px; font-size: 14px; line-height: 22px; }
.todo { margin: 0; padding-left: 18px; font-size: 15px; line-height: 22px; display: flex; flex-direction: column; gap: 4px; }

.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.pick-grid.small { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pick { text-align: left; background: var(--ground); border: 1px solid var(--rule-strong); border-radius: 3px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pick b { font: 400 18px/23px var(--display); color: var(--ink); }
.pick span { font-size: 14px; line-height: 20px; color: var(--soft); }
.pick:hover { background: var(--wash); }
.pick.on { background: var(--wash); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.pick.on b { color: var(--accent); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks.cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.check, .radio { display: flex; align-items: center; gap: 8px; border: 1px solid var(--rule); border-radius: 3px; padding: 7px 10px; cursor: pointer; background: var(--ground); min-height: 42px; }
.check.on, .radio.on { border-color: var(--accent); background: var(--wash); }
.check.inline { border: 0; padding: 0; background: none; min-height: 0; display: inline-flex; }
.check:has(input:disabled) { opacity: .55; cursor: default; }
.radios { display: flex; flex-direction: column; gap: 8px; }
.radio b { font-family: var(--display); color: var(--accent); }
.assign { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 14px; }
.assign .field { margin-bottom: 14px; }
.pts { color: var(--accent); }
.more { border-top: 1px solid var(--rule); padding: 6px 0; }
.more summary { cursor: pointer; padding: 4px 0; font-weight: 600; }
.more summary::marker { color: var(--accent); }
.desc { color: var(--ink); font-size: 16px; line-height: 25px; padding: 4px 0 8px; max-width: 70ch; }
.desc p { margin: 0 0 8px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 16px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
thead th { font: 400 12px/16px var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--soft); }
.scores td, .scores th { text-align: center; } .scores th:first-child { text-align: left; }
.qty { width: 74px !important; min-height: 36px !important; padding: 4px 8px !important; }
.coins { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 10px; }
.counts { display: flex; gap: 8px; flex-wrap: wrap; }
.spell-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.spell { border: 1px solid var(--rule); border-radius: 3px; padding: 10px 12px 4px; background: var(--ground); min-width: 0; }
.spell.on { border-color: var(--accent); }
.spell .check { border: 0; padding: 0; background: none; min-height: 28px; }
.spell .sub { margin: 2px 0 2px; }

/* sheet */
.notice { background: var(--wash); border: 1px solid var(--rule); border-radius: 3px; padding: 8px 12px; margin: 0 0 16px; }
.s-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; border-bottom: 2px solid var(--accent); padding-bottom: 14px; margin-bottom: 18px; }
.s-head h1 { margin: 0; font-size: 46px; line-height: 52px; color: var(--ink); }
.s-head .lead { margin: 4px 0 0; }
.facts { display: grid; grid-template-columns: repeat(3, auto); gap: 4px 22px; margin: 0; }
.facts dt { font: 400 11px/14px var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--soft); }
.facts dd { margin: 0; font-size: 17px; }
.facts.row4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 14px; }
.facts.stack { grid-template-columns: 1fr; gap: 10px; }
.facts.stack dd { white-space: pre-wrap; }
.s-def { display: grid; grid-template-columns: 150px minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px; margin-bottom: 12px; }
.box { background: var(--raised); border: 1px solid var(--rule); border-radius: 3px; padding: 12px 14px; box-shadow: var(--shadow); min-width: 0; }
.box.ac { text-align: center; border: 2px solid var(--accent); border-radius: 3px 3px 40% 40% / 3px 3px 30% 30%; }
.hp-row { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.hp-row label { display: flex; flex-direction: column; font-size: 13px; color: var(--soft); }
.hp-row input { width: 96px !important; font: 400 26px/1 var(--display) !important; text-align: center; }
.hp-row .of { color: var(--soft); padding-bottom: 10px; }
.big-text { font: 400 30px/36px var(--display); margin: 0 0 6px; }
.dots { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: 15px; color: var(--soft); flex-wrap: wrap; }
.dot { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--rule-strong); background: transparent; cursor: pointer; padding: 0; }
.dot.on { background: var(--accent); border-color: var(--accent); }
.s-core { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--raised); border: 1px solid var(--rule); border-radius: 3px; padding: 10px; text-align: center; min-width: 0; }
.stat .label { font-size: 11px; letter-spacing: .1em; }
.num { background: none; border: 0; padding: 0 2px; cursor: pointer; color: var(--ink); font: inherit; border-bottom: 1px dashed transparent; }
.num:hover { border-bottom-color: var(--rule-strong); }
.num.big { font: 400 32px/40px var(--display); }
.num.static { cursor: default; margin: 0; border: 0; }
.num.set, .score.set { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; color: var(--accent); }
.insp { border: 1px solid var(--rule-strong); background: var(--ground); border-radius: 999px; padding: 4px 16px; cursor: pointer; margin-top: 6px; min-height: 36px; }
.insp.on { background: var(--fill); color: var(--on-fill); border-color: var(--fill); }
.s-cols { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
.s-abilities { display: flex; flex-direction: column; gap: 10px; }
.ability { background: var(--raised); border: 1px solid var(--rule); border-radius: 3px; padding: 10px 12px; }
.ab-top { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--rule); padding-bottom: 6px; margin-bottom: 4px; }
.ab-nums { display: flex; align-items: center; gap: 8px; }
.mod { font: 400 26px/30px var(--display); }
.score { border: 1px solid var(--rule-strong); border-radius: 3px; background: var(--ground); min-width: 38px; padding: 1px 6px; cursor: pointer; font-size: 15px; }
.row { display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 8px; font-size: 15px; line-height: 26px; }
.row.save { font-weight: 600; }
.pip { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--rule-strong); }
.pip.on { background: var(--accent); border-color: var(--accent); }
.pip.exp { box-shadow: 0 0 0 2px var(--raised), 0 0 0 3.5px var(--accent); }
.pip-l { display: inline-flex; align-items: center; gap: 4px; margin-right: 10px; color: var(--soft); }
.pip-l::before { content: ""; width: 10px; height: 10px; border-radius: 2px; border: 1.5px solid var(--rule-strong); }
.pip-l.on { color: var(--ink); } .pip-l.on::before { background: var(--accent); border-color: var(--accent); }
.s-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.block { background: var(--raised); border: 1px solid var(--rule); border-radius: 3px; padding: 14px 18px; box-shadow: var(--shadow); min-width: 0; }
.block h2 { margin-top: 0; }
.slots { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.slot { border: 1px solid var(--rule); border-radius: 3px; padding: 6px 10px; }
.slot p { margin: 0 0 4px; display: flex; gap: 5px; }
.gear { columns: 2; margin: 0 0 12px; padding-left: 18px; }
.hint { margin-top: 18px; text-align: center; }

/* popover & dialog */
.pop { position: absolute; z-index: 30; background: var(--raised); border: 1px solid var(--rule-strong); border-radius: 6px; box-shadow: var(--shadow); padding: 12px; width: 240px; }
.pop input { margin-bottom: 8px; }
.pop-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dlg-wrap { position: fixed; inset: 0; background: rgba(20,8,10,.55); z-index: 40; display: grid; place-items: center; padding: 16px; }
.dlg { background: var(--raised); color: var(--ink); border-radius: 6px; padding: 20px; width: min(560px, 100%); max-height: 90vh; overflow: auto; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.dlg h2 { margin-top: 0; }

@media (max-width: 1080px) {
  .build { grid-template-columns: minmax(0, 1fr); }
  .steps { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .step { grid-template-columns: 26px auto; flex: none; }
  .step .mark { display: none; }
  .summary { position: static; }
  .s-cols { grid-template-columns: minmax(0, 1fr); }
  .s-abilities { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}
@media (max-width: 720px) {
  h1 { font-size: 32px; line-height: 38px; }
  .panel { padding: 16px; }
  .s-def { grid-template-columns: 1fr 1fr; align-items: start; }
  .box.ac { padding-bottom: 22px; }
  .card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .card-actions .btn { min-height: 44px; }
  .card-actions .btn.ghost { border-color: var(--rule); }
  .card-actions .btn.ghost.danger { grid-column: auto; }
  .s-core { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .facts.row4 { grid-template-columns: 1fr 1fr; }
  .form-grid.add { grid-template-columns: 1fr; }
  .coins { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gear { columns: 1; }
  .hp-row input { width: 76px !important; font-size: 22px !important; }
  .hp-row .num.big { font-size: 26px; }
  .box { padding: 10px; }
  .s-head h1 { font-size: 36px; line-height: 42px; }
  .brand svg { height: 36px; }
  .top { flex-wrap: nowrap; padding: 8px 16px; }
  .top .theme-btn { min-height: 44px; padding: 6px 10px; }
  .top .caret { display: none; }
  .top-right .btn.ghost[data-act="home"] { display: none; }
  .lib-head { gap: 16px; margin-bottom: 16px; }
  .lib-actions { width: 100%; }
  .lib-actions .btn { flex: 1 1 0; min-height: 48px; }
  .empty { padding-top: 8px; }
  .empty svg { width: 140px; }
  .empty-actions .btn { min-height: 48px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* account */
.sync-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--rule-strong); flex: none; }
.sync-dot.s-synced { background: var(--good); }
.sync-dot.s-syncing, .sync-dot.s-pending { background: var(--gold, #8a6526); }
.sync-dot.s-error, .sync-dot.s-signedout { background: var(--danger); }
.acct-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--rule); margin-bottom: 4px; }
.acct-head p { margin: 0; }
a.theme-item { text-decoration: none; }
.gate { display: grid; place-items: center; }
.gate-card { max-width: 520px; text-align: center; padding: 24px 0; color: var(--ink); }
.gate-card svg { width: 220px; height: auto; display: block; margin: 0 auto 18px; color: var(--logo); }
.gate-card .lead { margin-left: auto; margin-right: auto; }
