/* MORN · Companion V1 — shared visual system */
@font-face {
  font-family: "Cinzel";
  src: url("./assets/Cinzel-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #181b19;
  --panel: #20241f;
  --panel-raised: #262b25;
  --panel-deep: #1b1f1b;
  --text: #ece6d6;
  --muted: #a7ad9e;
  --muted-dim: #858d7f;
  --gold: #b8a270;
  --gold-light: #d2bf92;
  --gold-soft: rgba(184, 162, 112, .1);
  --border: rgba(184, 162, 112, .17);
  --border-strong: rgba(184, 162, 112, .36);
  --sage: #a8bb98;
  --life: #bd7c70;
  --mana: #8da7b9;
  --danger: #d89687;
  --radius: 10px;
  --serif: "Cinzel", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; scroll-padding-top: 100px; }
body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(ellipse at 70% 0, rgba(89, 100, 73, .06), transparent 55%), var(--bg);
  font: 400 1rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
body:has(dialog[open]) { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .34; }
button, a { touch-action: manipulation; }
button, input, textarea, select { border-radius: 6px; }
button { border: 0; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--gold-light); }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
button img { pointer-events: none; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.3; text-wrap: balance; }
h1 { font-size: clamp(1.75rem, 3.3vw, 2.6rem); letter-spacing: -.02em; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.1rem; }
p { overflow-wrap: anywhere; }
strong { font-weight: 600; }
small { font-size: .875rem; }
::selection { color: #f9f3e7; background: #675d3e; }
:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 4px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-offset: 2px; }
input, textarea, select { background: var(--panel-deep); border: 1px solid var(--border-strong); }
input, select { min-height: 46px; padding: 10px 12px; }
textarea { width: 100%; padding: 12px 14px; line-height: 1.65; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted-dim); opacity: 1; }
input[type="number"] { appearance: textfield; -moz-appearance: textfield; font-variant-numeric: tabular-nums; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
select {
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23b8a270' stroke-width='1.5'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 18px;
  background-position: right 12px center;
}
option { background: var(--panel); color: var(--text); }
.icon { width: 21px; height: 21px; flex: 0 0 21px; vertical-align: middle; }
.muted { color: var(--muted); }
.small-text, .text-note { font-size: .875rem; }
.text-note { color: var(--muted-dim); line-height: 1.5; }
.positive { color: var(--sage); }
.negative, .danger { color: var(--danger); }
.eyebrow { display: block; color: var(--gold); font-size: .875rem; line-height: 1.55; letter-spacing: .13em; font-weight: 500; }
.actions { display: flex; align-items: center; gap: 10px; }
.btn, .icon-btn, .text-button, .counter-btn { transition: background .18s ease, color .18s ease, border-color .18s ease; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--text);
  background: var(--panel-raised);
  font-size: .9375rem;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
}
.btn:hover { background: #30362c; border-color: var(--gold); color: var(--text); }
.btn-primary { color: #21231c; background: var(--gold); border-color: var(--gold); font-weight: 650; box-shadow: inset 0 1px 0 #dfcea14d; }
.btn-primary:hover { color: #181b19; background: var(--gold-light); border-color: var(--gold-light); }
.btn-outline { background: transparent; color: var(--gold-light); }
.btn-outline:hover { background: var(--gold-soft); }
.btn-quiet { border-color: transparent; color: var(--muted); background: transparent; }
.btn-quiet:hover { background: var(--gold-soft); border-color: transparent; }
.btn-danger { background: #5e342b; border-color: #985e50; color: #f5e6de; }
.btn-danger:hover { background: #754034; border-color: #bd7c70; }
.btn-full { width: 100%; }
.icon-btn {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
}
.icon-btn:hover { color: var(--gold-light); background: var(--gold-soft); }
.icon-btn-small { width: 44px; height: 44px; }
.text-button { display: inline-flex; min-height: 44px; padding: 7px 0; align-items: center; gap: 8px; color: var(--gold-light); text-align: left; background: transparent; font-size: .9375rem; }
.text-button:hover { color: #e3d4ae; }
.count-badge, .badge { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; min-height: 25px; padding: 2px 7px; background: var(--gold-soft); border: 1px solid var(--border); border-radius: 5px; color: var(--gold-light); font: 500 .875rem/1.4 var(--sans); font-variant-numeric: tabular-nums; }
.skip-link { position: fixed; top: -100px; left: 16px; padding: 12px 20px; z-index: 100; background: var(--gold); color: var(--bg); }
.skip-link:focus { top: 12px; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; border: 0 !important; }
input[type="radio"], input[type="checkbox"] { width: 20px; height: 20px; min-height: 20px; flex: 0 0 20px; padding: 0; margin: 0; accent-color: var(--gold); }

/* Shell */
.app-header { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--border); background: rgba(24, 27, 25, .95); backdrop-filter: blur(18px); }
.header-inner { max-width: 1280px; min-height: 88px; margin: 0 auto; padding: 12px 40px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; flex-shrink: 0; gap: 13px; color: var(--gold-light); }
.brand > img { width: 42px; height: 42px; }
.brand-text { font: 500 1.7rem/1.1 var(--serif); letter-spacing: .19em; }
.brand-text small { display: block; margin-top: 7px; color: var(--muted); font: 400 .625rem/1.1 var(--sans); letter-spacing: .18em; }
.desktop-nav { display: flex; gap: 6px; align-self: stretch; align-items: stretch; }
.desktop-nav > a { display: flex; align-items: center; gap: 9px; position: relative; padding: 12px 17px; color: var(--muted); font-size: .9375rem; white-space: nowrap; }
.desktop-nav > a:hover { color: var(--text); background: #ffffff03; }
.desktop-nav > a.active { color: var(--gold-light); }
.desktop-nav > a.active::after { content: ""; position: absolute; bottom: -13px; left: 17px; right: 17px; height: 2px; background: var(--gold); }
.header-tools { display: flex; align-items: center; gap: 17px; }
.save-status { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8125rem; white-space: nowrap; }
.save-status .icon { width: 15px; height: 15px; flex-basis: 15px; color: var(--sage); }
.save-status.error, .save-status.error .icon { color: var(--danger); }
.main-content { width: min(1200px, calc(100% - 80px)); margin: 0 auto; padding: 36px 0 12px; min-height: calc(100svh - 201px); }
.app-footer { width: min(1200px, calc(100% - 80px)); margin: 58px auto 0; padding: 22px 0 28px; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--border); color: var(--muted-dim); font-size: .8125rem; }
.footer-sep { margin: 0 12px; color: var(--gold); font-size: .5rem; vertical-align: 2px; }
.mobile-nav { display: none; }
.initial-loading { min-height: 100svh; display: grid; align-content: center; justify-items: center; gap: 24px; }
.wordmark { color: var(--gold-light); font: 500 3.8rem/1 var(--serif); letter-spacing: .2em; padding-left: .2em; }
.initial-loading > p { color: var(--muted); }

/* Welcome and character collection */
.welcome-banner { position: relative; isolation: isolate; display: flex; align-items: center; min-height: 352px; overflow: hidden; padding: 38px 46px; margin-bottom: 44px; border: 1px solid var(--border); border-radius: var(--radius); background: radial-gradient(ellipse at 72% 45%, #363d2b70, transparent 65%), linear-gradient(110deg, #23291f, #1c211c); }
.welcome-banner::before { content: ""; position: absolute; inset: 8px; z-index: -1; border: 1px solid #b8a2700d; border-radius: 5px; pointer-events: none; }
.welcome-copy { position: relative; z-index: 2; max-width: 56%; }
.welcome-copy h1 { margin: 12px 0 17px; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.22; color: #e9e2ce; letter-spacing: -.025em; }
.welcome-copy > p { color: #b3b9a8; line-height: 1.7; }
.welcome-sigil { position: absolute; width: 400px; right: 6%; top: 50%; transform: translateY(-50%); opacity: .76; z-index: -1; }
.banner-rule { display: flex; align-items: center; gap: 12px; width: 124px; margin-top: 25px; color: var(--gold); font-size: .5rem; }
.banner-rule::before, .banner-rule::after { content: ""; height: 1px; background: var(--border-strong); flex: 1; }
.banner-caption { position: absolute; right: 49px; bottom: 22px; font-size: .6875rem; letter-spacing: .18em; color: #a39c82; }
.section-heading, .stats-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 23px; }
.section-heading h2 { display: flex; align-items: center; gap: 12px; }
.section-heading .eyebrow { margin-bottom: 5px; }
.section-heading p, .stats-intro p { margin-top: 6px; }
.heroes-section { margin-bottom: 34px; }
.hero-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.hero-card { padding: 22px 22px 0; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color .2s, background .2s; }
.hero-card:hover { border-color: var(--border-strong); background: #232820; }
.hero-card-top { display: flex; align-items: flex-start; gap: 7px; }
.hero-card-top > .icon-btn { margin: -8px -10px 0 0; }
.hero-card-identity { min-width: 0; display: flex; align-items: center; gap: 15px; flex: 1; }
.hero-card-identity > div:last-child { min-width: 0; }
.hero-card-identity h3 { overflow-wrap: anywhere; font-size: 1.15rem; margin: 0 0 5px; }
.hero-card-identity p { font-size: .875rem; color: var(--muted); line-height: 1.45; }
.portrait { position: relative; display: block; width: 68px; height: 78px; flex: 0 0 68px; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 7px 7px 18px 18px; background: radial-gradient(ellipse at 50% 35%, #343a2e, #1c211a); }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait img[src$="hero-empty.svg"] { object-fit: contain; padding: 7px 4px 0; opacity: .82; }
.hero-card-resources { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin: 25px 0 20px; }
.hero-card-resources > div > span { display: flex; gap: 5px; align-items: center; color: var(--muted); font-size: .875rem; white-space: nowrap; }
.hero-card-resources .icon { width: 16px; height: 16px; flex-basis: 16px; }
.hero-card-resources strong { margin-left: auto; color: var(--text); font-size: 1rem; font-variant-numeric: tabular-nums; }
.hero-card-resources strong small { color: var(--muted); font-size: .8125rem; font-weight: 400; }
.hero-card-resources > div:first-child .icon { color: var(--life); }
.hero-card-resources > div:last-child .icon { color: var(--mana); }
.resource-track { height: 4px; border-radius: 2px; margin-top: 11px; overflow: hidden; background: #ffffff0a; }
.resource-track span { height: 100%; display: block; background: var(--gold); transition: width .2s; }
.resource-track.life { background: #bd7c7019; }
.resource-track.life span { background: var(--life); }
.resource-track.mana { background: #8da7b919; }
.resource-track.mana span { background: var(--mana); }
.hero-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; border-top: 1px solid var(--border); font-size: .875rem; }
.hero-card-bottom > span { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.hero-card-bottom .icon { width: 16px; height: 16px; flex-basis: 16px; }
.hero-card-bottom a { display: inline-flex; align-items: center; min-height: 44px; color: var(--gold-light); }
.empty-heroes { display: flex; align-items: center; justify-content: center; gap: 40px; min-height: 244px; padding: 30px 24px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: #20241f75; }
.empty-heroes > img { width: 128px; height: 158px; flex: 0 0 128px; opacity: .64; }
.empty-heroes h3 { font-size: 1.25rem; }
.empty-heroes p { margin: 10px 0 20px; color: var(--muted); line-height: 1.65; }
.quick-links { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.quick-link { display: flex; align-items: center; padding: 26px 28px; gap: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: #20241f55; transition: background .2s, border-color .2s; }
.quick-link:hover { background: var(--panel); border-color: var(--border-strong); color: var(--text); }
.quick-icon { display: grid; place-items: center; width: 56px; height: 56px; flex: 0 0 56px; border: 1px solid var(--border-strong); border-radius: 50%; color: var(--gold); }
.quick-icon .icon { width: 28px; height: 28px; }
.quick-link .eyebrow { font-size: .75rem; letter-spacing: .13em; }
.quick-link h3 { margin: 5px 0 6px; font-size: 1.2rem; }
.quick-link p { color: var(--muted); font-size: .875rem; }

/* Character sheet and counters */
.breadcrumbs { display: flex; align-items: center; gap: 11px; margin: -6px 0 22px; font-size: .875rem; color: var(--muted); }
.breadcrumbs .icon { width: 14px; height: 14px; flex-basis: 14px; color: var(--muted-dim); }
.breadcrumbs span { color: var(--gold-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-overview { display: grid; grid-template-columns: 1fr 1.05fr; gap: 38px; padding: 27px 30px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); }
.hero-identity { display: flex; align-items: center; gap: 23px; min-width: 0; }
.hero-identity > div { min-width: 0; }
.hero-identity > .icon-btn { margin-left: auto; align-self: flex-start; }
.hero-identity h1 { font-size: clamp(1.65rem, 2.5vw, 2.25rem); margin: 7px 0; overflow-wrap: anywhere; }
.hero-identity p { color: var(--muted); font-size: .9375rem; }
.hero-identity .eyebrow { font-size: .75rem; }
.portrait-large { width: 104px; height: 130px; flex-basis: 104px; padding: 0; }
.portrait-edit { position: absolute; inset: auto 0 0; display: flex; justify-content: center; padding: 6px; background: #181b19c9; color: var(--gold-light); }
.portrait-edit .icon { width: 15px; height: 15px; }
.hero-vitals { min-width: 0; }
.seals-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 17px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.seals-row > span { display: flex; align-items: center; gap: 8px; font-size: .875rem; color: var(--muted); }
.seals-row > span .icon { color: var(--gold); width: 19px; height: 19px; flex-basis: 19px; }
.counter { display: grid; grid-template-columns: 44px minmax(30px, 1fr) 44px; width: 158px; min-width: 118px; height: 46px; overflow: hidden; align-items: stretch; border: 1px solid var(--border); border-radius: 6px; background: var(--panel-deep); }
.counter input { width: 100%; min-width: 0; min-height: 44px; height: 44px; border: 0; padding: 5px 0; text-align: center; font-size: 1.15rem; font-weight: 500; border-radius: 0; background: transparent; }
.counter input:focus { background: #b8a27016; outline: none; box-shadow: inset 0 -2px var(--gold); }
.counter-btn { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0; background: transparent; color: var(--gold-light); border-radius: 0; }
.counter-btn:hover:not(:disabled) { background: var(--gold-soft); }
.counter-btn .icon { width: 17px; height: 17px; flex-basis: 17px; }
.counter-small { width: 122px; min-width: 118px; }
.counter-small input { font-size: 1rem; }
.resource-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.resource-block { min-width: 0; }
.resource-block .counter { width: 100%; }
.resource-label { display: flex; align-items: center; gap: 6px; min-height: 45px; margin-bottom: 8px; color: var(--muted); font-size: .875rem; }
.resource-label > .icon { width: 18px; height: 18px; flex-basis: 18px; }
.life > .resource-label > .icon { color: var(--life); }
.mana > .resource-label > .icon { color: var(--mana); }
.maximum-label { margin-left: auto; display: flex; align-items: center; gap: 6px; color: var(--muted-dim); font-size: .8125rem; }
.maximum-label input { min-height: 44px; width: 49px; text-align: center; padding: 8px 4px; font-size: .9375rem; color: var(--text); background: transparent; border: 1px solid var(--border); }
.tab-nav { display: flex; align-items: stretch; gap: 22px; margin-top: 23px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tab-nav::-webkit-scrollbar { display: none; }
.tab-nav a { display: inline-flex; align-items: center; gap: 9px; position: relative; flex-shrink: 0; padding: 16px 10px 17px; min-height: 58px; color: var(--muted); font-size: .9375rem; border-bottom: 2px solid transparent; }
.tab-nav a:first-child { padding-left: 0; }
.tab-nav a.active { border-bottom-color: var(--gold); color: var(--gold-light); }
.tab-nav a:hover { color: var(--text); }
.tab-nav .icon { width: 19px; height: 19px; flex-basis: 19px; }
.tab-content { padding-top: 29px; }
.stats-intro { align-items: end; }
.character-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }
.character-stats { display: grid; gap: 20px; min-width: 0; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; min-height: 60px; padding: 17px 20px; gap: 12px; border-bottom: 1px solid var(--border); }
.panel-heading h3 { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; }
.panel-heading h3 .icon { color: var(--gold); }
.stat-row { display: grid; grid-template-columns: minmax(0, 1fr) 142px 65px 65px; gap: 14px; align-items: center; padding: 7px 20px; min-height: 61px; border-bottom: 1px solid #b8a2700c; }
.stat-row:last-child { border-bottom: 0; }
.stat-row:hover:not(.stat-head) { background: #b8a27004; }
.stat-row .counter { width: 142px; background: #1b1f1a; }
.stat-head { min-height: 41px; padding-top: 9px; padding-bottom: 9px; color: var(--muted-dim); font-size: .8125rem; background: #181b1933; }
.stat-head span:not(:first-child) { text-align: center; }
.stat-name { min-width: 0; font-size: .9375rem; line-height: 1.35; overflow-wrap: anywhere; }
.stat-effect, .stat-total { text-align: center; font-variant-numeric: tabular-nums; }
.stat-effect { color: var(--muted-dim); font-size: .9375rem; }
.stat-effect.positive { color: var(--sage); }
.stat-effect.negative { color: var(--danger); }
.stat-total { font-size: 1.25rem; color: var(--text); font-weight: 500; }
.effects-column { position: sticky; top: 111px; min-width: 0; }
.effect-card { padding: 11px 18px 18px; border-bottom: 1px solid var(--border); }
.effect-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.effect-name { font-size: 1rem; color: var(--text); font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.effect-heading > .icon-btn { margin-right: -9px; }
.effect-card p { color: var(--muted); font-size: .875rem; white-space: pre-line; margin-bottom: 10px; }
.effect-bonus { display: inline-block; padding: 3px 8px; background: #ffffff06; border-radius: 4px; font-size: .875rem; }
.effect-turns { margin-top: 13px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.effect-turns > span { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: .8125rem; }
.effect-turns > span .icon { width: 15px; height: 15px; flex-basis: 15px; }
.panel-footer { padding: 17px 18px 10px; }
.panel-footnote { padding: 0 18px 18px; color: var(--muted-dim); font-size: .8125rem; line-height: 1.55; }
.small-empty { text-align: center; padding: 29px 15px 15px; color: var(--muted); }
.small-empty > .icon { width: 33px; height: 33px; margin: 0 auto 13px; color: #718064; }
.small-empty > p { margin-bottom: 8px; font-size: .9375rem; color: #c1c8b7; }
.small-empty > span { font-size: .875rem; }

/* Inventory, gear and build */
.aether-panel { padding: 19px 24px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: linear-gradient(110deg, #2b3024, #20251f); display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.aether-label { display: flex; align-items: center; gap: 17px; }
.aether-label > .icon { width: 35px; height: 35px; flex-basis: 35px; color: var(--gold-light); }
.aether-label h3 { font-size: 1.4rem; margin-top: 2px; }
.aether-label .eyebrow { font-size: .75rem; }
.aether-panel .counter { width: 200px; }
.inventory-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.item-slot, .build-card { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 190px; min-width: 0; padding: 29px 18px 18px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: #20241f75; color: var(--muted); text-align: center; transition: background .2s, border-color .2s; }
.item-slot:hover, .build-card:hover { background: #282f23; border-color: var(--gold); }
.item-slot > .icon, .build-card > .icon { width: 28px; height: 28px; flex-basis: 28px; color: var(--gold); }
.item-slot > span:not(.slot-number, .item-code) { font-size: .875rem; }
.slot-number { position: absolute; top: 10px; left: 12px; color: #7c8574; font: 400 .75rem/1 var(--serif); }
.item-slot.filled, .build-card.filled { align-items: flex-start; justify-content: flex-start; background: var(--panel); border-style: solid; text-align: left; color: var(--text); }
.item-slot.filled > .icon { margin-top: 3px; }
.item-slot h3 { font-size: 1rem; line-height: 1.4; overflow-wrap: anywhere; text-wrap: initial; }
.item-slot p, .library-card > p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: .875rem; line-height: 1.6; color: var(--muted); }
.item-code { margin-top: auto; padding-top: 6px; font-size: .8125rem; color: var(--gold); }
.equipment-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 20px; }
.equipment-card .panel-heading { padding: 8px 18px; }
.equipment-card .panel-heading > .text-button { min-width: 0; }
.equipment-card .panel-heading h3 { overflow-wrap: anywhere; }
.equipment-card .panel-heading > .text-button > .icon { width: 14px; height: 14px; flex-basis: 14px; color: var(--muted-dim); }
.equip-item { display: flex; width: calc(100% - 36px); align-items: center; justify-content: center; gap: 17px; min-height: 113px; margin: 18px; padding: 20px; border: 1px dashed var(--border-strong); color: var(--muted); background: #181b194d; border-radius: 6px; }
.equip-item:hover { color: var(--text); border-color: var(--gold); background: #b8a27008; }
.equip-item > .icon { color: var(--gold); width: 29px; height: 29px; flex-basis: 29px; }
.equip-item.filled { justify-content: flex-start; border-style: solid; text-align: left; }
.equip-item.filled > span { min-width: 0; }
.equip-item strong { color: var(--text); display: block; margin-bottom: 6px; font: 500 1.05rem/1.45 var(--serif); }
.equip-item > span > span { display: block; font-size: .875rem; line-height: 1.6; white-space: pre-line; }
.runes-section { padding: 0 18px 18px; }
.runes-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.runes-heading > span { color: var(--muted); font-size: .875rem; }
.runes-heading .text-button { min-height: 44px; font-size: .875rem; }
.runes-heading .icon { width: 16px; height: 16px; flex-basis: 16px; }
.rune-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.rune-slot { display: flex; align-items: center; gap: 10px; min-height: 55px; padding: 11px 12px; border: 1px dashed var(--border); border-radius: 6px; color: var(--muted); background: #181b1933; text-align: left; font-size: .875rem; }
.rune-slot > span { min-width: 0; overflow-wrap: anywhere; }
.rune-slot > .icon { width: 18px; height: 18px; flex-basis: 18px; color: var(--gold); }
.rune-slot.filled { border-style: solid; background: #a1b38b0a; color: var(--text); }
.rune-slot:hover { border-color: var(--gold); background: var(--gold-soft); }
.rune-slots > .small-text { grid-column: 1 / -1; }
.build-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.build-card { padding: 30px 25px 25px; min-height: 210px; }
.build-card h3 { font-size: 1.05rem; line-height: 1.45; text-wrap: initial; }
.build-card p { font-size: .875rem; color: var(--muted); line-height: 1.65; white-space: pre-line; }
.build-card:not(.filled) p { max-width: 230px; }
.journal-panel { position: relative; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.journal-ornament { position: absolute; top: 23px; left: 24px; color: var(--gold); opacity: .75; }
.journal { display: block; min-height: 420px; width: 100%; padding: 64px 28px 28px; border: 0; background: transparent; color: var(--text); line-height: 1.9; font-size: 1rem; resize: vertical; }
.journal:focus { outline: none; box-shadow: inset 0 0 0 1px var(--border-strong); }

/* Game master and destiny */
.gm-heading { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 4px 0 14px; }
.gm-heading h1 { margin: 7px 0 9px; }
.gm-heading > div { min-width: 0; }
.reputation-panel { display: grid; grid-template-columns: 1fr auto; gap: 12px 22px; align-items: center; min-width: 340px; padding: 20px 23px 17px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.reputation-panel .eyebrow { font-size: .6875rem; margin-bottom: 5px; }
.reputation-panel h3 { font-size: 1.05rem; }
.reputation-value { display: flex; align-items: center; gap: 8px; }
.reputation-value .counter { width: 134px; }
.reputation-value > span { color: var(--muted); font-size: .875rem; white-space: nowrap; }
.reputation-scale { grid-column: 1 / -1; display: flex; gap: 4px; padding-top: 3px; }
.reputation-scale > span { display: block; flex: 1; height: 4px; border-radius: 1px; background: #ffffff0a; }
.reputation-scale > span.filled { background: var(--gold); }
.gm-tabs { margin-top: 15px; }
.gm-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: start; gap: 28px; }
.destiny-stage { padding: 30px 24px 28px; display: flex; align-items: center; flex-direction: column; text-align: center; border: 1px solid var(--border); border-radius: var(--radius); background: radial-gradient(ellipse at 50% 42%, #3f49302e, transparent 65%), var(--panel-deep); }
.destiny-stage > .eyebrow { font-size: .6875rem; letter-spacing: .12em; color: var(--muted); }
.destiny-sigil { width: min(100%, 332px); margin: 19px auto 8px; opacity: .85; }
.destiny-stage h2 { font-size: 1.6rem; }
.destiny-stage > p { color: var(--muted); margin-top: 10px; font-size: .9375rem; line-height: 1.6; }
.btn-invoke { width: min(100%, 290px); margin-top: 24px; min-height: 50px; }
.destiny-caption { color: var(--muted-dim); font-size: .8125rem; margin-top: 14px; }
.destiny-results { display: grid; gap: 16px; min-width: 0; }
.destiny-intro { min-height: 608px; padding: 49px 34px 34px; text-align: center; background: #20241f50; border: 1px dashed var(--border-strong); border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.destiny-intro > .icon { width: 38px; height: 38px; flex-basis: 38px; margin-bottom: 21px; color: var(--gold); opacity: .7; }
.destiny-intro > .eyebrow { font-size: .75rem; }
.destiny-intro h3 { font-size: 1.5rem; margin: 13px 0 15px; }
.destiny-intro > p { font-size: .9375rem; color: var(--muted); line-height: 1.75; }
.destiny-empty-lines { display: grid; width: 100%; gap: 0; margin-top: 31px; max-width: 295px; }
.destiny-empty-lines > span { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); text-align: left; color: #858e7e; font: 400 .9375rem/1.5 var(--serif); }
.destiny-empty-lines i { font-style: normal; color: var(--gold); }
.result-card { padding: 21px 24px; border: 1px solid var(--border); border-left: 2px solid var(--gold); border-radius: 7px; background: var(--panel); }
.result-label { display: flex; align-items: center; gap: 9px; color: var(--gold-light); font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; }
.result-label > .icon { width: 19px; height: 19px; flex-basis: 19px; }
.result-code { margin-left: auto; color: var(--muted-dim); font: 400 .75rem/1.5 var(--sans); letter-spacing: .04em; white-space: nowrap; }
.result-card h3 { font-size: 1.16rem; margin-top: 13px; line-height: 1.5; text-wrap: initial; }
.result-card h3 > span { color: var(--gold-light); }
.result-card > p { font-size: .875rem; color: var(--muted); margin-top: 6px; }
.result-card > .text-button { font-size: .875rem; margin: 0 0 -5px; }
.result-card.threat { border-left-color: #b47868; }
.result-card.threat .result-label { color: #d19b88; }
.result-card.encounter { border-left-color: #8d9c78; }
.result-card.encounter .result-label { color: #b4c39d; }
.result-card.complication { border-left-color: #9d859f; }
.result-card.complication .result-label { color: #c0a7c1; }
.result-card details { color: var(--muted); font-size: .875rem; margin-top: 3px; }
.result-card summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 9px; list-style: none; color: var(--muted); }
.result-card summary::-webkit-details-marker { display: none; }
.result-card summary::before { content: "+"; color: var(--gold); font-size: 1.15rem; }
.result-card details[open] summary::before { content: "−"; }
.result-card details p { padding-top: 3px; white-space: pre-line; }
.threat-levels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 15px; }
.threat-levels > div { min-width: 0; display: flex; gap: 7px; align-items: baseline; padding: 11px 10px; border: 1px solid #b4786829; border-radius: 4px; background: #b4786807; }
.threat-levels > div > span { color: #bc8d7d; font-family: var(--serif); font-size: .875rem; }
.threat-levels strong { font-size: .875rem; font-weight: 500; overflow-wrap: anywhere; line-height: 1.5; }
.enemy-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; align-items: start; }
.enemy-heading { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 12px 15px; border-bottom: 1px solid var(--border); }
.enemy-heading > .text-button { min-width: 0; }
.enemy-heading h3 { font-size: 1.06rem; color: var(--text); overflow-wrap: anywhere; text-wrap: initial; }
.enemy-heading > .text-button > .icon { width: 14px; height: 14px; flex-basis: 14px; color: var(--muted-dim); }
.enemy-heading .actions { gap: 0; }
.enemy-card > .resource-block { padding: 10px 20px 22px; }
.enemy-card > .effects-panel { border: 0; border-top: 1px solid var(--border); border-radius: 0; background: #181b1940; }
.enemy-card .effects-panel .panel-heading { min-height: 52px; padding-top: 14px; padding-bottom: 14px; }
.enemy-card .effects-panel .panel-heading h3 { font-size: .9375rem; }
.enemy-card .panel-footnote { display: none; }
.enemy-card .panel-footer { padding-bottom: 17px; }
.empty-icon { display: grid; place-items: center; width: 100px; height: 100px; border: 1px solid var(--border-strong); border-radius: 50%; color: var(--gold); }
.empty-icon .icon { width: 42px; height: 42px; }
.combat-empty p { margin-bottom: 0; }

/* Library and contextual item picker */
.library-heading { margin-bottom: 30px; }
.library-heading h1 { margin: 6px 0 9px; }
.library-total { display: flex; flex-direction: column; text-align: right; padding-left: 24px; color: var(--gold-light); font: 400 2.5rem/1.2 var(--serif); }
.library-total > span { color: var(--muted); font: 400 .875rem/1.5 var(--sans); letter-spacing: .08em; }
.library-toolbar, .picker-toolbar { display: flex; align-items: stretch; gap: 14px; margin-bottom: 21px; }
.search-field { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; min-height: 48px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--panel-deep); }
.search-field > .icon { color: var(--muted-dim); width: 20px; height: 20px; flex-basis: 20px; }
.search-field input { width: 100%; min-width: 0; min-height: 46px; border: 0; padding: 10px 0; background: transparent; font-size: 1rem; }
.search-field input:focus { outline: none; }
.search-field:focus-within { outline: 2px solid var(--gold-light); outline-offset: 2px; }
.filter-select { width: 255px; font-size: .9375rem; color: var(--muted); }
.results-count { margin: 0 0 16px; font-size: .875rem; color: var(--muted-dim); }
.library-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.library-card { display: flex; flex-direction: column; min-width: 0; min-height: 241px; padding: 21px; text-align: left; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); transition: background .2s, border-color .2s; }
.library-card:hover { background: #282e24; border-color: var(--border-strong); }
.library-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; margin-bottom: 19px; }
.library-card-top > .icon { color: var(--gold); width: 23px; height: 23px; flex-basis: 23px; }
.category-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; padding: 4px 9px; border: 1px solid var(--border); border-radius: 4px; background: var(--gold-soft); font: 500 .8125rem/1.5 var(--serif); color: var(--gold-light); white-space: nowrap; }
.category-2 { color: #b7c29e; background: #a1b38b0d; border-color: #a1b38b29; }
.category-3 { color: #a6bdc9; background: #8da7b90d; border-color: #8da7b929; }
.category-4 { color: #c2abc4; background: #a38aa50d; border-color: #a38aa529; }
.category-5 { color: #d2ab8d; background: #bd99790d; border-color: #bd997929; }
.category-6 { color: #d6c28c; background: #b8a27014; border-color: #b8a2704d; }
.library-card h3 { font-size: 1.03rem; line-height: 1.45; margin-bottom: 9px; overflow-wrap: anywhere; text-wrap: initial; }
.library-card > p { margin-bottom: 20px; }
.library-value { display: flex; gap: 6px; align-items: center; margin-top: auto; padding-top: 13px; width: 100%; border-top: 1px solid var(--border); color: var(--muted); font-size: .8125rem; line-height: 1.45; }
.library-value > .icon { width: 15px; height: 15px; flex-basis: 15px; color: var(--gold); }
.no-results { grid-column: 1 / -1; padding: 35px 18px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: 6px; }
.picker-tabs { display: flex; gap: 20px; margin: -6px 0 21px; border-bottom: 1px solid var(--border); }
.picker-tabs button { display: inline-flex; align-items: center; gap: 7px; min-height: 48px; padding: 10px 0 13px; background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted); font-size: .9375rem; }
.picker-tabs button.active { color: var(--gold-light); border-bottom-color: var(--gold); }
.picker-tabs > span.active { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 10px 0 13px; border-bottom: 2px solid var(--gold); color: var(--gold-light); font-size: .9375rem; }
.picker-results { max-height: 44svh; overflow-y: auto; overscroll-behavior: contain; padding: 2px; }
.picker-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 11px; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; text-align: left; }
.picker-item:hover { background: var(--gold-soft); }
.picker-item > .category-chip { align-self: flex-start; min-width: 54px; margin-top: 2px; }
.picker-item > span:nth-child(2) { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
.picker-item strong { color: var(--text); font-size: .9375rem; overflow-wrap: anywhere; }
.picker-item > span > span { color: var(--muted); font-size: .875rem; line-height: 1.55; }
.picker-item > .icon { color: var(--gold); width: 19px; height: 19px; flex-basis: 19px; }
.picker-toolbar { gap: 10px; margin-bottom: 10px; }
.picker-toolbar .filter-select, .picker-toolbar select { width: 195px; min-width: 0; font-size: .875rem; }

/* Dialogs, forms and settings */
#modal { width: min(650px, calc(100% - 32px)); max-height: calc(100svh - 48px); padding: 0; border: 1px solid var(--border-strong); border-radius: 12px; color: var(--text); background: var(--panel); box-shadow: 0 25px 100px #0009; overflow: auto; scrollbar-width: thin; scrollbar-color: #59604d #20241f; }
#modal::backdrop { background: #080c09b8; backdrop-filter: blur(5px); }
.modal-shell { max-height: calc(100svh - 50px); overflow-y: auto; overscroll-behavior: contain; }
.modal-heading { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 19px 25px; border-bottom: 1px solid var(--border); background: var(--panel); }
.modal-heading h2 { font-size: 1.4rem; overflow-wrap: anywhere; }
.modal-heading .icon-btn { margin: -5px -9px -5px 0; }
.modal-body { padding: 24px 26px; }
.modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 18px 26px 23px; border-top: 1px solid var(--border); background: #181b1929; }
.modal-actions > .danger:first-child { margin-right: auto; }
.modal-body > p:not(:last-child) { margin-bottom: 16px; }
.field { display: flex; min-width: 0; flex-direction: column; gap: 8px; margin-bottom: 19px; }
.field > span { color: #c3c9ba; font-size: .875rem; font-weight: 500; }
.field input, .field select { width: 100%; min-width: 0; }
.field textarea { min-height: 112px; }
.field small, .field .text-note { color: var(--muted-dim); font-size: .8125rem; font-weight: 400; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-row > .field { min-width: 0; }
.form-error { color: var(--danger); font-size: .875rem; line-height: 1.55; margin: 0 0 16px; }
.form-error:empty { display: none; }
.portrait-upload { display: flex; align-items: center; gap: 22px; padding-bottom: 23px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.modal-portrait { display: block; width: 94px; height: 112px; flex: 0 0 94px; object-fit: cover; border: 1px solid var(--border-strong); border-radius: 6px 6px 14px 14px; background: radial-gradient(ellipse, #343b2d, #1c211a); }
.modal-portrait[src$="hero-empty.svg"] { object-fit: contain; padding: 7px; }
.modal-portrait { overflow: hidden; }
.modal-portrait > img { width: 100%; height: 100%; object-fit: cover; }
.modal-portrait > img[src$="hero-empty.svg"] { object-fit: contain; padding: 6px; }
.portrait-upload > div { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.portrait-upload p { color: var(--muted); font-size: .8125rem; }
.portrait-upload input[type="file"] { max-width: 100%; font-size: .875rem; min-height: 44px; }
.portrait-upload input::file-selector-button { cursor: pointer; background: var(--panel-raised); color: var(--gold-light); padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: 4px; margin-right: 10px; }
.item-details { color: var(--muted); line-height: 1.75; }
.item-details > .category-chip { margin-bottom: 18px; }
.item-details h3 { color: var(--text); margin-bottom: 14px; font-size: 1.35rem; }
.item-details > p { white-space: pre-line; }
.detail-value { display: flex; align-items: center; gap: 9px; padding: 16px 0 0; margin-top: 22px; border-top: 1px solid var(--border); color: var(--gold-light); }
.detail-value .icon { width: 20px; height: 20px; flex-basis: 20px; }
.settings-list { display: flex; flex-direction: column; gap: 0; }
.settings-section .settings-list { margin: 12px 0; }
.settings-section + .settings-section { padding-top: 22px; }
.settings-section > .eyebrow { margin-bottom: 12px; }
.settings-version { font-size: .75rem; color: var(--muted-dim); text-align: center; margin-top: 23px; }
.settings-section { padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.settings-section:last-child { border-bottom: 0; padding-bottom: 0; }
.settings-section h3 { margin-bottom: 13px; color: var(--gold-light); font-size: 1.1rem; }
.settings-section p { font-size: .875rem; color: var(--muted); line-height: 1.7; }
.settings-section .actions { margin-top: 13px; flex-wrap: wrap; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 13px 0; }
.setting-row + .setting-row { border-top: 1px solid #b8a2700e; }
.setting-row > div { min-width: 0; }
.setting-row strong { font-size: .9375rem; display: block; margin-bottom: 5px; }
.setting-row p { font-size: .875rem; }
.setting-row > .btn { flex-shrink: 0; }
button.setting-row { width: 100%; min-height: 53px; justify-content: flex-start; gap: 13px; padding: 13px 10px; text-align: left; font-size: .9375rem; color: var(--text); background: transparent; border-radius: 4px; }
button.setting-row > .icon { color: var(--gold); }
button.setting-row.danger, button.setting-row.danger > .icon { color: var(--danger); }
button.setting-row:hover { background: var(--gold-soft); }
.choice-card { display: flex; align-items: center; gap: 14px; width: 100%; margin-bottom: 12px; padding: 17px; border: 1px solid var(--border-strong); border-radius: 7px; background: var(--panel-deep); text-align: left; }
.choice-card:hover { background: var(--gold-soft); border-color: var(--gold); }
.choice-card > .icon { color: var(--gold); }
.choice-card > div, .choice-card > span { min-width: 0; }
.choice-card strong { display: block; margin-bottom: 5px; font-weight: 500; }
.choice-card p, .choice-card small { color: var(--muted); font-size: .875rem; line-height: 1.6; }
.confirmation { color: var(--muted); font-size: 1rem; line-height: 1.75; }
.confirmation strong { color: var(--text); }
.install-guide { padding: 17px 18px; border: 1px solid var(--border); border-radius: 7px; color: var(--muted); background: #181b1959; font-size: .875rem; }
.install-guide h3, .install-guide h4 { font-size: 1rem; margin-bottom: 11px; color: var(--text); }
.install-guide p + h3 { margin-top: 23px; }
.install-guide ol, .install-guide ul { margin: 10px 0 0; padding-left: 21px; }
.install-guide li { padding: 4px 0; }
.notice { display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px; margin-top: 16px; border: 1px solid var(--border); border-radius: 6px; background: var(--gold-soft); font-size: .875rem; line-height: 1.6; color: #c5c4b3; }
.notice > .icon { margin-top: 2px; color: var(--gold); }
.notice p { font-size: .875rem; }
.notice:not(:has(> .icon)) { display: block; }
.notice > strong { display: block; margin-bottom: 6px; }
#toast { position: fixed; z-index: 100; bottom: 26px; left: 50%; transform: translate(-50%, 12px); max-width: min(540px, calc(100% - 32px)); min-width: 220px; padding: 13px 20px; border: 1px solid #8b9b7659; border-radius: 8px; background: #30382c; color: #e8efdd; box-shadow: 0 10px 45px #0005; text-align: center; font-size: .9375rem; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
#toast.show, #toast.visible { opacity: 1; transform: translate(-50%, 0); }
#toast.toast-error { border-color: #bc77656b; color: #f3d8d1; background: #4a3029; }
#toast:empty { visibility: hidden; }

/* The grimoire entrance */
.lock-page { display: flex; position: relative; isolation: isolate; min-height: 100svh; justify-content: center; align-items: center; padding: 60px 24px 90px; overflow: hidden; background: radial-gradient(ellipse at 50% 38%, #3a45302e, transparent 64%); }
.lock-sigil { position: absolute; z-index: -1; width: min(760px, 122vw); max-width: none; top: 42%; left: 50%; transform: translate(-50%, -50%); opacity: .13; }
.lock-content { width: min(390px, 100%); text-align: center; }
.lock-content > .eyebrow { font-size: .8125rem; letter-spacing: .17em; color: #a9aa8e; }
.lock-wordmark { margin: 18px -20px 0; font: 500 clamp(4rem, 10vw, 5.75rem)/1.2 var(--serif); letter-spacing: .16em; padding-left: .16em; color: #d0bb88; }
.ornament { display: flex; align-items: center; gap: 15px; width: 165px; margin: 20px auto; color: var(--gold); font-size: .55rem; }
.ornament::before, .ornament::after { content: ""; height: 1px; background: var(--border-strong); flex: 1; }
.lock-subtitle { color: #c6c5ad; font: 400 1.05rem/1.5 var(--serif); letter-spacing: .07em; }
.lock-form { margin-top: 43px; }
.lock-form .field { text-align: left; margin-bottom: 18px; }
.lock-form .field > span { color: var(--muted); font-size: .875rem; font-weight: 400; margin-bottom: 3px; }
.password-field { position: relative; }
.password-field > span { position: absolute; top: 0; bottom: 0; left: 14px; display: flex; align-items: center; color: var(--muted-dim); }
.password-field input { min-height: 50px; padding-left: 44px; background: #191e18cc; border-color: var(--border-strong); }
.lock-form .btn { width: 100%; min-height: 50px; }
.lock-form .form-error { text-align: left; }
.lock-note { margin-top: 24px; color: #7e8977; font-size: .875rem; }
.lock-version { position: absolute; bottom: 27px; padding-bottom: var(--safe-bottom); left: 20px; right: 20px; text-align: center; color: #7e8673; font-size: .6875rem; letter-spacing: .16em; }

/* Responsive adjustments */
@media (min-width: 1280px) {
  .threat-levels { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
  .threat-levels > div { display: block; padding: 9px 8px; }
  .threat-levels > div > span { display: block; margin-bottom: 5px; }
  .threat-levels strong { font-size: .8125rem; }
}
@media (max-width: 1120px) {
  .header-inner { padding-left: 28px; padding-right: 28px; gap: 15px; }
  .header-tools { gap: 10px; }
  .desktop-nav { gap: 0; }
  .desktop-nav > a { padding-left: 12px; padding-right: 12px; }
  .save-status > span { display: none; }
  .main-content, .app-footer { width: calc(100% - 56px); }
  .hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-overview { grid-template-columns: 1fr 1fr; gap: 25px; padding: 23px; }
  .hero-identity { gap: 15px; }
  .portrait-large { width: 86px; height: 112px; flex-basis: 86px; }
  .resource-grid { gap: 16px; }
  .resource-label { flex-wrap: wrap; gap: 5px; }
  .resource-label .maximum-label { margin-left: auto; }
  .character-layout { grid-template-columns: minmax(0, 1fr) 305px; gap: 19px; }
  .stat-row { grid-template-columns: minmax(0, 1fr) 122px 40px 40px; gap: 8px; padding-left: 16px; padding-right: 16px; }
  .stat-row .counter { width: 122px; }
  .inventory-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .library-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .enemy-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .welcome-sigil { right: 1%; width: 365px; }
  .welcome-banner { padding-left: 35px; padding-right: 35px; }
}
@media (max-width: 900px) {
  .brand-text { font-size: 1.45rem; }
  .brand-text small { display: none; }
  .brand { gap: 9px; }
  .header-inner { min-height: 76px; }
  .desktop-nav > a { font-size: .875rem; padding-left: 10px; padding-right: 10px; gap: 6px; }
  .desktop-nav > a .icon { width: 18px; height: 18px; flex-basis: 18px; }
  .character-layout { grid-template-columns: 1fr; }
  .effects-column { position: static; grid-row: 1; }
  .effects-panel .effect-list { display: grid; grid-template-columns: 1fr 1fr; }
  .effect-card:nth-child(odd) { border-right: 1px solid var(--border); }
  .effects-panel .small-empty { padding: 20px 18px 5px; }
  .effects-panel .small-empty > .icon, .effects-panel .small-empty > span { display: none; }
  .effects-panel .small-empty > p { margin-bottom: 0; }
  .effects-panel > .panel-footer { padding-top: 12px; }
  .effects-panel > .panel-footnote { padding-bottom: 13px; text-align: center; }
  .enemy-card .effects-panel .effect-list { grid-template-columns: 1fr; }
  .enemy-card .effect-card { border-right: 0; }
  .stat-row { grid-template-columns: minmax(0, 1fr) 142px 64px 64px; gap: 14px; padding-left: 20px; padding-right: 20px; }
  .stat-row .counter { width: 142px; }
  .hero-overview { grid-template-columns: 1fr; gap: 23px; }
  .hero-identity { gap: 20px; }
  .hero-identity h1 { font-size: 2rem; }
  .portrait-large { width: 90px; height: 108px; flex-basis: 90px; }
  .hero-vitals { padding-top: 20px; border-top: 1px solid var(--border); }
  .seals-row { padding-bottom: 14px; margin-bottom: 8px; }
  .resource-grid { gap: 24px; }
  .tab-nav { gap: 12px; }
  .quick-link { padding: 23px 20px; gap: 15px; }
  .quick-icon { width: 47px; height: 47px; flex-basis: 47px; }
  .quick-link h3 { font-size: 1.05rem; }
  .quick-link .eyebrow { font-size: .6875rem; }
  .gm-heading { gap: 22px; }
  .gm-heading > div > p { max-width: 320px; font-size: .9375rem; }
  .reputation-panel { min-width: 290px; padding: 17px; gap: 12px 15px; }
  .reputation-value .counter { width: 122px; }
  .gm-layout { gap: 20px; }
  .destiny-stage { padding: 27px 18px; }
  .destiny-stage > .eyebrow { max-width: 230px; line-height: 1.7; }
  .destiny-stage h2 { font-size: 1.4rem; }
  .destiny-sigil { margin-top: 20px; margin-bottom: 17px; }
  .destiny-intro { min-height: 550px; padding-left: 22px; padding-right: 22px; }
  .result-card { padding: 18px; }
  .result-card h3 { font-size: 1.05rem; }
  .result-code { font-size: .6875rem; }
  .threat-levels { grid-template-columns: 1fr; gap: 7px; }
  .threat-levels > div { padding: 7px 9px; }
  .build-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  html { scroll-padding-top: 90px; }
  body { padding-bottom: calc(76px + var(--safe-bottom)); }
  body:has(.lock-page) { padding-bottom: 0; }
  .header-inner { min-height: 72px; padding: max(10px, env(safe-area-inset-top, 0px)) 20px 10px; }
  .brand > img { width: 37px; height: 37px; }
  .brand-text { font-size: 1.5rem; }
  .brand-text small { display: block; font-size: .5625rem; letter-spacing: .14em; margin-top: 5px; }
  .desktop-nav { display: none; }
  .header-tools { gap: 9px; }
  .save-status > span { display: inline; font-size: .75rem; }
  .mobile-nav { display: flex; align-items: stretch; position: fixed; z-index: 40; bottom: 0; left: 0; right: 0; padding: 6px max(8px, env(safe-area-inset-left, 0px)) calc(5px + var(--safe-bottom)); min-height: calc(72px + var(--safe-bottom)); border-top: 1px solid var(--border-strong); background: #1b1f1bf5; backdrop-filter: blur(18px); }
  .mobile-nav > a { display: flex; align-items: center; justify-content: center; gap: 5px; flex-direction: column; flex: 1; min-width: 0; color: var(--muted-dim); font-size: .875rem; min-height: 59px; border-radius: 7px; }
  .mobile-nav .icon { width: 23px; height: 23px; }
  .mobile-nav > a.active { color: var(--gold-light); background: var(--gold-soft); }
  .main-content, .app-footer { width: calc(100% - 40px); }
  .main-content { padding-top: 23px; min-height: calc(100svh - 240px); }
  .app-footer { margin-top: 35px; padding: 19px 0 24px; font-size: .75rem; }
  .app-footer > span:last-child { display: none; }
  .welcome-banner { min-height: 304px; padding: 29px 28px; margin-bottom: 31px; }
  .welcome-copy { max-width: 65%; }
  .welcome-copy h1 { font-size: 2.05rem; }
  .welcome-copy .eyebrow { font-size: .75rem; letter-spacing: .1em; }
  .welcome-copy > p { font-size: .9375rem; }
  .welcome-sigil { width: 310px; right: -70px; opacity: .35; }
  .banner-caption { display: none; }
  .welcome-copy .desktop-only { display: none; }
  .section-heading, .stats-intro { gap: 15px; }
  .section-heading h2, .stats-intro h2 { font-size: 1.35rem; }
  .section-heading p, .stats-intro p { font-size: .875rem; }
  .section-heading .eyebrow { font-size: .75rem; }
  .section-heading .actions { gap: 5px; }
  .section-heading .btn { padding-left: 13px; padding-right: 13px; font-size: .875rem; }
  .heroes-section > .section-heading .btn-quiet span { display: none; }
  .heroes-section > .section-heading .btn-quiet { padding-left: 10px; padding-right: 10px; }
  .hero-grid { grid-template-columns: 1fr; gap: 15px; }
  .hero-card { padding: 20px 21px 0; }
  .hero-card-identity h3 { font-size: 1.25rem; }
  .hero-card-resources { gap: 28px; }
  .empty-heroes { gap: 23px; min-height: 235px; padding: 25px 20px; }
  .empty-heroes > img { width: 99px; height: 127px; flex-basis: 99px; }
  .empty-heroes h3 { font-size: 1.1rem; }
  .empty-heroes p { font-size: .875rem; }
  .empty-heroes br { display: none; }
  .quick-links { grid-template-columns: 1fr; gap: 13px; }
  .quick-link { padding: 22px; gap: 19px; }
  .quick-link h3 { font-size: 1.15rem; }
  .quick-link .eyebrow { font-size: .6875rem; }
  .hero-overview { padding: 20px; }
  .tab-nav { gap: 6px; margin-top: 16px; }
  .tab-nav a { gap: 6px; padding: 14px 10px 15px; font-size: .875rem; }
  .hero-tabs a .icon { display: none; }
  .tab-content { padding-top: 24px; }
  .stats-intro > .text-note { display: none; }
  .stats-intro { align-items: center; margin-bottom: 18px; }
  .inventory-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .item-slot { min-height: 175px; padding: 28px 15px 16px; }
  .equipment-grid { grid-template-columns: 1fr; gap: 18px; }
  .aether-panel { padding: 17px 20px; margin-bottom: 19px; }
  .aether-panel .counter { width: 160px; }
  .gm-heading { align-items: stretch; flex-direction: column; gap: 22px; padding-bottom: 4px; }
  .gm-heading > div > p { max-width: none; }
  .gm-heading > div > .eyebrow { font-size: .75rem; }
  .reputation-panel { grid-template-columns: 1fr auto; min-width: 0; padding: 17px 20px 16px; }
  .reputation-panel .eyebrow { font-size: .6875rem; }
  .reputation-value .counter { width: 142px; }
  .gm-layout { grid-template-columns: 1fr; }
  .destiny-stage { position: relative; min-height: 245px; padding: 26px 24px; align-items: flex-start; overflow: hidden; text-align: left; isolation: isolate; }
  .destiny-stage > .eyebrow { max-width: 280px; font-size: .6875rem; margin-bottom: 14px; }
  .destiny-sigil { position: absolute; top: 50%; right: -20px; transform: translateY(-50%); width: 270px; z-index: -1; opacity: .38; margin: 0; }
  .destiny-stage h2 { font-size: 1.5rem; }
  .destiny-stage > p { margin-top: 8px; font-size: .875rem; }
  .btn-invoke { width: auto; padding-left: 21px; padding-right: 21px; min-height: 46px; margin-top: 21px; }
  .destiny-caption { font-size: .75rem; }
  .destiny-intro { min-height: 330px; padding: 29px 24px; }
  .destiny-intro > .icon { display: none; }
  .destiny-intro h3 { font-size: 1.3rem; margin: 12px 0 10px; }
  .destiny-intro p { font-size: .875rem; }
  .destiny-empty-lines { margin-top: 18px; }
  .destiny-empty-lines > span { font-size: .875rem; padding: 9px 0; }
  .result-card { padding: 20px; }
  .result-card h3 { font-size: 1.1rem; }
  .threat-levels { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .threat-levels > div { padding: 10px; }
  .enemy-grid { grid-template-columns: 1fr; }
  .enemy-card .effect-list { display: grid; grid-template-columns: 1fr 1fr; }
  .enemy-card .effect-card:nth-child(odd) { border-right: 1px solid var(--border); }
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .library-card { padding: 18px; min-height: 239px; }
  .library-card h3 { font-size: 1rem; }
  .library-toolbar { flex-direction: column; gap: 10px; }
  .filter-select { width: 100%; min-height: 46px; }
  .library-total { font-size: 2.1rem; }
  .library-heading { align-items: flex-start; margin-bottom: 23px; }
  #toast { bottom: calc(88px + var(--safe-bottom)); font-size: .875rem; }
}
@media (max-width: 480px) {
  h1 { font-size: 1.8rem; }
  .main-content, .app-footer { width: calc(100% - 32px); }
  .header-inner { padding-left: 16px; padding-right: 12px; }
  .brand { gap: 7px; }
  .brand > img { width: 34px; height: 34px; }
  .brand-text { font-size: 1.35rem; }
  .brand-text small { font-size: .5rem; letter-spacing: .13em; }
  .save-status > span { display: none; }
  .welcome-banner { min-height: 290px; padding: 25px 23px; border-radius: 8px; }
  .welcome-copy { max-width: 90%; }
  .welcome-copy > .eyebrow { font-size: .6875rem; }
  .welcome-copy h1 { font-size: 1.95rem; margin: 13px 0 15px; }
  .welcome-copy > p { max-width: 235px; font-size: .875rem; }
  .welcome-sigil { width: 310px; right: -163px; opacity: .26; }
  .banner-rule { width: 100px; margin-top: 22px; }
  .heroes-section .section-heading { gap: 7px; }
  .heroes-section h2 { font-size: 1.3rem; gap: 8px; }
  .heroes-section .section-heading .btn-primary { gap: 6px; padding-left: 11px; padding-right: 11px; }
  .heroes-section .section-heading .btn-primary .icon { width: 17px; height: 17px; flex-basis: 17px; }
  .heroes-section .section-heading .btn-primary span { font-size: .8125rem; }
  .heroes-section .section-heading .btn-quiet { padding-left: 7px; padding-right: 7px; }
  .count-badge { min-width: 23px; min-height: 23px; font-size: .8125rem; padding: 1px 6px; }
  .empty-heroes { flex-direction: column; gap: 18px; text-align: center; padding: 24px 20px 28px; }
  .empty-heroes > img { width: 94px; height: 112px; flex-basis: 112px; }
  .empty-heroes h3 { font-size: 1.1rem; }
  .empty-heroes p { margin: 9px 0 17px; }
  .hero-card { padding-left: 18px; padding-right: 18px; }
  .hero-card-identity { gap: 13px; }
  .hero-card-identity h3 { font-size: 1.15rem; }
  .hero-card-resources { gap: 19px; }
  .hero-card-resources strong { font-size: .9375rem; }
  .hero-card-resources strong small { font-size: .75rem; }
  .quick-link { padding: 20px 17px; gap: 15px; }
  .quick-link h3 { font-size: 1.05rem; }
  .quick-link p { font-size: .8125rem; }
  .quick-icon { width: 44px; height: 44px; flex-basis: 44px; }
  .breadcrumbs { font-size: .8125rem; margin-bottom: 17px; }
  .hero-overview { padding: 16px; }
  .hero-identity { gap: 14px; }
  .hero-identity h1 { font-size: 1.55rem; margin: 5px 0; }
  .hero-identity p { font-size: .875rem; }
  .hero-identity .eyebrow { font-size: .625rem; }
  .hero-identity > .icon-btn { margin: -7px -9px 0 -8px; }
  .portrait-large { width: 70px; height: 89px; flex-basis: 70px; }
  .hero-vitals { padding-top: 15px; }
  .seals-row { gap: 7px; }
  .seals-row > span { gap: 6px; line-height: 1.35; font-size: .875rem; }
  .seals-row > span > .icon { width: 17px; height: 17px; flex-basis: 17px; }
  .seals-row > .counter { width: 118px; min-width: 118px; }
  .resource-grid { gap: 14px; }
  .resource-label { margin-bottom: 8px; gap: 4px; font-size: .875rem; }
  .resource-label > .icon { width: 16px; height: 16px; flex-basis: 16px; }
  .resource-label > span { white-space: nowrap; }
  .maximum-label { width: 100%; justify-content: space-between; margin-top: 0; font-size: .75rem; }
  .maximum-label input { width: 60px; min-height: 44px; }
  .resource-grid .counter input { font-size: 1.1rem; }
  .hero-tabs { margin-left: -1px; margin-right: -1px; gap: 4px; }
  .hero-tabs a { padding-left: 10px; padding-right: 10px; font-size: .875rem; }
  .hero-tabs a:first-child { padding-left: 0; }
  .stat-row { grid-template-columns: minmax(66px, 1fr) 118px 37px 33px; gap: 5px; padding: 7px 11px; }
  .stat-row .counter { width: 118px; min-width: 118px; }
  .stat-name { font-size: .875rem; line-height: 1.35; }
  .stat-head { font-size: .75rem; }
  .stat-head > span:first-child { font-size: .6875rem; }
  .stat-effect { font-size: .875rem; }
  .stat-total { font-size: 1.15rem; }
  .stat-panel .panel-heading { min-height: 56px; padding: 16px; }
  .stat-panel .panel-heading h3 { font-size: 1rem; }
  .effects-panel .effect-list, .enemy-card .effect-list { grid-template-columns: 1fr; }
  .effects-panel .effect-card:nth-child(odd), .enemy-card .effect-card:nth-child(odd) { border-right: 0; }
  .effects-panel .panel-heading { padding: 16px; min-height: 56px; }
  .effects-panel .panel-heading h3 { font-size: 1rem; }
  .effect-turns > span { font-size: .875rem; }
  .effect-card { padding-left: 16px; padding-right: 16px; }
  .effect-turns { margin-top: 10px; }
  .inventory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .item-slot { min-height: 170px; padding: 27px 14px 16px; }
  .item-slot h3 { font-size: .9375rem; }
  .item-slot p { font-size: .875rem; }
  .aether-panel { padding: 17px 15px; gap: 13px; }
  .aether-label { gap: 11px; }
  .aether-label > .icon { width: 28px; height: 28px; flex-basis: 28px; }
  .aether-label h3 { font-size: 1.2rem; }
  .aether-label .eyebrow { font-size: .625rem; }
  .aether-panel .counter { width: 134px; }
  .section-heading .btn-outline { padding: 9px 11px; gap: 6px; font-size: .8125rem; }
  .section-heading .btn-outline .icon { width: 17px; height: 17px; flex-basis: 17px; }
  .rune-slots { grid-template-columns: 1fr; }
  .build-grid { grid-template-columns: 1fr; gap: 15px; }
  .build-card { min-height: 172px; padding: 29px 22px 23px; }
  .build-card:not(.filled) { min-height: 172px; }
  .journal { padding: 62px 20px 23px; min-height: 410px; }
  .journal-ornament { left: 20px; }
  .tab-content > .section-heading { align-items: flex-start; }
  .tab-content > .section-heading > .text-note { display: none; }
  .gm-tabs a { font-size: .8125rem; gap: 6px; padding-left: 12px; padding-right: 12px; }
  .gm-tabs a:first-child { padding-left: 0; }
  .gm-tabs .icon { width: 17px; height: 17px; flex-basis: 17px; }
  .gm-tabs .count-badge { font-size: .75rem; padding: 1px 5px; min-width: 20px; }
  .gm-heading h1 { font-size: 1.8rem; }
  .gm-heading > div > p { font-size: .875rem; }
  .reputation-panel { padding: 16px; }
  .reputation-panel h3 { font-size: 1rem; }
  .reputation-value .counter { width: 126px; }
  .destiny-stage { padding: 23px 20px; min-height: 260px; }
  .destiny-stage > .eyebrow { font-size: .625rem; max-width: 260px; }
  .destiny-stage h2 { font-size: 1.3rem; }
  .destiny-sigil { right: -105px; width: 300px; opacity: .29; }
  .destiny-stage > p { color: #b9c0ad; }
  .destiny-intro { padding: 26px 20px; min-height: 318px; }
  .destiny-intro > .eyebrow { font-size: .6875rem; }
  .result-card { padding: 18px 16px; }
  .result-label { font-size: .75rem; gap: 8px; }
  .result-label .result-code { font-size: .6875rem; }
  .result-card h3 { font-size: 1rem; }
  .threat-levels { grid-template-columns: 1fr; gap: 7px; }
  .threat-levels > div { padding: 9px 11px; }
  .threat-levels > div > span { min-width: 24px; }
  .threat-levels strong { font-size: .9375rem; }
  .enemy-heading { padding-left: 16px; padding-right: 10px; }
  .enemy-heading h3 { font-size: 1.03rem; }
  .combat-empty { gap: 21px; }
  .empty-icon { width: 73px; height: 73px; }
  .empty-icon .icon { width: 33px; height: 33px; }
  .library-heading h1 { font-size: 1.8rem; }
  .library-heading .eyebrow { font-size: .6875rem; }
  .library-heading p { font-size: .875rem; }
  .library-total { font-size: 1.8rem; padding-left: 0; padding-top: 25px; }
  .library-total span { font-size: .75rem; }
  .library-grid { gap: 12px; }
  .library-card { padding: 15px; min-height: 244px; }
  .library-card h3 { font-size: .9375rem; }
  .library-card p { font-size: .875rem; -webkit-line-clamp: 4; line-height: 1.55; }
  .library-card-top { margin-bottom: 16px; }
  .library-card-top > .icon { width: 19px; height: 19px; flex-basis: 19px; }
  .library-card .category-chip { min-width: 40px; padding: 4px 6px; font-size: .75rem; }
  .library-value { font-size: .75rem; gap: 4px; }
  .library-value > .icon { width: 13px; height: 13px; flex-basis: 13px; }
  #modal { width: calc(100% - 20px); max-height: calc(100svh - 24px); border-radius: 10px; }
  .modal-shell { max-height: calc(100svh - 26px); }
  .modal-heading { padding: 17px 18px; }
  .modal-heading h2 { font-size: 1.17rem; }
  .modal-body { padding: 21px 18px; }
  .modal-actions { padding: 17px 18px 19px; gap: 10px; flex-wrap: wrap; }
  .modal-actions .btn { font-size: .875rem; padding-left: 13px; padding-right: 13px; }
  .modal-actions > .danger:first-child { margin-right: auto; }
  .field-row { gap: 12px; }
  .field { gap: 8px; margin-bottom: 17px; }
  .field > span { font-size: .875rem; }
  .portrait-upload { gap: 16px; }
  .modal-portrait { width: 78px; height: 96px; flex-basis: 78px; }
  .portrait-upload > div .btn { font-size: .8125rem; padding-left: 12px; padding-right: 12px; }
  .picker-toolbar { flex-direction: column; }
  .picker-toolbar .filter-select, .picker-toolbar select { width: 100%; }
  .picker-results { max-height: 45svh; }
  .picker-item { gap: 10px; padding: 13px 4px; }
  .picker-item > .category-chip { min-width: 44px; padding: 4px 6px; font-size: .75rem; }
  .picker-item strong { font-size: .875rem; }
  .picker-item > span > span { font-size: .8125rem; }
  .picker-item > .icon { width: 16px; height: 16px; flex-basis: 16px; }
  .picker-tabs { gap: 17px; }
  .picker-tabs button { font-size: .875rem; }
  .setting-row { align-items: flex-start; flex-direction: column; gap: 13px; }
  button.setting-row { flex-direction: row; align-items: center; }
  .setting-row > .btn { align-self: flex-start; }
  .settings-section .actions { gap: 10px; }
  .settings-section .actions .btn { font-size: .875rem; padding-left: 13px; padding-right: 13px; }
  .lock-page { padding: 45px 27px 88px; }
  .lock-wordmark { font-size: 4rem; letter-spacing: .13em; padding-left: .13em; }
  .lock-content > .eyebrow { font-size: .6875rem; }
  .lock-subtitle { font-size: .9375rem; }
  .lock-form { margin-top: 35px; }
  .lock-sigil { width: 150vw; opacity: .11; }
  .lock-version { font-size: .5625rem; letter-spacing: .14em; }
}
@media (max-width: 359px) {
  .main-content, .app-footer { width: calc(100% - 24px); }
  .stat-row { grid-template-columns: minmax(55px, 1fr) 118px 34px 30px; padding-left: 8px; padding-right: 8px; gap: 3px; }
  .stat-name { font-size: .8125rem; }
  .hero-overview { padding: 13px; }
  .resource-grid { gap: 10px; }
  .seals-row > span { font-size: .75rem; }
  .section-heading .btn-primary span { max-width: 82px; }
  .heroes-section .section-heading .btn-quiet { display: none; }
  .hero-card-resources { gap: 10px; }
  .hero-card-resources strong small { font-size: .6875rem; }
  .mobile-nav > a { font-size: .75rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  body { color: #252722; background: white; padding: 0; }
  .app-header, .app-footer, .mobile-nav, .icon-btn, .counter-btn, .btn, .tab-nav, #toast { display: none !important; }
  .main-content { width: 100%; padding: 0; }
  .panel, .hero-overview, .counter, input, .resource-block { background: white; color: #252722; border-color: #b8b8aa; }
  .character-layout { grid-template-columns: 1fr; }
  .effects-column { position: static; }
  .stat-row { grid-template-columns: 1fr 70px 70px 70px; }
  .counter { display: block; width: 70px !important; min-width: 0; }
  .stat-panel { break-inside: avoid; }
}
