:root {
  --mahogany: #3f0d12;
  --ruby: #a71d31;
  --rose: #cc877f;
  --sand: #dfbca6;
  --lemon: #f1f0cc;
  --fawn: #d5bf86;
  --copper: #8d775f;
  --smoke: #f4f4f4;
  --blossom: #f6bdd1;
  --ink: #21090c;
  --shadow: 0 24px 70px rgba(63, 13, 18, .22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--mahogany);
  background: radial-gradient(circle at 85% 20%, rgba(246,189,209,.5), transparent 32rem), var(--lemon);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .09;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.25'/%3E%3C/svg%3E");
  z-index: 40;
  mix-blend-mode: multiply;
}

.topbar {
  width: min(1440px, calc(100% - 64px));
  min-height: 78px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}

.brand { display: flex; align-items: center; gap: 12px; font: 900 11px/1.05 "Arial Narrow", sans-serif; letter-spacing: .12em; }
.brand-dot { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--lemon); background: var(--mahogany); font-size: 20px; }
.topbar nav { display: flex; gap: 28px; font: 800 11px/1 monospace; text-transform: uppercase; letter-spacing: .1em; }
.header-brand {
  position: fixed;
  top: 14px;
  left: max(16px, calc((100vw - 1440px) / 2));
  z-index: 70;
  padding: 5px 14px 5px 5px;
  border: 1px solid rgba(255,255,255,.56);
  border-radius: 999px;
  background: rgba(244,244,244,.52);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.92), 0 14px 38px rgba(63,13,18,.14);
  backdrop-filter: blur(24px) saturate(1.35);
  -webkit-backdrop-filter: blur(24px) saturate(1.35);
}
.site-picker {
  position: fixed;
  top: 14px;
  left: 50%;
  z-index: 70;
  transform: translateX(-50%);
  padding: 5px;
  gap: 0 !important;
  border: 1px solid rgba(255,255,255,.56);
  border-radius: 999px;
  background: rgba(244,244,244,.52);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.92), 0 14px 38px rgba(63,13,18,.14);
  backdrop-filter: blur(24px) saturate(1.35);
  -webkit-backdrop-filter: blur(24px) saturate(1.35);
}
.site-picker a,
.site-picker button {
  min-width: 92px;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  color: rgba(63,13,18,.58);
  background: transparent;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  text-align: center;
  transition: color .2s ease, background .2s ease, box-shadow .2s ease;
}
.site-picker a.is-active,
.site-picker button.is-active,
.site-picker a:hover,
.site-picker button:hover {
  color: var(--mahogany);
  background: rgba(255,255,255,.82);
  box-shadow: 0 5px 18px rgba(63,13,18,.14), inset 0 1px 0 rgba(255,255,255,.92);
}

.mobile-counter-dock { display: none; }

.layout {
  width: min(1440px, calc(100% - 64px));
  height: auto;
  margin: 0 auto 34px;
  display: grid;
  grid-template-columns: minmax(0, 2.35fr) minmax(300px, .8fr);
  grid-template-rows: clamp(720px, calc(100svh - 126px), 860px) auto;
  gap: 24px;
  align-items: stretch;
}

.terminal {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 28px;
  color: var(--lemon);
  background: linear-gradient(145deg, #3f0d12, #28080c 70%);
  box-shadow: var(--shadow);
}

.terminal-line, .terminal-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 24px;
  border-color: rgba(241, 240, 204, .14);
  font: 700 10px/1.25 "Courier New", monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.terminal-line { border-bottom: 1px solid rgba(241, 240, 204, .14); }
.terminal-footer { border-top: 1px solid rgba(241, 240, 204, .14); color: var(--sand); }
.terminal-line strong { color: var(--blossom); }

.hero-panel { min-height: 0; padding: clamp(30px, 3.6vw, 54px); align-self: center; }
.eyebrow { margin: 0 0 12px; color: var(--rose); font: 800 10px/1.2 "Courier New", monospace; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow.dark { color: var(--copper); }
h1 { margin: 0; font: 950 clamp(48px, 5.5vw, 86px)/.82 "Arial Narrow", Impact, sans-serif; letter-spacing: 0; text-transform: uppercase; }

.real-world { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 20px 0 0; color: var(--sand); font: 700 12px/1.2 "Courier New", monospace; letter-spacing: .06em; text-transform: uppercase; }
.real-world strong { padding: 8px 11px; border: 1px solid rgba(241, 240, 204, .22); border-radius: 9px; color: var(--blossom); }
.real-world span { color: var(--rose); }

.counter { display: grid; grid-template-columns: repeat(7, auto); align-items: start; gap: clamp(4px, .65vw, 10px); margin-top: 28px; }
.counter div { display: grid; gap: 8px; min-width: 0; }
.counter small { text-align: center; color: var(--rose); font: 800 8px/1 "Courier New", monospace; letter-spacing: .15em; text-transform: uppercase; }
.counter b { padding-top: .13em; color: var(--rose); font: 300 clamp(38px, 5.2vw, 82px)/.8 "Arial Narrow", sans-serif; }
.flap {
  min-width: clamp(58px, 7.2vw, 120px);
  height: clamp(70px, 8.8vw, 122px);
  display: grid;
  place-items: center;
  position: relative;
  border-radius: 14px;
  color: var(--smoke);
  background: linear-gradient(#25090d 49.5%, #170608 50.5%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), inset 0 -12px 22px rgba(0,0,0,.22), 0 10px 25px rgba(0,0,0,.2);
  font: 900 clamp(54px, 7.4vw, 108px)/.8 "Arial Narrow", Impact, sans-serif;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.flap::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(244,244,244,.16); box-shadow: 0 2px 0 rgba(0,0,0,.38); }
.flap.changed { animation: flip .38s ease-out; }

.timeline { margin-top: 28px; }
.timeline-labels { display: grid; grid-template-columns: repeat(3, 1fr); font: 900 14px/1 "Arial Narrow", sans-serif; text-transform: uppercase; }
.timeline-labels span:nth-child(2) { text-align: center; color: var(--blossom); }
.timeline-labels span:last-child { text-align: right; }
.timeline-labels small { display: block; margin-bottom: 5px; color: var(--rose); font: 800 8px/1 monospace; letter-spacing: .12em; }
.track { height: 16px; margin-top: 12px; position: relative; border-radius: 999px; background: rgba(244,244,244,.08); overflow: visible; }
.track-base, .track-added { position: absolute; inset-block: 0; border-radius: inherit; }
.track-base { left: 0; width: 100%; background: linear-gradient(90deg, var(--fawn), rgba(213,191,134,.34)); opacity: .8; }
.track-added { left: 0%; width: 0%; background: var(--ruby); transition: left .35s linear, width .35s linear; }
.track i { position: absolute; left: 0%; top: 50%; width: 12px; height: 12px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--blossom); transition: left .35s linear; }
.track i.pulse { animation: pulse 1s ease-out; }
.timeline p { margin: 10px 0 0; text-align: center; color: var(--rose); font: 700 10px/1.2 "Courier New", monospace; letter-spacing: .08em; }
.timeline strong { color: var(--blossom); }

.pay-card, .reminder-card, .live-log-card, .records article {
  border: 1px solid rgba(63,13,18,.09);
  border-radius: 22px;
  box-shadow: 0 20px 50px rgba(63,13,18,.11);
}
.focus-panel { min-height: 0; overflow: hidden; }
.focus-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex: 0 0 auto; }
.focus-panel-head > div { min-width: 0; }
.panel-more {
  flex: 0 0 auto;
  padding: 6px 8px;
  border: 1px solid rgba(63,13,18,.12);
  border-radius: 9px;
  color: var(--mahogany);
  background: rgba(255,255,255,.62);
  font: 800 8px/1 monospace;
  text-transform: uppercase;
}
.pay-card { padding: 18px; background: var(--smoke); display: flex; flex-direction: column; }
.pay-card h2 { margin: 0; font: 950 clamp(28px, 2.2vw, 36px)/.88 "Arial Narrow", Impact, sans-serif; letter-spacing: 0; text-transform: uppercase; }
.pay-card h2 em { color: var(--ruby); font-style: normal; }
.pay-panel-details { min-height: 0; overflow: auto; scrollbar-width: thin; transition: opacity .2s ease; }
.copy { margin: 10px 0 0; color: var(--copper); font-size: 12px; line-height: 1.35; }
.amount-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 10px 0; }
.amount { min-height: 46px; padding: 8px 10px; border: 1px solid rgba(63,13,18,.12); border-radius: 9px; color: var(--mahogany); background: transparent; text-align: left; font: 950 15px/1 "Arial Narrow", sans-serif; }
.amount small { display: block; margin-top: 5px; color: var(--copper); font: 700 8px/1 monospace; }
.amount.is-active { color: var(--lemon); background: var(--mahogany); border-color: var(--mahogany); }
.amount.is-active small { color: var(--sand); }
label { display: block; margin: 8px 0 5px; color: var(--mahogany); font: 800 9px/1 monospace; letter-spacing: .08em; text-transform: uppercase; }
input, textarea {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid rgba(63,13,18,.16);
  border-radius: 12px;
  color: var(--mahogany);
  background: #fff;
  outline: none;
}
textarea { resize: vertical; min-height: 56px; }
input:focus, textarea:focus { border-color: var(--ruby); box-shadow: 0 0 0 3px rgba(167,29,49,.12); }
.primary {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  padding: 11px 13px;
  border: 0;
  border-radius: 13px;
  color: var(--smoke);
  background: var(--ruby);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  box-shadow: 0 12px 30px rgba(167,29,49,.24);
  font: 900 11px/1 "Arial Narrow", sans-serif;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.primary:disabled { opacity: .55; cursor: not-allowed; }
.fineprint { margin: 8px 0 0; color: var(--copper); font-size: 9px; line-height: 1.35; }
.pay-card > .primary,
.pay-card > .fineprint { flex: 0 0 auto; }
.reminder-card { padding: 11px 12px; background: var(--sand); overflow: hidden; }
.reminder-card .eyebrow { margin-bottom: 4px; font-size: 8px; }
.reminder-card h3 { margin: 0 0 6px; font: 900 15px/.95 "Arial Narrow", sans-serif; text-transform: uppercase; }
.reminder-card form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.reminder-card input { min-height: 34px; }
.reminder-card button { border: 0; border-radius: 9px; padding: 0 12px; color: var(--lemon); background: var(--mahogany); font: 800 9px/1 monospace; text-transform: uppercase; }
.reminder-card p:last-child { min-height: 0; margin: 4px 0 0; color: var(--mahogany); font-size: 9px; }
.reminder-card p:last-child:empty { display: none; }

.live-log-card {
  padding: 12px;
  display: flex;
  flex-direction: column;
  background: rgba(244,244,244,.82);
}
.live-log-card h2 { margin: 0; font: 950 22px/.92 "Arial Narrow", sans-serif; letter-spacing: 0; text-transform: uppercase; }
.live-log-card .events { min-height: 0; margin-top: 9px; overflow: auto; scrollbar-width: thin; }
.events { display: grid; gap: 8px; }
.event { min-height: 60px; padding: 9px 10px; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; border-radius: 12px; background: var(--lemon); }
.avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--lemon); background: var(--mahogany); font: 900 10px/1 monospace; }
.event strong { font-size: 11px; }
.event p { margin: 3px 0 0; color: var(--copper); font-size: 10px; }
.event time { color: var(--ruby); font: 800 8px/1 monospace; }
.empty { color: var(--copper); }

.records { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.records article { min-height: 96px; padding: 14px 16px; background: var(--sand); display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: end; column-gap: 12px; }
.records article:nth-child(2) { background: var(--rose); }
.records article:nth-child(3) { color: var(--lemon); background: var(--ruby); }
.records article:nth-child(4) { color: var(--lemon); background: var(--mahogany); }
.records small { grid-column: 1 / -1; align-self: start; font: 800 8px/1 monospace; letter-spacing: .1em; text-transform: uppercase; }
.records strong { font: 950 34px/.82 "Arial Narrow", sans-serif; }
.records p { margin: 0; color: currentColor; opacity: .72; font-size: 9px; }

.site-footer {
  width: min(1440px, calc(100% - 64px));
  margin: 0 auto 34px;
  padding: clamp(34px, 5vw, 68px) clamp(26px, 4vw, 56px) 28px;
  border-radius: 34px;
  color: var(--mahogany);
  background:
    radial-gradient(circle at 18% 12%, rgba(246,189,209,.55), transparent 28rem),
    linear-gradient(135deg, rgba(244,244,244,.86), rgba(223,188,166,.72));
  border: 1px solid rgba(63,13,18,.09);
  box-shadow: 0 24px 70px rgba(63,13,18,.14);
}
.site-footer__brand {
  display: grid;
  gap: 16px;
  align-content: start;
}
.site-footer__brand span,
.site-footer__bottom {
  color: rgba(63,13,18,.48);
  font: 800 12px/1.4 "Courier New", monospace;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.footer-brand { width: max-content; font-size: 12px; }
.footer-brand .brand-dot {
  width: 48px;
  height: 48px;
  color: var(--lemon);
  background: var(--mahogany);
  font: 900 24px/1 "Arial Narrow", sans-serif;
  letter-spacing: 0;
}
.site-footer__brand .footer-brand > span:last-child {
  color: var(--mahogany);
  font: 900 13px/1.05 "Arial Narrow", sans-serif;
  letter-spacing: .12em;
}
.site-footer {
  display: grid;
  grid-template-columns: .9fr 1.6fr;
  gap: clamp(28px, 6vw, 90px);
}
.site-footer__cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(20px, 4vw, 70px);
}
.site-footer__cols div {
  display: grid;
  align-content: start;
  gap: 18px;
}
.site-footer__cols p {
  margin: 0 0 10px;
  color: var(--copper);
  font: 800 12px/1 "Courier New", monospace;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.site-footer__cols a,
.site-footer__cols span {
  color: rgba(63,13,18,.72);
  font-size: 15px;
  line-height: 1.25;
}
.site-footer__cols a:hover { color: var(--ruby); }
.site-footer__bottom {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 42px;
  padding-top: 24px;
  border-top: 1px solid rgba(63,13,18,.12);
}

.legal-layout {
  width: min(920px, calc(100% - 64px));
  margin: 0 auto 70px;
}
.legal-card {
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid rgba(63,13,18,.09);
  border-radius: 34px;
  color: var(--mahogany);
  background: rgba(244,244,244,.82);
  box-shadow: var(--shadow);
}
.legal-card h1 {
  margin-bottom: 28px;
  color: var(--mahogany);
}
.legal-card h2,
.legal-card h3 {
  margin: 30px 0 10px;
  font: 950 28px/.95 "Arial Narrow", Impact, sans-serif;
  text-transform: uppercase;
}
.legal-card p,
.legal-card li {
  color: rgba(63,13,18,.72);
  font-size: 16px;
  line-height: 1.6;
}
.legal-card a {
  color: var(--ruby);
  font-weight: 800;
}
.legal-back { margin-top: 34px; }

dialog {
  width: min(520px, calc(100% - 28px));
  border: 0;
  border-radius: 24px;
  padding: 22px;
  color: var(--mahogany);
  background: var(--smoke);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(33, 9, 12, .55); backdrop-filter: blur(4px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; font: 900 20px/1 "Arial Narrow", sans-serif; text-transform: uppercase; }
.dialog-head button { border: 0; background: transparent; color: var(--mahogany); font-size: 30px; line-height: 1; }

.toast { position: fixed; left: 50%; bottom: 22px; z-index: 50; transform: translate(-50%, 120px); min-width: min(380px, calc(100% - 28px)); padding: 15px 18px; border-radius: 999px; color: var(--mahogany); background: var(--blossom); box-shadow: var(--shadow); text-align: center; font: 900 11px/1 monospace; letter-spacing: .08em; transition: transform .35s ease; }
.toast.show { transform: translate(-50%, 0); }

@keyframes flip { 0% { transform: rotateX(-70deg); filter: brightness(1.8); } 100% { transform: none; filter: none; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(246,189,209,.68); } 100% { box-shadow: 0 0 0 28px rgba(246,189,209,0); } }

@media (max-width: 960px) {
  .topbar, .layout { width: min(100% - 28px, 720px); }
  .topbar { min-height: 66px; grid-template-columns: 1fr auto; }
  .topbar nav { display: flex; }
  .header-brand {
    position: fixed;
    top: 8px;
    left: 14px;
    z-index: 70;
    padding: 4px 10px 4px 4px;
    border: 1px solid rgba(255,255,255,.56);
    background: rgba(244,244,244,.58);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.92), 0 10px 28px rgba(63,13,18,.14);
    backdrop-filter: blur(20px) saturate(1.3);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
  }
  .header-brand .brand-dot { width: 34px; height: 34px; font-size: 17px; }
  .site-picker {
    top: 8px;
    padding: 4px;
  }
  .site-picker a,
  .site-picker button {
    min-width: 62px;
    padding: 9px 8px;
    font-size: 9px;
  }
  .mobile-counter-dock {
    position: fixed;
    top: 57px;
    left: 50%;
    z-index: 66;
    width: max-content;
    padding: 5px 10px;
    display: grid;
    grid-template-columns: repeat(7, auto);
    align-items: center;
    gap: 5px;
    border: 1px solid rgba(246,189,209,.22);
    border-radius: 12px;
    color: var(--smoke);
    background: rgba(39,7,11,.84);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 12px 30px rgba(63,13,18,.24);
    backdrop-filter: blur(20px) saturate(1.25);
    -webkit-backdrop-filter: blur(20px) saturate(1.25);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -8px) scale(.96);
    transition: opacity .2s ease, transform .2s ease;
  }
  .mobile-counter-dock.is-visible { opacity: 1; transform: translate(-50%, 0) scale(1); }
  .mobile-counter-value {
    min-width: 24px;
    text-align: center;
    font: 900 20px/.95 "Arial Narrow", Impact, sans-serif;
    font-variant-numeric: tabular-nums;
  }
  .mobile-counter-dock b { color: var(--rose); font: 800 14px/1 monospace; }
  .mobile-counter-value.changed { animation: flip .28s ease-out; }
  .layout { height: auto; display: block; margin-bottom: 42px; }
  .terminal { height: auto; min-height: auto; border-radius: 26px; }
  .terminal-line { padding: 14px 18px; }
  .terminal-line .wide { display: none; }
  .hero-panel { padding: 24px 18px 22px; }
  h1 { font-size: clamp(42px, 12.5vw, 68px); }
  .counter { gap: 3px; margin-top: 26px; }
  .counter b { font-size: clamp(24px, 7vw, 44px); }
  .flap { min-width: clamp(39px, 13vw, 68px); height: clamp(54px, 17vw, 82px); border-radius: 9px; font-size: clamp(38px, 13vw, 64px); }
  .counter small { font-size: 7px; }
  .timeline { margin-top: 24px; }
  .terminal-footer { overflow-x: auto; white-space: nowrap; padding: 14px 18px; }
  .pay-card .copy { font-size: 13px; line-height: 1.4; }
  input, textarea { padding: 12px 13px; }
  .live-log-card { border-radius: 20px; }
  .reminder-card { padding: 14px; border-radius: 20px; }
  .reminder-card h3 { margin-bottom: 9px; font-size: 20px; }
  .reminder-card input,
  .reminder-card button { min-height: 48px; }
  .reminder-card button { padding: 0 15px; }
  .records { margin-top: 12px; grid-template-columns: repeat(2, 1fr); }
  .records article { min-height: 104px; padding: 12px; display: flex; flex-direction: column; align-items: stretch; justify-content: space-between; }
  .records strong { font-size: 34px; }
  .site-footer {
    width: min(100% - 28px, 720px);
    grid-template-columns: 1fr;
    border-radius: 26px;
  }
  .legal-layout { width: min(100% - 28px, 720px); }
  .legal-card { border-radius: 26px; }
  .site-footer__cols { grid-template-columns: 1fr; }
  .site-footer__bottom { display: grid; }
}

@media (max-width: 600px) {
  .header-brand > span:last-child { display: none; }
  .header-brand { padding-right: 4px; }
}

@media (max-width: 440px) {
  .brand { font-size: 10px; }
  .counter { grid-template-columns: repeat(7, auto); }
  .flap { min-width: 37px; height: 52px; font-size: 36px; }
  .counter b { font-size: 24px; }
  .amount-grid { grid-template-columns: 1fr 1fr; }
  .reminder-card form { grid-template-columns: minmax(0, 1fr) auto; }
}

/* ========================================================================== */
/* MARK: Fixed app shell — Live / Stats / Warn                                */
/* ========================================================================== */

:root {
  --app-safe-top: env(safe-area-inset-top, 0px);
  --app-safe-bottom: env(safe-area-inset-bottom, 0px);
  --header-control-height: 54px;
  --glass-surface: rgba(244, 244, 244, .58);
  --glass-border: rgba(255, 255, 255, .62);
}

[hidden] { display: none !important; }

.sr-only {
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  position: absolute;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-page {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}

.app-page .topbar {
  width: 100%;
  min-height: 0;
  height: 0;
  margin: 0;
  display: block;
}

.app-page .header-brand,
.app-page .site-picker {
  top: calc(var(--app-safe-top) + 12px);
  height: var(--header-control-height);
}

.app-page .header-brand {
  left: max(16px, calc((100vw - 1480px) / 2));
  padding: 5px 14px 5px 5px;
}

.app-page .header-brand .brand-dot {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
}

.app-page .site-picker {
  padding: 4px;
  align-items: stretch;
}

.site-picker button {
  min-width: 88px;
  min-height: 44px;
  padding: 4px 15px;
  display: grid;
  grid-template-columns: auto auto;
  place-content: center;
  align-items: center;
  gap: 6px;
}

.site-picker button svg,
.legal-launcher svg,
.warn-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-page .layout {
  width: min(1480px, calc(100% - 32px));
  height: auto;
  margin: 0;
  position: fixed;
  top: calc(var(--app-safe-top) + 80px);
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: minmax(0, 2.25fr) minmax(310px, .75fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.app-page .terminal {
  position: relative;
  isolation: isolate;
}

.scene-layer {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(circle at 82% 16%, rgba(167, 29, 49, .13), transparent 35%);
}

.day-heading-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.day-heading-row h1 { min-width: 0; }

.app-page .real-world {
  flex: 0 0 auto;
  margin: 0 0 2px;
  flex-wrap: nowrap;
}

.app-page .real-world span { color: var(--sand); }

.calendar-note {
  margin: 18px 0 0;
  color: var(--rose);
  font: 700 11px/1.2 "Courier New", monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ========================================================================== */
/* MARK: Interchangeable experience deck                                      */
/* ========================================================================== */

.experience-deck {
  min-width: 0;
  min-height: 0;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.view-panel {
  width: 100%;
  height: 100%;
  min-height: 0;
  animation: panel-in .28s ease both;
}

.live-view {
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(132px, 25%);
  gap: 10px;
}

.live-view .pay-card,
.live-view .live-log-card {
  min-width: 0;
  min-height: 0;
}

.live-view .pay-card {
  padding: clamp(16px, 1.5vw, 22px);
}

.live-view .live-log-card {
  padding: 13px;
}

.live-view .live-log-card .events {
  min-height: 0;
  overflow: auto;
}

.live-view .live-log-card .event:nth-child(n+3) { display: none; }

.panel-more { display: none; }

.stats-view,
.warn-view {
  padding: clamp(18px, 2vw, 28px);
  border: 1px solid rgba(63, 13, 18, .09);
  border-radius: 26px;
  background: rgba(244, 244, 244, .62);
  box-shadow: 0 20px 50px rgba(63, 13, 18, .11);
  backdrop-filter: blur(20px) saturate(1.12);
  -webkit-backdrop-filter: blur(20px) saturate(1.12);
}

.stats-view {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
}

.deck-heading h2 {
  margin: 0;
  font: 950 clamp(30px, 3vw, 44px)/.9 "Arial Narrow", Impact, sans-serif;
  text-transform: uppercase;
}

.stats-view .records {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stats-view .records article {
  min-height: 0;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
}

.stats-view .records strong { font-size: clamp(36px, 4vw, 58px); }
.stats-view .records p { font-size: 11px; }

.warn-view {
  display: grid;
  place-items: center;
}

.warn-view .reminder-card {
  width: 100%;
  padding: clamp(22px, 3vw, 38px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 20px;
  overflow: visible;
}

.warn-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  color: var(--lemon);
  background: var(--mahogany);
}

.warn-icon svg { width: 25px; height: 25px; }

.warn-view .reminder-card h3 {
  margin: 0;
  font-size: clamp(28px, 3vw, 44px);
}

.reminder-copy {
  margin: 9px 0 0;
  color: rgba(63, 13, 18, .64);
  font-size: 13px;
  line-height: 1.4;
}

.warn-view .reminder-card form,
.warn-view .reminder-card > p:last-child {
  grid-column: 1 / -1;
}

.warn-view .reminder-card form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.warn-view .reminder-card input,
.warn-view .reminder-card button {
  min-height: 52px;
}

.warn-view .reminder-card button {
  padding: 0 22px;
  border-radius: 12px;
}

.desktop-overlay-view {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  width: 100%;
  height: clamp(150px, 22vh, 206px);
  min-height: 0;
  border-color: rgba(255, 255, 255, .62);
  border-radius: 26px;
  background: rgba(244, 244, 244, .72);
  box-shadow: 0 24px 70px rgba(33, 9, 12, .26), inset 0 1px 0 rgba(255, 255, 255, .9);
  backdrop-filter: blur(28px) saturate(1.25);
  -webkit-backdrop-filter: blur(28px) saturate(1.25);
}

.desktop-overlay-view.stats-view {
  padding: 14px 64px 14px 16px;
  grid-template-columns: minmax(180px, .58fr) minmax(0, 2.42fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: stretch;
  gap: 14px;
}

.desktop-overlay-view .deck-heading {
  align-self: center;
}

.desktop-overlay-view .deck-heading h2 {
  font-size: clamp(25px, 2.4vw, 38px);
}

.desktop-overlay-view.stats-view .records {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  gap: 8px;
}

.desktop-overlay-view.stats-view .records article {
  padding: 13px 15px;
}

.desktop-overlay-view.stats-view .records strong {
  font-size: clamp(30px, 3.3vw, 50px);
}

.desktop-overlay-view.warn-view {
  padding: 14px 64px 14px 16px;
}

.desktop-overlay-view.warn-view .reminder-card {
  max-width: none;
  padding: 14px 16px;
  grid-template-columns: 48px minmax(240px, .8fr) minmax(360px, 1.4fr);
  align-items: center;
  gap: 14px;
}

.desktop-overlay-view.warn-view .reminder-card h3 {
  font-size: clamp(21px, 2.2vw, 34px);
}

.desktop-overlay-view.warn-view .reminder-card form {
  grid-column: 3;
}

.desktop-overlay-view.warn-view .reminder-card > p:last-child {
  position: absolute;
  right: 82px;
  bottom: 9px;
}

.view-close {
  width: 42px;
  height: 42px;
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: grid;
  place-items: center;
  border: 1px solid rgba(63, 13, 18, .13);
  border-radius: 50%;
  color: var(--mahogany);
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 8px 24px rgba(63, 13, 18, .13);
  font-size: 26px;
  line-height: 1;
}

/* ========================================================================== */
/* MARK: Legal glass launcher and modal                                       */
/* ========================================================================== */

.legal-launcher {
  min-width: 92px;
  height: 44px;
  padding: 0 15px;
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  color: var(--mahogany);
  background: var(--glass-surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .94), 0 14px 38px rgba(63, 13, 18, .16);
  backdrop-filter: blur(24px) saturate(1.35);
  -webkit-backdrop-filter: blur(24px) saturate(1.35);
  font: 800 9px/1 monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.legal-dialog {
  width: min(860px, calc(100% - 28px));
  height: min(720px, calc(100dvh - 48px));
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 30px;
  color: var(--mahogany);
  background: rgba(244, 244, 244, .76);
  box-shadow: 0 32px 90px rgba(33, 9, 12, .34), inset 0 1px 0 rgba(255, 255, 255, .92);
  backdrop-filter: blur(34px) saturate(1.25);
  -webkit-backdrop-filter: blur(34px) saturate(1.25);
}

.legal-dialog::backdrop {
  background: rgba(33, 9, 12, .42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.legal-dialog-shell {
  height: 100%;
  padding: 22px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
}

.legal-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.legal-dialog-head h2 {
  margin: 0;
  font: 950 clamp(28px, 4vw, 46px)/.9 "Arial Narrow", Impact, sans-serif;
  text-transform: uppercase;
}

.dialog-close {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(63, 13, 18, .12);
  border-radius: 50%;
  color: var(--mahogany);
  background: rgba(255, 255, 255, .62);
  font-size: 27px;
  line-height: 1;
}

.legal-picker {
  width: max-content;
  max-width: 100%;
  padding: 4px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border: 1px solid rgba(63, 13, 18, .09);
  border-radius: 999px;
  background: rgba(255, 255, 255, .38);
}

.legal-picker button {
  min-height: 40px;
  padding: 0 17px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  color: rgba(63, 13, 18, .56);
  background: transparent;
  font: 800 9px/1 monospace;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.legal-picker button.is-active {
  color: var(--mahogany);
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 5px 16px rgba(63, 13, 18, .12);
}

.legal-dialog-content {
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(63, 13, 18, .08);
  border-radius: 20px;
  background: rgba(255, 255, 255, .34);
}

.legal-document {
  height: 100%;
  padding: clamp(20px, 4vw, 42px);
  overflow: auto;
  overscroll-behavior: contain;
}

.legal-document h1 {
  margin: 0 0 26px;
  color: var(--mahogany);
  font-size: clamp(34px, 5vw, 58px);
}

.legal-document h2,
.legal-document h3 {
  margin: 28px 0 10px;
  font: 950 24px/.95 "Arial Narrow", Impact, sans-serif;
  text-transform: uppercase;
}

.legal-document p,
.legal-document li {
  color: rgba(63, 13, 18, .74);
  font-size: 15px;
  line-height: 1.6;
}

.legal-document a { color: var(--ruby); font-weight: 800; }

.app-page .toast {
  bottom: calc(var(--app-safe-bottom) + 66px);
  z-index: 100;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========================================================================== */
/* MARK: Mobile fixed composition                                             */
/* ========================================================================== */

@media (max-width: 960px) {
  :root { --header-control-height: 50px; }

  .app-page .header-brand,
  .app-page .site-picker {
    top: calc(var(--app-safe-top) + 8px);
  }

  .app-page .header-brand {
    left: 12px;
    width: var(--header-control-height);
    padding: 4px;
  }

  .app-page .header-brand > span:last-child { display: none; }
  .app-page .header-brand .brand-dot {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .app-page .site-picker {
    left: auto;
    right: 12px;
    width: calc(100% - 78px);
    max-width: 330px;
    transform: none;
  }

  .site-picker button {
    min-width: 0;
    min-height: 40px;
    padding: 3px 7px;
    flex: 1 1 0;
    grid-template-columns: 1fr;
    grid-template-rows: 14px auto;
    gap: 2px;
    font-size: 8px;
  }

  .site-picker button svg { width: 14px; height: 14px; justify-self: center; }

  .app-page .layout {
    width: calc(100% - 20px);
    height: auto;
    margin: 0;
    top: calc(var(--app-safe-top) + 66px);
    bottom: calc(var(--app-safe-bottom) + 10px);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) clamp(142px, 22dvh, 184px);
    gap: 8px;
  }

  .experience-deck,
  .desktop-overlay-view {
    grid-column: 1;
    grid-row: 2;
  }

  .experience-deck { z-index: 1; }

  .desktop-overlay-view {
    position: relative;
    inset: auto;
    z-index: 2;
    width: 100%;
    height: 100%;
  }

  .view-close { display: none; }

  .app-page .terminal {
    height: 100%;
    min-height: 0;
    border-radius: 22px;
  }

  .app-page .terminal-line,
  .app-page .terminal-footer {
    padding: 8px 12px;
    gap: 8px;
    font-size: 7.5px;
  }

  .app-page .terminal-footer {
    overflow: hidden;
    white-space: nowrap;
  }

  .app-page .hero-panel {
    width: 100%;
    padding: clamp(10px, 2.3dvh, 20px) 13px;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .app-page .hero-panel > .eyebrow {
    margin-bottom: 4px;
    font-size: 7.5px;
  }

  .day-heading-row { gap: 10px; }
  .day-heading-row h1 { font-size: clamp(36px, 11vw, 54px); }

  .app-page .real-world {
    margin-bottom: 0;
    gap: 4px;
    font-size: clamp(6.5px, 1.8vw, 8px);
    letter-spacing: .035em;
  }

  .app-page .real-world strong {
    padding: 5px 7px;
    border-radius: 7px;
  }

  .calendar-note {
    margin-top: 7px;
    font-size: 7.5px;
  }

  .app-page .counter {
    width: 100%;
    margin-top: clamp(10px, 2dvh, 17px);
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 3px;
  }

  .app-page .counter b {
    padding-top: .2em;
    font-size: clamp(22px, 6vw, 34px);
  }

  .app-page .flap {
    width: 100%;
    min-width: 0;
    height: clamp(48px, 8dvh, 68px);
    border-radius: 9px;
    font-size: clamp(34px, 11vw, 52px);
  }

  .app-page .counter small { font-size: 6.5px; }

  .app-page .timeline { margin-top: clamp(10px, 2dvh, 17px); }
  .app-page .timeline-labels { font-size: clamp(10px, 3vw, 13px); }
  .app-page .timeline-labels small { font-size: 6.5px; }
  .app-page .track { height: 11px; margin-top: 8px; }
  .app-page .timeline p { margin-top: 7px; font-size: 7.5px; }

  .experience-deck {
    border: 1px solid rgba(255, 255, 255, .58);
    border-radius: 20px;
    background: rgba(244, 244, 244, .34);
    box-shadow: 0 14px 34px rgba(63, 13, 18, .1), inset 0 1px 0 rgba(255, 255, 255, .72);
    backdrop-filter: blur(18px) saturate(1.15);
    -webkit-backdrop-filter: blur(18px) saturate(1.15);
  }

  .live-view {
    padding: 6px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr);
    gap: 6px;
  }

  .live-view .pay-card,
  .live-view .live-log-card {
    height: 100%;
    min-height: 0;
    padding: 10px;
    border-radius: 15px;
  }

  .live-view .focus-panel-head { gap: 5px; }
  .live-view .pay-card .eyebrow,
  .live-view .pay-panel-details,
  .live-view .pay-card .fineprint { display: none; }

  .live-view .pay-card h2 {
    font-size: clamp(18px, 5.4vw, 26px);
    line-height: .9;
  }

  .live-view .pay-card .primary {
    min-height: 46px;
    margin-top: auto;
    padding: 8px;
    border-radius: 10px;
    font-size: 8px;
    line-height: 1.1;
  }

  .live-view .live-log-card h2 {
    font-size: clamp(16px, 4.8vw, 22px);
  }

  .live-view .live-log-card .eyebrow {
    margin-bottom: 3px;
    font-size: 6.5px;
  }

  .live-view .live-log-card .events {
    margin-top: 6px;
    overflow: hidden;
  }

  .live-view .live-log-card .event:nth-child(n+2) { display: none; }
  .live-view .event {
    min-height: 43px;
    padding: 5px;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px;
  }
  .live-view .event time { display: none; }
  .live-view .avatar { width: 27px; height: 27px; }
  .live-view .event strong,
  .live-view .event p {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 8px;
  }

  .panel-more {
    display: block;
    min-width: 42px;
    min-height: 28px;
    padding: 5px;
    font-size: 6.5px;
  }

  .stats-view,
  .warn-view {
    padding: 6px;
    border: 0;
    border-radius: 20px;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .desktop-overlay-view.stats-view,
  .desktop-overlay-view.warn-view {
    padding: 6px;
  }

  .stats-view .deck-heading { display: none; }
  .stats-view { display: block; }

  .desktop-overlay-view.stats-view .records {
    width: 100%;
    height: 100%;
    margin: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .desktop-overlay-view.stats-view .records article {
    min-height: 0;
    padding: 8px 10px;
    border-radius: 14px;
  }

  .desktop-overlay-view.stats-view .records small { font-size: 6.5px; }
  .desktop-overlay-view.stats-view .records strong { font-size: clamp(19px, 6vw, 28px); }
  .desktop-overlay-view.stats-view .records p { font-size: 7px; }

  .warn-view { display: grid; }
  .desktop-overlay-view.warn-view .reminder-card {
    height: 100%;
    padding: 12px;
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    gap: 8px 10px;
    border-radius: 15px;
  }

  .warn-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }
  .warn-icon svg { width: 19px; height: 19px; }
  .warn-view .reminder-card .eyebrow { margin-bottom: 3px; font-size: 6.5px; }
  .desktop-overlay-view.warn-view .reminder-card h3 { margin: 0; font-size: clamp(17px, 5vw, 23px); }
  .reminder-copy { display: none; }
  .desktop-overlay-view.warn-view .reminder-card form {
    grid-column: 1 / -1;
    gap: 6px;
  }
  .warn-view .reminder-card input,
  .warn-view .reminder-card button { min-height: 48px; }
  .warn-view .reminder-card input { padding: 8px 10px; font-size: 13px; }
  .warn-view .reminder-card button { padding: 0 13px; font-size: 8px; }
  .desktop-overlay-view.warn-view .reminder-card > p:last-child {
    position: static;
    grid-column: 1 / -1;
    margin: 0;
    font-size: 8px;
  }

  .legal-launcher {
    right: 8px;
    bottom: 8px;
    min-width: 78px;
    height: 42px;
    padding: 0 12px;
    font-size: 8px;
  }

  .app-page:not([data-active-view="live"]) .legal-launcher {
    display: none;
  }

  .mobile-counter-dock {
    top: calc(var(--app-safe-top) + 64px);
  }

  .legal-dialog {
    width: calc(100% - 20px);
    height: min(76dvh, 680px);
    border-radius: 24px;
  }

  .legal-dialog-shell { padding: 14px; gap: 10px; }
  .legal-dialog-head h2 { font-size: clamp(27px, 8vw, 38px); }
  .legal-document { padding: 20px; }
  .legal-document h1 { font-size: 34px; }

  .mobile-detail-dialog {
    width: calc(100% - 24px);
    height: min(80dvh, 720px);
    max-height: none;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 26px;
    color: var(--mahogany);
    background: rgba(244, 244, 244, .78);
    box-shadow: 0 30px 90px rgba(33, 9, 12, .38), inset 0 1px 0 rgba(255, 255, 255, .94);
    backdrop-filter: blur(30px) saturate(1.25);
    -webkit-backdrop-filter: blur(30px) saturate(1.25);
  }

  .mobile-detail-dialog::backdrop {
    background: rgba(33, 9, 12, .42);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .mobile-detail-shell {
    height: 100%;
    padding: 14px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 11px;
  }

  .mobile-detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .mobile-detail-head .eyebrow { margin-bottom: 4px; }
  .mobile-detail-head h2 {
    margin: 0;
    font: 950 clamp(27px, 8vw, 38px)/.9 "Arial Narrow", Impact, sans-serif;
    text-transform: uppercase;
  }

  .mobile-detail-host {
    min-height: 0;
    overflow: hidden;
  }

  .mobile-detail-host > .focus-panel {
    width: 100%;
    height: 100%;
    max-height: none;
    padding: 16px;
    border-radius: 19px;
  }

  .mobile-detail-host .panel-more { display: none; }
  .mobile-detail-host .pay-card .eyebrow,
  .mobile-detail-host .pay-panel-details,
  .mobile-detail-host .pay-card .fineprint { display: block; }

  .mobile-detail-host .pay-panel-details {
    min-height: 0;
    overflow: auto;
  }

  .mobile-detail-host .pay-card h2 {
    font-size: clamp(32px, 9vw, 44px);
  }

  .mobile-detail-host .pay-card .primary {
    min-height: 52px;
    margin-top: 10px;
    font-size: 10px;
  }

  .mobile-detail-host .live-log-card h2 {
    font-size: clamp(28px, 8vw, 38px);
  }

  .mobile-detail-host .live-log-card .events {
    min-height: 0;
    overflow: auto;
  }

  .mobile-detail-host .live-log-card .event:nth-child(n) { display: grid; }
  .mobile-detail-host .live-log-card .event time { display: block; }
}

/* ========================================================================== */
/* MARK: Compact-height safeguards                                            */
/* ========================================================================== */

@media (max-width: 960px) and (max-height: 720px) {
  .app-page .layout {
    grid-template-rows: minmax(0, 1fr) 132px;
  }
  .app-page .hero-panel { padding-block: 7px; }
  .app-page .calendar-note { display: none; }
  .app-page .counter { margin-top: 8px; }
  .app-page .flap { height: clamp(42px, 7dvh, 52px); }
  .app-page .timeline { margin-top: 8px; }
  .app-page .timeline p { display: none; }
  .app-page .terminal-line,
  .app-page .terminal-footer { padding-block: 6px; }
}

@media (min-width: 961px) and (max-height: 780px) {
  .app-page .layout {
    height: auto;
    margin: 0;
    top: calc(var(--app-safe-top) + 70px);
    bottom: 12px;
  }
  .app-page .header-brand,
  .app-page .site-picker { top: calc(var(--app-safe-top) + 8px); }
  .app-page .hero-panel { padding-block: 24px; }
  .app-page .counter { margin-top: 18px; }
  .app-page .timeline { margin-top: 18px; }
  .live-view { grid-template-rows: minmax(0, 1fr) 118px; }
}

@media (prefers-reduced-motion: reduce) {
  .view-panel { animation: none; }
}
