/* app.css — the measured law of tutundzhian.com, literal.
 * ONE type: Inter 15/500/22. ONE exception: 28/600/-0.01em titles.
 * TWO text colors on white: #000 and #A9A9A9. Hierarchy = color + whitespace.
 */

:root {
  --black: #000000;
  --grey:  #A9A9A9;
  --paper: #FFFFFF;
  --card:  #F7F7F7;
  --hearth: #1A1715;
  --hearth-text: #FFFFFF;
  --hearth-grey: rgba(255,255,255,.45);
  --radius: 26px;
  --margin: 24px;
  --ease: cubic-bezier(.22,.61,0,1);
  --spring: cubic-bezier(.34,1.28,.44,1);
  --morph-ease: cubic-bezier(.32,.72,0,1);

  /* Gradient token system (aurora / warm / slate). Used ONLY on gradient
     surfaces, where the two-color law relaxes for contrast (white/cream). */
  --aurora:      linear-gradient(168deg,#B0CBE6 0%,#C3D3EA 24%,#DEDBEE 48%,#E6C6CE 74%,#C5BFDF 100%);
  --aurora-soft: linear-gradient(168deg,#DCE7F3 0%,#E6E4F1 40%,#F2E4E8 75%,#E4E1F0 100%);
  --warm:        linear-gradient(168deg,#8A7365 0%,#6B584E 55%,#43352E 100%);
  --slate:       linear-gradient(168deg,#5A6B7C 0%,#8B8FB0 55%,#C9BFD9 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  background: var(--paper);
  color: var(--black);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 22px;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

body { overflow: hidden; }

/* ---- The one type system. Everything is 15/500/22. ---- */
p, span, div, a, input, label, button, li, h1, h2, h3, small, strong, em {
  font-size: 15px;
  font-weight: 500;
  line-height: 22px;
  letter-spacing: 0;
  font-style: normal;
  color: inherit;
}
strong, b { font-weight: 500; } /* emphasis is color, never weight */

/* The ONE exception: rare screen titles. */
.title {
  font-size: 28px;
  font-weight: 600;
  line-height: 32px;
  letter-spacing: -0.01em;
  color: var(--black);
}

/* Two colors, nothing else. */
.grey { color: var(--grey); }
.black { color: var(--black); }

/* ---- App shell ---- */
#app {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--paper);
}

.screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  transform: scale(.995);
  transition: opacity 360ms var(--ease), transform 360ms var(--ease);
  pointer-events: none;
  padding: 0 var(--margin);
  padding-top: calc(env(safe-area-inset-top) + 8px);
}
.screen.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  z-index: 2;
}
.screen.dark {
  background: var(--hearth);
  color: var(--hearth-text);
}

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(12px); }
.reveal.in {
  opacity: 1; transform: none;
  transition: opacity 420ms var(--ease), transform 420ms var(--ease);
}

/* ---- Type blocks ---- */
.letter { margin-top: 48px; max-width: 34ch; }
.letter .dear { color: var(--black); margin-bottom: 22px; }
.letter .body { color: var(--grey); }
.letter .body b { color: var(--black); }

.label-line { color: var(--grey); margin-bottom: 28px; }

.section { margin-top: 56px; }
.section:first-of-type { margin-top: 40px; }

/* ---- The stacked pair — THE data component. ---- */
.pairs { list-style: none; }
.pair { margin-bottom: 28px; }
.pair:last-child { margin-bottom: 0; }
.pair .k { color: var(--black); display: block; }
.pair .v { color: var(--grey); display: block; }
.pair.resolved .k, .pair.resolved .v { color: var(--grey); transition: color 600ms var(--ease); }
.pair.tappable { cursor: pointer; }

/* ---- Underlined links = ALL actions. ---- */
.link {
  display: inline;
  color: var(--black);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
}
.link.quiet { color: var(--grey); }
.link.struck { color: var(--grey); text-decoration-line: line-through; }

/* ---- Cards ---- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
}

/* Cards rail — horizontal scroll */
.rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  margin: 0 calc(-1 * var(--margin));
  padding: 0 var(--margin);
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail .card {
  flex: 0 0 auto;
  width: 200px;
  height: 176px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  will-change: transform;
}
.rail .card .card-art {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.rail .card .card-art .badger-mount { width: 96px; height: 56px; }

/* ---- Accordion (decision detail) ---- */
.acc { overflow: hidden; height: 0; }
.acc-inner { padding-top: 20px; }

.detail-opts { margin-bottom: 24px; }
.trace { margin: 24px 0; }
.trace-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--grey);
  margin-bottom: 14px;
}
.trace-line .stamp { flex: 0 0 auto; width: 24px; height: 16px; margin-top: 3px; }
.trace-line.live { animation: liveflash 900ms var(--ease); }
@keyframes liveflash { from { background: rgba(0,0,0,.04); } to { background: transparent; } }

/* ---- Chat ---- */
#screen-chat { padding-bottom: 168px; }
.chat-scroll { padding-bottom: 12px; }
.msg { max-width: 34ch; margin-bottom: 22px; clear: both; }
.msg.guardian { color: var(--black); float: none; }
.msg.user { color: var(--grey); text-align: right; margin-left: auto; }
.msg.pairs-msg { max-width: 100%; }
.daybreak { color: var(--grey); text-align: center; margin: 22px 0; }
.working-line { display: flex; align-items: center; gap: 10px; color: var(--grey); margin-bottom: 22px; }
.working-line .mini { width: 30px; height: 18px; }

.composer {
  position: fixed;
  left: var(--margin);
  right: var(--margin);
  bottom: calc(env(safe-area-inset-bottom) + 84px);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 4;
}
.composer .field-wrap {
  flex: 1;
  border-top: 1px solid rgba(0,0,0,.12);
  padding-top: 12px;
}
.composer input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--black);
  font: inherit;
}
.composer input::placeholder { color: var(--grey); }
.send {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--black);
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform 120ms var(--ease), opacity 200ms var(--ease);
}
.send:active { transform: scale(.94); }
.send svg { width: 16px; height: 16px; }

/* ---- The floating pill — the only chrome ---- */
.pill {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 16px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  padding-left: 8px;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-radius: 26px;
  box-shadow: 0 8px 30px rgba(0,0,0,.12), 0 1px 3px rgba(0,0,0,.06);
  z-index: 6;
  transition: opacity 300ms var(--ease);
}
.pill.hidden { opacity: 0; pointer-events: none; }
.pill .nav-badger {
  width: 40px; height: 26px;
  flex: 0 0 auto;
  margin-right: 2px;
  display: flex; align-items: center; justify-content: center;
}
.pill .segs { position: relative; display: flex; }
.pill .thumb {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  border-radius: 20px;
  background: #FFFFFF;
  box-shadow: 0 1px 4px rgba(0,0,0,.10);
  transition: transform 380ms var(--spring), width 380ms var(--spring);
  z-index: 0;
}
.pill .seg {
  position: relative;
  z-index: 1;
  padding: 8px 20px;
  color: var(--grey);
  cursor: pointer;
  background: none; border: none;
  transition: color 300ms var(--ease);
}
.pill .seg.active { color: var(--black); }

/* ---- Hello / onboarding ---- */
#screen-hello { display: flex; flex-direction: column; padding-bottom: 40px; }
.hero-video-wrap {
  margin: 0 auto;
  margin-top: 24px;
  width: 200px; height: 200px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.hero-video-wrap video {
  width: 100%; height: 100%;
  object-fit: contain;
}
.hero-fallback { width: 160px; height: 100px; display: none; }
.name-input-wrap { margin-top: 40px; }
.name-input {
  border: none; outline: none; background: transparent;
  color: var(--black); font: inherit;
  border-bottom: 1px solid rgba(0,0,0,.18);
  padding: 4px 0; width: 60%;
  text-decoration: underline; text-underline-offset: 3px;
}
.name-input::placeholder { color: var(--grey); }
.suggestions { margin-top: 20px; display: flex; gap: 16px; flex-wrap: wrap; }
.meet-wrap { margin-top: 32px; }
.meet-wrap.hidden { display: none; }

/* footer */
.foot { color: var(--grey); margin-top: 56px; padding-bottom: 120px; }

/* empty state */
.empty { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 80px; color: var(--grey); }
.empty .badger-mount { width: 120px; height: 70px; }

/* paw stamp */
.paw-svg { width: 14px; height: 14px; vertical-align: -2px; margin-left: 6px; opacity: 0; }
.paw-svg.in { animation: pawin 480ms var(--spring) forwards; }
@keyframes pawin { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }

/* toasts */
.toast {
  position: fixed;
  left: 50%; bottom: calc(env(safe-area-inset-bottom) + 92px);
  transform: translateX(-50%) translateY(10px);
  background: var(--card);
  color: var(--black);
  padding: 12px 20px;
  border-radius: 26px;
  opacity: 0;
  z-index: 8;
  box-shadow: 0 6px 20px rgba(0,0,0,.08);
  transition: opacity 300ms var(--ease), transform 300ms var(--ease);
}
.toast.in { opacity: 1; transform: translateX(-50%) translateY(0); }

/* dwelling */
#composer.dwell .field-wrap { border-top-color: rgba(255,255,255,.18); }
#composer.dwell input { color: var(--hearth-text); }
#composer.dwell input::placeholder { color: var(--hearth-grey); }
#composer.dwell .send { background: #FFFFFF; }
#composer.dwell .send svg path { stroke: #1A1715; }
#screen-dwell .dwell-line { color: var(--hearth-grey); text-align: center; margin: 24px 0; }
#screen-dwell .msg.guardian { color: var(--hearth-text); }
#screen-dwell .msg.user { color: var(--hearth-grey); }
#screen-dwell .dwell-badger {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 20px);
  transform: translateX(-50%);
  width: 56px; height: 34px; z-index: 6;
}

/* leash toggles */
.toggle-row { margin-bottom: 28px; }
.svg-mono { display: inline-block; }

/* stamp inline in trace */
.stamp-svg .m { }

/* count-up keeps tabular so width doesn't jump */
.countup { font-variant-numeric: tabular-nums; }

/* desktop phone shell */
@media (min-width: 520px) {
  body { display: flex; align-items: center; justify-content: center; background: #ECECEC; }
  #app {
    width: 390px; height: 844px;
    border-radius: 44px;
    box-shadow: 0 30px 80px rgba(0,0,0,.24);
    overflow: hidden;
  }
}

/* =======================================================================
   PREMIUM FOUNDATION LAYER (variant-invariant machinery)
   ======================================================================= */

/* ---- Grain overlay: SVG feTurbulence, mix-blend overlay ~35% ---- */
.grain { position: relative; }
.grain::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: .35;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

/* ---- Gradient fills (relaxed-contrast surfaces) ---- */
.g-warm        { background: var(--warm); }
.g-slate       { background: var(--slate); }
.g-aurora      { background: var(--aurora); }
.g-aurora-soft { background: var(--aurora-soft); }

/* ---- The card component (.vcard) ---- */
.vcard {
  background: #FFFFFF;
  border-radius: 22px;
  box-shadow: 0 8px 26px rgba(20,18,16,.08);
  padding: 16px;
  transition: transform 180ms var(--spring), box-shadow 140ms var(--ease);
  will-change: transform;
}
.vcard.tappable { cursor: pointer; }
.vcard.tappable:active {
  transform: scale(.98);
  box-shadow: 0 3px 12px rgba(20,18,16,.10);
  transition: transform 140ms var(--ease), box-shadow 140ms var(--ease);
}
.vcard.g-warm, .vcard.g-slate, .vcard.g-aurora, .vcard.g-aurora-soft { color: #FFFFFF; }

/* Decision rows — carded stacked pair + chevron. Same content, now a card. */
.dec-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 10px;
}
.dec-main { min-width: 0; }
.dec-k { color: var(--black); font-weight: 600; display: block; }
.dec-sub { color: var(--grey); font-size: 12.5px; line-height: 17px; display: block; margin-top: 2px; }
.chev { flex: 0 0 auto; color: #C9BFD9; font-size: 18px; line-height: 22px; }
.dec-row.resolved .dec-k { color: var(--grey); font-weight: 500; transition: color 600ms var(--ease); }
.dec-row.resolved .dec-sub { color: var(--grey); }
.dec-row.resolved .chev { opacity: 0; }

/* ---- Expand morph (card -> fullscreen, App-Store style) ---- */
.morph {
  position: fixed; inset: 0;
  background: #FFFFFF;
  z-index: 20;
  overflow: hidden;
  will-change: clip-path;
  contain: paint;
  -webkit-clip-path: inset(0 round 0);
  clip-path: inset(0 round 0);
}
.morph-content {
  position: absolute; inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: calc(env(safe-area-inset-top) + 20px) var(--margin) 48px;
}
.morph-content .mfade { opacity: 0; transform: translateY(10px); }
.morph-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }

/* ---- Bottom sheet ---- */
.sheet-scrim {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.28);
  opacity: 0; z-index: 24;
  transition: opacity 320ms var(--ease);
}
.sheet-scrim.in { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 25;
  background: rgba(250,250,248,.82);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-radius: 26px 26px 0 0;
  padding: 8px var(--margin) calc(env(safe-area-inset-bottom) + 28px);
  transform: translateY(112%);
  transition: transform 460ms var(--spring);
  box-shadow: 0 -8px 40px rgba(0,0,0,.14);
  touch-action: none;
}
.sheet.in { transform: translateY(0); }
.grabber {
  width: 40px; height: 5px; border-radius: 3px;
  background: rgba(0,0,0,.16);
  margin: 6px auto 18px;
}

/* ---- Press-state polish sweep ---- */
.link { transition: opacity 140ms var(--ease); }
.link:active { opacity: .5; }
.card { transition: transform 180ms var(--spring); }
.card:active { transform: scale(.98); }
.seg { transition: color 300ms var(--ease), transform 140ms var(--ease); }
.seg:active { transform: scale(.95); }
.pair.tappable:active { opacity: .6; }
.suggestions .link:active { opacity: .5; }

/* =======================================================================
   CONFIRMED DECISIONS LAYER (board 01/02/03)
   ======================================================================= */

/* ---- Look tokens (accent + door ink + CSS-fallback plate). Set on <body>
   by plates.setLook(); accent is the ONE color that joins the two-color law. ---- */
:root { --accent: #7A6FE0; --accent-ink: #FFFFFF; --door-ink: #2A2A34;
        --plate: #EFEEF5; --bloom: none;
        --deck-spring: cubic-bezier(.34,1.28,.44,1); }

/* ---- The mark (chat-scale identity) ---- */
.mark-svg { display: block; }
.mark-slot { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.turn { display: flex; gap: 9px; align-items: flex-start; margin-bottom: 22px; }
.turn .mark-slot {
  width: 26px; height: 26px; border-radius: 9px; margin-top: 1px;
  background: var(--card); box-shadow: 0 2px 7px rgba(20,18,16,.08);
}
.turn .gm { color: var(--black); max-width: 30ch; }
.turn .gm.grey { color: var(--grey); }
.composer .comp-mark {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 13%, var(--card));
}
#composer.dwell .comp-mark { background: rgba(255,255,255,.10); }

/* ---- HOME: the greeting hero + decision deck ---- */
.hero-plate {
  position: relative; margin: 8px calc(-1 * var(--margin)) 0;
  min-height: 138px; border-radius: 0; overflow: hidden;
  display: flex; align-items: flex-end;
}
.rail .card.door { justify-content: flex-end; padding: 16px; }
.hero-plate .hero-inner { position: relative; z-index: 1; padding: 0 var(--margin) 14px; width: 100%; }
.hero-plate .letter { margin-top: 0; }

.deck {
  position: relative; height: 236px; margin: 24px 2px 0;
}
.deck-card {
  position: absolute; left: 0; right: 0;
  transform-origin: top center; will-change: transform, opacity;
  touch-action: pan-y;
  transition: transform .45s var(--deck-spring), opacity .35s var(--ease);
}
.card-face {
  position: relative; overflow: hidden;
  background: var(--card, #F7F7F7);
  border-radius: 24px; padding: 17px 18px 16px;
  box-shadow: 0 8px 26px rgba(20,18,16,.10);
}
.cf-top { display: flex; gap: 12px; align-items: flex-start; }
.cico-chip {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 14%, #FFFFFF); color: var(--black);
}
.cico { width: 22px; height: 22px; display: block; }
.cf-tt { min-width: 0; }
.cf-title { color: var(--black); font-weight: 600; line-height: 20px; }
.cf-sub { color: var(--grey); font-size: 12.5px; line-height: 17px; margin-top: 3px; }
.cf-acts { margin-top: 16px; display: flex; align-items: baseline; gap: 18px; }
.commit {
  color: var(--black); font-weight: 600; cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--accent);
  text-decoration-thickness: 2px; text-underline-offset: 3px;
  transition: transform .12s var(--ease);
}
.commit:active { transform: scale(.97); }
.later { color: var(--grey); cursor: pointer; transition: transform .12s var(--ease); }
.later:active { transform: scale(.97); }
.deck-hint {
  position: absolute; top: 14px; right: 16px; z-index: 2;
  font-size: 10.5px; color: var(--grey); opacity: .55; letter-spacing: .3px;
  transition: opacity .2s var(--ease);
}
/* paw stamp on the resolving card */
.deck-stamp {
  position: absolute; top: 42%; left: 50%; z-index: 5; pointer-events: none;
  color: var(--accent); opacity: 0;
  transform: translate(-50%,-50%) scale(0) rotate(-18deg);
}
.deck-stamp.show { animation: deckstamp .5s cubic-bezier(.34,1.56,.64,1) forwards; }
@keyframes deckstamp {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(0) rotate(-20deg); }
  55% { opacity: .95; }
  100% { opacity: .9; transform: translate(-50%,-50%) scale(1.05) rotate(-11deg); }
}
/* empty state */
.deck-empty {
  display: none; flex-direction: column; align-items: center; text-align: center;
  padding: 40px 24px 0; gap: 14px;
}
.deck-empty.show { display: flex; }
.deck-empty .eb {
  width: 52px; height: 52px; border-radius: 16px; background: var(--card);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(20,18,16,.10);
}
.deck-empty .eb .badger-mount { width: 40px; height: 26px; }
.deck-empty p { color: var(--black); font-weight: 600; }
.deck-empty a {
  color: var(--grey); cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px;
}
.deck-empty a:active { opacity: .5; }

/* ---- Edge-life (applied to the deck's top card) ---- */
.e-light::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: 4;
  padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--edge-a,0deg), transparent 0 74%, var(--accent) 84%, #fff 90%, transparent 97%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: edgespin 4.2s linear infinite;
}
@property --edge-a { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes edgespin { to { --edge-a: 360deg; } }
.e-breath { animation: edgebreath 4.6s ease-in-out infinite; }
@keyframes edgebreath {
  0%,100% { box-shadow: 0 8px 26px rgba(20,18,16,.10); }
  50% { box-shadow: 0 16px 38px rgba(20,18,16,.18); }
}
.e-sheen::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: 4;
  pointer-events: none; mix-blend-mode: overlay;
  background: linear-gradient(115deg, transparent 32%, rgba(255,255,255,.6) 50%, transparent 68%);
  background-size: 250% 100%; animation: edgesheen 5s ease-in-out infinite;
}
@keyframes edgesheen { 0%,100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }

/* ---- CHAT: the ledger / artifact card (accent-edged, tinted header) ---- */
.ledger {
  margin: 12px 0 12px 35px; overflow: hidden; border-radius: 18px;
  background: var(--card); box-shadow: 0 8px 24px rgba(20,18,16,.10);
  border: 1.5px solid color-mix(in srgb, var(--accent) 42%, transparent);
}
.ledg-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  background: color-mix(in srgb, var(--accent) 13%, var(--card));
}
.ledg-head .mark-slot { width: 22px; height: 22px; border-radius: 7px; background: var(--card); }
.ledg-head span { font-size: 11px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--grey); }
.ledg-body { padding: 4px 14px 6px; }
.ledg-row {
  display: flex; align-items: center; font-size: 13.5px; padding: 8px 0;
  color: var(--black); border-bottom: 1px solid color-mix(in srgb, #000 8%, transparent);
}
.ledg-row:last-child { border: none; }
.ledg-row .rl { flex: 1; }
.ledg-row .amt { color: var(--grey); }
.ledg-row .tk { margin-left: 9px; color: var(--accent); font-weight: 700; opacity: 0; transform: translateX(-5px); transition: opacity .3s var(--ease), transform .3s var(--ease); }
.ledg-row.ticked .tk { opacity: 1; transform: none; }
.ledg-acts { padding: 6px 14px 13px; }
.ledg-acts .link { margin-right: 16px; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

/* ---- Doors as shader plates (replaces the rejected earthy gradients) ---- */
.door {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--plate); color: var(--door-ink);
}
.door .plate-canvas { border-radius: inherit; }
.door .door-ico { position: absolute; top: 14px; left: 16px; width: 22px; height: 22px; z-index: 2; color: var(--door-ink); }
.door .door-text { position: relative; z-index: 2; }
.door .dl { color: var(--door-ink); font-weight: 600; }
.door .ds { color: var(--door-ink); opacity: .72; font-size: 12.5px; line-height: 17px; }
body.look-chroma .door .dl, body.look-chroma .door .ds,
body.look-deep   .door .dl, body.look-deep   .door .ds { text-shadow: 0 1px 3px rgba(0,0,0,.24); }
body.look-chroma .door .door-ico, body.look-deep .door .door-ico { filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); }

/* WebGL plate canvas fills its mount, sits behind content */
.plate-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none; display: block;
}
/* CSS fallback (no WebGL): drifting bloom via ::before */
body.no-webgl .door::before,
body.no-webgl .hero-plate::before {
  content: ''; position: absolute; inset: -55%; z-index: 0; pointer-events: none;
  background: var(--bloom); filter: blur(8px); opacity: .9;
  animation: platedrift 26s linear infinite;
}
body.no-webgl .hero-plate::before { opacity: .5; }
@keyframes platedrift {
  0% { transform: rotate(0deg) scale(1.1); }
  50% { transform: rotate(180deg) translate(5%,4%) scale(1.28); }
  100% { transform: rotate(360deg) scale(1.1); }
}

/* ---- hold-to-commit fill (crossings) ---- */
.card-face { position: relative; }
.cf-top, .cf-acts, .deck-stamp { position: relative; z-index: 1; }
.hold-fill {
  position: absolute; inset: 0; z-index: 0; border-radius: inherit; pointer-events: none;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  transform: scaleX(0); transform-origin: left center; opacity: 0;
}
.card-face.holding { box-shadow: 0 3px 14px rgba(20,18,16,.14); }
.card-face.holdable .commit { text-decoration-style: dotted; }

/* ---- mark shimmer (Chat entry) ---- */
.mark-shimmer { animation: markshimmer 720ms var(--ease) 1; }
@keyframes markshimmer {
  0% { filter: brightness(1); transform: scale(1); }
  45% { filter: brightness(1.4); transform: scale(1.07); }
  100% { filter: brightness(1); transform: scale(1); }
}

/* ---- press states ---- */
.door:active { transform: scale(.98); transition: transform .14s var(--ease); }
.deck-card .card-face { transition: box-shadow .14s var(--ease); }
.ledger { transition: box-shadow .14s var(--ease), transform .14s var(--ease); }
.ledg-acts .link:active { opacity: .5; }
.send:active { transform: scale(.94); box-shadow: 0 2px 8px rgba(0,0,0,.14); }

/* ---- pointer-fine hover lift (behind hover:hover so touch is unaffected) ---- */
@media (hover: hover) {
  .door, .ledger, .cico-chip { transition: transform .18s var(--spring), box-shadow .18s var(--ease); }
  .door:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(20,18,16,.16); }
  .ledger:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(20,18,16,.14); }
  .deck-card .card-face:hover { box-shadow: 0 12px 32px rgba(20,18,16,.14); }
  .commit:hover, .later:hover, .link:hover { opacity: .82; }
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: 120ms !important; }
  .screen { transform: none; }
  .reveal { transition: opacity 200ms linear; transform: none; }
  .morph { -webkit-clip-path: inset(0 round 0) !important; clip-path: inset(0 round 0) !important; }
  .morph-content .mfade { opacity: 1 !important; transform: none !important; }
  .vcard.tappable:active { transform: none; }
  .e-light::after, .e-breath, .e-sheen::after, body.no-webgl .door::before, body.no-webgl .hero-plate::before, .mark-shimmer { animation: none !important; }
  .deck-card { transition: opacity .2s linear; }
  .deck-stamp.show { animation: none; opacity: .9; transform: translate(-50%,-50%) scale(1) rotate(-11deg); }
}
