:root {
  --paper: #F2E9D8;
  --manila: #E3C387;
  --ink: #1B2440;
  --ledger: #2E5C4E;
  --stamp: #BF3B2B;
  --brass: #C9A227;
  --brown: #7A4A2B;
  --muted: #8C9A8E;

  --font-display: "Alfa Slab One", Georgia, serif;
  --font-text: "Public Sans", "Segoe UI", Arial, sans-serif;
  --font-num: "Courier Prime", "Courier New", monospace;

  --hard: 4px 4px 0 rgba(27, 36, 64, .30);
  --hard-sm: 2px 2px 0 rgba(27, 36, 64, .32);
  --hard-lg: 8px 9px 0 rgba(27, 36, 64, .26);
  --line: 2px solid var(--ink);

  --win-max: 1000px;
  --banner-h: 292px;

  --site-bg: #F2E9D8;
  --site-panel: #E3C387;
  --site-ink: #1B2440;
  --site-accent: #7A4A2B;
  --site-accent-text: #F2E9D8;
  --banner-bg: #FFFCF2;
  --banner-text: #1B2440;
  --banner-accent: #1E6BE0;
  --banner-accent-text: #FFFCF2;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-text);
  color: var(--ink);
  background: #cbb891;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: .055;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

button { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--stamp);
  outline-offset: 3px;
}

.desk-wrap { position: fixed; inset: 0; z-index: -2; background: #cfbb92; }
.desk { width: 100%; height: 100%; object-fit: cover; object-position: 50% 44%; display: block; }

.page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  min-height: 100svh;
  padding: 12px clamp(14px, 3vw, 46px) 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ============ MASTHEAD ============ */

.top {
  display: grid;
  grid-template-columns: minmax(230px, 0.27fr) minmax(0, 1fr);
  gap: clamp(12px, 2vw, 30px);
  align-items: start;
  flex: none;
}

.plaque-wrap {
  position: relative;
  width: 100%;
  max-width: clamp(250px, 23vw, 356px);
  filter: drop-shadow(5px 6px 0 rgba(27, 36, 64, .26));
  transform: rotate(-.35deg);
}
.plaque-img { width: 100%; height: auto; display: block; }
.plaque-copy {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 16%;
  bottom: 15%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1px;
}
.plaque-kicker {
  font-size: clamp(6px, .52vw, 8.5px);
  font-weight: 700;
  letter-spacing: .17em;
  color: rgba(27, 36, 64, .72);
  line-height: 1;
  margin-bottom: 2px;
}
.plaque-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  color: var(--ink);
  line-height: .89;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.plaque-title span {
  font-size: clamp(14px, 1.35vw, 21px);
  letter-spacing: .02em;
}
.plaque-title strong {
  font-weight: 400;
  font-size: clamp(21px, 2.05vw, 33px);
  letter-spacing: -.005em;
}
.plaque-tag {
  margin-top: 3px;
  font-size: clamp(8px, .78vw, 12px);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ledger);
  border-top: 1.5px solid rgba(27, 36, 64, .55);
  padding-top: 3px;
  width: 76%;
}

.top-right {
  display: flex;
  align-items: flex-start;
  gap: clamp(8px, 1.4vw, 20px);
  min-width: 0;
}
.seals-block { flex: 1 1 auto; min-width: 0; }
.seals-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(7px, .62vw, 9.5px);
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--ink);
  margin: 1px 0 6px;
  white-space: nowrap;
}
.seals-head .rule { flex: 1; height: 2px; background: rgba(27, 36, 64, .45); }
.seals-note { letter-spacing: .03em; font-weight: 400; text-transform: none; color: rgba(27, 36, 64, .62); font-size: 10px; }
.seals {
  display: flex;
  align-items: flex-start;
  gap: clamp(5px, 1.15vw, 18px);
  flex-wrap: nowrap;
}
.seal {
  background: none;
  border: 0;
  padding: 0;
  width: clamp(64px, 7vw, 102px);
  flex: 0 1 auto;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  transition: transform .15s steps(2), filter .15s linear;
}
.seal img {
  width: 100%;
  height: auto;
  display: block;
  filter: saturate(.42) opacity(.62);
  transition: filter .16s linear, transform .16s steps(2);
}
.seal-name {
  font-size: clamp(7px, .68vw, 10px);
  line-height: 1.12;
  text-align: center;
  font-weight: 600;
  opacity: .64;
  max-width: 100%;
  transition: opacity .16s;
}
.seal:hover img, .seal:focus-visible img { filter: saturate(.85) opacity(.9); }
.seal:hover .seal-name { opacity: .9; }
.seal.sel img {
  filter: none;
  transform: rotate(-2.2deg) scale(1.035);
}
.seal.sel .seal-name { opacity: 1; font-weight: 700; }
.seal.sel::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 4%;
  width: 92%;
  aspect-ratio: 1;
  border: 2.5px solid var(--stamp);
  border-radius: 50%;
  transform: rotate(5deg);
  opacity: .92;
  pointer-events: none;
}
.seal.sel::after {
  content: "";
  position: absolute;
  top: 22%;
  left: 26%;
  width: 48%;
  height: 19%;
  border-top: 2px solid var(--stamp);
  border-radius: 50%;
  transform: rotate(-13deg);
  opacity: .7;
  pointer-events: none;
}

.utility { display: flex; gap: 7px; flex: none; padding-top: 1px; }
.paper-btn {
  width: 38px;
  height: 38px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: var(--hard-sm);
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 17px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform .1s, box-shadow .1s;
}
.paper-btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 rgba(0,0,0,0); }
.sound-btn { font-size: 9px; letter-spacing: .04em; }
.sound-btn.muted { color: var(--muted); text-decoration: line-through; }

/* ============ MAIN ============ */

.main {
  display: grid;
  grid-template-columns: minmax(0, 1.74fr) minmax(302px, .72fr);
  gap: clamp(10px, 1.7vw, 28px);
  align-items: stretch;
  flex: 0 0 auto;
  min-height: 0;
}

.stage {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-width: 0;
  padding-bottom: 26px;
}

.window {
  position: relative;
  width: 100%;
  max-width: var(--win-max);
  aspect-ratio: 1.76;
  filter: drop-shadow(7px 9px 0 rgba(27, 36, 64, .24));
  transform: rotate(.12deg);
}
.window-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  z-index: 0;
}

/* --- mock site inside the frame --- */
.site {
  position: absolute;
  left: 4.1%;
  top: 16.2%;
  width: 91.8%;
  height: 73.2%;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2.1%;
  overflow: hidden;
  padding: .6% .2% 0;
  background: var(--site-bg);
  color: var(--site-ink);
}
.site-head {
  display: flex;
  align-items: center;
  gap: 7px;
  border-bottom: 2px solid var(--site-ink);
  padding-bottom: 1.3%;
  flex: none;
}
.site-logo {
  width: clamp(15px, 1.5vw, 24px);
  height: clamp(15px, 1.5vw, 24px);
  border-radius: 50%;
  border: 2px solid var(--site-ink);
  background: var(--site-accent);
  color: var(--site-accent-text);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: clamp(8px, .85vw, 13px);
  line-height: 1;
  flex: none;
}
.site-name {
  font-family: var(--font-display);
  font-size: clamp(8px, 1.05vw, 15px);
  text-transform: uppercase;
  letter-spacing: -.01em;
  white-space: nowrap;
  color: var(--site-ink);
}
.site-nav {
  margin-left: auto;
  display: flex;
  gap: clamp(4px, .7vw, 12px);
  font-size: clamp(5px, .58vw, 8px);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: .06em;
  opacity: .75;
  flex-wrap: nowrap;
  color: var(--site-ink);
}
.ad-hero {
  position: relative;
  flex: 0 0 26%;
  width: 60%;
  min-height: 0;
  border: 0;
  overflow: hidden;
}
.ad-hero img { width: 100%; height: 100%; object-fit: fill; display: block; }
.ad-tag {
  position: absolute;
  top: 4%;
  left: 1.5%;
  background: var(--site-panel);
  border: 1.5px solid var(--site-ink);
  padding: 0 4px;
  font-size: clamp(4.5px, .46vw, 7px);
  font-weight: 700;
  letter-spacing: .12em;
  line-height: 1.5;
  z-index: 2;
}
.ad-copy {
  position: absolute;
  right: 2%;
  bottom: 6%;
  background: var(--site-accent);
  border: 1.5px solid var(--site-ink);
  color: var(--site-accent-text);
  font-size: clamp(4.5px, .48vw, 7.5px);
  font-weight: 700;
  letter-spacing: .05em;
  padding: 1px 4px;
  max-width: 46%;
  line-height: 1.3;
}
.site-body { display: flex; gap: 2.4%; flex: 1 1 auto; min-height: 0; }
.site-copy { flex: 1 1 55%; min-width: 0; display: flex; flex-direction: column; gap: 2px; position: relative; }
.site-copy h3 {
  font-family: var(--font-display);
  font-size: clamp(9px, 1.3vw, 19px);
  line-height: 1.02;
  margin: 0;
  text-transform: uppercase;
  color: var(--site-ink);
}
.site-copy p {
  margin: 0;
  font-size: clamp(5.5px, .65vw, 9px);
  line-height: 1.35;
  max-width: 92%;
  color: var(--site-ink);
}
.site-copy .tiny-lines { font-size: clamp(5px, .56vw, 8px); opacity: .72; }
.ad-side { position: relative; }
.ad-video {
  margin-top: auto;
  width: 72%;
  height: 42%;
  min-height: 0;
}
.ad-video img { width: 100%; height: 100%; object-fit: contain; object-position: left bottom; display: block; }
.ad-video .ad-tag { top: 0; left: 0; }
.site-side {
  flex: 0 0 39%;
  display: flex;
  flex-direction: column;
  gap: 4%;
  min-width: 0;
  position: relative;
}
.ad-link { position: relative; }
.ad-link img { width: 100%; display: block; }
.ad-link span {
  position: absolute;
  left: 6%;
  bottom: 12%;
  font-size: clamp(4.5px, .48vw, 7px);
  font-weight: 700;
  letter-spacing: .03em;
  max-width: 90%;
}
.ad-pop {
  position: relative;
  width: 52%;
  margin-top: auto;
  align-self: flex-end;
  transform: rotate(2deg);
}
.ad-pop img { width: 100%; display: block; }
.ad-pop .ad-tag { top: 0; left: 0; }
.site-footer {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  border-top: 1.5px solid var(--site-ink);
  padding-top: .7%;
  font-size: clamp(5px, .55vw, 8px);
  color: var(--site-ink);
}
.site-footer button {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  text-decoration: underline;
  cursor: pointer;
  opacity: .82;
  min-height: 0;
}
.site-footer button:hover { color: var(--site-accent); opacity: 1; }
.site-foot-note { margin-left: auto; opacity: .45; font-family: var(--font-num); font-size: 7px; white-space: nowrap; }

/* --- gauge --- */
.gauge {
  position: absolute;
  right: -3.2%;
  top: 1.8%;
  width: 30%;
  aspect-ratio: 872 / 519;
  z-index: 4;
  filter: drop-shadow(3px 4px 0 rgba(27, 36, 64, .24));
  pointer-events: none;
}
.gauge-face { position: absolute; inset: 0; overflow: hidden; }
.gauge-face img { width: 100%; height: auto; display: block; }
.needle {
  position: absolute;
  left: 46.9%;
  top: 65.2%;
  width: 31.9%;
  height: 8.28%;
  overflow: hidden;
  transform-origin: 5.8% 50%;
  transform: rotate(185deg);
  transition: transform .82s cubic-bezier(.34, 1.5, .6, 1);
}
.needle img {
  position: absolute;
  width: 156.8%;
  left: -38.31%;
  top: -653.5%;
  max-width: none;
}

/* --- consent banner (CMP models) --- */

.banner-layer {
  position: absolute;
  left: 4.1%;
  top: 16.2%;
  width: 91.8%;
  height: 73.2%;
  z-index: 6;
  pointer-events: none;
}
.banner {
  position: absolute;
  pointer-events: auto;
  background: var(--banner-bg);
  color: var(--banner-text);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 rgba(27, 36, 64, .28);
  border-radius: 4px;
  font-family: var(--font-text);
  line-height: 1.3;
  overflow: hidden;
}
.banner.pos-bottom { left: 0; right: 0; bottom: 0; border-left: 0; border-right: 0; border-bottom: 0; }
.banner.pos-top { left: 0; right: 0; top: 0; border-left: 0; border-right: 0; border-top: 0; }
.banner.pos-center { left: 50%; top: 50%; width: 82%; max-height: 96%; transform: translate(-50%, -50%); }
.banner.pos-left { left: 0; top: 2%; width: 49%; height: 84%; }
.banner.pos-corner { right: 0; bottom: 0; width: 43%; }

.banner.pos-center,
.banner.pos-left { overflow: auto; }
.banner.pos-center::-webkit-scrollbar, .banner.pos-left::-webkit-scrollbar { width: 6px; }
.banner.pos-center::-webkit-scrollbar-thumb, .banner.pos-left::-webkit-scrollbar-thumb { background: var(--banner-accent); }

/* bar layouts */
.cmp-bar { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 12px 8px; }
.cmp-bar-main { flex: 1 1 auto; min-width: 0; }
.cmp-bar .cmp-title { font-size: clamp(8px, 1.05vw, 14px); }
.cmp-bar .cmp-sub { font-size: clamp(5.5px, .6vw, 8.5px); margin-top: 1px; }
.cmp-bar .cmp-links { margin-top: 2px; }
.cmp-bar .cmp-actions { align-self: center; }
.cmp-brand {
  position: absolute;
  right: 10px;
  top: 6px;
  color: var(--banner-accent);
  font-size: clamp(5px, .55vw, 8px);
  font-weight: 700;
  letter-spacing: .01em;
  opacity: .9;
  pointer-events: none;
}
.cmp-bar.has-brand { padding-top: 15px; }

.cmp-title {
  margin: 0;
  font-family: var(--font-text);
  font-weight: 700;
  font-size: clamp(9px, 1.2vw, 15px);
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--banner-accent);
}
.cmp-sub {
  margin: 2px 0 0;
  font-size: clamp(5.5px, .6vw, 8.5px);
  line-height: 1.32;
  color: var(--banner-text);
  opacity: .86;
}
.cmp-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; font-size: clamp(5.5px, .58vw, 8px); }
.cmp-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--banner-accent);
  font: inherit;
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
  min-height: 0;
  line-height: 1.3;
}
.cmp-link:hover { text-decoration-thickness: 2px; }
.cmp-dot { opacity: .4; }
.cmp-actions { display: flex; align-items: center; gap: 6px; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.cmp-btn {
  border: 1.5px solid var(--banner-accent);
  background: transparent;
  color: var(--banner-text);
  border-radius: 999px;
  min-height: 26px;
  padding: 2px 11px;
  font-family: var(--font-text);
  font-size: clamp(6.5px, .66vw, 9px);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(27, 36, 64, .16);
  transition: transform .08s steps(2);
}
.cmp-btn:hover { transform: translateY(-1px); }
.cmp-btn:active { transform: translateY(1px); box-shadow: none; }
.cmp-btn.filled { background: var(--banner-accent); color: var(--banner-accent-text); border-color: var(--ink); }
.cmp-btn.ghost { border-color: var(--banner-text); color: var(--banner-text); }
.cmp-btn.text { border-color: transparent; background: transparent; box-shadow: none; color: var(--banner-text); text-decoration: underline; padding: 2px 4px; }
.cmp-btn.is-hidden { opacity: .3; filter: saturate(.35); transform: scale(.92); }

/* categories */
.cmp-checks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 11px; margin-top: 8px; }
.cmp-check { display: flex; align-items: center; gap: 4px; font-size: clamp(6px, .6vw, 8.5px); color: var(--banner-text); white-space: nowrap; }
.cmp-box {
  width: 11px;
  height: 11px;
  border: 1.5px solid var(--muted);
  background: transparent;
  display: inline-grid;
  place-items: center;
  font-size: 8px;
  line-height: 1;
  color: var(--banner-accent-text);
  flex: none;
}
.cmp-box.on { background: var(--banner-accent); border-color: var(--banner-accent); }
.cmp-box.na { background: rgba(140, 154, 142, .35); border-color: var(--muted); }
.cmp-box span { transform: translateY(-.5px); }

/* center red (att-003) */
.cmp-center-red { display: grid; grid-template-columns: 1.45fr 1fr; gap: 10px 14px; padding: 13px 15px 12px; }
.cmp-center-red .cmp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; grid-column: 1 / -1; }
.cmp-center-red .cmp-body { grid-column: 1; }
.cmp-center-red .cmp-checks { grid-column: 1; }
.cmp-center-red .cmp-actions { grid-column: 2; grid-row: 2 / span 2; flex-direction: column; align-items: stretch; justify-content: center; gap: 8px; }
.cmp-center-red .cmp-actions .cmp-btn { width: 100%; text-align: center; min-height: 30px; }
.cmp-center-red .cmp-title { font-size: clamp(10px, 1.25vw, 16px); }

/* center green (att-005) */
.cmp-panel { height: 100%; display: flex; flex-direction: column; padding: 11px 13px 10px; }
.cmp-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex: none; }
.cmp-panel-title { margin: 0; font-size: clamp(10px, 1.25vw, 16px); font-weight: 700; color: var(--banner-accent); line-height: 1.08; }
.cmp-close {
  width: 22px;
  height: 22px;
  flex: none;
  border: 1.5px solid var(--banner-accent);
  border-radius: 50%;
  background: transparent;
  color: var(--banner-accent);
  font-family: var(--font-num);
  font-size: 14px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.cmp-close:hover { background: var(--banner-accent); color: var(--banner-accent-text); }
.cmp-x-dark { position: absolute; top: 5px; right: 5px; z-index: 3; background: var(--banner-bg); }
.cmp-toggles { flex: 1 1 auto; overflow: hidden; margin-top: 5px; }
.cmp-toggle-row { display: grid; grid-template-columns: 13px 1fr auto; align-items: center; gap: 5px; padding: 4px 0 3px; border-bottom: 1px solid rgba(27, 36, 64, .13); }
.cmp-toggle-row .name { font-size: clamp(6.5px, .65vw, 9px); font-weight: 700; color: var(--banner-text); }
.cmp-toggle-row .count { font-size: clamp(5.5px, .55vw, 8px); font-weight: 400; opacity: .7; margin-left: 3px; }
.cmp-toggle-row .desc { grid-column: 2 / -1; font-size: clamp(5px, .5vw, 7.5px); line-height: 1.25; color: var(--banner-text); opacity: .65; margin-top: -1px; }
.cmp-switch {
  width: 26px;
  height: 13px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: rgba(140, 154, 142, .45);
  position: relative;
  flex: none;
  padding: 0;
  cursor: pointer;
}
.cmp-switch::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--ink);
  transition: left .12s steps(3);
}
.cmp-switch.on { background: var(--banner-accent); }
.cmp-switch.on::after { left: 14px; }
.cmp-panel-foot { flex: none; margin-top: 6px; }
.cmp-panel-foot .cmp-brand { position: static; display: block; text-align: right; margin-bottom: 3px; }
.cmp-panel-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.cmp-panel-actions .cmp-btn { min-height: 27px; }

/* corner card (att-007) */
.cmp-corner { position: relative; padding: 12px 14px 11px; }
.cmp-corner .cmp-title { font-size: clamp(10px, 1.2vw, 15px); }
.cmp-corner .cmp-brand { top: 9px; }
.cmp-corner .cmp-links { margin-top: 6px; }
.cmp-corner .cmp-actions { margin-top: 9px; justify-content: flex-start; }

/* generic banners */
.cmp-generic { padding: 9px 12px; }
.cmp-generic .cmp-title { color: var(--banner-text); }
.cmp-generic .cmp-sub { margin-top: 3px; }
.cmp-generic .cmp-actions { margin-left: auto; }
.cmp-generic-accept .cmp-actions .cmp-btn { min-height: 30px; padding: 2px 15px; }
.cmp-none-note {
  position: absolute;
  right: 2%;
  bottom: 2%;
  background: var(--banner-bg);
  border: 2px solid var(--banner-accent);
  color: var(--banner-text);
  padding: 4px 8px;
  font-family: var(--font-num);
  font-size: 7px;
  letter-spacing: .05em;
  box-shadow: 2px 2px 0 rgba(27,36,64,.2);
}

/* the persistent cookie button */
.cmp-floater {
  position: absolute;
  left: 1.2%;
  bottom: 1.2%;
  width: clamp(30px, 4.2vw, 44px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--banner-accent);
  box-shadow: 3px 3px 0 rgba(27, 36, 64, .26);
  padding: 2px;
  cursor: pointer;
  pointer-events: auto;
  z-index: 8;
  display: grid;
  place-items: center;
}
.cmp-floater img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; display: block; }
.cmp-floater[hidden] { display: none; }

.banner-off {
  position: absolute;
  left: 4.1%;
  bottom: 10.8%;
  z-index: 7;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-bottom: 5px solid var(--stamp);
  box-shadow: var(--hard-sm);
  padding: 6px 10px;
  font-family: var(--font-num);
  font-size: 8px;
  text-align: left;
  cursor: pointer;
  transform: rotate(-1deg);
  max-width: 190px;
}
.banner-off strong { display: block; color: var(--stamp); font-size: 10px; letter-spacing: .08em; }
.banner-off span { display: block; margin-top: 1px; opacity: .72; }

/* --- mascot --- */
.mascot-wrap {
  position: absolute;
  left: -10%;
  bottom: -4%;
  width: 15%;
  min-width: 110px;
  max-width: 158px;
  z-index: 8;
  pointer-events: none;
}
.mascot {
  width: 100%;
  height: auto;
  display: block;
  animation: mascot-breathe 2.6s steps(2, jump-none) infinite;
  transform-origin: 50% 100%;
  filter: drop-shadow(3px 4px 0 rgba(27, 36, 64, .20));
}
@keyframes mascot-breathe {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50% { transform: translateY(-1px) scaleY(1.014); }
}
.mascot-shadow {
  position: absolute;
  left: 12%;
  right: 10%;
  bottom: 1%;
  height: 7%;
  background: rgba(27, 36, 64, .18);
  border-radius: 50%;
  filter: blur(1px);
}
.mascot-bubble {
  position: absolute;
  left: 2%;
  bottom: 94%;
  width: max-content;
  max-width: 142px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 2px;
  padding: 5px 8px;
  font-size: 9.5px;
  line-height: 1.25;
  box-shadow: var(--hard-sm);
  transform: rotate(-1.5deg);
  z-index: 2;
}
.mascot-bubble::after {
  content: "";
  position: absolute;
  left: 24px;
  bottom: -7px;
  width: 10px;
  height: 10px;
  background: var(--paper);
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(45deg);
}

/* --- fine stamp --- */
.fine-stamp {
  position: absolute;
  right: -10%;
  bottom: 6%;
  width: 18%;
  aspect-ratio: 818 / 915;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-40px) rotate(4deg) scale(.94);
  transform-origin: 50% 60%;
  filter: drop-shadow(4px 5px 0 rgba(27, 36, 64, .2));
}
.fine-stamp .stamp-body { position: absolute; inset: 0; }
.fine-stamp .stamp-body img { width: 100%; height: 100%; object-fit: fill; display: block; }
.fine-stamp .stamp-print {
  position: absolute;
  left: 20.4%;
  top: 61.5%;
  width: 79.6%;
  height: 38.5%;
  overflow: hidden;
  opacity: 0;
}
.fine-stamp .stamp-print img {
  position: absolute;
  left: -25.66%;
  top: -159.8%;
  width: 125.65%;
  height: 260%;
  max-width: none;
}
.fine-stamp .stamp-word {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: clamp(10px, 1.5vw, 23px);
  color: var(--paper);
  letter-spacing: .02em;
  transform: rotate(-7deg) translateY(-2%);
  text-shadow: 0 1px 0 rgba(27, 36, 64, .25);
}
.fine-stamp.slam { animation: stamp-slam .52s cubic-bezier(.3, 1.5, .5, 1) forwards; }
.fine-stamp.slam .stamp-print { opacity: 1; transition: opacity .1s .28s linear; }
.fine-stamp.held { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
.fine-stamp.held .stamp-body { opacity: 0; transition: opacity .3s .5s linear; }
.fine-stamp.held .stamp-print { opacity: 1; }
@keyframes stamp-slam {
  0% { opacity: 0; transform: translateY(-52px) rotate(7deg) scale(.9); }
  58% { opacity: 1; transform: translateY(3px) rotate(0) scale(1.02); }
  74% { transform: translateY(-2px) rotate(-1deg) scale(1); }
  100% { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}
.window.jolt { animation: paper-jolt .34s steps(2) 1; }
@keyframes paper-jolt {
  0% { transform: rotate(.12deg) translate(0, 0); }
  25% { transform: rotate(.12deg) translate(2px, 4px); }
  55% { transform: rotate(.12deg) translate(-2px, 2px); }
  100% { transform: rotate(.12deg) translate(0, 0); }
}

/* ============ LEDGER ============ */

.ledger {
  position: relative;
  min-width: 0;
  min-height: 100%;
  align-self: stretch;
  filter: drop-shadow(5px 6px 0 rgba(27, 36, 64, .22));
  transform: rotate(.2deg);
}
.ledger-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; display: block; }
.ledger-inner {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: 6.5% 7.5% 4.5%;
  display: flex;
  flex-direction: column;
  gap: 2.1%;
  min-height: 0;
}
.ledger-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.fiscal-tag { display: flex; align-items: center; gap: 4px; flex: none; align-self: center; }
.fiscal-tag img { width: clamp(22px, 2.15vw, 34px); height: auto; display: block; filter: drop-shadow(1px 1px 0 rgba(27,36,64,.2)); }
.fiscal-tag span {
  font-family: var(--font-num);
  font-size: clamp(4.5px, .42vw, 6px);
  line-height: 1.1;
  letter-spacing: .03em;
  color: rgba(27, 36, 64, .72);
}
.eyebrow {
  display: block;
  font-family: var(--font-text);
  font-size: clamp(6px, .56vw, 8.5px);
  font-weight: 700;
  letter-spacing: .17em;
  color: var(--ledger);
  line-height: 1.3;
}
.ledger .eyebrow { color: rgba(27, 36, 64, .78); }
.ledger-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(15px, 1.35vw, 21px);
  line-height: 1;
  text-transform: none;
  letter-spacing: -.01em;
}
.day-chip {
  font-family: var(--font-num);
  font-size: clamp(8px, .72vw, 10.5px);
  border: 1.5px solid var(--ink);
  background: rgba(242, 233, 216, .7);
  padding: 2px 5px;
  white-space: nowrap;
  transform: rotate(1.2deg);
}
.day-chip b { font-size: 1.15em; }

.counter-row { display: flex; align-items: center; gap: 5px; }
.counter-sign {
  width: clamp(20px, 1.7vw, 26px);
  height: clamp(28px, 2.5vw, 38px);
  display: grid;
  place-items: center;
  background: var(--ledger);
  color: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 3px;
  font-family: var(--font-num);
  font-weight: 700;
  font-size: clamp(14px, 1.4vw, 21px);
  box-shadow: var(--hard-sm);
  flex: none;
}
.counter-sign.neg { background: var(--stamp); }
.counter { display: flex; gap: clamp(2px, .25vw, 4px); align-items: stretch; }
.counter .cell {
  width: clamp(20px, 1.85vw, 29px);
  height: clamp(29px, 2.65vw, 41px);
  border: 2px solid var(--ink);
  border-radius: 3px;
  background: var(--ledger);
  overflow: hidden;
  position: relative;
  box-shadow: var(--hard-sm);
  flex: none;
}
.counter .cell::after {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1px solid rgba(242, 233, 216, .16);
  border-radius: 1px;
  pointer-events: none;
}
.counter .strip { display: flex; flex-direction: column; transition: transform .42s cubic-bezier(.42, 1.35, .55, 1); }
.counter .strip span {
  height: clamp(29px, 2.65vw, 41px);
  display: grid;
  place-items: center;
  font-family: var(--font-num);
  font-weight: 700;
  font-size: clamp(17px, 1.6vw, 25px);
  line-height: 1;
  color: var(--paper);
}
.counter-red .cell { background: var(--stamp); }
.counter-red .cell::after { border-color: rgba(242, 233, 216, .2); }
.counter-caption {
  font-family: var(--font-num);
  font-size: clamp(6px, .54vw, 8px);
  color: rgba(27, 36, 64, .62);
  margin-top: -1.1%;
  margin-left: calc(clamp(20px, 1.7vw, 26px) + 6px);
}

.fine-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: rgba(242, 233, 216, .55);
  border: 1px solid rgba(27, 36, 64, .16);
  padding: 4px 7px;
  margin: 0 -7px;
}
.fine-head { display: flex; align-items: baseline; gap: 7px; }
.fine-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(12px, 1.05vw, 16px);
  font-weight: 400;
  color: var(--stamp);
}
.fine-tag {
  font-family: var(--font-num);
  font-size: 6.5px;
  letter-spacing: .12em;
  border: 1px solid var(--stamp);
  color: var(--stamp);
  padding: 0 3px;
  opacity: .8;
}
.counter-red { filter: drop-shadow(1px 2px 0 rgba(27, 36, 64, .14)); }
.counter-red .cell { border-color: var(--ink); }

.risk-block { display: flex; flex-direction: column; gap: 3px; }
.risk-head { display: flex; justify-content: space-between; align-items: baseline; font-size: clamp(7px, .62vw, 9.5px); font-weight: 700; letter-spacing: .03em; }
.risk-head b { font-family: var(--font-num); color: var(--stamp); font-size: 1.12em; }
.risk-track {
  position: relative;
  height: clamp(9px, .9vw, 13px);
  border: 2px solid var(--ink);
  background: rgba(242, 233, 216, .82);
  overflow: hidden;
  box-shadow: 1px 2px 0 rgba(27,36,64,.15);
}
.risk-fill {
  height: 100%;
  width: 0%;
  background: var(--stamp);
  transition: width .8s cubic-bezier(.34, 1.3, .6, 1);
  position: relative;
}
.risk-fill::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--ink);
}
.risk-tolerance {
  position: absolute;
  left: 55%;
  top: 0;
  bottom: 0;
  width: 10%;
  border-left: 1.5px dashed rgba(27, 36, 64, .62);
  border-right: 1.5px dashed rgba(27, 36, 64, .62);
  background: repeating-linear-gradient(135deg, transparent 0 3px, rgba(27, 36, 64, .14) 3px 4px);
  pointer-events: none;
}
.risk-note { font-family: var(--font-num); font-size: clamp(6px, .56vw, 8.5px); color: rgba(27,36,64,.7); }

.goal-block { display: flex; flex-direction: column; gap: 3px; }
.goal-head { display: flex; justify-content: space-between; align-items: baseline; font-size: clamp(7px, .62vw, 9.5px); font-weight: 700; }
.goal-head b { font-family: var(--font-num); font-size: 1.14em; }
.goal-track {
  position: relative;
  height: clamp(10px, .95vw, 14px);
  border: 2px solid var(--ink);
  background: rgba(242, 233, 216, .82);
  overflow: hidden;
  box-shadow: 1px 2px 0 rgba(27,36,64,.15);
}
.goal-fill { height: 100%; width: 0%; background: var(--ledger); transition: width .75s cubic-bezier(.34, 1.3, .6, 1); }
.goal-target { position: absolute; right: 0; top: 0; bottom: 0; width: 2px; background: var(--ink); }
.goal-note { display: flex; justify-content: space-between; font-family: var(--font-num); font-size: clamp(6px, .56vw, 8.5px); color: rgba(27,36,64,.72); }

.mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px 14px;
  margin-top: 1%;
}
.mini-stats > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  border-bottom: 1px solid rgba(46, 92, 78, .25);
  padding: 2px 0;
  font-size: clamp(6.5px, .58vw, 8.5px);
}
.mini-stats span { opacity: .84; white-space: nowrap; }
.mini-stats b { font-family: var(--font-num); font-size: clamp(8px, .74vw, 10.5px); font-weight: 700; white-space: nowrap; }

.rule-line { height: 2px; background: rgba(27, 36, 64, .28); margin: .4% 0; }
.quick-tabs { display: flex; gap: 3px; flex-wrap: nowrap; }
.quick-tab {
  flex: 1 1 auto;
  border: 1.5px solid var(--ink);
  border-bottom-width: 3px;
  background: rgba(227, 195, 135, .72);
  padding: 4px 2px;
  font-size: clamp(6.5px, .58vw, 8.5px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  cursor: pointer;
  min-height: 26px;
  transition: transform .1s;
  position: relative;
}
.quick-tab:hover { background: var(--paper); transform: translateY(-1px); }
.quick-tab em {
  font-style: normal;
  background: var(--stamp);
  color: var(--paper);
  border-radius: 8px;
  padding: 0 4px;
  font-family: var(--font-num);
  font-size: .92em;
  margin-left: 1px;
}
.quick-tab em.zero { background: var(--muted); }

.roll-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 14px;
  background: var(--ledger);
  color: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 3px 4px 0 rgba(27, 36, 64, .34);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: clamp(13px, 1.15vw, 18px);
  letter-spacing: .01em;
  text-transform: uppercase;
  transition: transform .09s steps(2), box-shadow .09s steps(2), filter .15s;
  margin-top: 1%;
}
.roll-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.roll-btn:active, .roll-btn.stamping { transform: translate(3px, 4px); box-shadow: 0 0 0 rgba(0,0,0,0); }
.roll-btn:disabled { opacity: .55; cursor: wait; }
.roll-main { pointer-events: none; }
.roll-key {
  font-family: var(--font-num);
  font-size: 8px;
  background: rgba(242, 233, 216, .16);
  border: 1px solid rgba(242, 233, 216, .5);
  padding: 1px 5px;
  letter-spacing: .08em;
  pointer-events: none;
}
.day-note {
  margin: 0;
  font-family: var(--font-num);
  font-size: clamp(6.5px, .58vw, 8.5px);
  line-height: 1.3;
  color: rgba(27, 36, 64, .76);
  min-height: 2.6em;
}

/* ============ FOOTER ============ */

.bottom {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: clamp(8px, 1.4vw, 18px);
  min-height: 104px;
  flex: 0 0 auto;
  margin-top: auto;
  padding-top: 2px;
}
.cal-wrap {
  position: relative;
  width: clamp(62px, 5.7vw, 88px);
  flex: none;
  align-self: flex-end;
  filter: drop-shadow(3px 4px 0 rgba(27, 36, 64, .22));
  transform: rotate(-.6deg);
}
.cal-wrap > img { width: 100%; height: auto; display: block; }
.cal-copy {
  position: absolute;
  left: 21%;
  top: 21%;
  width: 64%;
  height: 52%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--ink);
  line-height: .9;
}
.cal-kicker { font-family: var(--font-num); font-size: clamp(5px, .5vw, 7px); letter-spacing: .18em; font-weight: 700; }
.cal-copy b { font-family: var(--font-num); font-weight: 700; font-size: clamp(22px, 2.4vw, 38px); line-height: .92; }
.cal-sub { font-family: var(--font-num); font-size: clamp(5px, .5vw, 7px); letter-spacing: .12em; font-weight: 700; margin-top: 2px; }

.hintbar {
  flex: 0 1 900px;
  min-width: 320px;
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.2vw, 20px);
  background: rgba(227, 195, 135, .92);
  border: 2px solid var(--ink);
  box-shadow: var(--hard);
  padding: 7px clamp(9px, 1.2vw, 18px);
  position: relative;
  transform: rotate(.08deg);
}
.hintbar::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 12%;
  bottom: 12%;
  width: 7px;
  background: repeating-linear-gradient(180deg, var(--paper) 0 4px, transparent 4px 8px);
  border-left: 1.5px solid rgba(27,36,64,.5);
}
.hint-main { flex: 1 1 auto; min-width: 0; }
.hint-kicker { display: block; font-family: var(--font-num); font-size: 7px; font-weight: 700; letter-spacing: .16em; color: var(--ledger); margin-bottom: 1px; }
.hint-main p { margin: 0; font-size: clamp(8px, .76vw, 11px); line-height: 1.32; font-weight: 500; }
.hint-shortcuts {
  flex: none;
  display: flex;
  align-items: center;
  gap: clamp(5px, .8vw, 12px);
  font-size: clamp(6.5px, .58vw, 8.5px);
  color: rgba(27,36,64,.78);
  white-space: nowrap;
}
.hint-shortcuts b { font-family: var(--font-num); border: 1px solid var(--ink); padding: 0 3px; font-size: .95em; background: rgba(242,233,216,.6); }
.hint-help {
  border: 1.5px solid var(--ink);
  background: var(--paper);
  padding: 4px 8px;
  font-size: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(27,36,64,.24);
  min-height: 26px;
  white-space: nowrap;
}
.hint-help:hover { background: #fff8ea; }

.jar-wrap {
  position: relative;
  width: clamp(56px, 5.3vw, 80px);
  flex: none;
  align-self: flex-end;
  aspect-ratio: 658 / 899;
}
.jar-base, .jar-fill { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.jar-base { opacity: .4; filter: saturate(.55) contrast(.94); }
.jar-fill { overflow: hidden; clip-path: inset(28% 0 0 0); transition: clip-path .7s cubic-bezier(.4, 1.2, .5, 1); }
.jar-fill img { width: 100%; height: 100%; display: block; }
.jar-line {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 72%;
  height: 1.5px;
  background: var(--ledger);
  opacity: .55;
  transition: top .7s cubic-bezier(.4, 1.2, .5, 1);
}
.jar-tag {
  position: absolute;
  right: -22%;
  top: 42%;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  box-shadow: 1px 2px 0 rgba(27,36,64,.26);
  padding: 1px 4px;
  transform: rotate(-3deg);
  text-align: center;
  font-size: 5.5px;
  letter-spacing: .1em;
  z-index: 2;
  pointer-events: none;
}
.jar-tag span { display: block; opacity: .7; font-weight: 700; }
.jar-tag b { display: block; font-family: var(--font-num); font-size: 9px; line-height: 1; }

/* ============ DRAWER ============ */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(27, 36, 64, .52);
  opacity: 0;
  transition: opacity .18s linear;
}
.drawer-backdrop.show { opacity: 1; }
.drawer {
  position: fixed;
  z-index: 41;
  left: 50%;
  top: 50%;
  width: min(940px, 94vw);
  max-height: 90svh;
  transform: translate(-50%, -48%) rotate(-.12deg);
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 12px 14px 0 rgba(27, 36, 64, .4);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s linear, transform .2s cubic-bezier(.3, 1.3, .55, 1);
}
.drawer.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) rotate(-.12deg);
}
.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px 10px;
  border-bottom: 2px solid rgba(27, 36, 64, .28);
  flex: none;
}
.drawer-head h2 {
  margin: 1px 0 1px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(20px, 2.1vw, 30px);
  line-height: 1;
  text-transform: uppercase;
}
.drawer-sub { margin: 0; font-size: 10.5px; color: rgba(27, 36, 64, .7); }
.drawer-close {
  width: 38px;
  height: 38px;
  flex: none;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: var(--hard-sm);
  font-family: var(--font-num);
  font-size: 22px;
  cursor: pointer;
  display: grid;
  place-items: center;
  line-height: 1;
}
.drawer-close:hover { background: var(--stamp); color: var(--paper); }
.drawer-tabs {
  display: flex;
  gap: 3px;
  padding: 8px 18px 0;
  flex: none;
  flex-wrap: wrap;
}
.drawer-tabs button {
  border: 2px solid var(--ink);
  border-bottom: none;
  background: rgba(227, 195, 135, .62);
  padding: 7px 16px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  cursor: pointer;
  position: relative;
  top: 2px;
  min-height: 32px;
}
.drawer-tabs button.active { background: var(--paper); top: 0; padding-bottom: 8px; border-bottom: 2px solid var(--paper); z-index: 2; }
.drawer-tabs button:hover { background: rgba(242, 233, 216, .9); }
.drawer-body {
  overflow-y: auto;
  padding: 14px 22px 22px;
  border-top: 2px solid var(--ink);
  flex: 1 1 auto;
  min-height: 0;
  background: var(--paper);
}
.drawer-body::-webkit-scrollbar { width: 10px; }
.drawer-body::-webkit-scrollbar-track { background: rgba(227,195,135,.4); }
.drawer-body::-webkit-scrollbar-thumb { background: var(--ink); border: 2px solid var(--paper); }

/* drawer content */
.dcard {
  background: #f7efe1;
  border: 2px solid var(--ink);
  box-shadow: var(--hard-sm);
  padding: 12px 14px;
  margin-bottom: 12px;
  position: relative;
}
.dcard:last-child { margin-bottom: 0; }
.dcard h3 {
  margin: 0 0 2px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.05;
  text-transform: uppercase;
}
.dcard .sub { margin: 0 0 9px; font-size: 10px; line-height: 1.4; color: rgba(27, 36, 64, .72); max-width: 72ch; }
.dgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dgrid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }

.mode-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mode-card {
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 2px 2px 0 rgba(27,36,64,.22);
  padding: 8px;
  text-align: left;
  cursor: pointer;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: transform .1s;
}
.mode-card:hover { transform: translateY(-1px); }
.mode-card.active { background: #fff8ea; box-shadow: 4px 4px 0 rgba(191,59,43,.5); border-color: var(--stamp); }
.mode-card .mc-stamp {
  width: 26px;
  height: 20px;
  border: 1.5px solid var(--ink);
  display: grid;
  place-items: center;
  font-family: var(--font-num);
  font-size: 10px;
  font-weight: 700;
  color: var(--paper);
  background: var(--muted);
}
.mode-card.active .mc-stamp { background: var(--stamp); }
.mode-card strong { font-size: 10.5px; line-height: 1.15; }
.mode-card small { font-size: 8.5px; line-height: 1.25; color: rgba(27,36,64,.7); }

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed rgba(27, 36, 64, .26);
}
.toggle-row:last-child { border-bottom: 0; }
.toggle-row .tr-text { flex: 1 1 auto; min-width: 0; }
.toggle-row strong { display: block; font-size: 10.5px; line-height: 1.25; }
.toggle-row small { display: block; font-size: 8.5px; line-height: 1.3; color: rgba(27,36,64,.68); }
.toggle-row .badge { flex: none; font-family: var(--font-num); font-size: 7px; letter-spacing: .04em; padding: 1px 4px; border: 1px solid currentColor; }
.badge.illegal { color: var(--stamp); }
.badge.legal { color: var(--ledger); }
.toggle {
  flex: none;
  width: 48px;
  height: 26px;
  border: 2px solid var(--ink);
  background: var(--muted);
  position: relative;
  cursor: pointer;
  padding: 0;
  transition: background .12s linear;
}
.toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--paper);
  border: 1.5px solid var(--ink);
  transition: left .12s steps(3);
}
.toggle[aria-pressed="true"] { background: var(--ledger); }
.toggle[aria-pressed="true"]::after { left: 24px; }
.toggle:disabled { opacity: .4; cursor: not-allowed; }
.toggle-label { font-family: var(--font-num); font-size: 7px; width: 20px; text-align: center; flex: none; }

.estimate-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 2px dashed rgba(27,36,64,.24);
}
.estimate-strip div {
  flex: 1 1 120px;
  background: rgba(227,195,135,.3);
  border: 1px solid rgba(27,36,64,.3);
  padding: 5px 7px;
  font-size: 8px;
}
.estimate-strip span { display: block; opacity: .7; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; font-size: 7px; }
.estimate-strip b { font-family: var(--font-num); font-size: 13px; }

.clause-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 7px 0;
  border-bottom: 1px dashed rgba(27,36,64,.26);
}
.clause-row:last-child { border-bottom: 0; }
.clause-check {
  flex: none;
  width: 22px;
  height: 22px;
  border: 2px solid var(--ink);
  background: var(--paper);
  display: grid;
  place-items: center;
  font-family: var(--font-num);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  margin-top: 1px;
}
.clause-check[aria-pressed="true"] { background: var(--ledger); color: var(--paper); }
.clause-text { flex: 1 1 auto; min-width: 0; }
.clause-text strong { display: block; font-size: 10.5px; line-height: 1.25; }
.clause-text small { display: block; font-size: 8.5px; line-height: 1.3; color: rgba(27,36,64,.7); }
.law-badges { flex: none; display: flex; gap: 3px; align-items: center; padding-top: 2px; flex-wrap: wrap; max-width: 104px; justify-content: flex-end; }
.law-badge {
  font-family: var(--font-num);
  font-size: 6.5px;
  font-weight: 700;
  border: 1px solid rgba(27,36,64,.4);
  padding: 1px 3px;
  color: rgba(27,36,64,.5);
}
.law-badge.req { border-color: var(--stamp); color: var(--stamp); }
.law-badge.met { border-color: var(--ledger); color: var(--ledger); }

.policy-preview {
  margin-top: 9px;
  background: #fffaf0;
  border: 1px solid rgba(27,36,64,.5);
  padding: 10px 12px;
  font-family: var(--font-num);
  font-size: 8.5px;
  line-height: 1.55;
  max-height: 150px;
  overflow: auto;
  box-shadow: inset 2px 2px 0 rgba(27,36,64,.07);
}
.policy-preview h4 { margin: 0 0 3px; font-family: var(--font-display); font-size: 11px; }
.policy-preview p { margin: 0 0 4px; }
.policy-card { padding-top: 40px; }
.policy-stamp {
  position: absolute;
  right: 12px;
  top: 9px;
  transform: rotate(4deg);
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: .05em;
  border: 2px solid var(--stamp);
  color: var(--stamp);
  padding: 2px 6px;
  opacity: .85;
  background: rgba(242,233,216,.7);
}
.policy-stamp.ok { border-color: var(--ledger); color: var(--ledger); }

.spam-meter { display: flex; align-items: center; gap: 9px; margin: 7px 0 10px; }
.spam-meter .bar {
  flex: 1 1 auto;
  height: 16px;
  border: 2px solid var(--ink);
  background: rgba(242,233,216,.8);
  position: relative;
  overflow: hidden;
}
.spam-meter .bar > i { display: block; height: 100%; background: var(--stamp); width: 18%; transition: width .4s; }
.spam-meter b { font-family: var(--font-num); font-size: 18px; width: 48px; text-align: right; }
.mail-list { display: flex; flex-direction: column; gap: 7px; }
.mail-card {
  background: #fffaf0;
  border: 1.5px solid var(--ink);
  border-left: 5px solid var(--muted);
  padding: 8px 10px;
  position: relative;
  box-shadow: 2px 2px 0 rgba(27,36,64,.14);
}
.mail-top { display: flex; justify-content: space-between; gap: 8px; font-family: var(--font-num); font-size: 7.5px; color: rgba(27,36,64,.65); }
.mail-subject { font-weight: 700; font-size: 10.5px; margin: 2px 0 1px; line-height: 1.25; }
.mail-body { font-size: 8.5px; line-height: 1.35; color: rgba(27,36,64,.78); }
.mail-actions { display: flex; gap: 6px; margin-top: 7px; }
.mini-btn {
  border: 1.5px solid var(--ink);
  background: var(--paper);
  padding: 5px 9px;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  min-height: 30px;
  box-shadow: 1px 2px 0 rgba(27,36,64,.2);
}
.mini-btn:hover { background: #fff8ea; }
.mini-btn.danger { background: var(--stamp); color: var(--paper); }
.mini-btn.good { background: var(--ledger); color: var(--paper); }
.mini-btn:active { transform: translate(1px, 1px); box-shadow: none; }
.mail-card.leaving { animation: mail-away .3s ease-in forwards; }
@keyframes mail-away {
  to { opacity: 0; transform: translateX(24px) rotate(1.5deg); }
}
.inbox-empty {
  border: 2px dashed rgba(27,36,64,.4);
  padding: 16px;
  text-align: center;
  font-family: var(--font-num);
  font-size: 10px;
  color: rgba(27,36,64,.7);
}
.filter-levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.filter-card {
  border: 2px solid rgba(27,36,64,.5);
  background: var(--paper);
  padding: 8px;
  font-size: 9px;
  line-height: 1.3;
  position: relative;
}
.filter-card.active { border-color: var(--ledger); background: rgba(46,92,78,.08); box-shadow: inset 0 0 0 2px rgba(46,92,78,.18); }
.filter-card strong { display: block; font-size: 10px; }
.filter-card small { display: block; color: rgba(27,36,64,.7); margin: 2px 0 5px; font-size: 8px; }
.price { font-family: var(--font-num); font-size: 10px; font-weight: 700; }

.upgrade-card {
  position: relative;
  border: 2px solid var(--ink);
  background: #fffaf0;
  box-shadow: var(--hard-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 136px;
}
.upgrade-card.has-portrait { padding-right: 58px; }
.upgrade-portrait {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 48px;
  height: 56px;
  object-fit: contain;
  opacity: .95;
}
.upgrade-card h4 { margin: 0; font-family: var(--font-display); font-size: 13px; line-height: 1.1; text-transform: uppercase; }
.upgrade-card p { margin: 0; font-size: 8.5px; line-height: 1.35; color: rgba(27,36,64,.72); flex: 1 1 auto; }
.upgrade-card .effect { font-family: var(--font-num); font-size: 8px; color: var(--ledger); }
.buy-btn {
  border: 1.5px solid var(--ink);
  background: var(--manila);
  padding: 6px 8px;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(27,36,64,.24);
  min-height: 34px;
}
.buy-btn:hover { background: var(--paper); }
.buy-btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.owned-stamp {
  font-family: var(--font-num);
  font-size: 8px;
  color: var(--ledger);
  border: 1px solid var(--ledger);
  padding: 2px 6px;
  align-self: flex-start;
  transform: rotate(-2deg);
}

/* site type + banner models + colour tool */
.step-line { display: flex; align-items: center; gap: 7px; margin-bottom: 2px; }
.step-line .step-n { width: 21px; height: 21px; font-size: 10px; margin: 0; flex: none; }
.step-line h3 { margin: 0; }
.site-type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.site-type-card {
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 2px 2px 0 rgba(27,36,64,.2);
  padding: 0;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform .1s;
}
.site-type-card:hover { transform: translateY(-1px); }
.site-type-card.active { border-color: var(--stamp); box-shadow: 3px 3px 0 rgba(191,59,43,.42); }
.site-type-card .stc-strip { display: flex; height: 17px; border-bottom: 1.5px solid var(--ink); }
.site-type-card .stc-strip i { flex: 1; display: block; }
.site-type-card .stc-body { display: block; padding: 6px 8px 7px; }
.site-type-card strong { display: block; font-size: 10px; line-height: 1.2; }
.site-type-card small { display: block; margin-top: 1px; font-size: 8px; line-height: 1.3; color: rgba(27,36,64,.7); }
.site-type-card em { display: block; margin-top: 3px; font-family: var(--font-num); font-style: normal; font-size: 7px; color: var(--ledger); }
.banner-style-group { font-family: var(--font-num); font-size: 7px; font-weight: 700; letter-spacing: .1em; color: rgba(27,36,64,.6); margin: 9px 0 4px; }
.banner-style-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.banner-style-card {
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 2px 2px 0 rgba(27,36,64,.2);
  padding: 6px;
  text-align: left;
  cursor: pointer;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: transform .1s;
}
.banner-style-card:hover { transform: translateY(-1px); }
.banner-style-card.active { border-color: var(--stamp); box-shadow: 3px 3px 0 rgba(191,59,43,.42); background: #fff8ea; }
.banner-style-card strong { font-size: 8.5px; line-height: 1.15; }
.banner-style-card small { font-size: 7px; line-height: 1.25; color: rgba(27,36,64,.65); }
.mini-cmp {
  position: relative;
  display: block;
  height: 34px;
  background: #fffcf2;
  border: 1px solid var(--ink);
  overflow: hidden;
  flex: none;
}
.mini-cmp i { position: absolute; display: block; background: var(--mc, #1E6BE0); }
.mini-cmp.mini-center i:nth-child(1) { left: 14%; top: 18%; width: 72%; height: 64%; }
.mini-cmp.mini-center i:nth-child(2) { left: 22%; top: 34%; width: 30%; height: 7%; background: rgba(27,36,64,.35); }
.mini-cmp.mini-center i:nth-child(3) { right: 20%; bottom: 24%; width: 22%; height: 20%; }
.mini-cmp.mini-left i:nth-child(1) { left: 4%; top: 8%; width: 48%; height: 84%; }
.mini-cmp.mini-left i:nth-child(2) { left: 8%; top: 25%; width: 34%; height: 5%; background: rgba(27,36,64,.3); }
.mini-cmp.mini-left i:nth-child(3) { left: 8%; top: 38%; width: 36%; height: 5%; background: rgba(27,36,64,.22); }
.mini-cmp.mini-bottom i:nth-child(1) { left: 0; right: 0; bottom: 0; height: 46%; }
.mini-cmp.mini-top i:nth-child(1) { left: 0; right: 0; top: 0; height: 46%; }
.mini-cmp.mini-corner i:nth-child(1) { right: 4%; bottom: 5%; width: 54%; height: 58%; }
.mini-cmp.mini-generic i:nth-child(1) { left: 0; right: 0; bottom: 0; height: 36%; opacity: .85; }
.mini-cmp.mini-generic i:nth-child(2) { right: 8%; bottom: 28%; width: 25%; height: 18%; background: var(--ink); }
.mini-cmp.mini-none i:nth-child(1) { left: 40%; top: 34%; width: 20%; height: 2px; background: var(--stamp); }
.mini-cmp.mini-none i:nth-child(2) { left: 49%; top: 16%; width: 2px; height: 70%; background: var(--stamp); }

.colour-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 10px; }
.colour-field {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(27,36,64,.35);
  background: rgba(242,233,216,.5);
  padding: 4px 6px;
  font-size: 8px;
  font-weight: 600;
}
.colour-field span { flex: 1 1 auto; min-width: 0; }
.colour-field input[type="color"] {
  width: 26px;
  height: 22px;
  border: 1.5px solid var(--ink);
  padding: 1px;
  background: var(--paper);
  cursor: pointer;
}
.colour-field input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.colour-field input[type="color"]::-webkit-color-swatch { border: 0; }
.colour-subhead { font-family: var(--font-num); font-size: 7px; font-weight: 700; letter-spacing: .08em; color: rgba(27,36,64,.62); margin: 8px 0 4px; }
.complement-row { display: flex; align-items: stretch; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.comp-swatch {
  flex: 1 1 58px;
  min-height: 46px;
  border: 2px solid var(--ink);
  background: var(--paper);
  cursor: pointer;
  padding: 0;
  text-align: left;
  position: relative;
  overflow: hidden;
}
.comp-swatch .cs-colour { display: block; height: 19px; border-bottom: 1.5px solid var(--ink); }
.comp-swatch .cs-label { display: block; font-size: 6.5px; line-height: 1.2; padding: 2px 3px; }
.comp-swatch .cs-ratio { display: block; font-family: var(--font-num); font-size: 6.5px; padding: 0 3px 2px; color: rgba(27,36,64,.65); }
.comp-swatch:hover { transform: translateY(-1px); }
.contrast-box {
  margin-top: 9px;
  border: 2px solid var(--ink);
  background: rgba(242,233,216,.55);
  padding: 7px 9px;
}
.contrast-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 8px; font-weight: 700; }
.contrast-head b { font-family: var(--font-num); font-size: 13px; }
.contrast-track { height: 9px; border: 1.5px solid var(--ink); background: var(--paper); margin: 4px 0 3px; position: relative; overflow: hidden; }
.contrast-fill { height: 100%; width: 0%; background: var(--ledger); transition: width .15s linear; }
.contrast-verdict { font-family: var(--font-num); font-size: 7px; color: rgba(27,36,64,.7); }
.contrast-stats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; font-size: 7.5px; }
.contrast-stats b { font-family: var(--font-num); }
.auto-colour-btn {
  border: 1.5px solid var(--ink);
  background: var(--manila);
  padding: 3px 7px;
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 1px 2px 0 rgba(27,36,64,.2);
  margin-top: 6px;
}
.auto-colour-btn:hover { background: var(--paper); }


/* ============ MODALS ============ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(27, 36, 64, .56);
  opacity: 0;
  transition: opacity .18s linear;
}
.modal-backdrop.show { opacity: 1; }

.modal {
  position: fixed;
  z-index: 51;
  left: 50%;
  top: 50%;
  width: min(900px, 94vw);
  max-height: 91svh;
  overflow-y: auto;
  transform: translate(-50%, -47%);
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 12px 14px 0 rgba(27, 36, 64, .42);
  padding: 24px 28px 22px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s linear, transform .2s cubic-bezier(.3,1.3,.55,1);
}
.modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%); }
.modal-close {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 36px;
  height: 36px;
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: var(--hard-sm);
  font-family: var(--font-num);
  font-size: 21px;
  cursor: pointer;
  display: grid;
  place-items: center;
  line-height: 1;
}
.modal-close:hover { background: var(--stamp); color: var(--paper); }
.modal h2 {
  margin: 2px 0 12px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(24px, 3vw, 42px);
  line-height: .96;
  text-transform: uppercase;
}
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.help-step {
  border: 2px solid var(--ink);
  background: #f7efe1;
  padding: 11px 13px;
  position: relative;
  box-shadow: var(--hard-sm);
}
.step-n {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brass);
  border: 2px solid var(--ink);
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 4px;
}
.help-step h3 { margin: 0 0 3px; font-family: var(--font-display); font-weight: 400; font-size: 14px; text-transform: uppercase; line-height: 1.1; }
.help-step p { margin: 0; font-size: 9.5px; line-height: 1.45; color: rgba(27,36,64,.8); }
.help-foot { margin-top: 13px; border-top: 2px dashed rgba(27,36,64,.3); padding-top: 10px; }
.help-foot p { margin: 0 0 4px; font-size: 10px; line-height: 1.45; }
.fineprint { font-size: 8px; color: rgba(27,36,64,.66); font-style: italic; }
.big-ink-btn {
  margin-top: 12px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  padding: 11px 18px;
  font-family: var(--font-display);
  font-size: 15px;
  cursor: pointer;
  box-shadow: 3px 4px 0 rgba(27,36,64,.34);
  min-height: 46px;
  text-transform: uppercase;
}
.big-ink-btn:hover { background: var(--ledger); }

/* end modal */
.end-modal { width: min(820px, 94vw); }
.end-head { text-align: center; margin-bottom: 8px; }
.end-head .eyebrow { color: var(--stamp); }
.end-grade {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 52px);
  line-height: .95;
  text-transform: uppercase;
  margin: 2px 0 4px;
}
.end-grade.bad { color: var(--stamp); }
.end-grade.good { color: var(--ledger); }
.end-sub { font-size: 11px; line-height: 1.45; max-width: 60ch; margin: 0 auto 12px; color: rgba(27,36,64,.8); }
.end-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.end-fiscal {
  position: absolute;
  right: 16px;
  top: 12px;
  width: 64px;
  height: 74px;
  object-fit: contain;
  transform: rotate(4deg);
  opacity: .9;
}
.end-fiscal-tag {
  position: absolute;
  right: 10px;
  top: 80px;
  font-family: var(--font-num);
  font-size: 6px;
  letter-spacing: .04em;
  color: rgba(27,36,64,.65);
  transform: rotate(4deg);
}
.end-stat { border: 2px solid var(--ink); background: #f7efe1; padding: 8px; text-align: center; box-shadow: var(--hard-sm); }
.end-stat span { display: block; font-size: 7.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .68; }
.end-stat b { display: block; font-family: var(--font-num); font-size: 17px; line-height: 1.2; }
.end-stat b.red { color: var(--stamp); }
.end-stamp {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(16px, 2.4vw, 28px);
  letter-spacing: .04em;
  color: var(--stamp);
  border: 3px solid var(--stamp);
  padding: 3px 14px;
  transform: rotate(-3deg);
  margin: 4px 0 2px;
  opacity: .9;
}
.end-stamp.ok { color: var(--ledger); border-color: var(--ledger); }
.end-note { font-family: var(--font-num); font-size: 8.5px; line-height: 1.5; text-align: center; color: rgba(27,36,64,.7); margin: 7px 0; }
.end-board { margin: 12px 0; border: 2px solid rgba(27,36,64,.4); background: #f7efe1; padding: 9px 11px; }
.end-board h4 { margin: 0 0 5px; font-family: var(--font-num); font-size: 8px; letter-spacing: .12em; text-transform: uppercase; }
.board-row { display: flex; gap: 8px; align-items: baseline; font-family: var(--font-num); font-size: 9.5px; padding: 2px 0; border-bottom: 1px dotted rgba(27,36,64,.22); }
.board-row:last-child { border-bottom: 0; }
.board-row .rank { width: 18px; opacity: .6; }
.board-row .who { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-row .who a { color: var(--ledger); }
.board-row .val { font-weight: 700; }
.board-row.mine { background: rgba(201,162,39,.18); }
.end-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: center; margin-top: 12px; }
.end-actions .big-ink-btn { margin-top: 0; }
.end-actions .ghost-btn {
  border: 2px solid var(--ink);
  background: var(--paper);
  padding: 10px 16px;
  font-family: var(--font-display);
  font-size: 13px;
  cursor: pointer;
  min-height: 44px;
  text-transform: uppercase;
  box-shadow: var(--hard-sm);
}
.end-actions .ghost-btn:hover { background: var(--manila); }

/* ============ TOAST ============ */

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translate(-50%, 16px) rotate(-.5deg);
  z-index: 60;
  background: var(--manila);
  border: 2px solid var(--ink);
  box-shadow: var(--hard);
  padding: 8px 14px;
  font-family: var(--font-num);
  font-size: 10.5px;
  line-height: 1.35;
  max-width: min(520px, 92vw);
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s linear, transform .2s cubic-bezier(.3,1.3,.55,1);
}
.toast.show { opacity: 1; transform: translate(-50%, 0) rotate(-.5deg); }
.toast.bad { background: var(--stamp); color: var(--paper); border-color: var(--ink); }
.toast.good { background: var(--ledger); color: var(--paper); }

/* ============ RESPONSIVE ============ */

@media (max-width: 1240px) {
  .plaque-wrap { max-width: 300px; }
  .seal { width: clamp(58px, 6.6vw, 92px); }
  .seals-note { display: none; }
  .ledger-inner { padding: 7.5% 8% 5%; }
  .mini-stats { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1020px) {
  .main { grid-template-columns: 1fr; }
  .window { max-width: 760px; }
  .ledger { min-height: 0; }
  .ledger-bg { }
  .ledger-inner { padding: 5% 6% 4%; }
  .bottom { margin-top: 4px; }
  .plaque-wrap { max-width: 310px; }
  .seal { width: clamp(64px, 8.5vw, 96px); }
  .seals-note { display: inline; }
  .end-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .plaque-wrap { max-width: 270px; }
  .seal { width: clamp(54px, 7.4vw, 72px); }
  .seals-note { display: none; }
  .window { max-width: none; }
  .help-grid { grid-template-columns: 1fr; }
  .drawer { width: min(720px, 96vw); }
}

@media (max-width: 700px) {
  .page { padding: 8px 10px 12px; gap: 7px; }
  .top { grid-template-columns: 1fr; }
  .plaque-wrap { max-width: 280px; }
  .seals-head { margin-bottom: 4px; }
  .seals { gap: 4px; }
  .seal { width: 23%; }
  .seal-name { font-size: 7.5px; }
  .seal.sel::before { border-width: 2px; }
  .utility { position: absolute; right: 16px; top: 12px; z-index: 12; gap: 5px; }
  .paper-btn { width: 32px; height: 32px; font-size: 14px; }

  .stage { padding-bottom: 100px; }
  .window { aspect-ratio: 1.42; }
  .site { left: 4%; top: 15%; width: 92%; height: 72%; }
  .site-body { gap: 2%; }
  .site-side { flex-basis: 34%; }
  .ad-video { width: 88%; height: 36%; }
  .ad-hero { width: 62%; flex-basis: 34%; }
  .gauge { width: 30%; right: -1%; top: 2%; }
  .banner-layer { left: 3%; top: 8%; width: 94%; height: 86%; }
  .banner.pos-center { width: 94%; max-height: 100%; }
  .banner.pos-left { width: 90%; height: 98%; }
  .banner.pos-corner { width: 72%; }
  .banner .cmp-title { font-size: 12px; }
  .banner .cmp-sub { font-size: 8px; }
  .banner .cmp-link { font-size: 7.5px; }
  .banner .cmp-btn { min-height: 30px; font-size: 9px; padding: 2px 10px; }
  .cmp-bar { flex-wrap: wrap; gap: 5px; padding: 7px 8px 6px; }
  .cmp-bar .cmp-actions { width: 100%; justify-content: flex-start; }
  .cmp-bar.has-brand { padding-top: 14px; }
  .cmp-center-red { display: flex; flex-direction: column; gap: 5px; padding: 9px 10px; }
  .cmp-center-red .cmp-actions { flex-direction: row; align-items: center; justify-content: flex-start; margin-top: 2px; }
  .cmp-center-red .cmp-actions .cmp-btn { width: auto; min-height: 30px; }
  .cmp-checks { gap: 4px 8px; }
  .cmp-check { font-size: 8px; }
  .cmp-panel { padding: 8px 9px 7px; }
  .cmp-panel-title { font-size: 12px; }
  .cmp-toggle-row { padding: 3px 0 2px; }
  .cmp-toggle-row .name { font-size: 8.5px; }
  .cmp-toggle-row .desc { display: none; }
  .cmp-panel-actions .cmp-btn { min-height: 28px; font-size: 8px; }
  .cmp-panel-foot .cmp-brand { display: none; }
  .cmp-corner .cmp-title { font-size: 12px; }
  .cmp-floater { display: none; }
  .banner-off { left: 4%; bottom: 12%; font-size: 8px; max-width: 160px; }
  .mascot-wrap { width: 22%; left: -1.5%; bottom: -80px; min-width: 76px; max-width: 116px; }
  .mascot-bubble { display: none; }
  .fine-stamp { width: 22%; right: -2%; bottom: -55%; }

  .ledger { margin-top: 0; }
  .ledger-inner { padding: 7% 6.5% 5%; gap: 5px; }
  .ledger-head h2 { font-size: 20px; }
  .counter .cell { width: 24px; height: 34px; }
  .counter .strip span { height: 34px; font-size: 21px; }
  .counter-sign { width: 22px; height: 32px; font-size: 17px; }
  .mini-stats { gap: 2px 16px; }
  .mini-stats > div { font-size: 9px; padding: 3px 0; }
  .mini-stats b { font-size: 10px; }
  .quick-tab { font-size: 8.5px; min-height: 34px; }
  .roll-btn { min-height: 50px; font-size: 17px; }
  .day-note { font-size: 8px; min-height: 0; }

  .bottom { min-height: 96px; gap: 6px; flex-wrap: wrap; }
  .hintbar { order: -1; flex: 1 1 100%; min-height: 64px; }
  .hint-shortcuts { display: none; }
  .hint-main p { font-size: 9.5px; }
  .cal-wrap { width: 72px; margin-left: 2px; }
  .jar-wrap { width: 66px; margin-left: auto; margin-right: 6px; }

  .drawer {
    left: 0;
    top: 3svh;
    width: 100vw;
    height: 94svh;
    max-height: 94svh;
    transform: none;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
  }
  .drawer.open { transform: none; }
  .drawer-head { padding: 13px 14px 8px; }
  .drawer-head h2 { font-size: 22px; }
  .drawer-tabs { padding: 6px 10px 0; gap: 2px; }
  .drawer-tabs button { flex: 1 1 22%; padding: 7px 6px 6px; font-size: 9px; }
  .drawer-body { padding: 12px 14px 20px; }
  .dgrid { grid-template-columns: 1fr; }
  .dgrid3 { grid-template-columns: 1fr 1fr; }
  .banner-style-grid { grid-template-columns: 1fr 1fr; }
  .site-type-grid { grid-template-columns: 1fr 1fr; }
  .colour-grid { grid-template-columns: 1fr 1fr; }
  .mode-grid { grid-template-columns: 1fr 1fr; }
  .filter-levels { grid-template-columns: 1fr; }
  .modal { padding: 20px 16px 18px; width: 96vw; }
  .modal-close { right: 10px; top: 8px; }
  .help-grid { gap: 8px; }
  .end-stats { grid-template-columns: 1fr 1fr; }
  .end-actions { flex-direction: column; }
  .end-actions .big-ink-btn, .end-actions .ghost-btn { width: 100%; }
  .toast { bottom: 10px; font-size: 9.5px; }
}

@media (max-width: 430px) {
  .plaque-wrap { max-width: 238px; }
  .plaque-title span { font-size: 12px; }
  .plaque-title strong { font-size: 21px; }
  .plaque-tag { font-size: 8px; }
  .plaque-kicker { font-size: 5.5px; letter-spacing: .1em; }
  .seals-head { font-size: 6.5px; }
  .seals-head .rule { display: none; }
  .seals-note { font-size: 7px; }
  .seal-name { font-size: 6.5px; }
  .window { aspect-ratio: 1.4; }
  .site-nav { display: none; }
  .site-foot-note { display: none; }
  .banner-layer { left: 2%; top: 7%; width: 96%; height: 88%; }
  .banner .cmp-title { font-size: 11px; }
  .banner .cmp-btn { font-size: 8px; padding: 2px 8px; }
  .cmp-bar .cmp-actions { gap: 4px; }
  .cmp-panel-title { font-size: 11px; }
  .ledger { margin-top: 0; }
  .counter .cell { width: 21px; height: 31px; }
  .counter .strip span { height: 31px; font-size: 19px; }
  .counter-caption { font-size: 7px; }
  .mode-grid { grid-template-columns: 1fr 1fr; }
  .dgrid3 { grid-template-columns: 1fr; }
  .clause-text strong { font-size: 10px; }
  .law-badges { max-width: 74px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
