/* ============================================================
   MortadaOS · styles.css (v11 — Graphite & Bone)
   A bilingual instrument console. The shell is quiet so the five
   workspace colours carry every bit of meaning.
   Signature: the load ribbon under the app bar.
   ============================================================ */

@view-transition { navigation: auto; }

:root {
  /* surfaces — bone, not cream */
  --paper: #F2F3F1;
  --card:  #FFFFFF;
  --raise: #FAFAF8;
  --ink:   #17181A;
  --faint: #6A6C69;
  --line:  #E1E3DF;
  --hair:  #EDEEEA;
  --danger:#A6402C;

  /* the five threads — semantic, unchanged */
  --ws-zuha: #6F543E;
  --ws-docrep: #0E7C86;
  --ws-dist: #9A7740;
  --ws-aoos: #4A6FA5;
  --ws-personal: #6F7F63;

  --sheen: rgba(255,255,255,.62);
  --skel-mid: #E9EAE6;
  --unassigned: #CBCDC7;

  /* Content is bilingual: the sans resolves to SF Arabic on iOS.
     The serif is reserved for NUMERALS only — it has no Arabic. */
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Arabic",
          "Segoe UI", Roboto, "Noto Sans Arabic", "Helvetica Neue", Arial, sans-serif;
  --figure: "New York", Georgia, "Times New Roman", serif;

  --ease: cubic-bezier(.22,.7,.3,1);
  --spring: cubic-bezier(.34,1.24,.42,1);

  --r-sm: 9px;
  --r-md: 13px;
  --r-lg: 18px;
  --tabbar-h: calc(56px + env(safe-area-inset-bottom));

  color-scheme: light dark;
}

[data-theme="dark"] {
  --paper: #101113;
  --card:  #191B1E;
  --raise: #202226;
  --ink:   #E9EAE6;
  --faint: #93968F;
  --line:  #2A2D31;
  --hair:  #232629;
  --danger:#DC7358;

  --ws-zuha: #B08F73;
  --ws-docrep: #45AEB8;
  --ws-dist: #C79E60;
  --ws-aoos: #83A2D0;
  --ws-personal: #9BAC8D;

  --sheen: rgba(255,255,255,.06);
  --skel-mid: #26282C;
  --unassigned: #43464A;
}


/* ---------- the app bar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--paper);
  padding-top: env(safe-area-inset-top);
  margin: 0 -16px 18px;
  border-bottom: 1px solid var(--hair);
  view-transition-name: appbar;
}
.ab-brand {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 16px 0;
  transition: opacity .22s var(--ease), max-height .28s var(--ease), padding .28s var(--ease);
  max-height: 40px; overflow: hidden;
}
.ab-brand .wordmark { font-size: 14px; letter-spacing: .04em; color: var(--faint); flex: 1; }
.ab-head { padding: 4px 16px 10px; }
.ab-title {
  font-size: 30px; line-height: 1.12; font-weight: 620; letter-spacing: -.022em;
  unicode-bidi: plaintext; margin: 0;
  transition: font-size .26s var(--ease);
}
.ab-meta {
  font-size: 12.5px; color: var(--faint); margin-top: 3px;
  font-variant-numeric: tabular-nums;
  transition: opacity .2s var(--ease), max-height .26s var(--ease);
  max-height: 20px; overflow: hidden;
}
.ab-actions { display: flex; align-items: center; gap: 2px; flex: none; }

/* the signature: five threads, proportioned to what's actually open */
.ribbon {
  display: flex; height: 3px; width: 100%; overflow: hidden;
  background: var(--hair);
}
.ribbon i {
  display: block; height: 100%; flex: 0 0 auto;
  transition: width .8s var(--ease);
}
.ribbon.empty { opacity: .35; }

/* condensed on scroll: the brand lifts away, the title tucks in */
.appbar.tight .ab-brand { max-height: 0; opacity: 0; padding-top: 0; }
.appbar.tight .ab-title { font-size: 19px; }
.appbar.tight .ab-meta { max-height: 0; opacity: 0; }
.appbar.tight .ab-head { padding-top: 10px; }

/* ---------- type scale ---------- */
.eyebrow, .label {
  font-family: var(--sans);
  font-size: 10.5px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--faint);
  margin-bottom: 11px; display: flex; align-items: center; gap: 8px;
}
.label b {
  color: var(--ink); font-weight: 700; font-family: var(--figure);
  font-size: 13px; letter-spacing: 0; font-variant-numeric: tabular-nums;
}
.num, .amt, .col, .sumrow, .barval, .rowitem .tm, .cal-d .n {
  font-family: var(--figure); font-variant-numeric: tabular-nums lining-nums;
}

/* ---------- entrances, staggered ---------- */
@keyframes riseIn { from { opacity: 0; transform: translateY(9px) scale(.994); } to { opacity: 1; transform: none; } }
.card, .rowitem, .sumrow, .tile, .navcard, .barrow, .beat, .feedrow {
  animation: riseIn .34s var(--spring) both;
  animation-delay: calc(var(--i, 0) * 22ms);
}
/* Stagger without JavaScript — the observer that used to do this cost more
   than the effect was worth. */
.card:nth-child(1), .rowitem:nth-child(1), .navcard:nth-child(1), .barrow:nth-child(1), .feedrow:nth-child(1) { --i: 0 }
.card:nth-child(2), .rowitem:nth-child(2), .navcard:nth-child(2), .barrow:nth-child(2), .feedrow:nth-child(2) { --i: 1 }
.card:nth-child(3), .rowitem:nth-child(3), .navcard:nth-child(3), .barrow:nth-child(3), .feedrow:nth-child(3) { --i: 2 }
.card:nth-child(4), .rowitem:nth-child(4), .navcard:nth-child(4), .barrow:nth-child(4), .feedrow:nth-child(4) { --i: 3 }
.card:nth-child(5), .rowitem:nth-child(5), .navcard:nth-child(5), .barrow:nth-child(5), .feedrow:nth-child(5) { --i: 4 }
.card:nth-child(6), .rowitem:nth-child(6), .navcard:nth-child(6), .barrow:nth-child(6), .feedrow:nth-child(6) { --i: 5 }
.card:nth-child(7), .rowitem:nth-child(7), .navcard:nth-child(7), .barrow:nth-child(7), .feedrow:nth-child(7) { --i: 6 }
.card:nth-child(n+8), .rowitem:nth-child(n+8), .navcard:nth-child(n+8), .barrow:nth-child(n+8), .feedrow:nth-child(n+8) { --i: 7 }
@media (prefers-reduced-motion: reduce) {
  .card, .rowitem, .sumrow, .tile, .navcard, .barrow, .beat { animation: none; }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* 1.7 — .frm{display:grid} and friends are author rules, so they override the
   browser's [hidden]{display:none}. Every collapsed form was rendering open. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main, .wrap > section { view-transition-name: none; }

.wrap { max-width: 620px; margin: 0 auto; padding: 0 16px 8px; }
/* 1.1 — padding alone proved unreliable: a real block after the content is
   guaranteed to extend the scroll height past the fixed bar. */
.wrap::after {
  content: ""; display: block; height: calc(var(--tabbar-h) + 28px);
  flex: none; pointer-events: none;
}
html { scroll-padding-block-end: calc(var(--tabbar-h) + 28px); }

/* ---------- motion primitives ---------- */
@keyframes riseIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }
@keyframes rot { to { transform: rotate(360deg); } }
@keyframes pulse { 40% { transform: scale(1.22); } }

.card, .rowitem { animation: riseIn .26s var(--ease) both; }
.card, .rowitem {
  transition: opacity .18s ease, transform .2s var(--ease), height .24s var(--ease),
    padding .24s var(--ease), margin .24s var(--ease), border-width .24s var(--ease);
}
.leaving { opacity: 0; transform: translateX(12px) scale(.985); }
.busy { opacity: .55; pointer-events: none; }

.thinking { position: relative; overflow: hidden; }
.thinking::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, var(--sheen) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: shimmer 1.05s linear infinite;
}

.skel {
  height: 66px; border-radius: 12px; margin-bottom: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(90deg, var(--card) 25%, var(--skel-mid) 50%, var(--card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.1s linear infinite;
}
.skel.short { height: 46px; border-radius: 10px; }

.spin {
  width: 13px; height: 13px; display: inline-block; vertical-align: -2px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  margin-inline-end: 7px;
  animation: rot .7s linear infinite;
}

.tick { animation: pulse .35s var(--ease); }
.label b, .tile .nums { display: inline-block; }

.donefx .t { text-decoration: line-through; color: var(--faint); }
.donefx .dot { opacity: .4; }

/* ---------- brand ---------- */
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.dots i:nth-child(1) { background: var(--ws-zuha); }
.dots i:nth-child(2) { background: var(--ws-docrep); }
.dots i:nth-child(3) { background: var(--ws-dist); }
.dots i:nth-child(4) { background: var(--ws-aoos); }
.dots i:nth-child(5) { background: var(--ws-personal); }

.wordmark { font-family: var(--figure); font-size: 20px; letter-spacing: 0.02em; }

/* ---------- header ---------- */
header.app {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0 14px; border-bottom: 1px solid var(--line); margin-bottom: 18px;
}
header.app .id { display: flex; align-items: center; gap: 10px; }
header.app .date { color: var(--faint); font-size: 13px; }
.linkbtn {
  background: none; border: none; color: var(--faint); font-size: 13px;
  cursor: pointer; padding: 8px; font-family: var(--sans); text-decoration: none;
  transition: color .15s ease;
}
.linkbtn:hover, .linkbtn.here { color: var(--ink); }

/* ---------- bottom tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  view-transition-name: tabbar;
}
.tabbar::before {
  content: ""; position: absolute; top: 0; height: 2px; background: var(--ink);
  width: calc(100% / 6); left: 0; border-radius: 0 0 2px 2px;
  transform: translateX(calc(var(--tab, 0) * 100%));
  transition: transform .34s var(--spring);
}
@media (prefers-reduced-motion: reduce) { .tabbar::before { transition: none; } }
.tabbar .tab {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; min-height: 56px; padding: 7px 1px 6px;
  color: var(--faint); text-decoration: none; font-size: 10px; letter-spacing: 0;
  transition: color .15s ease;
}
.tabbar .tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar .tab svg { width: 21px; height: 21px; flex: none; }
@media (max-width: 340px) {
  .tabbar .tab { font-size: 9px; }
  .tabbar .tab svg { width: 19px; height: 19px; }
}
.tabbar .tab.on { color: var(--ink); }
.tabbar .tab.on svg { transform: translateY(-1px); }
.tabbar .tab svg { transition: transform .3s var(--spring); }
.tabbar .tab:active svg { transform: scale(.88); }
.tabbar .tab:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }

/* ---------- sections ---------- */
section { margin-bottom: 26px; }
.label .actions { margin-inline-start: auto; display: flex; gap: 8px; align-items: center; }
.label .actions .btn { font-size: 13px; padding: 6px 10px; min-height: 34px; }

/* ---------- capture ---------- */
.capture textarea {
  width: 100%; min-height: 88px; resize: vertical;
  font-family: var(--sans); font-size: 16px; line-height: 1.5;
  padding: 14px; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  unicode-bidi: plaintext;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.capture textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.capture .row { display: flex; justify-content: flex-end; margin-top: 8px; }

/* ---------- tiles ---------- */
.tiles { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.tile {
  display: flex; align-items: center; gap: 7px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 12px; font-size: 13px;
  animation: riseIn .26s var(--ease) both;
}
.tile .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.tile .nums { color: var(--faint); font-variant-numeric: tabular-nums; }
.tile .tl-n { font-weight: 600; }
.tile-empty { opacity: .55; }
.rowitem.flash, .obrow.flash { background: var(--raise); border-color: var(--ink); }

/* ---------- chips (filters) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; padding: 7px 12px; min-height: 36px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); color: var(--faint);
  cursor: pointer; font-family: var(--sans);
  transition: color .15s ease, border-color .15s ease;
}
.chip .dot { width: 9px; height: 9px; border-radius: 50%; }
.chip.on { color: var(--ink); border-color: var(--ink); }

.searchbox {
  width: 100%; font-family: var(--sans); font-size: 16px; color: var(--ink);
  padding: 12px 14px; margin-bottom: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  unicode-bidi: plaintext;
}
.searchbox:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }

.weekstrip { color: var(--faint); font-size: 13px; margin: -6px 0 16px; }
.dayhead {
  font-family: var(--figure); font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); margin: 16px 0 8px;
}

/* ---------- cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 15px; margin-bottom: 9px; border-inline-start-width: 3px;
}
.card .text { white-space: pre-wrap; word-wrap: break-word; unicode-bidi: plaintext; }
.card .text.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { color: var(--faint); font-size: 12.5px; margin-top: 8px; }
.card .reason {
  font-size: 12.5px; color: var(--faint); font-style: italic; margin-top: 8px;
  unicode-bidi: plaintext; animation: riseIn .24s var(--ease) both;
}
.card .controls {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
}
.controls input.famt {
  font-family: var(--sans); font-size: 14px; width: 118px;
  padding: 8px 10px; min-height: 40px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  font-variant-numeric: tabular-nums;
}
.controls input.famt:focus { outline: 2px solid var(--ink); outline-offset: 1px; }

select.ws {
  font-family: var(--sans); font-size: 14px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; min-height: 40px;
}
select.ws.flash { outline: 2px solid var(--danger); }
select.ws.small { min-width: 76px; }

.check { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--faint); }
.check input { width: 16px; height: 16px; accent-color: var(--ink); }

/* ---------- buttons ---------- */
button { font-family: var(--sans); cursor: pointer; }
.btn {
  font-size: 14px; border-radius: var(--r-sm); padding: 9px 14px; min-height: 40px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font-weight: 500;
  transition: transform .12s var(--spring), background .18s ease, border-color .18s ease;
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: scale(.955); }
.btn.fill { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.ghost { border-color: transparent; color: var(--faint); }
.btn.ghost:hover { color: var(--ink); }
.btn.suggest { border-width: 2px; }
.btn.mini { padding: 7px 11px; min-height: 36px; font-size: 13px; }
.btn[disabled] { opacity: 0.55; cursor: default; }
.btn:focus-visible, .linkbtn:focus-visible, select.ws:focus-visible, .chip:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 2px;
}
.btn:active { transform: scale(.97); }
.bigbtn { width: 100%; padding: 14px; font-size: 15px; }

.xbtn { background: none; border: none; color: var(--faint); font-size: 17px; padding: 6px 8px; cursor: pointer; flex: none; transition: color .15s ease; }
.xbtn:hover { color: var(--danger); }

/* ---------- rows ---------- */
.rowitem {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 11px 13px; margin-bottom: 7px;
}
.rowitem:active { background: var(--raise); }
.rowitem .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; transition: opacity .2s ease; }
.rowitem .t { flex: 1; min-width: 0; unicode-bidi: plaintext; overflow-wrap: break-word; transition: color .2s ease; }
.rowitem .t small { color: var(--faint); font-size: 12px; display: block; }
.rowitem .rank { font-family: var(--figure); font-size: 18px; width: 22px; flex: none; color: var(--faint); text-align: center; }
.rowitem .amt { font-variant-numeric: tabular-nums; font-size: 14px; flex: none; text-align: end; }
.rowitem .amt small { display: block; color: var(--faint); font-size: 11.5px; }
.rowitem input.inline-in {
  flex: 1; min-width: 110px; font-family: var(--sans); font-size: 15px;
  padding: 8px 10px; min-height: 40px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  unicode-bidi: plaintext;
}
.rowitem input.inline-in:focus { outline: 2px solid var(--ink); outline-offset: 1px; }

.flag { font-size: 12px; color: var(--faint); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; flex: none; }
.flag.late { color: var(--danger); border-color: var(--danger); }

.empty { color: var(--faint); font-size: 14px; padding: 6px 2px; animation: riseIn .26s var(--ease) both; }

/* ---------- 4.2 rows commit to one direction ---------- */
/* dir is set per row from its own title, so a flex row mirrors wholesale:
   dot, text, meta and action all swap sides together. Everything below is
   written with logical properties so it follows. */
.rowitem[dir="rtl"], .obrow[dir="rtl"] { text-align: start; }
.rowitem .t small, .obrow .ob-m { text-align: start; }
.rowitem .amt, .obrow .ob-amt { text-align: end; }
.card[style*="border-left"] { border-inline-start-width: 3px; }

/* inline-start/end aware spacing for row internals */
.rowitem .rank { margin-inline-end: 0; }
.rowitem input.inline-in { text-align: start; }

/* ---------- 4.1 desktop ---------- */
/* Phone layout is untouched below 900px. */
@media (min-width: 900px) {
  .tabbar {
    inset-inline-start: 0; inset-block: 0 auto; top: 0; bottom: 0;
    width: 96px; height: 100dvh; flex-direction: column; justify-content: flex-start;
    gap: 2px; padding: 18px 8px calc(18px + env(safe-area-inset-bottom));
    border-top: none; border-inline-end: 1px solid var(--line);
  }
  /* Sized to an actual tab (62px + 2px gap) and offset by the rail's own
     padding. Previously it was a sixth of the viewport height, which put a
     stray sliver hundreds of pixels below the tab it was indicating. */
  .tabbar::before {
    width: 3px; height: 62px; left: 0; top: 0;
    transform: translateY(calc(18px + var(--tab, 0) * 64px));
    border-radius: 0 2px 2px 0;
  }
  .tabbar .tab { min-height: 62px; font-size: 11px; flex: 0 0 auto; padding: 10px 2px; }
  .tabbar .tab svg { width: 22px; height: 22px; }

  .wrap {
    max-width: 1180px;
    padding-inline-start: calc(96px + 28px);
    padding-inline-end: 28px;
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    column-gap: 30px;
    align-items: start;
  }
  .wrap > .appbar { grid-column: 1 / -1; margin-inline: -28px; }
  .wrap > *:not(.side):not(.side2):not(.appbar) { grid-column: 1; }
  .wrap > .side, .wrap > .side2 { grid-column: 2; }
  /* Obligations are the point of the Money page; they get the full width
     instead of being squeezed into the left column. */
  .wrap > .fullw { grid-column: 1 / -1; }
  .obcols { grid-template-columns: 1fr 1fr; gap: 24px; }
  .obtotals { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 620px; }
  .wrap::after { grid-column: 1 / -1; height: 40px; }
  .appbar { position: sticky; }
  #toast { bottom: 28px; }
  .searchpane { inset-inline-start: 96px; }
}

@media (min-width: 1280px) {
  .wrap {
    max-width: 1400px;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, .9fr);
  }
  .wrap > .side2 { grid-column: 3; }
  .wrap > .side { grid-column: 2; }
  .wrap > *:not(.side):not(.side2):not(.appbar) { grid-column: 1; }
}

/* ---------- search ---------- */
.searchpane {
  position: fixed; inset: 0; z-index: 60; background: var(--paper);
  display: none; flex-direction: column;
  padding-top: env(safe-area-inset-top);
}
.searchpane.on { display: flex; animation: riseIn .22s var(--ease) both; }
.sp-bar {
  display: flex; gap: 8px; align-items: center; padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.sp-bar input {
  flex: 1; font-family: var(--sans); font-size: 17px; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 11px 13px; min-width: 0; unicode-bidi: plaintext;
}
.sp-bar input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.sp-results {
  flex: 1; overflow-y: auto; padding: 12px 16px calc(24px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}
.sp-group {
  font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--faint); margin: 16px 0 7px;
}
.sp-group:first-child { margin-top: 0; }
.sp-row {
  display: block; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 11px 13px; margin-bottom: 6px;
}
.sp-row:active { background: var(--raise); }
.sp-t { display: block; font-size: 15px; unicode-bidi: plaintext; overflow-wrap: anywhere; }
.sp-s {
  display: block; font-size: 12.5px; color: var(--faint); margin-top: 2px;
  unicode-bidi: plaintext; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- task weight & detail ---------- */
/* 3.2 — a payment that blocks an operation must not look like a
   reminder to buy sugar. */
.rowitem.task .t, .t.tap { cursor: pointer; }
.t.tap:active { opacity: .7; }
.rowitem.p1 .t { font-weight: 600; font-size: 16px; }
.rowitem.p1 { border-inline-start: 3px solid var(--ink); }
.rowitem.p3 .t { color: var(--faint); font-size: 15px; }
.rowitem.p3 .t small { opacity: .75; }
/* 4.3 — an undated low-priority item should not shout as loudly as a dated
   one. Weight tracks consequence. */
.rowitem.p2 .t { font-weight: 450; }
.rowitem.p3 { border-inline-start: 3px solid transparent; }
.rowitem.p1 .t small { color: var(--faint); font-weight: 500; }
.rowitem .dot.p1 { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px currentColor; }
.rowitem.open { border-bottom-left-radius: 0; border-bottom-right-radius: 0; margin-bottom: 0; }
.unb { color: var(--ws-dist); font-weight: 600; }

.taskdetail {
  background: var(--raise); border: 1px solid var(--line); border-top: none;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  padding: 13px; margin-bottom: 7px;
  animation: riseIn .28s var(--spring) both;
}
.taskdetail .td-text {
  font-size: 14.5px; line-height: 1.55; white-space: pre-wrap;
  unicode-bidi: plaintext; overflow-wrap: anywhere; margin-bottom: 10px;
}
.taskdetail .td-block { margin-bottom: 10px; }
.taskdetail .td-row { display: flex; gap: 10px; flex-wrap: wrap; }
.taskdetail .td-row label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--faint);
}
.taskdetail .td-meta { font-size: 12px; color: var(--faint); margin-top: 10px; }

.rowitem.promise { border-inline-start: 3px solid var(--ws-dist); }

/* ---------- sparklines ---------- */
.sparkrow {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--hair);
}
.sparkrow:last-of-type { border-bottom: none; }
.sparkrow .sp-name {
  flex: none; width: 92px; display: flex; align-items: center; gap: 7px;
  font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sparkrow .sp-name .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.spark { flex: 1; height: 30px; min-width: 60px; }
.sp-zero { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 3; }
.sparkrow .sp-now {
  flex: none; text-align: end; font-family: var(--figure);
  font-variant-numeric: tabular-nums; font-size: 13.5px; min-width: 86px;
}
.sparkrow .sp-now small { display: block; color: var(--faint); font-size: 11px; font-family: var(--sans); }
.sparkrow .sp-now.neg { color: var(--danger); }

/* ---------- obligations ---------- */
.obtotals { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 14px; }
.obtot {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 13px 14px; border-inline-start-width: 3px;
}
.obtot.neg { border-inline-start-color: var(--danger); }
.ot-l { font-size: 10.5px; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: var(--faint); }
.ot-v {
  font-family: var(--figure); font-size: 19px; margin-top: 4px;
  font-variant-numeric: tabular-nums lining-nums; letter-spacing: -.01em;
  overflow-wrap: anywhere;
}
.ot-sep { color: var(--faint); }
.ot-u { font-size: 12px; color: var(--faint); margin-top: 2px; font-variant-numeric: tabular-nums; }

.obcols { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 720px) { .obcols { grid-template-columns: 1fr 1fr; gap: 20px; } }

.obrow {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 11px 13px; margin-bottom: 7px; border-inline-start-width: 3px;
  animation: riseIn .34s var(--spring) both;
  transition: background .3s ease, border-color .3s ease;
}
.obrow.late { border-inline-start-color: var(--danger); }
.obrow.flash { background: var(--raise); border-color: var(--ink); }
.obrow .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.obrow .ob-b { flex: 1; min-width: 0; }
.obrow .ob-who {
  font-size: 15px; unicode-bidi: plaintext;
  /* was overflow-wrap:anywhere, which is what split "amico" into amic / o */
  overflow-wrap: normal; word-break: keep-all;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.obrow .ob-m {
  font-size: 12px; color: var(--faint); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.obrow .ob-b { min-width: 120px; }
.obrow .ob-amt { white-space: nowrap; }
.ob-late { color: var(--danger); }
.obrow .ob-amt {
  flex: none; text-align: end; font-family: var(--figure);
  font-variant-numeric: tabular-nums lining-nums; font-size: 14.5px;
}
.obrow .ob-amt small { display: block; color: var(--faint); font-size: 11.5px; }

/* the thirty-day read */
.tl { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; }
.tl-over { padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--hair); }
.tl-h {
  font-size: 10.5px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase;
  color: var(--danger); margin-bottom: 7px;
}
.tl-track {
  display: flex; align-items: stretch; gap: 8px; overflow-x: auto;
  padding-bottom: 4px; -webkit-overflow-scrolling: touch;
}
.tl-day {
  flex: none; align-self: center; font-size: 10.5px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--faint); padding: 0 2px; white-space: nowrap;
}
.tl-pill {
  flex: none; display: block; text-decoration: none; color: inherit;
  background: var(--raise); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 8px 11px; font-size: 13px; max-width: 190px; unicode-bidi: plaintext;
  border-bottom-width: 2px; transition: border-color .15s ease, transform .1s ease;
}
.tl-pill:active { transform: scale(.97); }
.tl-pill b { font-family: var(--figure); font-variant-numeric: tabular-nums; margin-inline-start: 4px; }
.tl-pill small { display: block; color: var(--faint); font-size: 11px; margin-top: 1px; }
.tl-pill.late { border-bottom-color: var(--danger); }
.tl-pill.in { border-bottom-color: var(--ws-personal); }
.tl-over .tl-pill { display: inline-block; margin: 0 6px 6px 0; }

/* ---------- money ---------- */
.sumrow {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 12px; margin-bottom: 6px;
  font-size: 14px; font-variant-numeric: tabular-nums;
  animation: riseIn .26s var(--ease) both;
}
.sumrow .nm { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.sumrow .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.sumrow .col { width: 82px; text-align: end; flex: none; }
.sumrow .col small { display: block; color: var(--faint); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; }
.sumrow.total { border-color: var(--ink); }
.sumrow.slim .col { width: auto; min-width: 82px; }
.neg { color: var(--danger); }

.banner {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--ink); border-inline-start-width: 3px;
  border-radius: 12px; padding: 12px 14px; margin-bottom: 12px;
  animation: riseIn .26s var(--ease) both;
}
.banner .t { flex: 1; font-size: 14.5px; }
.banner .t small { display: block; color: var(--faint); font-size: 12.5px; }

.frm {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px;
}
.frm .full { grid-column: 1 / -1; }
.frm label { font-size: 12px; color: var(--faint); display: block; margin-bottom: 4px; }
.frm input, .frm select {
  width: 100%; font-family: var(--sans); font-size: 15px; color: var(--ink);
  padding: 10px; min-height: 42px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
}
.frm input:focus, .frm select:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.frm input[disabled] { color: var(--faint); }
.frm .submit { display: flex; justify-content: flex-end; }

.seg { display: flex; border: 1px solid var(--ink); border-radius: 8px; overflow: hidden; }
.seg button, .seg .segbtn {
  flex: 1; padding: 10px; min-height: 42px; background: var(--card); border: none;
  font-size: 14px; color: var(--ink); font-family: var(--sans); cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.seg .on { background: var(--ink); color: var(--paper); }

details.box {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 10px;
}
details.box summary { cursor: pointer; font-size: 14px; color: var(--faint); list-style-position: inside; transition: color .15s ease; }
details.box[open] summary { color: var(--ink); margin-bottom: 12px; }
details.box .frm { border: none; padding: 0; }

/* ---------- the life map ---------- */
.mapwrap {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 4px; margin-bottom: 12px; overflow: hidden;
}
.mapwrap svg { display: block; width: 100%; height: auto; touch-action: manipulation; }

/* Territories, not pie slices: each company owns a soft region. */
.map-wedge { transition: opacity .3s ease; }
.map-orbit { fill: none; stroke: var(--hair); stroke-width: 1; }
.map-orbit-label {
  font-family: var(--sans); font-size: 7.5px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; fill: var(--faint);
  opacity: .75; text-anchor: middle;
}
.map-sector-label {
  font-family: var(--sans); font-size: 9px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  text-anchor: middle; opacity: .95;
}

.map-link { fill: none; stroke: var(--line); transition: stroke .3s ease, stroke-width .3s ease, opacity .3s ease; }
.map-link.lit { stroke: var(--ink); opacity: 1; }

.map-node { cursor: pointer; }
.map-node .hit { fill: transparent; }
.map-node .shape {
  transition: transform .34s var(--spring);
  transform-box: fill-box; transform-origin: center;
}
.map-node:active .shape { transform: scale(.84); }
.map-node .halo { opacity: 0; transition: opacity .3s ease; }
.map-node.fresh .halo { opacity: .3; }
.map-node.sel .halo { opacity: .55; }
.map-node.sel .ring { stroke: var(--ink); stroke-width: 2; }
.map-node.dim { opacity: .18; }
.map-label {
  font-family: var(--sans); font-size: 8.5px; font-weight: 500; fill: var(--faint);
  text-anchor: middle; unicode-bidi: plaintext; cursor: pointer;
  paint-order: stroke; stroke: var(--card); stroke-width: 2.5px; stroke-linejoin: round;
  transition: fill .25s ease, opacity .25s ease;
}
/* A label with pointer-events:none let taps pass through to whichever bubble
   happened to sit beneath it — that is why the wrong subject opened. */
.map-labels .map-label { pointer-events: auto; }
.map-lead {
  stroke: var(--line); stroke-width: .8; fill: none; pointer-events: none;
}
.map-node.sel .map-label { fill: var(--ink); font-weight: 700; }
.map-you {
  font-family: var(--sans); font-size: 8px; font-weight: 700; letter-spacing: .18em;
  fill: var(--faint); text-anchor: middle; pointer-events: none;
}

@keyframes nodeIn { from { opacity: 0; transform: scale(.3); } to { opacity: 1; transform: scale(1); } }
.map-node .shape { animation: nodeIn .55s var(--spring) both; animation-delay: calc(var(--i,0) * 18ms); }
@keyframes breathe { 0%,100% { r: var(--r0); } 50% { r: calc(var(--r0) * 1.05); } }
@media (prefers-reduced-motion: reduce) { .map-node .shape { animation: none; } }

.maplegend {
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;
  font-size: 11px; color: var(--faint); margin: -4px 0 12px;
}
.maplegend span { display: inline-flex; align-items: center; gap: 5px; }
.maplegend i { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); display: block; }
.maplegend i.sq { border-radius: 2px; }

.mapinfo {
  background: var(--raise); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px; margin-bottom: 12px;
  animation: riseIn .3s var(--spring) both;
}
.mapinfo .mi-top { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.mapinfo .mi-name { font-size: 18px; font-weight: 650; flex: 1; unicode-bidi: plaintext; letter-spacing: -.01em; }
.mapinfo .mi-stats {
  display: flex; gap: 16px; margin: 10px 0 12px; font-size: 12px; color: var(--faint);
}
.mapinfo .mi-stats b {
  display: block; font-family: var(--figure); font-size: 19px; color: var(--ink);
  font-variant-numeric: tabular-nums; line-height: 1.15;
}
.mapinfo .mi-links { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.mapinfo .mi-links a {
  font-size: 12px; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--faint); text-decoration: none;
  unicode-bidi: plaintext; transition: color .15s ease, border-color .15s ease;
}
.mapinfo .mi-links a:hover { color: var(--ink); border-color: var(--ink); }

.pulse {
  display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--faint);
  margin-bottom: 14px; font-variant-numeric: tabular-nums;
}
.pulse b { color: var(--ink); font-family: var(--figure); }

.feedday {
  font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--faint); margin: 18px 0 8px;
}
.feedrow {
  display: flex; align-items: flex-start; gap: 11px; padding: 10px 0;
  border-bottom: 1px solid var(--hair); text-decoration: none; color: inherit;
}
.feedrow:last-child { border-bottom: none; }
.feedrow .fr-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 6px; }
.feedrow .fr-b { flex: 1; min-width: 0; }
.feedrow .fr-t { font-size: 14.5px; unicode-bidi: plaintext; display: block; }
.feedrow .fr-m { font-size: 12px; color: var(--faint); margin-top: 2px; display: block; }
.feedrow .fr-k {
  font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint);
  border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; flex: none; margin-top: 4px;
}

.freshdot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--danger); margin-inline-start: 6px; vertical-align: 1px;
}

/* ---------- nav cards (the More hub) ---------- */
.navcard {
  display: flex; align-items: center; gap: 13px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; margin-bottom: 8px; text-decoration: none; color: var(--ink);
  animation: riseIn .26s var(--ease) both;
  transition: border-color .15s ease, transform .1s ease;
}
.navcard:active { transform: scale(.99); }
.navcard:hover { border-color: var(--ink); }
.navcard:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.navcard .nc-i { font-size: 21px; flex: none; width: 30px; text-align: center; }
.navcard .nc-t { flex: 1; min-width: 0; font-size: 15.5px; }
.navcard .nc-t small {
  display: block; color: var(--faint); font-size: 12.5px; margin-top: 2px; line-height: 1.4;
}

/* ---------- bars ---------- */
.barrow {
  display: flex; align-items: center; gap: 10px; margin-bottom: 7px;
  animation: riseIn .26s var(--ease) both;
}
.barlabel {
  flex: none; width: 34%; max-width: 150px; font-size: 13.5px;
  display: flex; align-items: center; gap: 7px; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  unicode-bidi: plaintext;
}
.barlabel .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.bartrack {
  flex: 1; height: 9px; background: var(--line); border-radius: 5px; overflow: hidden;
}
.barfill {
  height: 100%; border-radius: 5px; min-width: 3px;
  transition: width .5s var(--ease);
}
.barval {
  flex: none; width: 52px; text-align: end; font-size: 12.5px;
  color: var(--faint); font-variant-numeric: tabular-nums;
}

/* ---------- story arc ---------- */
.arc { position: relative; padding-inline-start: 18px; }
.arc::before {
  content: ""; position: absolute; inset-block: 6px; inset-inline-start: 4px;
  width: 2px; background: var(--line); border-radius: 2px;
}
.beat { position: relative; padding: 0 0 16px 0; animation: riseIn .26s var(--ease) both; }
.beat::before {
  content: ""; position: absolute; inset-inline-start: -18px; top: 5px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--ink);
}
.beat:last-child { padding-bottom: 0; }
.beat-when {
  font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--faint); font-family: var(--figure); margin-bottom: 2px;
}
.beat-what { font-size: 15px; line-height: 1.5; unicode-bidi: plaintext; }

/* ---------- calendar ---------- */
.cal {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px;
}
.cal-h {
  text-align: center; font-size: 11px; color: var(--faint);
  font-family: var(--figure); letter-spacing: .08em; padding-bottom: 4px;
}
.cal-d {
  position: relative; aspect-ratio: 1 / 1; min-height: 40px;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 2px; padding: 5px 2px 3px;
  background: none; border: 1px solid transparent; border-radius: 9px;
  font-family: var(--sans); color: var(--ink); cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.cal-d.out { visibility: hidden; cursor: default; }
.cal-d .n { font-size: 14px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.cal-d .mk { display: flex; align-items: center; gap: 2px; min-height: 8px; flex-wrap: wrap; justify-content: center; }
.cal-d .mk i { width: 5px; height: 5px; border-radius: 50%; display: block; }
.cal-d .mk .tn {
  font-size: 9.5px; font-weight: 600; color: var(--faint);
  border: 1px solid var(--line); border-radius: 4px; padding: 0 3px; line-height: 1.35;
}
.cal-d.today .n { font-weight: 700; }
.cal-d.today { background: var(--paper); }
.cal-d.sel { border-color: var(--ink); }
.cal-d:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; }

.rowitem .tm {
  flex: none; width: 60px; font-size: 12.5px; color: var(--faint);
  font-variant-numeric: tabular-nums; line-height: 1.25;
}

/* ---------- settings ---------- */
.setgroup { margin-bottom: 26px; }
.setrow {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 14px; margin-bottom: 8px;
}
.setrow .rowline { display: flex; align-items: center; gap: 10px; }
.setrow .t { flex: 1; min-width: 0; }
.setrow .t small { display: block; color: var(--faint); font-size: 12.5px; }
.setrow .seg { max-width: 260px; flex: none; }
.setrow input.setin {
  font-family: var(--sans); font-size: 15px; color: var(--ink);
  padding: 9px 10px; min-height: 40px; width: 130px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  font-variant-numeric: tabular-nums;
}
.setrow input.setin.wide { width: 100%; }
.setrow input.setin:focus { outline: 2px solid var(--ink); outline-offset: 1px; }

/* ---------- brief ---------- */
.narrative {
  font-size: 17px; line-height: 1.62; letter-spacing: -.004em;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; margin-bottom: 12px; unicode-bidi: plaintext;
  animation: riseIn .3s var(--ease) both;
}
.briefmeta { color: var(--faint); font-size: 12.5px; margin-bottom: 10px; }

/* ---------- login ---------- */
.login { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom)); }
.login .card { width: 100%; max-width: 360px; padding: 28px; border-inline-start-width: 1px; }
.login .brand { text-align: center; margin-bottom: 22px; }
.login .brand .dots { margin-bottom: 10px; }
.login .wordmark { font-size: 24px; display: block; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--faint); margin-bottom: 5px; }
.field input {
  width: 100%; font-size: 16px; padding: 12px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
}
.field input:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.login .btn { width: 100%; margin-top: 6px; }
.err { color: var(--danger); font-size: 13.5px; margin-top: 10px; min-height: 1.2em; }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(78px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(10px) scale(.98);
  background: var(--ink); color: var(--paper); font-size: 14px;
  padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease); max-width: 90vw;
  display: flex; align-items: center; gap: 10px;
}
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); pointer-events: auto; }
#toast .tbtn {
  background: none; border: 1px solid var(--paper); color: var(--paper);
  border-radius: 7px; padding: 4px 10px; font-size: 13px; font-family: var(--sans);
}

/* ---------- accessibility modes ---------- */
@media (prefers-contrast: more) {
  :root { --faint: #55503F; --line: #B7B0A2; }
  [data-theme="dark"] { --faint: #CFC7B8; --line: #5B5348; }
}
@media (forced-colors: active) {
  .card, .rowitem, .tile, .sumrow, .banner, .btn, .chip, .tabbar, .setrow { border: 1px solid ButtonText; }
  .btn:focus-visible, .chip:focus-visible, .tab:focus-visible { outline: 2px solid Highlight; }
  .thinking::after, .skel { animation: none; background: none; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .card, .rowitem, .tile, .sumrow, .banner, .narrative, .empty, .reason { animation: none; }
  .thinking::after, .skel { animation: none; }
  .tick { animation: none; }
  #toast, .card, .rowitem, .btn { transition: none; }
  .spin { animation-duration: 1.4s; }
}


/* The old static header is removed by mountBar() at runtime. It is left
   visible in CSS on purpose: if scripting fails, a plain header is far
   better than a page with no heading at all. */
header.app { display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0 12px; border-bottom: 1px solid var(--hair); margin-bottom: 16px; }

/* ---------- view transition choreography ---------- */
::view-transition-old(root) { animation: vtOut .16s var(--ease) both; }
::view-transition-new(root) { animation: vtIn .26s var(--spring) both; }
@keyframes vtOut { to { opacity: 0; } }
@keyframes vtIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
::view-transition-group(appbar), ::view-transition-group(tabbar) { animation-duration: .01s; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
