/* KINGDOM: illuminated manuscript meets tabletop diorama. Palette and rules in brand/STYLE.md. */
:root {
  --page: #f2e4c7; --panel: #f2e6cd; --ledger: #efe3c9; --card: #f8ecd6; --haze: #e9d9b8;
  --cream: #ede6d6;
  --ink: #150d0a; --brown: #3a2618; --sable: #332016;
  --rail: #5e1415; --wax: #7d1a17; --gules: #7a1f1f;
  --gold-hi: #e6b048; --gold: #c19442; --or: #b8913a;
  --water: #393e32; --vert: #3f4a3c; --forest: #354326; --purpure: #5a3448;
  --serif: "Cormorant Garamond", "IM Fell English", Georgia, serif;
  --fell: "IM Fell English", "Cormorant Garamond", Georgia, serif;
  --black: "UnifrakturCook", "IM Fell English", serif;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --rail-w: 112px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--brown); font: 15px/1.5 var(--sans);
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(233, 217, 184, .55), transparent 60%),
    radial-gradient(ellipse at 90% 80%, rgba(193, 148, 66, .10), transparent 55%);
  min-height: 100vh;
}
a { color: var(--gules); }
img { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--serif); color: var(--ink); margin: 0; font-weight: 700; letter-spacing: .005em; }
button { font: inherit; }
.num { font-variant-numeric: tabular-nums; }
.fine { font-size: 12.5px; color: #6b5440; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- shell: banner rail + top bar ---------- */
.shell { display: grid; grid-template-columns: var(--rail-w) 1fr; min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; z-index: 20; color: var(--cream);
  display: flex; flex-direction: column; align-items: center; padding: 14px 0 0;
}
.rail::before {
  content: ""; position: absolute; inset: 0 8px 0 8px; background: var(--rail);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 46px), 0 100%);
  box-shadow: inset 0 0 0 2px var(--or);
  border-left: 3px solid var(--or); border-right: 3px solid var(--or);
}
.rail > * { position: relative; }
.rail .crest { display: block; width: 74px; height: 74px; margin: 4px 0 6px; }
.rail .crest img { width: 74px; height: 74px; display: block; }
.rail nav { display: flex; flex-direction: column; align-items: center; width: 100%; }
.rail .div { color: var(--or); margin: 6px 0; line-height: 0; }
.rail nav a {
  display: flex; flex-direction: column; align-items: center; gap: 4px; width: 84px; padding: 10px 4px; border-radius: 6px;
  color: var(--cream); text-decoration: none; font: 600 15px/1.1 var(--serif); text-align: center;
}
.rail nav a:hover { background: rgba(237, 230, 214, .08); }
.rail nav a.on { color: var(--gold-hi); }
.rail nav a.on svg { filter: none; }
.rail .foot-ico { margin-top: auto; padding-bottom: 66px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.rail .foot-ico a {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--cream);
  border: 1.5px solid var(--or); background: rgba(21, 13, 10, .2);
}
.rail .foot-ico a:hover { background: rgba(237, 230, 214, .12); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 18px; padding: 16px 34px 6px; }
.wordmark { font: 700 46px/1 var(--black); color: var(--ink); text-decoration: none; letter-spacing: .01em; }
.rule { flex: 1; display: flex; align-items: center; gap: 6px; color: var(--brown); min-width: 40px; }
.rule i { flex: 1; height: 0; border-top: 1px solid var(--brown); border-bottom: 1px solid var(--brown); padding-top: 2px; }
.ca-pill { font: 500 12px var(--sans); color: var(--brown); border: 1px solid var(--brown); border-radius: 999px; padding: 4px 10px; text-decoration: none; white-space: nowrap; }
.demo-note { margin: 4px 34px 0; padding: 6px 12px; border: 1px dashed var(--gules); color: var(--gules); font: 600 12.5px var(--sans); background: var(--card); }
#view { outline: none; flex: 1; }
.page { padding: 18px 34px 40px; }

/* ---------- buttons ---------- */
.seal {
  --s: var(--wax); position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 10px 30px 14px; border: 0; cursor: pointer; text-decoration: none;
  color: var(--cream); background: var(--s); font: 700 19px/1 var(--serif); letter-spacing: .01em;
  border-radius: 52% 48% 50% 50% / 58% 54% 46% 42%;
  box-shadow: inset 0 0 0 3px #6a1512, inset 0 0 0 5px rgba(237, 230, 214, .22), 0 2px 0 rgba(21, 13, 10, .35);
}
.seal::after { content: ""; position: absolute; left: 50%; bottom: 6px; width: 16px; height: 3px; margin-left: -8px; border-radius: 2px; background: var(--or); }
.seal:hover { background: #8a1f1b; }
.seal:disabled, .seal[aria-disabled="true"] { background: #9c7a6c; cursor: not-allowed; box-shadow: inset 0 0 0 3px #8a6a5c; }
.seal.sm { min-height: 40px; padding: 8px 20px 11px; font-size: 16px; }
.seal.wide { width: 100%; }
.btn2 {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 26px;
  background: var(--card); color: var(--ink); text-decoration: none; cursor: pointer; font: 700 18px/1 var(--serif);
  border: 1px solid var(--brown); outline: 1px solid var(--brown); outline-offset: 3px; margin: 4px; border-radius: 2px;
}
.btn2:hover { background: var(--haze); }
.btn2.sm { min-height: 36px; padding: 6px 14px; font-size: 15px; }
.connect { min-width: 140px; }

/* ---------- framed panels ---------- */
.frame {
  position: relative; background: var(--panel); border: 1px solid var(--brown); padding: 4px;
}
.frame > .in { border: 1px solid var(--brown); height: 100%; position: relative; }
.frame::before, .frame::after, .frame > .in::before, .frame > .in::after {
  content: ""; position: absolute; width: 10px; height: 10px; border: 1.5px solid var(--or); z-index: 2; pointer-events: none;
}
.frame::before { top: -5px; left: -5px; border-radius: 0 0 10px 0; border-width: 0 1.5px 1.5px 0; }
.frame::after { top: -5px; right: -5px; border-radius: 0 0 0 10px; border-width: 0 0 1.5px 1.5px; }
.frame > .in::before { bottom: -10px; left: -10px; border-radius: 0 10px 0 0; border-width: 1.5px 1.5px 0 0; }
.frame > .in::after { bottom: -10px; right: -10px; border-radius: 10px 0 0 0; border-width: 1.5px 0 0 1.5px; }
.ph { display: flex; align-items: center; gap: 10px; padding: 12px 16px 8px; }
.ph h2 { font-size: 26px; }
.ph .fl { color: var(--or); }
.ph .end { margin-left: auto; }

/* ---------- home ---------- */
.dio-canvas { display: block; width: 100%; height: 100%; }
.hero3d {
  position: relative; margin: 8px 34px 0; height: clamp(520px, 74vh, 760px); overflow: hidden;
  background: var(--haze); border: 1px solid var(--brown); outline: 1px solid var(--brown); outline-offset: 4px;
}
.hero-stage { position: absolute; inset: 0; touch-action: pan-y; }
.hero-stage canvas { cursor: grab; }
.hero-card { position: absolute; left: 26px; top: 26px; width: min(440px, 44%); z-index: 3; background: rgba(242, 230, 205, .94); }
.hero-card .in { padding: 22px 24px 24px; }
.hero-card h1 { font-size: clamp(38px, 4.2vw, 60px); line-height: .98; }
.hero-card .sub { font: 600 clamp(19px, 1.8vw, 24px)/1.25 var(--serif); color: var(--brown); margin: 14px 0 0; }
.hero-card .lede { margin: 12px 0 0; color: #5a4330; font-size: 14.5px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 20px; }
.hero-cap {
  position: absolute; left: 26px; right: 26px; bottom: 18px; z-index: 3; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 14px; background: rgba(248, 236, 214, .94); border: 1px solid var(--brown); color: var(--brown); text-decoration: none; font-size: 13.5px;
}
.hero-cap b { font: 700 19px var(--serif); color: var(--ink); }
.hero-cap .sh svg { width: 24px; height: 29px; display: block; }
.hero-cap .go { margin-left: auto; font: 700 16px var(--serif); color: var(--gules); display: inline-flex; gap: 6px; align-items: center; }
.hero-cap:hover .go { text-decoration: underline; }

.home-grid { display: grid; grid-template-columns: 1fr 340px; gap: 26px; margin-top: 30px; align-items: start; }
.roll .tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 4px 16px 14px; }
.search {
  flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 42px;
  background: var(--card); border: 1px solid var(--brown); border-radius: 3px;
}
.search input { border: 0; background: transparent; outline: none; flex: 1; font: 15px var(--sans); color: var(--ink); min-width: 0; }
.tabs { display: flex; border: 1px solid var(--brown); border-radius: 3px; overflow: hidden; }
.tabs button { border: 0; background: var(--card); color: var(--ink); padding: 0 18px; height: 40px; font: 700 16px var(--serif); cursor: pointer; }
.tabs button + button { border-left: 1px solid var(--brown); }
.tabs button.on { background: var(--gold-hi); }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 0 16px 18px; }
.card {
  display: grid; grid-template-columns: 62px 1fr 112px; gap: 12px; align-items: center; padding: 12px 12px 12px 12px;
  background: var(--card); border: 1px solid var(--brown); outline: 1px solid rgba(58, 38, 24, .35); outline-offset: -5px;
  text-decoration: none; color: var(--brown); transition: background .15s;
}
.card:hover { background: #fbf2e1; }
.card .sh svg { width: 58px; height: 70px; display: block; }
.card h3 { font-size: 22px; line-height: 1.05; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .tk { font: 600 13px var(--sans); color: #6b5440; }
.card .tier { display: flex; align-items: center; gap: 6px; margin-top: 6px; font: 700 15px var(--serif); color: var(--ink); }
.card .meta { font-size: 12.5px; color: #6b5440; margin-top: 4px; }
.card .vig { width: 112px; height: 84px; }
.bar { height: 9px; background: var(--cream); border: 1px solid var(--brown); border-radius: 5px; overflow: hidden; margin-top: 6px; }
.bar > i { display: block; height: 100%; background: var(--gold); border-right: 1px solid var(--brown); }
.more { display: flex; justify-content: center; padding: 0 0 18px; }
.empty { padding: 26px 16px; text-align: center; color: #6b5440; }
.empty b { display: block; font: 700 22px var(--serif); color: var(--ink); margin-bottom: 4px; }

.chron ul { list-style: none; margin: 0; padding: 0 16px 10px; }
.chron li { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-top: 1px solid rgba(58, 38, 24, .45); font-size: 13.5px; }
.chron li:first-child { border-top: 0; }
.chron li.empty { display: block; color: #6b5440; }
.chron li b { color: var(--ink); }
.chron li time { color: #6b5440; font-size: 12px; white-space: nowrap; }
.chron li a { color: inherit; text-decoration: none; }
.chron li a:hover b { text-decoration: underline; }

.ledger {
  display: grid; grid-template-columns: auto repeat(3, 1fr) auto; gap: 0; align-items: center; margin-top: 26px;
  background: var(--ledger); border-top: 1px solid var(--brown); border-bottom: 1px solid var(--brown); outline: 1px solid var(--brown); outline-offset: 3px;
}
.ledger > div { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-left: 1px solid rgba(58, 38, 24, .5); }
.ledger > div:first-child { border-left: 0; font: 700 21px var(--serif); color: var(--ink); }
.ledger b { font: 700 20px var(--serif); color: var(--ink); font-variant-numeric: tabular-nums; }
.ledger small { color: #6b5440; }
.ledger .note { font: italic 15px var(--fell); color: var(--brown); }

/* ---------- world page ---------- */
.w-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.w-head .sh svg { width: 64px; height: 77px; display: block; }
.w-head h1 { font-size: 40px; line-height: 1; }
.w-head .tk { font: 600 14px var(--sans); color: #6b5440; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--brown); border-radius: 999px; font: 600 12px var(--sans); background: var(--card); color: var(--ink); }
.chip.live { background: var(--forest); color: var(--cream); border-color: var(--forest); }
.chip.pre { background: var(--cream); color: var(--gules); border-color: var(--gules); }
.w-head .links { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.w-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.w-head p { margin: 6px 0 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; }
.w-head p b { font: 700 17px var(--serif); color: var(--ink); }
.w-head .ca { font: 500 12.5px var(--sans); border-bottom: 1px dashed var(--brown); cursor: copy; }
.stage-frame { position: sticky; top: 10px; background: var(--haze); border: 1px solid var(--brown); outline: 1px solid var(--brown); outline-offset: 4px; margin: 5px; }
.stage { position: relative; width: 100%; height: calc(100vh - 150px); min-height: 460px; overflow: hidden; touch-action: none; outline: none; }
.stage canvas { display: block; width: 100%; height: 100%; }
.stage .hud { position: absolute; left: 10px; top: 10px; display: flex; gap: 8px; z-index: 3; flex-wrap: wrap; }
.stage .hud .btn2 { margin: 3px; }
.stage .tip {
  position: absolute; z-index: 4; pointer-events: none; transform: translate(-50%, calc(-100% - 12px)); white-space: nowrap;
  background: var(--card); border: 1px solid var(--brown); padding: 4px 9px; font-size: 12.5px; color: var(--ink); display: none;
}
.stage .legend { position: absolute; right: 10px; bottom: 10px; z-index: 3; background: rgba(248, 236, 214, .92); border: 1px solid var(--brown); padding: 6px 10px; font-size: 12px; display: flex; flex-wrap: wrap; gap: 4px 12px; max-width: 70%; }
.stage .legend i { display: inline-block; width: 10px; height: 10px; border: 1px solid var(--brown); margin-right: 4px; vertical-align: -1px; }
.stage .legend span.off { opacity: .45; text-decoration: line-through; }
.z-farm { background: #98a055; } .z-town { background: #b39a68; } .z-forest { background: #55653a; } .z-mine { background: #948a78; } .z-harbour { background: #c7ae7a; }
.k-farm { background: #d9b04a; } .k-mill { background: #ede6d6; } .k-watchtower { background: #7a1f1f; } .k-stall { background: #b8913a; } .k-smith { background: #3a2618; }
.k-mason { background: #8f8574; } .k-lodge { background: #5b3b22; } .k-quarry { background: #6d665a; } .k-wharf { background: #7d5a36; }
.stage .plotnote { position: absolute; left: 50%; top: 66px; transform: translateX(-50%); z-index: 3; width: min(420px, 86%); text-align: center; }
.stage .plotnote .in { padding: 10px 16px 12px; }
.stage .plotnote b { font: 700 24px var(--serif); color: var(--gules); }
.stage .plotnote p { margin: 4px 0 0; font-size: 13.5px; }
.side { display: flex; flex-direction: column; gap: 20px; }
ol.ladder { list-style: none; margin: 0; padding: 0 16px 12px; }
.ladder small.need { color: var(--gules); }
.ladder li { display: grid; grid-template-columns: 30px 1fr; gap: 8px; padding: 8px 0; border-top: 1px solid rgba(58, 38, 24, .35); }
.ladder li:first-child { border-top: 0; }
.ladder li .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--brown); font: 700 14px var(--serif); color: var(--ink); background: var(--cream); }
.ladder li.done .n { background: var(--gold); }
.ladder li.cur .n { background: var(--wax); color: var(--cream); border-color: var(--wax); }
.ladder li b { font: 700 17px var(--serif); color: var(--ink); }
.ladder li small { display: block; color: #6b5440; font-size: 12px; }
.ladder li.locked { opacity: .62; }
.figs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0 16px 12px; border: 1px solid var(--brown); background: var(--card); }
.figs div { padding: 8px 10px; border-left: 1px solid rgba(58, 38, 24, .4); }
.figs div:first-child { border-left: 0; }
.figs small { display: block; font-size: 11px; color: #6b5440; text-transform: uppercase; letter-spacing: .06em; }
.figs b { font: 700 18px var(--serif); color: var(--ink); font-variant-numeric: tabular-nums; }
.palette { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 0 16px 10px; }
.palette button {
  display: grid; grid-template-columns: 14px 1fr; gap: 2px 8px; text-align: left; padding: 8px 10px; cursor: pointer;
  background: var(--card); border: 1px solid var(--brown); color: var(--ink); border-radius: 2px;
}
.palette button i { width: 12px; height: 12px; border: 1px solid var(--brown); margin-top: 4px; grid-row: span 2; }
.palette button b { font: 700 16px/1.1 var(--serif); }
.palette button small { font-size: 11.5px; color: #6b5440; }
.palette button.on { background: var(--gold-hi); outline: 1px solid var(--brown); outline-offset: 2px; }
.palette button:disabled { opacity: .45; cursor: not-allowed; }
.buildbox .in { padding-bottom: 14px; }
.buildbox .pick, .buildbox .seal, .buildbox .status { margin-left: 16px; margin-right: 16px; }
.buildbox .seal.wide { width: calc(100% - 32px); }
.buildbox .pick { font-size: 13.5px; margin: 0 16px 10px; min-height: 40px; }
.buildbox .pick b { color: var(--ink); }
.status { font-size: 13.5px; margin-top: 10px; }
.status:empty { display: none; }
.status.err { color: var(--gules); }
.status.ok { color: var(--forest); }
.econ [data-econ] { padding: 0 16px 12px; }
.econ .row span { font: 700 16px var(--serif); color: var(--ink); }
.econ .row small { color: #6b5440; font-size: 12px; }
.econ .row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid rgba(58, 38, 24, .3); }
.econ .row:first-child { border-top: 0; }
.econ .row b { margin-left: auto; font: 700 19px var(--serif); color: var(--ink); font-variant-numeric: tabular-nums; }
.econ .note { font: italic 14px var(--fell); color: var(--brown); margin: 6px 0 0; }

/* ---------- charter ---------- */
.charter { max-width: 1040px; }
.charter .lead { font: 600 22px/1.35 var(--serif); color: var(--brown); max-width: 760px; margin: 10px 0 24px; }
.charter h1 { font-size: 52px; }
.charter section { margin-bottom: 22px; }
.charter .in { padding: 4px 18px 16px; }
.charter p { max-width: 760px; }
.charter ol.rules { padding-left: 20px; }
.charter ol.rules li { margin: 6px 0; }
.charter ol.rules li::marker { font: 700 16px var(--serif); color: var(--gules); }
table.roll { width: 100%; border-collapse: collapse; font-size: 14px; }
table.roll th { text-align: left; font: 700 16px var(--serif); color: var(--ink); border-bottom: 2px solid var(--brown); padding: 8px 8px 6px; }
table.roll td { border-bottom: 1px solid rgba(58, 38, 24, .35); padding: 8px; vertical-align: top; }
table.roll td b { font: 700 16px var(--serif); color: var(--ink); }
.dropcap::first-letter { float: left; font: 700 64px/0.8 var(--black); color: var(--gules); margin: 6px 8px 0 0; }

/* ---------- found a realm (launch) ---------- */
.found-head .ph { padding: 4px 0 0; }
.found h1 { font-size: 50px; }
.found .lede { font: 600 20px/1.35 var(--serif); margin: 6px 0 18px; max-width: 700px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 26px; align-items: start; }
.found form .in { padding: 6px 20px 8px; }
.step { padding: 12px 0 8px; border-top: 1px solid rgba(58, 38, 24, .35); }
.step:first-child { border-top: 0; }
.step header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.step h2 { font-size: 25px; }
.step .num-r { width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--wax); color: var(--cream); display: grid; place-items: center; font: 700 16px var(--serif); box-shadow: inset 0 0 0 2px #6a1512, inset 0 0 0 4px rgba(237, 230, 214, .22); }
.step header small { margin-left: auto; color: #6b5440; font-style: italic; font-family: var(--fell); font-size: 14px; }
.field.narrow { max-width: 240px; }
.deed { position: sticky; top: 14px; }
.deed .ph { justify-content: center; padding: 0 0 6px; }
.deed-art { display: flex; align-items: end; justify-content: center; gap: 10px; margin: 6px 0; }
.deed-art .sh svg { width: 72px; height: 86px; display: block; }
.deed .status { text-align: left; }
.deed .seal { margin-top: 4px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > span { font: 700 15px var(--serif); color: var(--ink); display: flex; justify-content: space-between; }
.field input, .field textarea {
  font: 15px var(--sans); color: var(--ink); background: var(--card); border: 1px solid var(--brown); border-radius: 2px; padding: 10px 12px; outline: none; width: 100%;
}
.field input:focus, .field textarea:focus { border-color: var(--wax); box-shadow: 0 0 0 2px rgba(125, 26, 23, .18); }
.drop { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1.5px dashed var(--brown); background: var(--card); cursor: pointer; }
.drop.over, .drop.has { border-style: solid; border-color: var(--wax); }
.drop .th { width: 64px; height: 64px; flex: none; display: grid; place-items: center; border: 1px solid var(--brown); font: 700 28px var(--serif); background: var(--cream); overflow: hidden; }
.drop .th img { width: 100%; height: 100%; object-fit: cover; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chips button { border: 1px solid var(--brown); background: var(--card); color: var(--ink); padding: 6px 14px; border-radius: 999px; cursor: pointer; font: 600 13.5px var(--sans); }
.chips button.on { background: var(--gold-hi); }
.deed .in { padding: 14px 18px 18px; text-align: center; }
.deed .sh svg { width: 120px; height: 144px; }
.deed h3 { font-size: 28px; margin-top: 6px; overflow-wrap: anywhere; }
.deed .tk { color: #6b5440; font-weight: 600; }
.deed dl { text-align: left; margin: 14px 0; font-size: 13.5px; }
.deed dl div { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid rgba(58, 38, 24, .3); }
.deed dt { color: #6b5440; }
.deed dd { margin: 0; color: var(--ink); font-weight: 600; text-align: right; }
.deed .vig { width: 200px; height: 150px; }

/* ---------- footer, toasts ---------- */
.foot { margin-top: auto; padding: 18px 34px 26px; display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; font-size: 12.5px; color: #6b5440; border-top: 1px solid rgba(58, 38, 24, .35); }
.foot a { color: var(--brown); display: inline-flex; gap: 6px; align-items: center; text-decoration: none; margin-left: 14px; }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--card); color: var(--ink); border: 1px solid var(--brown); border-left: 5px solid var(--or); padding: 10px 14px; max-width: 360px; font-size: 14px; box-shadow: 0 3px 0 rgba(21, 13, 10, .18); transition: opacity .4s; }
.toast.err { border-left-color: var(--gules); }
.toast.out { opacity: 0; }
.lnk { color: var(--gules); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .home-grid, .w-grid, .two-col { grid-template-columns: 1fr; }
  .stage-frame, .deed { position: relative; top: 0; }
  .stage { height: 72vh; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
}
@media (max-width: 860px) {
  .hero3d { height: auto; display: flex; flex-direction: column; overflow: visible; background: transparent; border: 0; outline: 0; }
  .hero-stage { position: relative; inset: auto; height: 52vh; min-height: 340px; order: 1; background: var(--haze); border: 1px solid var(--brown); }
  .hero-card { position: relative; left: 0; top: 0; width: auto; order: 3; margin-top: 14px; }
  .hero-cap { position: relative; left: 0; right: 0; bottom: 0; order: 2; margin-top: -1px; }
  .ledger { grid-template-columns: 1fr 1fr 1fr; }
  .ledger > div:first-child, .ledger .note { grid-column: 1 / -1; border-left: 0; }
}
@media (max-width: 760px) {
  :root { --rail-w: 0px; }
  .shell { display: block; padding-bottom: 72px; }
  .rail { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: 64px; flex-direction: row; padding: 0 10px; justify-content: space-between; }
  .rail::before { inset: 0; clip-path: none; border: 0; border-top: 3px solid var(--or); box-shadow: none; }
  .rail .crest, .rail .crest img { width: 44px; height: 44px; margin: 0; }
  .rail nav { flex-direction: row; justify-content: center; width: auto; flex: 1; }
  .rail nav a { width: auto; padding: 6px 8px; font-size: 13px; }
  .rail nav a svg { width: 18px; height: 18px; }
  .rail .div { display: none; }
  .rail .foot-ico { margin: 0; padding: 0; flex-direction: row; gap: 6px; }
  .rail .foot-ico a { width: 32px; height: 32px; }
  .top { padding: 12px 16px 4px; gap: 10px; }
  .wordmark { font-size: 34px; }
  .ca-pill { display: none; }
  .page { padding: 14px 16px 30px; }
  .demo-note { margin: 4px 16px 0; }
  .cards { grid-template-columns: 1fr; padding: 0 10px 14px; }
  .card { grid-template-columns: 52px 1fr 86px; gap: 10px; }
  .card .sh svg { width: 50px; height: 60px; }
  .card .vig { width: 86px; height: 64px; }
  .two { grid-template-columns: 1fr; }
  .ledger { grid-template-columns: 1fr; }
  .ledger > div { border-left: 0; border-top: 1px solid rgba(58, 38, 24, .3); }
  .stage { height: 64vh; min-height: 340px; }
  .hero3d { margin: 6px 16px 0; }
  .hero-card .in { padding: 16px; }
  .found h1 { font-size: 38px; }
  .stage .legend { max-width: none; left: 10px; }
  .w-head h1 { font-size: 30px; }
  .w-head .links { margin-left: 0; }
  .foot { padding: 16px; }
  .connect { min-width: 0; padding: 8px 16px 11px; min-height: 40px; font-size: 15px; }
}
