/* Terhia: Heroes — Character Creator
   Ink-and-gilt dark UI with a parchment character sheet. */

:root {
  --ink-0: #0d0e12;
  --ink-1: #14161c;
  --ink-2: #1b1e26;
  --ink-3: #242833;
  --ink-4: #2f3441;
  --line: #343a48;
  --line-soft: #262b36;
  --text: #ece6d9;
  --text-dim: #aaa292;
  --text-faint: #736c60;
  --gilt: #d4a94f;
  --gilt-hi: #f0cf82;
  --gilt-lo: #8a6a2c;
  --accent: var(--gilt);
  --ok: #6fbf7a;
  --warn: #e0a743;
  --bad: #e06a5a;
  --accord: #5c8fd6;
  --crown: #d9ad45;
  --chimera: #5aa468;
  --parch: #efe4cc;
  --parch-2: #e5d6b6;
  --parch-ink: #2c2418;
  --parch-dim: #6e5f45;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --font-display: "Cinzel", "Trajan Pro", Georgia, serif;
  --font-lore: "Cormorant Garamond", Georgia, serif;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--ink-0);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14.5px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(212, 169, 79, .08), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(92, 143, 214, .06), transparent 60%),
    var(--ink-0);
}
a { color: var(--gilt-hi); }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(212, 169, 79, .35); }

/* ——— Landing ——— */
.landing {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(13, 14, 18, .35) 0%, rgba(13, 14, 18, .85) 65%, var(--ink-0) 100%), url("../assets/hero.jpg") center/cover no-repeat;
  transition: opacity .5s ease, visibility .5s;
}
.landing.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.landing-card { text-align: center; max-width: 640px; padding: 32px 24px; }
.landing .eyebrow { letter-spacing: .4em; text-transform: uppercase; font-size: 12px; color: var(--gilt-hi); }
.landing h1 {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(40px, 7vw, 76px);
  margin: 10px 0 6px; letter-spacing: .04em; line-height: 1;
  text-shadow: 0 4px 30px rgba(0, 0, 0, .7);
}
.landing h1 span { color: var(--gilt); }
.landing p.lore { font-family: var(--font-lore); font-size: 21px; font-style: italic; color: #e6dcc6; margin: 12px auto 28px; max-width: 520px; text-shadow: 0 2px 12px #000; }
.landing .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ——— Ornaments ——— */
.rule {
  display: flex; align-items: center; gap: 12px; color: var(--gilt);
  font-family: var(--font-display); font-size: 12px; letter-spacing: .25em; text-transform: uppercase;
}
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gilt-lo), transparent); }
.diamond { display: inline-block; width: 7px; height: 7px; background: var(--gilt); transform: rotate(45deg); margin: 0 6px; vertical-align: middle; }

/* ——— App shell ——— */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(13, 14, 18, .82); backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner { max-width: 1440px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; }
.brand { font-family: var(--font-display); font-weight: 700; letter-spacing: .08em; font-size: 17px; white-space: nowrap; }
.brand span { color: var(--gilt); }
.brand small { display: block; font-family: var(--font-ui); font-weight: 500; font-size: 10.5px; letter-spacing: .25em; color: var(--text-faint); text-transform: uppercase; }
.top-actions { margin-left: auto; display: flex; gap: 8px; }

.stepper { max-width: 1440px; margin: 0 auto; padding: 0 20px 10px; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.stepper::-webkit-scrollbar { display: none; }
.step-pill {
  flex: 1 0 auto; min-width: 104px; display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 10px; border: 1px solid transparent; background: transparent;
  cursor: pointer; color: var(--text-dim); font-size: 12.5px; text-align: left; transition: background .15s, color .15s;
}
.step-pill:hover { background: var(--ink-2); color: var(--text); }
.step-pill .num {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none;
  border: 1px solid var(--line); font-size: 11px; font-weight: 600; color: var(--text-dim);
}
.step-pill.done .num { background: rgba(111, 191, 122, .15); border-color: rgba(111, 191, 122, .5); color: var(--ok); }
.step-pill.warn .num { background: rgba(224, 167, 67, .12); border-color: rgba(224, 167, 67, .5); color: var(--warn); }
.step-pill.active { background: var(--ink-2); border-color: var(--line); color: var(--text); }
.step-pill.active .num { background: var(--gilt); border-color: var(--gilt); color: #1a1408; }
.progress { height: 2px; background: var(--line-soft); }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--gilt-lo), var(--gilt-hi)); transition: width .35s ease; }

.layout { max-width: 1440px; margin: 0 auto; padding: 24px 20px 120px; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; }
@media (max-width: 1080px) { .layout { grid-template-columns: 1fr; } .dossier { position: static !important; } }
@media (max-width: 640px) {
  .topbar-inner { padding: 8px 14px; gap: 10px; }
  .brand small { display: none; }
  .top-actions .btn { padding: 5px 8px; }
  .top-actions [data-act="download"] { display: none; }
  .stepper, .layout, .navbar-inner { padding-left: 14px; padding-right: 14px; }
  .navbar .kbd, .navbar .status { display: none; }
  .navbar-inner { justify-content: space-between; }
  .panel { padding: 14px; }
}

/* ——— Step content ——— */
.step { animation: rise .35s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.step-head { margin-bottom: 20px; }
.step-head .kicker { font-size: 11.5px; letter-spacing: .3em; text-transform: uppercase; color: var(--gilt); font-weight: 600; }
.step-head h2 { font-family: var(--font-display); font-size: clamp(26px, 3.2vw, 36px); margin: 4px 0 6px; letter-spacing: .03em; font-weight: 600; }
.step-head p { font-family: var(--font-lore); font-size: 18.5px; color: var(--text-dim); margin: 0; max-width: 780px; }

.panel {
  background: linear-gradient(180deg, var(--ink-2), var(--ink-1));
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px; position: relative;
}
.panel > h3, .panel-title {
  font-family: var(--font-display); font-size: 15px; letter-spacing: .12em; text-transform: uppercase;
  margin: 0 0 14px; color: var(--gilt-hi); font-weight: 600; display: flex; align-items: center; gap: 10px;
}
.panel-title .hint, .panel > h3 .hint { margin-left: auto; font-family: var(--font-ui); text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--text-faint); font-weight: 400; }
.panel.corners::before, .panel.corners::after {
  content: ""; position: absolute; width: 14px; height: 14px; border: 1px solid var(--gilt-lo); opacity: .7;
}
.panel.corners::before { top: 6px; left: 6px; border-right: 0; border-bottom: 0; border-top-left-radius: 4px; }
.panel.corners::after { bottom: 6px; right: 6px; border-left: 0; border-top: 0; border-bottom-right-radius: 4px; }

.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.span2 { grid-column: span 2; }
@media (max-width: 760px) { .span2 { grid-column: auto; } }

/* ——— Fields ——— */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); display: flex; align-items: center; gap: 8px; }
.field .help { font-size: 12.5px; color: var(--text-faint); line-height: 1.45; }
.field .help em { color: var(--text-dim); }
.input, select.input, textarea.input {
  width: 100%; background: var(--ink-0); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; outline: none; transition: border-color .15s, box-shadow .15s; min-height: 40px;
}
textarea.input { resize: vertical; min-height: 96px; line-height: 1.55; }
textarea.lore { font-family: var(--font-lore); font-size: 17px; }
.input:focus { border-color: var(--gilt); box-shadow: 0 0 0 3px rgba(212, 169, 79, .18); }
.input::placeholder { color: var(--text-faint); }
select.input {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--gilt) 50%), linear-gradient(135deg, var(--gilt) 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
select.input option, select.input optgroup { background: var(--ink-1); color: var(--text); }
.input.small { padding: 6px 9px; min-height: 32px; font-size: 13px; }
.input-row { display: flex; gap: 8px; align-items: stretch; }
.input-row > * { min-width: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--ink-3);
  cursor: pointer; font-weight: 600; font-size: 13.5px; transition: transform .08s, background .15s, border-color .15s; white-space: nowrap;
}
.btn:hover { background: var(--ink-4); border-color: #475064; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, var(--gilt-hi), var(--gilt)); color: #20180a; border-color: var(--gilt); box-shadow: 0 6px 20px rgba(212, 169, 79, .25); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.price-row { display: grid; grid-template-columns: auto 1fr auto 1fr auto auto; gap: 6px; align-items: center; }
.price-row label { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); }
.price-row .input { min-width: 0; }
@media (max-width: 640px) { .price-row { grid-template-columns: auto 1fr auto 1fr; } .price-row .btn { grid-column: span 2; } }
.sh-price { white-space: nowrap; }
.btn.lg { padding: 13px 22px; font-size: 15px; border-radius: 12px; }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn.icon { padding: 7px; width: 34px; height: 34px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--gilt-hi); cursor: pointer; font-size: 12px; font-weight: 600; }
.link-btn:hover { text-decoration: underline; }

/* Segmented control */
.seg { display: inline-flex; background: var(--ink-0); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 13px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-dim); }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--ink-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.seg.gilt button.on { background: var(--gilt); color: #20180a; box-shadow: none; }

/* Toggle */
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 13.5px; }
.toggle input { display: none; }
.toggle .track { width: 38px; height: 22px; border-radius: 99px; background: var(--ink-4); position: relative; transition: background .2s; flex: none; }
.toggle .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #cfc8b8; transition: transform .2s; }
.toggle input:checked + .track { background: var(--gilt); }
.toggle input:checked + .track::after { transform: translateX(16px); background: #fff8e6; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--ink-1); font-size: 12.5px; cursor: pointer; color: var(--text-dim);
}
.chip:hover { color: var(--text); border-color: #4a5266; }
.chip.on { border-color: var(--gilt); color: var(--gilt-hi); background: rgba(212, 169, 79, .1); }
.chip.static { cursor: default; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; letter-spacing: .03em; background: var(--ink-3); color: var(--text-dim); border: 1px solid var(--line-soft); }
.tag.accord { color: #9bc0f5; border-color: rgba(92, 143, 214, .45); background: rgba(92, 143, 214, .1); }
.tag.crown { color: #f0cf82; border-color: rgba(217, 173, 69, .45); background: rgba(217, 173, 69, .1); }
.tag.chimera { color: #93d69f; border-color: rgba(90, 164, 104, .45); background: rgba(90, 164, 104, .1); }
.tag.flag { color: #ffb4a8; border-color: rgba(224, 106, 90, .5); background: rgba(224, 106, 90, .12); }
.tag.ok { color: var(--ok); border-color: rgba(111, 191, 122, .45); background: rgba(111, 191, 122, .08); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); flex: none; }

/* Callouts */
.note { border-left: 3px solid var(--gilt-lo); background: rgba(212, 169, 79, .06); padding: 10px 14px; border-radius: 0 10px 10px 0; font-size: 13.5px; color: var(--text-dim); }
.note.warn { border-color: var(--warn); background: rgba(224, 167, 67, .08); color: #efd3a2; }
.note.bad { border-color: var(--bad); background: rgba(224, 106, 90, .08); color: #f3bfb6; }
.note.lore { font-family: var(--font-lore); font-size: 17px; font-style: italic; color: #d8cdb6; }
.issues { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }

/* ——— Class cards ——— */
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.class-card {
  position: relative; border-radius: var(--radius); overflow: hidden; cursor: pointer; aspect-ratio: 2 / 3;
  border: 1px solid var(--line-soft); background: var(--ink-2); text-align: left; padding: 0;
  transition: transform .2s ease, border-color .2s, box-shadow .2s;
}
.class-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 12%; transition: transform .5s ease; filter: saturate(.92); }
.class-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 38%, rgba(10, 10, 14, .92) 88%); }
.class-card:hover { transform: translateY(-3px); border-color: var(--c, var(--gilt)); box-shadow: 0 16px 30px rgba(0, 0, 0, .45); }
.class-card:hover img { transform: scale(1.04); }
.class-card.on { border-color: var(--c, var(--gilt)); box-shadow: 0 0 0 2px var(--c, var(--gilt)), 0 16px 30px rgba(0, 0, 0, .5); }
.class-card .meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px; z-index: 1; }
.class-card .meta h4 { font-family: var(--font-display); font-size: 19px; margin: 0; letter-spacing: .04em; }
.class-card .meta .sub { font-size: 11.5px; color: #d6cebe; display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.class-card .type-badge { position: absolute; top: 10px; left: 10px; z-index: 1; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: rgba(10, 10, 14, .7); border: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(6px); }
.class-card .check { position: absolute; top: 10px; right: 10px; z-index: 1; width: 26px; height: 26px; border-radius: 50%; background: var(--c, var(--gilt)); color: #111; display: none; place-items: center; font-weight: 800; }
.class-card.on .check { display: grid; }

.class-detail { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; }
@media (max-width: 760px) { .class-detail { grid-template-columns: 1fr; } }
.portrait-picker { display: flex; flex-direction: column; gap: 8px; }
.portrait-main { border-radius: 12px; overflow: hidden; aspect-ratio: 2 / 3; border: 1px solid var(--line); background: var(--ink-0); }
.portrait-main img { width: 100%; height: 100%; object-fit: cover; object-position: center 10%; display: block; }
.portrait-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
/* The portrait gallery: any number of portraits, filtered, in a scrolling grid. */
.portrait-filters { display: flex; flex-wrap: wrap; gap: 4px; }
.portrait-filters button { font: inherit; font-size: 11.5px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text-dim); cursor: pointer; }
.portrait-filters button.on { border-color: var(--gilt); color: var(--gilt-hi); background: rgba(212, 169, 79, .08); }
.portrait-filters button:hover { color: var(--gilt-hi); }
.portrait-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; max-height: 236px; overflow-y: auto; padding: 2px; scrollbar-width: thin; }
.portrait-gallery button { position: relative; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; aspect-ratio: 2 / 3; cursor: pointer; background: var(--ink-0); opacity: .8; }
.portrait-gallery button img { width: 100%; height: 100%; object-fit: cover; object-position: center 8%; display: block; }
.portrait-gallery button.on { opacity: 1; border-color: var(--gilt); box-shadow: 0 0 0 1px var(--gilt); }
.portrait-gallery button.best::after { content: "\25C6"; position: absolute; top: 3px; right: 4px; font-size: 9px; color: var(--gilt-hi); text-shadow: 0 0 3px #000; }
.portrait-gallery button:hover { opacity: 1; }
.portrait-gallery .none { grid-column: 1 / -1; font-size: 12.5px; color: var(--text-dim); padding: 8px 2px; }
.portrait-cap { font-size: 12px; line-height: 1.35; }
.portrait-cap b { color: var(--gilt-hi); font-weight: 600; }
.portrait-thumbs button { padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; aspect-ratio: 1; cursor: pointer; background: none; opacity: .6; transition: opacity .15s; }
.portrait-thumbs button img { width: 100%; height: 100%; object-fit: cover; object-position: center 8%; display: block; }
.portrait-thumbs button.on { opacity: 1; border-color: var(--gilt); box-shadow: 0 0 0 1px var(--gilt); }
.portrait-thumbs button:hover { opacity: 1; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv dt { color: var(--text-faint); text-transform: uppercase; font-size: 11px; letter-spacing: .08em; padding-top: 2px; }
.kv dd { margin: 0; }

/* Level slider */
.level-wrap { display: flex; flex-direction: column; gap: 10px; }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--gilt) var(--p, 0%), var(--ink-4) var(--p, 0%)); outline: none; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff5dc; border: 3px solid var(--gilt); cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff5dc; border: 3px solid var(--gilt); cursor: pointer; }
.rank-scale { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; font-size: 11px; text-align: center; color: var(--text-faint); letter-spacing: .12em; text-transform: uppercase; }
.rank-scale div { padding: 5px 0; border-top: 2px solid var(--line); }
.rank-scale div.on { color: var(--gilt-hi); border-color: var(--gilt); }
.bignum { font-family: var(--font-display); font-size: 40px; line-height: 1; font-weight: 700; }

/* ——— Attributes ——— */
.attr-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .attr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .attr-grid { grid-template-columns: 1fr; } }
.attr-card { background: var(--ink-0); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.attr-card.key { border-color: var(--c, var(--gilt)); box-shadow: inset 0 0 0 1px var(--c, var(--gilt)); }
.attr-card .top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.attr-card h4 { margin: 0; font-family: var(--font-display); font-size: 17px; letter-spacing: .06em; }
.attr-card .score { display: flex; align-items: baseline; gap: 8px; }
.attr-card .score b { font-family: var(--font-display); font-size: 34px; line-height: 1; }
.attr-card .mod { font-weight: 700; font-size: 15px; color: var(--gilt-hi); background: rgba(212, 169, 79, .1); border-radius: 8px; padding: 2px 8px; }
.attr-card .gov { font-size: 12px; color: var(--text-faint); line-height: 1.4; }
.attr-card .badge-key { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--c, var(--gilt)); }
.stepper-ctl { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.stepper-ctl button { width: 32px; height: 32px; border: 0; background: var(--ink-3); cursor: pointer; font-size: 16px; }
.stepper-ctl button:hover { background: var(--ink-4); }
.stepper-ctl input { width: 46px; height: 32px; border: 0; text-align: center; background: var(--ink-0); outline: none; -moz-appearance: textfield; }
.stepper-ctl input::-webkit-inner-spin-button { -webkit-appearance: none; }
.dice-row { display: flex; gap: 8px; flex-wrap: wrap; }
.die { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 18px; background: var(--ink-0); border: 1px solid var(--line); }
.die.rolled { animation: tumble .45s ease; }
@keyframes tumble { 0% { transform: rotate(-35deg) scale(.7); opacity: .2; } 100% { transform: none; opacity: 1; } }
.pool { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pool .val { min-width: 40px; height: 36px; padding: 0 8px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; background: var(--ink-3); border: 1px solid var(--line); }
.pool .val.used { opacity: .3; text-decoration: line-through; }

/* ——— Map ——— */
.map-wrap { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #0a1a26; }
.map-wrap img { display: block; width: 100%; height: auto; }
.map-pin {
  position: absolute; transform: translate(-50%, -50%); border: 0; cursor: pointer; padding: 4px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .03em; background: rgba(13, 14, 18, .78); color: #fff; backdrop-filter: blur(4px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .25); transition: transform .15s, background .15s; white-space: nowrap;
}
.map-pin:hover { transform: translate(-50%, -50%) scale(1.08); }
.map-pin.dim { opacity: .45; }
.map-pin.on { background: var(--gilt); color: #1b1407; box-shadow: 0 0 0 3px rgba(240, 207, 130, .45), 0 6px 18px rgba(0, 0, 0, .5); }
@media (max-width: 640px) { .map-pin { font-size: 9px; padding: 2px 6px; } }

.banner { position: relative; border-radius: 12px; overflow: hidden; min-height: 190px; display: flex; align-items: flex-end; border: 1px solid var(--line); background: var(--ink-0) center/cover no-repeat; }
.banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 20%, rgba(8, 8, 12, .9)); }
.banner .inner { position: relative; z-index: 1; padding: 16px; width: 100%; }
.banner h3 { font-family: var(--font-display); font-size: 26px; margin: 0; letter-spacing: .04em; }

.option-list { display: grid; gap: 8px; }
.option {
  display: flex; align-items: flex-start; gap: 12px; padding: 11px 13px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--ink-0); cursor: pointer; text-align: left; transition: border-color .15s, background .15s; width: 100%;
}
.option:hover { border-color: #4a5266; }
.option.on { border-color: var(--gilt); background: rgba(212, 169, 79, .07); }
.option .radio { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); margin-top: 2px; flex: none; }
.option.on .radio { border-color: var(--gilt); background: radial-gradient(circle, var(--gilt) 45%, transparent 50%); }
.option .body { flex: 1; min-width: 0; }
.option .title { font-weight: 600; }
.option .desc { font-size: 12.5px; color: var(--text-faint); margin-top: 2px; }
.option .right { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.culture-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.culture-tile { padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--ink-0); cursor: pointer; text-align: left; transition: border-color .15s, transform .15s; }
.culture-tile:hover { border-color: #4a5266; transform: translateY(-2px); }
.culture-tile.on { border-color: var(--gilt); background: rgba(212, 169, 79, .07); }
.culture-tile h4 { margin: 0 0 2px; font-family: var(--font-display); font-size: 18px; }
.culture-tile .sub { font-size: 12px; color: var(--text-faint); }

.laws { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 760px) { .laws { grid-template-columns: 1fr; } }
.law { padding: 12px; border-radius: 10px; background: var(--ink-0); border: 1px solid var(--line-soft); }
.law b { font-family: var(--font-display); font-size: 14px; letter-spacing: .04em; color: var(--gilt-hi); }
.law p { margin: 4px 0 0; font-size: 12.5px; color: var(--text-dim); }

/* Moon picker */
.moons { display: flex; gap: 6px; flex-wrap: wrap; }
.moon-btn { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--ink-0); cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.moon-btn .dot { width: 12px; height: 12px; }
.moon-btn.on { color: var(--text); border-color: var(--mc); box-shadow: 0 0 0 1px var(--mc); }

/* Tracks */
.track-row { display: grid; grid-template-columns: 170px 1fr; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line-soft); }
.track-row:last-child { border-bottom: 0; }
@media (max-width: 600px) { .track-row { grid-template-columns: 1fr; } }
.pips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pip { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); background: transparent; cursor: pointer; padding: 0; transition: background .15s, border-color .15s; }
.pip.on { background: var(--gilt); border-color: var(--gilt); }
.pip.zero { width: auto; border-radius: 99px; font-size: 11px; padding: 0 8px; color: var(--text-faint); }
.pips .caption { font-size: 12.5px; color: var(--text-dim); margin-left: 6px; }
.marks .pip.on { background: var(--bad); border-color: var(--bad); }
.marks .pip.floor { background: #7d3a31; border-color: #a8544a; cursor: not-allowed; }
.marks .sep { width: 1px; height: 22px; background: var(--line); margin: 0 3px; }

/* Abilities timeline */
.timeline { display: grid; gap: 8px; }
.ab-row { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--ink-0); border: 1px solid var(--line-soft); }
.ab-row.locked { opacity: .42; }
.ab-row .lvl { font-family: var(--font-display); font-size: 12px; color: var(--gilt); letter-spacing: .06em; }
.ab-row .lvl small { display: block; color: var(--text-faint); font-family: var(--font-ui); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; }
.ab-row .nm { font-weight: 700; }
.ab-row .meta { font-size: 11.5px; color: var(--text-faint); }
.ab-row .fx { font-size: 13px; color: var(--text-dim); margin-top: 2px; }

/* Ability picker */
.slotbar { display: grid; grid-template-columns: 3fr 2fr 2fr 2fr; gap: 10px; }
@media (max-width: 900px) { .slotbar { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .slotbar { grid-template-columns: 1fr; } }
.slot-group { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sg-label { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--gilt); font-weight: 700; }
.sg-slots { display: grid; gap: 6px; }
.pick-slot {
  position: relative; display: flex; flex-direction: column; gap: 1px; min-height: 48px; padding: 7px 28px 7px 10px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--ink-0); text-align: left; font-size: 12.5px; min-width: 0;
}
.pick-slot .ps-l { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); }
.pick-slot .ps-n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-slot.locked { opacity: .45; border-style: dashed; }
.pick-slot.locked .ps-n { font-weight: 400; color: var(--text-faint); }
.pick-slot.empty { cursor: pointer; border-style: dashed; border-color: var(--gilt-lo); }
.pick-slot.empty .ps-n { color: var(--gilt-hi); font-weight: 500; }
.pick-slot.empty:hover, .pick-slot.target { background: rgba(212, 169, 79, .08); border-style: solid; border-color: var(--gilt); }
.pick-slot.filled { border-color: rgba(212, 169, 79, .55); background: linear-gradient(180deg, rgba(212, 169, 79, .12), rgba(212, 169, 79, .04)); }
.pick-slot.filled.down .ps-l { color: #9bc0f5; }
.ps-x { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); width: 20px; height: 20px; border-radius: 50%; border: 0; background: transparent; color: var(--text-faint); cursor: pointer; font-size: 11px; }
.ps-x:hover { background: var(--ink-4); color: var(--text); }

.ab-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 900px) { .ab-grid { grid-template-columns: 1fr; } }
.ab-card {
  display: flex; flex-direction: column; gap: 5px; padding: 12px 14px; border-radius: 12px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); background: var(--ink-0); transition: border-color .15s, background .15s, opacity .15s, transform .12s;
}
.ab-card:hover { border-color: #4a5266; transform: translateY(-1px); }
.ab-card.held { border-color: var(--gilt); background: linear-gradient(180deg, rgba(212, 169, 79, .12), rgba(212, 169, 79, .03)); box-shadow: inset 0 0 0 1px rgba(212, 169, 79, .35); }
.ab-card.cannot { opacity: .5; }
.ab-card.cannot:hover { opacity: .8; transform: none; }
.ab-card.inbuild { box-shadow: 0 0 0 2px rgba(92, 143, 214, .55); }
.ab-card.held.inbuild { box-shadow: 0 0 0 2px rgba(92, 143, 214, .55), inset 0 0 0 1px rgba(212, 169, 79, .35); }
.abc-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.abc-name { font-family: var(--font-display); font-size: 15.5px; font-weight: 600; letter-spacing: .02em; }
.abc-state { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--gilt-hi); white-space: nowrap; }
.ab-card.cannot .abc-state { display: none; }
.abc-meta { font-size: 11.5px; color: var(--text-faint); }
.ab-grid:not(.searching) .abc-rank { display: none; }
.abc-fx { font-size: 13px; color: var(--text-dim); line-height: 1.45; }
.abc-foot { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.abc-foot:empty { display: none; }
.abc-why { font-size: 11.5px; color: var(--warn); margin-left: auto; }
.tag.elem-fire { color: #ffb09c; border-color: rgba(208, 80, 58, .55); background: rgba(208, 80, 58, .12); }
.tag.elem-frost { color: #b8e1f5; border-color: rgba(120, 190, 230, .5); background: rgba(120, 190, 230, .1); }
.tag.elem-storm { color: #d9c9ff; border-color: rgba(160, 130, 230, .5); background: rgba(160, 130, 230, .1); }
.tag.elem-stone { color: #e2cfa6; border-color: rgba(170, 140, 90, .55); background: rgba(170, 140, 90, .12); }

/* Gear */
.gear-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .gear-grid { grid-template-columns: 1fr; } }
.slot { border: 1px solid var(--line); border-radius: 12px; background: var(--ink-0); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.slot-head { display: flex; align-items: center; gap: 10px; }
.slot-icon { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--ink-3); border: 1px solid var(--line); flex: none; }
.slot-icon svg { width: 20px; height: 20px; stroke: var(--gilt-hi); fill: none; stroke-width: 1.6; }
.slot-head h4 { margin: 0; font-family: var(--font-display); letter-spacing: .06em; font-size: 15px; }
.slot-head .intr { font-size: 11.5px; color: var(--text-faint); }
.slot-head .seg { margin-left: auto; }
.slot-head .seg button { padding: 4px 8px; font-size: 11px; }
.relic-box { border: 1px dashed var(--gilt-lo); border-radius: 10px; padding: 10px; background: rgba(212, 169, 79, .04); display: grid; gap: 8px; }
.relic-box .label { color: var(--gilt-hi); }
.slot .input-row { display: flex; gap: 6px; align-items: stretch; }
.slot .input-row .input { flex: 1; min-width: 0; }
.slot .input-row .btn.sm { white-space: nowrap; }
.slot-desc { font-family: var(--font-lore); font-size: 14px; line-height: 1.4; resize: vertical; min-height: 44px; }
.btn.ghost { background: transparent; }
.sh-desc { font-size: 11.5px; color: var(--text-dim); font-style: italic; }
.relic-empty { font-size: 12px; color: var(--text-faint); display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* Repeating rows */
.rows { display: grid; gap: 8px; }
.row-item { display: grid; grid-template-columns: 170px 1fr auto; gap: 8px; align-items: center; }
@media (max-width: 640px) { .row-item { grid-template-columns: 1fr; } }

/* ——— Dossier (summary) ——— */
.dossier { position: sticky; top: 118px; align-self: start; }
.dossier-card { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-soft); background: var(--ink-1); box-shadow: var(--shadow); }
.dossier-art { position: relative; height: 250px; background: var(--ink-0); }
.dossier-art img { width: 100%; height: 100%; object-fit: cover; object-position: center 12%; display: block; }
.dossier-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, var(--ink-1)); }
.dossier-art .empty { height: 100%; display: grid; place-items: center; color: var(--text-faint); font-family: var(--font-lore); font-style: italic; font-size: 18px; }
.dossier-body { padding: 0 16px 16px; margin-top: -54px; position: relative; z-index: 1; }
.dossier-name { font-family: var(--font-display); font-size: 22px; line-height: 1.15; margin: 0; }
.dossier-called { font-family: var(--font-lore); font-style: italic; color: var(--text-dim); font-size: 16px; }
.dossier-line { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0 12px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stat { background: var(--ink-0); border: 1px solid var(--line-soft); border-radius: 9px; padding: 7px 4px; text-align: center; }
.stat b { display: block; font-family: var(--font-display); font-size: 19px; line-height: 1.1; }
.stat span { font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); }
.attr-mini { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 8px; }
.attr-mini div { text-align: center; font-size: 10px; color: var(--text-faint); letter-spacing: .06em; }
.attr-mini b { display: block; font-size: 15px; color: var(--text); }
.dossier-foot { border-top: 1px solid var(--line-soft); padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--text-dim); }
.dossier-foot .row { display: flex; justify-content: space-between; gap: 10px; }
.dossier-foot .row span:first-child { color: var(--text-faint); }
.dossier-foot .row span:last-child { text-align: right; }

/* Footer nav */
.navbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 25; background: rgba(13, 14, 18, .9); backdrop-filter: blur(14px); border-top: 1px solid var(--line-soft); }
.navbar-inner { max-width: 1440px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 12px; }
.navbar .status { font-size: 12.5px; color: var(--text-faint); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navbar .kbd { font-size: 11px; border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; color: var(--text-faint); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(20px); opacity: 0; z-index: 60; background: var(--ink-3); border: 1px solid var(--gilt-lo); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); transition: all .25s; pointer-events: none; font-size: 13.5px; }
.toast.show { opacity: 1; transform: translateX(-50%); }

/* ——— The sheet (parchment) ——— */
.sheet {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255, 255, 255, .35), transparent 60%),
    radial-gradient(ellipse at 100% 100%, rgba(120, 85, 30, .18), transparent 55%),
    linear-gradient(180deg, var(--parch), var(--parch-2));
  color: var(--parch-ink); border-radius: 6px; padding: 34px 36px; box-shadow: 0 24px 60px rgba(0, 0, 0, .55), inset 0 0 80px rgba(110, 80, 30, .22);
  position: relative; font-size: 13.5px;
}
.sheet::before { content: ""; position: absolute; inset: 12px; border: 1px solid rgba(90, 65, 25, .35); border-radius: 3px; pointer-events: none; }
@media (max-width: 640px) { .sheet { padding: 24px 18px; } }
.sheet h1 { font-family: var(--font-display); font-size: 30px; margin: 0; letter-spacing: .04em; line-height: 1.1; }
.sheet .sh-sub { font-family: var(--font-lore); font-style: italic; font-size: 18px; color: var(--parch-dim); }
.sheet-head { display: grid; grid-template-columns: 150px 1fr; gap: 22px; align-items: start; margin-bottom: 18px; }
@media (max-width: 640px) { .sheet-head { grid-template-columns: 1fr; } }
.sheet-head img { width: 150px; aspect-ratio: 2/3; object-fit: cover; object-position: center 10%; border-radius: 4px; border: 3px solid #fff8e8; box-shadow: 0 6px 16px rgba(60, 40, 10, .35); }
.sh-section { margin-top: 18px; break-inside: avoid; }
.sh-section h3 { font-family: var(--font-display); font-size: 13px; letter-spacing: .2em; text-transform: uppercase; margin: 0 0 8px; padding-bottom: 4px; border-bottom: 1.5px solid rgba(90, 65, 25, .45); color: #5a3f14; }
.sh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 18px; }
.sh-f { display: flex; flex-direction: column; min-width: 0; }
.sh-f span { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--parch-dim); }
.sh-f b { font-weight: 600; overflow-wrap: anywhere; }
.sh-f b.empty { color: #a79676; font-weight: 400; font-style: italic; }
.sh-attrs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
@media (max-width: 640px) { .sh-attrs { grid-template-columns: repeat(3, 1fr); } }
.sh-attr { text-align: center; border: 1.5px solid rgba(90, 65, 25, .4); border-radius: 8px; padding: 6px 2px; background: rgba(255, 250, 235, .4); }
.sh-attr span { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--parch-dim); }
.sh-attr b { display: block; font-family: var(--font-display); font-size: 24px; line-height: 1.1; }
.sh-attr i { font-style: normal; font-weight: 700; color: #7a4f14; }
.sh-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.sh-table td, .sh-table th { text-align: left; padding: 5px 6px; border-bottom: 1px solid rgba(90, 65, 25, .2); vertical-align: top; }
.sh-table th { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--parch-dim); font-weight: 600; }
.sh-prose { font-family: var(--font-lore); font-size: 17px; line-height: 1.5; white-space: pre-wrap; }
.sh-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
@media (max-width: 760px) { .sh-cols { grid-template-columns: 1fr; } }

.export-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
pre.json { background: var(--ink-0); border: 1px solid var(--line); border-radius: 10px; padding: 14px; max-height: 360px; overflow: auto; font-size: 12px; color: #cfc6b4; }

.hidden { display: none !important; }
.muted { color: var(--text-faint); }
.gilt { color: var(--gilt-hi); }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt { margin-top: 12px; }
.mb0 { margin-bottom: 0; }

/* ——— Print: only the sheet ——— */
@media print {
  body { background: #fff; }
  body::before, .topbar, .navbar, .dossier, .landing, .step-head, .export-bar, .no-print, .toast { display: none !important; }
  .layout { display: block; padding: 0; max-width: none; }
  .sheet { box-shadow: none; background: #fff; padding: 12px; }
  .sheet::before { display: none; }
}

/* The pack (inventory) */
.inv-meter { height: 6px; border-radius: 99px; background: var(--ink-3); overflow: hidden; }
.inv-meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--gilt-lo), var(--gilt)); }
.inv-meter.over span { background: var(--bad, #e06a5a); }
.inv-list { display: grid; gap: 8px; }
.inv-item { border: 1px solid var(--line); border-radius: 12px; background: var(--ink-0); padding: 10px 12px; display: grid; gap: 8px; }
.inv-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inv-head b { font-family: var(--font-display); letter-spacing: .04em; font-size: 14px; }
.inv-type { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); color: var(--text-dim); }
.inv-gear .inv-type { color: var(--gilt-hi); border-color: var(--gilt-lo); }
.inv-potion .inv-type { color: #e8826c; border-color: rgba(208, 80, 58, .5); }
.inv-elixir .inv-type { color: #a88be8; border-color: rgba(160, 130, 230, .5); }
.inv-quest .inv-type { color: #93d69f; border-color: rgba(120, 190, 130, .5); }
.inv-qty { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-faint); }
.inv-qty .input { width: 64px; }
.inv-tools { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.slot-tools { display: flex; justify-content: flex-end; gap: 12px; margin: -4px 0 -4px; }
.import-box { margin-top: 12px; border: 1px dashed var(--gilt-lo); border-radius: 12px; padding: 12px; background: rgba(212, 169, 79, .04); display: grid; gap: 8px; }
.import-box .help a { color: var(--gilt-hi); }
.json-in { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px; line-height: 1.45; resize: vertical; }
.import-list { margin: 6px 0 0; padding-left: 1.2em; font-size: 12px; }

/* Image prompt */
.prompt-box { border: 1px solid var(--gilt-lo); border-radius: 12px; padding: 12px; background: rgba(212, 169, 79, .05); display: grid; gap: 8px; }
.prompt-text { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; line-height: 1.5; resize: vertical; white-space: pre-wrap; }

/* Color scheme on the sheet */
.cs { gap: 6px; }
.cs-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; border: 1px solid rgba(90, 65, 25, .25); max-width: 520px; margin: 4px 0 2px; }
.cs-bar i { display: block; }
.cs-row { display: grid; grid-template-columns: 170px auto 1fr; gap: 8px; align-items: center; font-size: 12.5px; }
.cs-label { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--parch-dim, #7a6a4f); }
.cs-sw { display: inline-flex; gap: 3px; }
.swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, .25); display: inline-block; }
.sh-f.cs .cs-row span.cs-text { text-transform: none; letter-spacing: 0; font-size: 12.5px; color: inherit; }
.sh-f.cs .cs-row span.cs-sw { text-transform: none; letter-spacing: 0; }
@media (max-width: 640px) { .cs-row { grid-template-columns: 1fr; gap: 3px; } }

/* ——— Lightbox: any element with data-lb opens its image full-size ——— */
[data-lb] { cursor: zoom-in; }
.lb { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 4vh 4vw; background: rgba(6, 7, 10, .9); backdrop-filter: blur(6px); opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility 0s linear .25s; }
.lb.open { opacity: 1; visibility: visible; transition: opacity .25s ease; }
.lb figure { position: relative; margin: 0; max-width: min(1400px, 92vw); display: flex; flex-direction: column; align-items: center; transform: scale(.97); transition: transform .25s ease; }
.lb.open figure { transform: scale(1); }
.lb img { max-width: 100%; max-height: 84vh; object-fit: contain; border: 1px solid var(--line); border-radius: 12px; background: var(--ink-2); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.lb figcaption { margin-top: 12px; font-size: 11.5px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--text-dim); text-align: center; }
.lb-close { position: absolute; top: -44px; right: -4px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--ink-2); color: var(--text); font-size: 15px; line-height: 1; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: border-color .2s, color .2s; }
.lb-close:hover { border-color: var(--gilt); color: var(--gilt); }
@media (max-width: 640px) { .lb-close { top: -40px; right: 0; } }
