/* Graphito Desk styles. Soft grey canvas, white cards with large radii and
   gentle shadows, a pastel wash on Home, black pill buttons, pastel status
   tags and a floating capsule tab bar with a black add button.
   Kept from Graphito Employees: four font weights, four radii, light glass,
   undo instead of confirmation dialogs. All colours are tokens. */

/* Figtree, SIL Open Font License 1.1. Self-hosted, no outside calls. */
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/figtree-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/figtree-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* Four weights */
  --w-regular: 400;
  --w-medium: 500;
  --w-semibold: 600;
  --w-bold: 700;

  /* Four radii */
  --r-s: 10px;
  --r-m: 16px;
  --r-l: 24px;
  --r-pill: 999px;

  --font: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;

  /* Canvas, cards and text */
  --bg: #F2F3F5;
  --surface: #FFFFFF;
  --surface-2: #F4F5F7;
  --surface-3: #E9EBEE;
  --ink: #0F1013;
  --ink-2: #5B616E;
  --ink-3: #9AA0AB;
  --line: #EDEEF1;
  --line-strong: #DCDFE4;
  --glass: rgba(255, 255, 255, 0.74);
  --glass-edge: rgba(255, 255, 255, 0.92);
  --blur: saturate(180%) blur(18px);
  --shadow-card: 0 1px 2px rgba(17, 24, 39, 0.04), 0 8px 24px -12px rgba(17, 24, 39, 0.12);
  --shadow-float: 0 14px 34px -10px rgba(17, 24, 39, 0.28), 0 3px 8px rgba(17, 24, 39, 0.06);
  --scrim: rgba(15, 16, 19, 0.32);

  /* Black pill buttons (white in dark mode) */
  --btn: #111214;
  --btn-hover: #2B2D33;
  --btn-ink: #FFFFFF;

  /* Pastel wash behind Home */
  --wash-1: rgba(167, 243, 208, 0.55);
  --wash-2: rgba(186, 230, 253, 0.65);
  --wash-3: rgba(221, 214, 254, 0.50);

  /* Accent: active tab, focus, progress. Teal by default. */
  --accent: #0F766E;
  --accent-fill: #0F766E;
  --accent-ink: #FFFFFF;
  --accent-soft: #E3F4F1;
  --accent-ring: rgba(15, 118, 110, 0.18);

  /* Pastels: tint, stronger tile tint, and ink for text on them */
  --lilac-bg: #EFECFD;
  --lilac-tile: #E8E4FC;
  --lilac-ink: #5B3FD1;
  --peach-bg: #FDEEE5;
  --peach-tile: #FCE5D7;
  --peach-ink: #C2410C;
  --sky-bg: #E3F1FD;
  --sky-tile: #DAEDFD;
  --sky-ink: #1D6FB8;
  --mint-bg: #E3F6EC;
  --mint-tile: #DAF2E4;
  --mint-ink: #15803D;
  --butter-bg: #FCF3D8;
  --butter-tile: #FAEDC5;
  --butter-ink: #A16207;
  --rose-bg: #FDE8EA;
  --rose-tile: #FBDDE0;
  --rose-ink: #C0262D;
  --grey-bg: #EEEFF1;
  --grey-ink: #5B616E;
  --lime: #D9F99D;
  --lime-ink: #1A2E05;

  --danger: #C0262D;
  --nav-h: 68px;
  --glide-shadow: 0 0 1px 0 var(--accent-ring), 0 6px 12px 0 var(--accent-ring);
  --pulse: rgba(17, 18, 20, 0.35);
  --dot: rgba(15, 16, 19, 0.16);
  color-scheme: light;
}

:root[data-accent="indigo"] {
  --accent: #4338CA;
  --accent-fill: #4338CA;
  --accent-soft: #ECEBFC;
  --accent-ring: rgba(67, 56, 202, 0.18);
}

:root[data-accent="marigold"] {
  --accent: #B45309;
  --accent-fill: #B45309;
  --accent-soft: #FCEEDF;
  --accent-ring: rgba(180, 83, 9, 0.18);
}

/* Dark mode, three ways. With no choice made (System), it follows the
   phone. Light or Dark in Settings sets data-theme on <html> and wins.
   The two blocks below must hold the same values: tools/check-css.js
   fails the release if they drift apart. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B0C10;
    --surface: #16181E;
    --surface-2: #1E2128;
    --surface-3: #282C34;
    --ink: #F2F3F5;
    --ink-2: #A8AEBA;
    --ink-3: #6E7482;
    --line: #23262E;
    --line-strong: #323640;
    --glass: rgba(22, 24, 30, 0.76);
    --glass-edge: rgba(255, 255, 255, 0.06);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-float: 0 14px 34px -10px rgba(0, 0, 0, 0.7);
    --scrim: rgba(0, 0, 0, 0.6);
    --glide-shadow: var(--shadow-card);
    --pulse: rgba(242, 243, 245, 0.35);
    --dot: rgba(255, 255, 255, 0.12);
    --btn: #F2F3F5;
    --btn-hover: #D9DCE1;
    --btn-ink: #0B0C10;
    --wash-1: rgba(52, 211, 153, 0.12);
    --wash-2: rgba(56, 189, 248, 0.12);
    --wash-3: rgba(139, 92, 246, 0.12);
    --accent: #2DD4BF;
    --accent-soft: rgba(45, 212, 191, 0.12);
    --accent-ring: rgba(45, 212, 191, 0.25);
    --lilac-bg: rgba(167, 139, 250, 0.14);
    --lilac-tile: rgba(167, 139, 250, 0.16);
    --lilac-ink: #C4B5FD;
    --peach-bg: rgba(251, 146, 60, 0.13);
    --peach-tile: rgba(251, 146, 60, 0.15);
    --peach-ink: #FDBA74;
    --sky-bg: rgba(96, 165, 250, 0.13);
    --sky-tile: rgba(96, 165, 250, 0.15);
    --sky-ink: #93C5FD;
    --mint-bg: rgba(52, 211, 153, 0.12);
    --mint-tile: rgba(52, 211, 153, 0.14);
    --mint-ink: #6EE7B7;
    --butter-bg: rgba(250, 204, 21, 0.11);
    --butter-tile: rgba(250, 204, 21, 0.13);
    --butter-ink: #FDE68A;
    --rose-bg: rgba(251, 113, 133, 0.13);
    --rose-tile: rgba(251, 113, 133, 0.15);
    --rose-ink: #FDA4AF;
    --grey-bg: #262A32;
    --grey-ink: #A8AEBA;
    --lime: #BEF264;
    --lime-ink: #1A2E05;
    --danger: #FDA4AF;
    color-scheme: dark;
  }
  :root:not([data-theme="light"])[data-accent="indigo"] { --accent: #A5B4FC; --accent-soft: rgba(129, 140, 248, 0.14); --accent-ring: rgba(129, 140, 248, 0.26); }
  :root:not([data-theme="light"])[data-accent="marigold"] { --accent: #FBBF24; --accent-soft: rgba(245, 158, 11, 0.13); --accent-ring: rgba(245, 158, 11, 0.26); }
}

:root[data-theme="dark"] {
  --bg: #0B0C10;
  --surface: #16181E;
  --surface-2: #1E2128;
  --surface-3: #282C34;
  --ink: #F2F3F5;
  --ink-2: #A8AEBA;
  --ink-3: #6E7482;
  --line: #23262E;
  --line-strong: #323640;
  --glass: rgba(22, 24, 30, 0.76);
  --glass-edge: rgba(255, 255, 255, 0.06);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-float: 0 14px 34px -10px rgba(0, 0, 0, 0.7);
  --scrim: rgba(0, 0, 0, 0.6);
  --glide-shadow: var(--shadow-card);
  --pulse: rgba(242, 243, 245, 0.35);
  --dot: rgba(255, 255, 255, 0.12);
  --btn: #F2F3F5;
  --btn-hover: #D9DCE1;
  --btn-ink: #0B0C10;
  --wash-1: rgba(52, 211, 153, 0.12);
  --wash-2: rgba(56, 189, 248, 0.12);
  --wash-3: rgba(139, 92, 246, 0.12);
  --accent: #2DD4BF;
  --accent-soft: rgba(45, 212, 191, 0.12);
  --accent-ring: rgba(45, 212, 191, 0.25);
  --lilac-bg: rgba(167, 139, 250, 0.14);
  --lilac-tile: rgba(167, 139, 250, 0.16);
  --lilac-ink: #C4B5FD;
  --peach-bg: rgba(251, 146, 60, 0.13);
  --peach-tile: rgba(251, 146, 60, 0.15);
  --peach-ink: #FDBA74;
  --sky-bg: rgba(96, 165, 250, 0.13);
  --sky-tile: rgba(96, 165, 250, 0.15);
  --sky-ink: #93C5FD;
  --mint-bg: rgba(52, 211, 153, 0.12);
  --mint-tile: rgba(52, 211, 153, 0.14);
  --mint-ink: #6EE7B7;
  --butter-bg: rgba(250, 204, 21, 0.11);
  --butter-tile: rgba(250, 204, 21, 0.13);
  --butter-ink: #FDE68A;
  --rose-bg: rgba(251, 113, 133, 0.13);
  --rose-tile: rgba(251, 113, 133, 0.15);
  --rose-ink: #FDA4AF;
  --grey-bg: #262A32;
  --grey-ink: #A8AEBA;
  --lime: #BEF264;
  --lime-ink: #1A2E05;
  --danger: #FDA4AF;
  color-scheme: dark;
}
:root[data-theme="dark"][data-accent="indigo"] { --accent: #A5B4FC; --accent-soft: rgba(129, 140, 248, 0.14); --accent-ring: rgba(129, 140, 248, 0.26); }
:root[data-theme="dark"][data-accent="marigold"] { --accent: #FBBF24; --accent-soft: rgba(245, 158, 11, 0.13); --accent-ring: rgba(245, 158, 11, 0.26); }


*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  font-weight: var(--w-regular);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
body.sheet-open { overflow: hidden; }

button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: inherit; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; }
h1 { font-size: 30px; font-weight: var(--w-semibold); letter-spacing: -0.02em; }
h2 { font-size: 20px; font-weight: var(--w-semibold); letter-spacing: -0.01em; }
h3 { font-size: 16px; font-weight: var(--w-semibold); }
p { margin: 0; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.boot { padding: 40vh 16px 0; text-align: center; color: var(--ink-3); }

/* ---------- Layout ---------- */
.shell { position: relative; max-width: 560px; margin: 0 auto; min-height: 100vh; }
.wash {
  position: absolute;
  inset: 0 0 auto 0;
  height: 380px;
  background:
    radial-gradient(90% 70% at 0% 0%, var(--wash-1), transparent 70%),
    radial-gradient(80% 70% at 100% 0%, var(--wash-2), transparent 70%),
    radial-gradient(70% 60% at 60% 35%, var(--wash-3), transparent 75%);
  -webkit-mask-image: linear-gradient(to bottom, #000 45%, transparent);
  mask-image: linear-gradient(to bottom, #000 45%, transparent);
  pointer-events: none;
}
.page {
  position: relative;
  padding: calc(14px + env(safe-area-inset-top)) 20px calc(var(--nav-h) + 56px + env(safe-area-inset-bottom));
  display: grid;
  /* One column that never grows past the screen, however wide a child is. */
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}
.results { display: grid; gap: 24px; }

/* Home header: round buttons, date, two-tone greeting */
.hdr { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hdr-end { display: flex; gap: 10px; }
.date-line { font-size: 14px; color: var(--ink-3); margin-bottom: 4px; }
.greeting { font-size: 32px; line-height: 1.12; }
.greeting span { display: block; color: var(--ink-3); }

/* Sub-page header: back button, title with count, actions */
.subhdr { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.subhdr h1 { flex: 1; min-width: 0; font-size: 26px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subhdr h1 sup { font-size: 13px; font-weight: var(--w-medium); color: var(--ink-3); vertical-align: super; margin-left: 2px; }
.subhdr-end { display: flex; align-items: center; gap: 8px; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.title-row h1 { font-size: 30px; }

.round-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-pill);
  border: 1px solid var(--glass-edge);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow-card);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
}
.round-btn svg { width: 20px; height: 20px; }
.round-btn.dark { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
.round-btn.small { width: 38px; height: 38px; }
.round-btn.small svg { width: 18px; height: 18px; }
.round-btn .dot {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: #F97316;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: var(--w-bold);
  display: grid;
  place-items: center;
  border: 2px solid var(--bg);
}

.section { display: grid; gap: 14px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-title h2 { font-size: 20px; }
.section-title .arrow { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-pill); color: var(--ink-2); text-decoration: none; }
.section-title .arrow svg { width: 22px; height: 22px; }
.section-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: var(--w-medium); color: var(--ink-3); padding: 0 4px; }
.section-label svg { width: 15px; height: 15px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border-radius: var(--r-l);
  box-shadow: var(--shadow-card);
  padding: 18px;
  display: grid;
  gap: 14px;
}
.card.glass { background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid var(--glass-edge); }
.card-link { text-decoration: none; color: inherit; }
button.card, button.tile { border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.account { display: flex; align-items: center; gap: 14px; }
.account .row-title { font-size: 17px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-head > div { display: grid; gap: 2px; min-width: 0; }
.divider { height: 1px; background: var(--line); }
.label { font-size: 13px; color: var(--ink-3); }
.arrow-icon { color: var(--ink-2); display: grid; }
.arrow-icon svg { width: 22px; height: 22px; }

/* Highlight card (current item) */
.highlight { display: flex; align-items: center; gap: 12px; padding: 16px 18px; }
.highlight .hl-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.highlight .hl-title { font-weight: var(--w-semibold); font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--r-pill); background: #475467; color: #FFFFFF; font-size: 12px; font-weight: var(--w-semibold); white-space: nowrap; }

/* Pastel stat tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 16px 16px 14px;
  border-radius: var(--r-l);
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
  min-height: 112px;
  align-content: space-between;
  cursor: pointer;
  border: 0;
  text-align: left;
}
/* The number on the left, the icon on the right. An amount too long to fit
   beside the icon goes just under it (wrap-reverse keeps the icon on top). */
.tile-top { display: flex; flex-wrap: wrap-reverse; align-items: center; justify-content: space-between; gap: 10px 8px; min-width: 0; }
.tile-top .tile-icon { margin-left: auto; }
.tile-value { font-size: 30px; font-weight: var(--w-semibold); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1; white-space: nowrap; }
.tile-bottom { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 14px; font-weight: var(--w-medium); }
.tile-bottom svg { width: 18px; height: 18px; }
/* The tile's icon: a glass square with a big line icon in the tile's ink. */
.tile-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--r-m); background: var(--glass); }
.tile-icon svg { width: 28px; height: 28px; overflow: visible; }
/* Narrow phones: a slightly smaller icon keeps most amounts beside it. */
@media (max-width: 380px) {
  .tile-icon { width: 42px; height: 42px; }
  .tile-icon svg { width: 25px; height: 25px; }
  .tile-value.small-money { font-size: 22px; }
}
.tile.t-lilac { background: var(--lilac-tile); } .tile.t-lilac .tile-icon { color: var(--lilac-ink); }
.tile.t-peach { background: var(--peach-tile); } .tile.t-peach .tile-icon { color: var(--peach-ink); }
.tile.t-sky { background: var(--sky-tile); } .tile.t-sky .tile-icon { color: var(--sky-ink); }
.tile.t-mint { background: var(--mint-tile); } .tile.t-mint .tile-icon { color: var(--mint-ink); }

/* Avatars and avatar stacks */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--r-pill);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: var(--w-semibold);
}
.avatar.small { width: 30px; height: 30px; font-size: 11px; }
.avatar.large { width: 56px; height: 56px; font-size: 18px; }
.stack { display: flex; }
.stack .avatar { width: 28px; height: 28px; font-size: 10px; border: 2px solid var(--surface); margin-left: -8px; }
.stack .avatar:first-child { margin-left: 0; }
/* Avatar circles: "+N" for the people not shown. */
.stack .avatar.more { background: var(--btn); color: var(--btn-ink); font-size: 9.5px; letter-spacing: -0.02em; }
.tile .stack .avatar { border-color: var(--peach-tile); }
.tone-mint { background: var(--mint-bg); color: var(--mint-ink); }
.tone-lilac { background: var(--lilac-bg); color: var(--lilac-ink); }
.tone-peach { background: var(--peach-bg); color: var(--peach-ink); }
.tone-sky { background: var(--sky-bg); color: var(--sky-ink); }
.tone-butter { background: var(--butter-bg); color: var(--butter-ink); }
.tone-rose { background: var(--rose-bg); color: var(--rose-ink); }
.tone-grey { background: var(--grey-bg); color: var(--grey-ink); }

/* Icon tiles */
.icon-tile { width: 42px; height: 42px; border-radius: var(--r-m); display: grid; place-items: center; flex-shrink: 0; }
.icon-tile svg { width: 20px; height: 20px; }
.icon-circle { width: 40px; height: 40px; border-radius: var(--r-pill); display: grid; place-items: center; flex-shrink: 0; }
.icon-circle svg { width: 18px; height: 18px; }

/* Status tags with icons */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: var(--r-s);
  font-size: 12.5px;
  font-weight: var(--w-semibold);
  white-space: nowrap;
}
.tag svg { width: 14px; height: 14px; }
.tag.t-pending { background: var(--peach-bg); color: var(--peach-ink); }
.tag.t-progress { background: var(--sky-bg); color: var(--sky-ink); }
.tag.t-submitted { background: var(--lilac-bg); color: var(--lilac-ink); }
.tag.t-review { background: var(--butter-bg); color: var(--butter-ink); }
.tag.t-success { background: var(--mint-bg); color: var(--mint-ink); }
.tag.t-failed { background: var(--rose-bg); color: var(--rose-ink); }
.tag.t-expired { background: var(--grey-bg); color: var(--grey-ink); }

.count-pill { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 8px; border-radius: var(--r-pill); background: var(--ink-2); color: var(--surface); font-size: 12px; font-weight: var(--w-semibold); font-variant-numeric: tabular-nums; }
.date-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-pill); background: var(--surface-2); font-size: 13px; font-weight: var(--w-medium); color: var(--ink-2); white-space: nowrap; }
.date-pill svg { width: 15px; height: 15px; }
.meta { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-3); min-width: 0; }
.meta svg { width: 15px; height: 15px; flex-shrink: 0; }
.meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metas { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: var(--r-pill); }
.legend .d-mint { background: var(--mint-ink); }
.legend .d-sky { background: var(--sky-ink); }
.legend .d-butter { background: var(--butter-ink); }
.legend .d-rose { background: var(--rose-ink); }

/* ---------- Carousel ---------- */
.carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  /* Cards snap to the page margin, in line with the cards above. */
  scroll-padding-inline: 20px;
  margin: 0 -20px;
  padding: 2px 20px 10px;
  scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel > * { flex: 0 0 76%; max-width: 300px; scroll-snap-align: start; }
.mini-card { display: grid; gap: 12px; padding: 16px; }
.mini-card .mc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mini-card .mc-title { font-weight: var(--w-semibold); font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-card .mc-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }

/* ---------- Lists ---------- */
.list-card { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow-card); overflow: hidden; }
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 12px 16px;
  border: 0;
  background: transparent;
  text-align: left;
  text-decoration: none;
  color: inherit;
  position: relative;
}
.row + .row::before { content: ""; position: absolute; top: 0; left: 70px; right: 16px; height: 1px; background: var(--line); }
.row.plain + .row.plain::before { left: 16px; }
button.row, a.row { cursor: pointer; }
button.row:active, a.row:active { background: var(--surface-2); }
.row-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.row-title { font-weight: var(--w-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub.wrap { white-space: normal; }
.row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; color: var(--ink-3); font-size: 12.5px; flex-shrink: 0; }
.row-end.inline { flex-direction: row; align-items: center; gap: 8px; }
.row.dim .row-title, .row.dim .avatar { opacity: 0.55; }
.chev { color: var(--ink-3); display: grid; }
.chev svg { width: 18px; height: 18px; }
.value-end { color: var(--ink-2); font-size: 14px; display: flex; align-items: center; gap: 6px; flex-shrink: 0; white-space: nowrap; }
.row-title.wrap { white-space: normal; }

/* Client cards */
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.client-card { display: grid; gap: 12px; padding: 16px 16px 14px; text-align: left; border: 0; width: 100%; cursor: pointer; color: inherit; font: inherit; }
.client-card.static { cursor: default; }
.client-card .cc-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.client-card .cc-top .tag { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.client-card .cc-name { flex: 1; min-width: 0; font-weight: var(--w-semibold); font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-card .cc-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.client-card.dim .cc-name { color: var(--ink-3); }
.kebab { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-pill); background: var(--surface-2); border: 0; color: var(--ink-2); cursor: pointer; flex-shrink: 0; }
.kebab svg { width: 18px; height: 18px; }

/* Transaction-style rows (backup history) */
.tx-list { display: grid; gap: 10px; }
.tx { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.tx .tx-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.tx .tx-title { font-weight: var(--w-semibold); font-size: 14.5px; }
.tx .tx-sub { font-size: 12.5px; color: var(--ink-3); }
.tx .tx-end { font-weight: var(--w-semibold); font-size: 14px; font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 22px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: var(--btn);
  color: var(--btn-ink);
  font-size: 15px;
  font-weight: var(--w-semibold);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, transform 0.1s;
}
.btn:hover { background: var(--btn-hover); }
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.45; cursor: default; transform: none; }
.btn.block { width: 100%; }
.btn.small { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn svg { width: 18px; height: 18px; }
.btn.secondary, .btn.quiet { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow-card); }
.btn.secondary:hover, .btn.quiet:hover { background: var(--surface-2); }
.sheet .btn.secondary, .card .btn.secondary { background: var(--surface-2); border-color: transparent; box-shadow: none; }
.btn.plain { background: transparent; color: var(--ink-2); padding: 0 12px; }
.btn.plain:hover { background: var(--surface-2); }
.btn.danger { background: var(--rose-bg); color: var(--rose-ink); }
.btn.danger:hover { background: var(--rose-tile); }
.btn.lime { background: var(--lime); color: var(--lime-ink); min-height: 38px; padding: 0 18px; font-size: 14px; }
.btn.lime:hover { filter: brightness(0.97); }
.btn.muted-pill { background: var(--surface-3); color: var(--ink-3); min-height: 38px; padding: 0 16px; font-size: 14px; cursor: default; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-pill); border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover, .icon-btn:active { background: var(--surface-2); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions .btn { flex: 1 1 auto; }
.pill-link { justify-self: center; display: inline-flex; align-items: center; gap: 4px; padding: 9px 16px; border-radius: var(--r-pill); background: var(--glass); border: 1px solid var(--glass-edge); color: var(--ink-3); font-size: 14px; text-decoration: none; cursor: pointer; }
.pill-link svg { width: 16px; height: 16px; }

/* Dropdown pill, text tabs, segmented pills, search pill */
.dropdown { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--surface); font-size: 13.5px; font-weight: var(--w-medium); cursor: pointer; color: var(--ink); white-space: nowrap; }
.dropdown svg { width: 16px; height: 16px; color: var(--ink-3); }
.tabs-row { display: flex; align-items: center; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: -6px -20px -16px; padding: 6px 20px 16px; }
.tabs-row::-webkit-scrollbar { display: none; }
.tabs-row .round-btn { box-shadow: none; background: var(--surface); }

/* Sliding-pill tabs, after the Uiverse "glider" tabs: a white capsule with
   a soft accent glow, a tinted pill that slides under the picked tab
   (placed by placeGliders in app.js), and count badges that fill in when
   picked. Tabs share the width and never shrink below their text. */
.glide { position: relative; display: flex; flex: 1 0 auto; max-width: 100%; padding: 5px; border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--glide-shadow); }
.tabs-row .glide { max-width: none; }
.glide-tab { position: relative; z-index: 2; flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 0; border-radius: var(--r-pill); background: none; color: var(--ink-2); font: inherit; font-size: 14px; font-weight: var(--w-medium); white-space: nowrap; cursor: pointer; transition: color 0.15s ease-in; }
.glide-tab.on { color: var(--accent); font-weight: var(--w-semibold); }
.glide-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.glide-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent); font-size: 11.5px; font-weight: var(--w-semibold); font-variant-numeric: tabular-nums; transition: background-color 0.15s ease-in, color 0.15s ease-in; }
.glide-tab.on .glide-count { background: var(--accent-fill); color: var(--accent-ink); }
.glider { position: absolute; z-index: 1; top: 5px; bottom: 5px; left: 0; width: 0; border-radius: var(--r-pill); background: var(--accent-soft); transition: transform 0.25s ease-out, width 0.25s ease-out; }
.search-pill { position: relative; display: flex; align-items: center; }
.search-pill svg { position: absolute; left: 16px; width: 18px; height: 18px; color: var(--ink-3); }
.search-pill .input { padding-left: 44px; border-radius: var(--r-pill); background: var(--surface); box-shadow: var(--shadow-card); border-color: transparent; }

/* ---------- Pop-up menu ---------- */
.menu-scrim { position: fixed; inset: 0; z-index: 45; }
.menu {
  position: fixed;
  z-index: 46;
  min-width: 190px;
  padding: 6px;
  border-radius: var(--r-m);
  background: var(--surface);
  box-shadow: var(--shadow-float);
  border: 1px solid var(--line);
  display: grid;
  animation: pop-in 0.14s ease-out;
}
.menu-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-s); border: 0; background: none; text-align: left; font-size: 14.5px; font-weight: var(--w-medium); color: var(--ink); cursor: pointer; text-decoration: none; }
.menu-item:hover { background: var(--surface-2); }
.menu-item svg { width: 18px; height: 18px; color: var(--lilac-ink); }
.menu-item.danger, .menu-item.danger svg { color: var(--rose-ink); }
.menu-item .tick { margin-left: auto; color: var(--accent); }
.menu-sep { height: 1px; background: var(--line); margin: 4px 8px; }

/* ---------- Forms ---------- */
form { display: grid; gap: 18px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.field { display: grid; gap: 7px; }
.field > span { font-size: 13px; font-weight: var(--w-medium); color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--ink-3); }
.field .value { font-weight: var(--w-medium); }
.input, .textarea {
  width: 100%;
  min-height: 52px;
  padding: 13px 16px;
  border-radius: var(--r-m);
  border: 1px solid transparent;
  background: var(--surface-2);
  font-size: 16px;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.textarea { min-height: 220px; resize: vertical; line-height: 1.55; }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:focus, .textarea:focus { outline: none; background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 50px; }
.input-wrap .icon-btn { position: absolute; right: 6px; top: 6px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--surface); font-size: 14px; font-weight: var(--w-medium); cursor: pointer; }
.choice input:checked + span { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.role-help { font-size: 12.5px; color: var(--ink-3); }

.banner { border-radius: var(--r-m); padding: 12px 14px; font-size: 14px; display: grid; gap: 10px; }
.banner.error { background: var(--rose-bg); color: var(--rose-ink); }
.banner.warn { background: var(--butter-bg); color: var(--butter-ink); }
.banner.ok { background: var(--mint-bg); color: var(--mint-ink); }
.banner.info { background: var(--sky-bg); color: var(--sky-ink); }
.banner .btn { justify-self: start; }

/* ---------- Auth screens ---------- */
.auth-wrap { position: relative; min-height: 100vh; }
.auth { position: relative; max-width: 420px; margin: 0 auto; padding: calc(56px + env(safe-area-inset-top)) 20px 40px; display: grid; gap: 24px; }
.auth-brand { display: grid; justify-items: center; gap: 12px; text-align: center; }
.auth-brand .app-icon { width: 60px; height: 60px; }
.auth-brand h1 { font-size: 26px; }
.auth-brand p { color: var(--ink-2); max-width: 32ch; }
.auth .card { padding: 22px; }
.auth-foot { text-align: center; color: var(--ink-3); font-size: 13px; }
.app-icon { display: block; border-radius: 24%; }
.app-icon .bg { fill: var(--accent-fill); }
.app-icon .ink { stroke: var(--accent-fill); }

/* ---------- Floating tab bar with add button ---------- */
.tabbar {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 20;
  width: min(420px, calc(100% - 28px));
  height: var(--nav-h);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-float);
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--ink-3); text-decoration: none; font-size: 11px; font-weight: var(--w-medium); padding: 6px 0; }
.tab svg { width: 23px; height: 23px; }
.tab.on { color: var(--accent); font-weight: var(--w-semibold); }
.fab {
  justify-self: center;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-top: -22px;
  border-radius: var(--r-pill);
  border: 4px solid var(--bg);
  background: var(--btn);
  color: var(--btn-ink);
  box-shadow: var(--shadow-float);
  cursor: pointer;
}
.fab svg { width: 26px; height: 26px; }

/* ---------- Sheets ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: var(--scrim); animation: fade-in 0.18s ease-out; }
.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 41;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 20px calc(26px + env(safe-area-inset-bottom));
  border-radius: var(--r-l) var(--r-l) 0 0;
  background: var(--surface);
  box-shadow: var(--shadow-float);
  animation: sheet-up 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: grid;
  gap: 18px;
}
.sheet-handle { width: 38px; height: 5px; border-radius: var(--r-pill); background: var(--surface-3); margin: 0 auto 2px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head h2 { font-size: 21px; }
.sheet-head .icon-btn { background: var(--surface-2); width: 36px; height: 36px; }
.sheet-head .icon-btn svg { width: 18px; height: 18px; }
@media (min-width: 720px) {
  .sheet { bottom: auto; top: 50%; transform: translate(-50%, -50%); max-width: 460px; max-height: 88vh; border-radius: var(--r-l); padding: 24px; animation: dialog-in 0.2s ease-out; }
  .sheet-handle { display: none; }
}

/* Keypad sheet */
.amount { display: grid; justify-items: center; gap: 6px; padding: 8px 0 4px; }
.amount .label { font-size: 14px; }
.amount-value { display: flex; align-items: baseline; gap: 6px; font-size: 52px; font-weight: var(--w-semibold); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.05; min-height: 56px; }
.amount-value .unit { font-size: 28px; color: var(--ink-3); font-weight: var(--w-medium); }
.amount-value .caret { width: 2px; height: 40px; background: var(--accent); align-self: center; animation: blink 1s steps(1) infinite; }
.amount-note { display: flex; align-items: center; gap: 8px; }
.max-pill { padding: 3px 10px; border-radius: var(--r-pill); background: var(--btn); color: var(--btn-ink); font-size: 11.5px; font-weight: var(--w-bold); letter-spacing: 0.04em; border: 0; cursor: pointer; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.key { min-height: 60px; border: 0; border-radius: var(--r-m); background: transparent; font-size: 26px; font-weight: var(--w-medium); color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.key:active { background: var(--surface-2); }
.key svg { width: 24px; height: 24px; }
.key:disabled { visibility: hidden; }

/* ---------- Toast (with Undo) ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 30px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 60;
  width: calc(100% - 32px);
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 16px;
  min-height: 54px;
  border-radius: var(--r-m);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-float);
  border: 1px solid var(--line);
  animation: toast-in 0.2s ease-out;
}
.toast-dot { width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--mint-ink); flex-shrink: 0; }
.toast.error .toast-dot { background: var(--rose-ink); }
.toast-text { flex: 1; font-size: 14px; font-weight: var(--w-medium); }
.toast .btn { min-height: 34px; padding: 0 14px; font-size: 13px; }
body.sheet-open .toast { top: calc(12px + env(safe-area-inset-top)); bottom: auto; }

/* ---------- Home pieces ---------- */
.steps { display: grid; }
.step { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.step-dot { width: 24px; height: 24px; border-radius: var(--r-pill); border: 1.5px solid var(--line-strong); display: grid; place-items: center; flex-shrink: 0; color: var(--accent-ink); }
.step-dot svg { width: 14px; height: 14px; }
.step.done .step-dot { background: var(--accent-fill); border-color: var(--accent-fill); }
.step.done .step-text { color: var(--ink-3); }
.step-text { flex: 1; font-weight: var(--w-medium); }

/* Task-style list (coming next, today's work) */
.tasks { display: grid; }
.task { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.task:first-child { border-top: 0; padding-top: 2px; }
.task-icon { width: 22px; height: 22px; flex-shrink: 0; margin-top: 18px; }
.task-icon svg { width: 22px; height: 22px; }
.task-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.task-kind { font-size: 12.5px; color: var(--ink-3); }
.task-title { font-weight: var(--w-semibold); font-size: 15.5px; }
.task-sub { font-size: 13px; color: var(--ink-2); }
.c-mint { color: var(--mint-ink); }
.c-lilac { color: var(--lilac-ink); }
.c-peach { color: var(--peach-ink); }
.c-sky { color: var(--sky-ink); }
.c-rose { color: var(--rose-ink); }

/* Backup summary (call-duration style) */
.summary-note { color: var(--ink-2); font-size: 14px; }
.summary-big { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.summary-big strong { font-size: 22px; font-weight: var(--w-semibold); line-height: 1.15; }
.summary-big .time { font-size: 30px; font-weight: var(--w-semibold); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; line-height: 1; }
.summary-small { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink-3); }

/* Balance card (Money) */
.balance { gap: 18px; padding: 22px; }
.balance .label { text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-2); font-size: 12.5px; }
.balance-row { display: flex; align-items: center; gap: 12px; }
.balance .actions { flex-wrap: nowrap; }
.balance .actions .btn { flex: 1 1 0; min-width: 0; padding: 0 14px; }
.balance .actions .round-btn { width: 50px; height: 50px; }
.balance-value { font-size: 40px; font-weight: var(--w-semibold); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.05; }
.overview-pill { justify-self: center; padding: 9px 18px; border-radius: var(--r-pill); background: var(--glass); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-card); font-size: 14px; font-weight: var(--w-medium); }

/* Calendar (Work) */
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cal-head strong { font-size: 16px; font-weight: var(--w-semibold); }
.cal-head span { color: var(--ink-3); font-size: 14px; margin-left: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 6px; text-align: center; }
.cal-dow { font-size: 13px; color: var(--ink-3); padding-bottom: 6px; }
.cal-day { justify-self: center; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-pill); font-size: 15px; font-weight: var(--w-medium); font-variant-numeric: tabular-nums; }
.cal-day.today { background: var(--btn); color: var(--btn-ink); }
.cal-day.weekend { color: var(--ink-3); }
.square-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-m); border: 0; background: var(--accent-fill); color: var(--accent-ink); cursor: pointer; }
.square-btn svg { width: 22px; height: 22px; }

/* Empty states */
.empty { text-align: center; padding: 34px 22px; display: grid; gap: 10px; justify-items: center; color: var(--ink-2); }
.empty .icon-tile { width: 56px; height: 56px; border-radius: var(--r-l); margin-bottom: 4px; }
.empty .icon-tile svg { width: 26px; height: 26px; }
.empty h2 { color: var(--ink); font-size: 18px; }
.empty p { max-width: 34ch; }
.empty .actions { margin-top: 6px; }

/* Import counts */
.counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; }
.count { display: grid; gap: 0; padding: 12px 14px; border-radius: var(--r-m); background: var(--surface-2); }
.count strong { font-size: 24px; font-weight: var(--w-semibold); font-variant-numeric: tabular-nums; }
.count span { font-size: 12.5px; }
details { border-radius: var(--r-m); background: var(--surface-2); }
details summary { padding: 12px 14px; cursor: pointer; font-weight: var(--w-medium); font-size: 14px; }
details ul { margin: 0; padding: 0 14px 12px 32px; display: grid; gap: 4px; font-size: 14px; color: var(--ink-2); }

/* Accent picker */
.accents { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.accent-opt { display: grid; justify-items: center; gap: 8px; padding: 16px 6px 14px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: center; }
.accent-opt .app-icon { width: 44px; height: 44px; }
.accent-opt.on { border-color: var(--btn); box-shadow: 0 0 0 1px var(--btn); }
.accent-opt strong { font-size: 14px; font-weight: var(--w-semibold); }
.accent-opt small { font-size: 12px; color: var(--ink-3); min-height: 1.5em; }
.swatch-teal .bg { fill: #0F766E; } .swatch-teal .ink { stroke: #0F766E; }
.swatch-indigo .bg { fill: #4338CA; } .swatch-indigo .ink { stroke: #4338CA; }
.swatch-marigold .bg { fill: #B45309; } .swatch-marigold .ink { stroke: #B45309; }

.share-box { border-radius: var(--r-m); background: var(--surface-2); padding: 14px 16px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }

/* ---------- Work log ---------- */
/* Calendar days are buttons: a dot marks days with work, a ring the picked day. */
button.cal-day { position: relative; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-size: 15px; font-weight: var(--w-medium); cursor: pointer; }
button.cal-day:not(.today):not(:disabled):hover { background: var(--surface-2); }
.cal-day.sel { box-shadow: inset 0 0 0 2px var(--btn); }
.cal-day.has::after { content: ""; position: absolute; left: 50%; bottom: 4px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: var(--r-pill); background: var(--accent); }
.cal-day.today.has::after { background: var(--btn-ink); }
.cal-day:disabled { opacity: 0.35; cursor: default; }
.cal-head .actions { flex-wrap: nowrap; gap: 2px; }
.icon-btn:disabled { opacity: 0.3; cursor: default; background: transparent; }

/* Entry rows reuse the task list. */
button.task { width: 100%; border: 0; border-top: 1px solid var(--line); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.task.entry { align-items: center; }
.task.entry .task-icon { margin-top: 0; }
.task.entry .tag, .task.entry .chev { flex-shrink: 0; }
.task.entry:active .task-main { opacity: 0.6; }

/* Totals per work type: big pastel numbers. */
.tot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tot { display: grid; gap: 8px; min-width: 0; padding: 16px; border-radius: var(--r-l); }
.tot-value { display: flex; align-items: baseline; gap: 5px; color: var(--ink); font-size: 30px; font-weight: var(--w-semibold); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.tot-value small { font-size: 13px; font-weight: var(--w-medium); letter-spacing: 0; color: var(--ink-2); }
.tot-label { font-size: 14px; font-weight: var(--w-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tot.tone-lilac { background: var(--lilac-tile); }
.tot.tone-peach { background: var(--peach-tile); }
.tot.tone-sky { background: var(--sky-tile); }
.tot.tone-mint { background: var(--mint-tile); }
.tot.tone-butter { background: var(--butter-tile); }
.tot.tone-rose { background: var(--rose-tile); }

.big-cta { min-height: 60px; border-radius: var(--r-l); font-size: 16.5px; box-shadow: var(--shadow-float); }
.big-cta svg { width: 22px; height: 22px; }
.small-empty { padding: 22px 18px; }
.small-empty .btn { margin-top: 2px; }
.note-line { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--ink-2); }
.note-line svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.section-title .btn.plain { min-height: 34px; padding: 0 10px; font-size: 14px; }

/* Log work sheet: tap-to-pick chips, a big quantity, quick dates. */
.picks { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { display: inline-block; max-width: 100%; min-height: 40px; padding: 0 16px; line-height: 38px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: var(--w-medium); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick:hover { background: var(--surface-2); }
.pick.on, .pick.on:hover { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
.pick:focus-visible, .tick:focus-visible, .theme-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.repeat { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border: 0; border-radius: var(--r-m); background: var(--lilac-bg); color: var(--lilac-ink); font-size: 14px; text-align: left; cursor: pointer; }
.repeat svg { width: 18px; height: 18px; flex-shrink: 0; }
.repeat span { flex: 1; min-width: 0; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-pill.mini .input { min-height: 46px; background: var(--surface-2); box-shadow: none; }
.search-pill.mini .input:focus { background: var(--surface); }
.qty { position: relative; display: flex; align-items: center; }
.qty .input { padding-right: 96px; font-size: 24px; font-weight: var(--w-semibold); font-variant-numeric: tabular-nums; }
.qty-unit { position: absolute; right: 16px; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-3); font-weight: var(--w-medium); pointer-events: none; }
.date-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.date-row .input { flex: 1 1 150px; min-width: 0; }
.details-body { display: grid; gap: 14px; padding: 0 14px 14px; }
.details-body .input { background: var(--surface); }
select.input { -webkit-appearance: none; appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.textarea.short { min-height: 96px; }
.sheet .list-card { background: var(--surface-2); box-shadow: none; }
.sheet .list-card .row + .row::before { background: var(--line-strong); }

/* ---------- Billing ---------- */
.filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -20px; padding: 2px 20px; }
.filters::-webkit-scrollbar { display: none; }
.filters .dropdown { flex-shrink: 0; max-width: 230px; }
a.dropdown { text-decoration: none; }
.dropdown span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown.on { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
.dropdown.on svg { color: inherit; opacity: 0.7; }
.bill-hero { gap: 16px; padding: 20px; }
.bill-hero .label { text-transform: uppercase; letter-spacing: 0.04em; font-size: 12px; color: var(--ink-2); }
.bill-hero h2 { font-size: 24px; margin-top: -8px; overflow-wrap: anywhere; }
.bill-hero .actions { flex-wrap: nowrap; }
.bill-hero .actions .btn { flex: 1 1 0; min-width: 0; padding: 0 14px; }
.bill-hero .actions .round-btn { width: 50px; height: 50px; flex-shrink: 0; }
.row.line { gap: 10px; }
.row.line + .row.line::before { left: 16px; }
.row-main.as-btn { padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.row.line .tag { flex-shrink: 0; max-width: 40%; overflow: hidden; text-overflow: ellipsis; }
/* Tick box: a 40px target around a 24px box. */
/* Google Drive sign-in code (Settings). */
.drive-code { margin: 4px 0 12px; font-size: 32px; font-weight: var(--w-bold); letter-spacing: 0.12em; text-align: center; font-variant-numeric: tabular-nums; user-select: all; }
.drive-card .account { margin-bottom: 12px; }
.drive-card .row-sub { white-space: normal; }

/* Access ticks on a person (People): labels wrap instead of being cut. */
.field.access .row-title, .field.access .row-sub { white-space: normal; overflow: visible; text-overflow: clip; }
.field.access .row-sub.changed { color: var(--accent); font-weight: var(--w-medium); }
.field.access .btn.plain { justify-self: start; }
.tick { display: grid; place-items: center; width: 40px; height: 40px; margin: -8px -6px -8px -8px; padding: 0; border: 0; background: none; color: transparent; cursor: pointer; flex-shrink: 0; border-radius: var(--r-s); }
.tick svg { width: 24px; height: 24px; padding: 3px; border-radius: 8px; border: 1.5px solid var(--line-strong); background: var(--surface); stroke-width: 2.6; box-sizing: border-box; }
.tick.on { color: var(--btn-ink); }
.tick.on svg { background: var(--btn); border-color: var(--btn); }

/* Expenses and vendor payments on the invoice. */
.bill-money { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.bill-money > span { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--r-m); background: var(--surface-2); min-width: 0; }
.bill-money strong { font-size: 20px; font-weight: var(--w-semibold); font-variant-numeric: tabular-nums; }

/* ---------- Money ---------- */
a.tag { text-decoration: none; }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; }
.list-head > strong { font-size: 16px; font-weight: var(--w-semibold); }
.month-step { display: flex; align-items: center; gap: 2px; }
.month-step strong { min-width: 8.5em; text-align: center; font-size: 15.5px; font-weight: var(--w-semibold); }
.list-total { display: flex; align-items: center; gap: 10px; }
.list-total strong { flex: 1; font-size: 20px; font-weight: var(--w-semibold); font-variant-numeric: tabular-nums; }
.small-money { font-size: 24px; }
/* Amount fields: a big number after a rupee sign. */
.money-input { position: relative; display: flex; align-items: center; }
.money-input > span { position: absolute; left: 16px; font-size: 22px; font-weight: var(--w-semibold); color: var(--ink-3); pointer-events: none; }
.money-input .input { padding-left: 38px; font-size: 24px; font-weight: var(--w-semibold); font-variant-numeric: tabular-nums; }
.need { margin-left: 4px; padding: 1px 8px; border-radius: var(--r-pill); background: var(--peach-bg); color: var(--peach-ink); font-size: 11.5px; font-weight: var(--w-semibold); }
.field-error { color: var(--rose-ink); font-size: 12.5px; }
/* Receipt photo or PDF: pick, preview, open. The real file input covers the
   whole box, so a tap anywhere opens the camera or files. */
.file-drop { position: relative; display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 14px 16px; border-radius: var(--r-m); border: 1.5px dashed var(--line-strong); background: var(--surface-2); cursor: pointer; }
.file-drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.file-drop.busy { opacity: 0.6; cursor: progress; }
.file-card { display: flex; align-items: center; gap: 14px; padding: 10px 8px 10px 12px; border-radius: var(--r-m); background: var(--surface-2); min-width: 0; }
a.file-card { padding: 12px 16px; min-height: 64px; }
.file-card svg { flex-shrink: 0; }
.file-thumb { width: 48px; height: 48px; border-radius: var(--r-s); object-fit: cover; flex-shrink: 0; background: var(--surface-3); }
.receipt-view { position: relative; display: block; border-radius: var(--r-m); overflow: hidden; background: var(--surface-2); }
.receipt-view img { display: block; width: 100%; max-height: 340px; object-fit: contain; }
.receipt-view .tag { position: absolute; right: 10px; bottom: 10px; }
/* Approvals: the amount big, the bill and the person at a glance. */
.approval { gap: 12px; }
.approval-main { display: grid; gap: 8px; width: 100%; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.approval .cc-top, .note-card .cc-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.approval .row-sub.wrap { color: var(--ink-2); }
.approval-amount { font-size: 28px; font-weight: var(--w-semibold); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.approval-amount.small { margin-left: auto; flex-shrink: 0; font-size: 16px; letter-spacing: 0; }
.tag-pair { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
/* Ledger lines and reports */
button.tx { width: 100%; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.tx:active .tx-main { opacity: 0.6; }
.tx .tx-end { display: grid; justify-items: end; gap: 2px; flex-shrink: 0; }
.tx .tx-end small { font-size: 12px; font-weight: var(--w-medium); }
.report { gap: 16px; }
.report-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; }
.report-label { font-weight: var(--w-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-row strong { font-weight: var(--w-semibold); font-variant-numeric: tabular-nums; }
.report-row .bar, .report-row .faint { grid-column: 1 / -1; }
.bar { display: block; width: 100%; height: 6px; }
.bar-track { fill: var(--surface-3); }
.bar-fill { fill: var(--accent); }
.spend { gap: 10px; }
.spend .summary-small { flex-wrap: wrap; }

/* ---------- Office list and item register ---------- */
.title-actions { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.move-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.move-grid .btn { min-width: 0; padding: 0 10px; white-space: normal; line-height: 1.2; text-align: center; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.timeline li { position: relative; display: flex; gap: 12px; padding-bottom: 16px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 18px; bottom: 2px; width: 2px; border-radius: 1px; background: var(--line-strong); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::before { display: none; }
.tl-dot { width: 14px; height: 14px; margin-top: 3px; border-radius: var(--r-pill); flex-shrink: 0; box-shadow: inset 0 0 0 3px currentColor; }
.tl-main { display: grid; gap: 2px; min-width: 0; }
.tl-main strong { font-weight: var(--w-semibold); }

/* ---------- Item icons (items.js) ----------
   Each kind of item has its own short motion. It plays once (.play, added
   by playItemIcons) or repeats gently on an item's sheet (.item-loop, kept
   in step across redraws by --sync). --n names the motion, --o the point it
   turns around, --d delays a second or third part. */
.item-icon { display: inline-grid; place-items: center; line-height: 0; }
.item-icon svg { overflow: visible; }
.item-icon .ia, .item-icon .iw { transform-box: fill-box; transform-origin: var(--o, center); }
.item-icon .iw { stroke-dasharray: 1; stroke-dashoffset: 0; }
.item-icon .ia2 { --d: 120ms; }
.item-icon .ia3 { --d: 240ms; }
.item-icon.play .ia { animation: var(--n, it-bounce) 1.4s ease-in-out both; animation-delay: calc(var(--i, 0) * 90ms + var(--d, 0ms)); }
.item-icon.play .iw { animation: it-draw 1.4s ease-out both; animation-delay: calc(var(--i, 0) * 90ms + var(--d, 0ms)); }
.item-loop .item-icon .ia { animation: var(--n, it-bounce) 2.8s ease-in-out infinite both; animation-delay: calc(var(--sync, 0ms) + var(--d, 0ms)); }
.item-loop .item-icon .iw { animation: it-draw 2.8s ease-out infinite both; animation-delay: calc(var(--sync, 0ms) + var(--d, 0ms)); }
.k-paper { --n: it-feed; }
.k-pen { --n: it-scribble; }
.k-stapler { --n: it-press; --o: 0% 100%; }
.k-tape { --n: it-turn; }
.k-folder { --n: it-rise; }
.k-tea { --n: it-steam; }
.k-water { --n: it-wave; }
.k-biscuit { --n: it-wobble; }
.k-cleaning { --n: it-puff; }
.k-broom { --n: it-sweep; --o: 85% 0%; }
.k-bin { --n: it-lid; --o: 0% 100%; }
.k-mouse { --n: it-scroll; }
.k-keyboard, .k-calculator { --n: it-key; }
.k-usb, .k-plug { --n: it-plug; }
.k-wifi, .k-battery { --n: it-blink; }
.k-headphones { --n: it-bob; }
.k-laptop { --n: it-open; --o: 50% 100%; }
.k-printer { --n: it-print; }
.k-toner { --n: it-drip; --o: 50% 100%; }
.k-phone { --n: it-ring; }
.k-camera { --n: it-flash; }
.k-camera .ia2 { --n: it-pulse; }
.k-bulb { --n: it-glow; }
.k-fan { --n: it-spin; }
.k-fan .ia { transform-box: view-box; transform-origin: 12px 11px; }
.k-chair { --n: it-swivel; --o: 50% 100%; }
.k-desk { --n: it-drawer; }
.k-box, .k-bag { --n: it-bounce; }
.k-scissors .ia, .k-clock .ia { transform-box: view-box; }
.k-scissors .ia { --n: it-snip; transform-origin: 13.75px 12px; }
.k-scissors .ia2 { --n: it-snip2; --d: 0ms; }
.k-clock .ia { --n: it-turn; transform-origin: 12px 12.5px; }
.k-lock { --n: it-unlock; }
.k-drive { --n: it-spin; }
.k-drive .ia2 { --n: it-blink; }
.k-plant { --n: it-swivel; --o: 50% 100%; }
.k-tools { --n: it-twist; }
.k-firstaid { --n: it-pulse; }
.k-paint { --n: it-roll; }
@keyframes it-draw { 0% { stroke-dashoffset: 1; } 45%, 100% { stroke-dashoffset: 0; } }
@keyframes it-feed { 0%, 55%, 100% { transform: translateY(0); } 22% { transform: translateY(-3px); } 40% { transform: translateY(0.6px); } }
@keyframes it-scribble { 0%, 55%, 100% { transform: translate(0, 0) rotate(0); } 12% { transform: translate(-1.2px, 0.6px) rotate(-5deg); } 26% { transform: translate(1.2px, -0.4px) rotate(4deg); } 40% { transform: translate(-0.6px, 0.3px) rotate(-2deg); } }
@keyframes it-press { 0%, 55%, 100% { transform: rotate(0); } 20% { transform: rotate(9deg); } 30% { transform: rotate(8deg); } 42% { transform: rotate(-1deg); } }
@keyframes it-turn { 0% { transform: rotate(0); } 55%, 100% { transform: rotate(360deg); } }
@keyframes it-spin { 0% { transform: rotate(0); } 70%, 100% { transform: rotate(720deg); } }
@keyframes it-rise { 0%, 55%, 100% { transform: translateY(0); } 25% { transform: translateY(-3px); } 42% { transform: translateY(0.5px); } }
@keyframes it-steam { 0%, 50%, 100% { opacity: 1; transform: translateY(0); } 18% { opacity: 0; transform: translateY(-3px); } 19% { opacity: 0; transform: translateY(2px); } }
@keyframes it-wave { 0%, 55%, 100% { transform: translate(0, 0); } 14% { transform: translate(-1.4px, -0.6px); } 28% { transform: translate(1.4px, 0.4px); } 42% { transform: translate(-0.6px, 0); } }
@keyframes it-wobble { 0%, 55%, 100% { transform: rotate(0); } 15% { transform: rotate(-12deg); } 30% { transform: rotate(9deg); } 44% { transform: rotate(-4deg); } }
@keyframes it-puff { 0%, 48%, 100% { opacity: 1; transform: translate(0, 0); } 10% { opacity: 0; transform: translate(-3px, 0); } 30% { opacity: 1; transform: translate(1px, 0); } }
@keyframes it-sweep { 0%, 55%, 100% { transform: rotate(0); } 15% { transform: rotate(-14deg); } 30% { transform: rotate(10deg); } 44% { transform: rotate(-5deg); } }
@keyframes it-lid { 0%, 55%, 100% { transform: translateY(0) rotate(0); } 22% { transform: translateY(-2.5px) rotate(-14deg); } 40% { transform: translateY(0) rotate(2deg); } }
@keyframes it-scroll { 0%, 55%, 100% { transform: translateY(0); } 12% { transform: translateY(1.4px); } 22% { transform: translateY(0); } 34% { transform: translateY(1.4px); } 44% { transform: translateY(0); } }
@keyframes it-key { 0%, 40%, 100% { opacity: 1; transform: translateY(0); } 12% { opacity: 0.15; transform: translateY(1px); } 24% { opacity: 1; transform: translateY(-0.4px); } }
@keyframes it-plug { 0%, 55%, 100% { transform: translateY(0); } 22% { transform: translateY(-3px); } 34% { transform: translateY(-2.2px); } 46% { transform: translateY(0.4px); } }
@keyframes it-blink { 0%, 40%, 100% { opacity: 1; } 8% { opacity: 0.1; } 26% { opacity: 1; } }
@keyframes it-bob { 0%, 55%, 100% { transform: translateY(0) rotate(0); } 16% { transform: translateY(-2px) rotate(-6deg); } 32% { transform: translateY(0) rotate(5deg); } 44% { transform: rotate(-2deg); } }
@keyframes it-open { 0%, 100% { transform: scaleY(1); } 6% { transform: scaleY(0.15); } 40% { transform: scaleY(1.05); } 50% { transform: scaleY(1); } }
@keyframes it-print { 0% { opacity: 1; transform: translateY(0); } 6% { opacity: 0; transform: translateY(-4px); } 40%, 100% { opacity: 1; transform: translateY(0); } }
@keyframes it-drip { 0%, 55%, 100% { transform: translateY(0) scale(1, 1); } 18% { transform: translateY(1.5px) scale(1.06, 0.9); } 32% { transform: translateY(-1.5px) scale(0.95, 1.08); } 44% { transform: translateY(0) scale(1, 1); } }
@keyframes it-ring { 0%, 50%, 100% { transform: rotate(0); } 6% { transform: rotate(-14deg); } 12% { transform: rotate(14deg); } 18% { transform: rotate(-12deg); } 24% { transform: rotate(10deg); } 30% { transform: rotate(-6deg); } 36% { transform: rotate(3deg); } }
@keyframes it-flash { 0%, 50%, 100% { opacity: 1; } 8% { opacity: 0.1; } 16% { opacity: 1; } 24% { opacity: 0.2; } 34% { opacity: 1; } }
@keyframes it-glow { 0%, 55%, 100% { opacity: 1; transform: scale(1); } 10% { opacity: 0.2; transform: scale(0.8); } 30% { opacity: 1; transform: scale(1.18); } 45% { transform: scale(1); } }
@keyframes it-swivel { 0%, 55%, 100% { transform: rotate(0); } 16% { transform: rotate(-8deg); } 32% { transform: rotate(7deg); } 46% { transform: rotate(-3deg); } }
@keyframes it-drawer { 0%, 55%, 100% { transform: translateX(0); } 22% { transform: translateX(-2.5px); } 40% { transform: translateX(0.4px); } }
@keyframes it-snip { 0%, 55%, 100% { transform: rotate(0); } 18% { transform: rotate(-24deg); } 36% { transform: rotate(0); } 46% { transform: rotate(-8deg); } }
@keyframes it-snip2 { 0%, 55%, 100% { transform: rotate(0); } 18% { transform: rotate(24deg); } 36% { transform: rotate(0); } 46% { transform: rotate(8deg); } }
@keyframes it-unlock { 0%, 55%, 100% { transform: translateY(0); } 20% { transform: translateY(-2.5px); } 30% { transform: translateY(-2.5px); } 44% { transform: translateY(0.3px); } }
@keyframes it-bounce { 0%, 55%, 100% { transform: translateY(0); } 18% { transform: translateY(-3px); } 34% { transform: translateY(0); } 44% { transform: translateY(-1px); } }
@keyframes it-twist { 0%, 55%, 100% { transform: rotate(0); } 18% { transform: rotate(-25deg); } 36% { transform: rotate(15deg); } 48% { transform: rotate(-4deg); } }
@keyframes it-pulse { 0%, 55%, 100% { transform: scale(1); } 18% { transform: scale(1.3); } 34% { transform: scale(0.92); } 46% { transform: scale(1.04); } }
@keyframes it-roll { 0%, 55%, 100% { transform: translateY(0); } 16% { transform: translateY(-2.5px); } 32% { transform: translateY(2px); } 46% { transform: translateY(0); } }

/* ---------- Home quick actions, notes ---------- */
.quick-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 12px; border: 0; border-radius: var(--r-l); background: var(--surface); box-shadow: var(--shadow-card); color: var(--ink); font: inherit; font-size: 14.5px; font-weight: var(--w-semibold); text-align: left; cursor: pointer; }
.quick .icon-tile { width: 38px; height: 38px; border-radius: var(--r-s); }
.quick:active { transform: scale(0.98); }
.quick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.note-card { gap: 8px; width: 100%; }
.note-title { flex: 1; min-width: 0; font-size: 16px; font-weight: var(--w-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pin { display: inline-grid; vertical-align: -2px; margin-right: 6px; color: var(--peach-ink); }
.pin svg { width: 16px; height: 16px; }
.note-body { color: var(--ink-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }

/* ---------- Appearance (Light, Dark, System) ---------- */
.theme-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.theme-opt { display: grid; justify-items: center; gap: 8px; padding: 14px 6px 12px; border-radius: var(--r-m); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.theme-opt strong { font-size: 14px; font-weight: var(--w-semibold); }
.theme-opt.on { border-color: var(--btn); box-shadow: 0 0 0 1px var(--btn); }
.theme-swatch { display: grid; place-items: center; width: 56px; height: 38px; border-radius: 10px; border: 1px solid #DCDFE4; }
.theme-swatch svg { width: 18px; height: 18px; }
.theme-swatch.sw-light { background: #F2F3F5; color: #0F1013; }
.theme-swatch.sw-dark { background: #0B0C10; color: #F2F3F5; border-color: #323640; }
.theme-swatch.sw-system { background: linear-gradient(135deg, #F2F3F5 50%, #0B0C10 50%); color: #9AA0AB; }

/* ---------- Motion, after Magic UI components ----------
   Ported to plain CSS (Desk has no React or Tailwind). Every effect stops
   for people who ask their phone for less motion. */

/* Blur fade: a screen's sections fade in from a soft blur, one after
   another. app.js sets --enter-offset so a redraw carries on mid-way. */
.page.enter > * { animation: blur-fade 0.4s ease-out both; animation-delay: calc(var(--enter-offset, 0ms) + var(--stagger, 0ms)); }
.page.enter > :nth-child(2) { --stagger: 50ms; }
.page.enter > :nth-child(3) { --stagger: 100ms; }
.page.enter > :nth-child(4) { --stagger: 150ms; }
.page.enter > :nth-child(5) { --stagger: 200ms; }
.page.enter > :nth-child(6) { --stagger: 250ms; }
.page.enter > :nth-child(7) { --stagger: 300ms; }
.page.enter > :nth-child(n+8) { --stagger: 350ms; }
@keyframes blur-fade { from { opacity: 0; filter: blur(6px); transform: translateY(6px); } to { opacity: 1; filter: none; transform: none; } }

/* Number ticker: numbers keep their width while they count. */
.ticker { font-variant-numeric: tabular-nums; }

/* Circular progress: setup steps done. */
.ring { position: relative; display: grid; place-items: center; width: 56px; height: 56px; flex-shrink: 0; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring-track { stroke: var(--surface-2); }
.ring-value { stroke: var(--accent-fill); stroke-linecap: round; }
.ring > span { font-size: 13px; font-weight: var(--w-semibold); font-variant-numeric: tabular-nums; }
.page.enter .ring-value { animation: ring-fill 1s ease-out both; animation-delay: calc(var(--enter-offset, 0ms) + 200ms); }
@keyframes ring-fill { from { stroke-dasharray: 0 126; } }

/* Shine border: a slow pastel shine around the card that needs action. */
.shine { position: relative; }
.shine::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background-image: radial-gradient(transparent, transparent, var(--lilac-ink), var(--rose-ink), var(--peach-ink), transparent, transparent);
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box exclude, linear-gradient(#fff 0 0);
  animation: shine 14s linear infinite;
  animation-delay: var(--sync, 0ms);
  pointer-events: none;
}
@keyframes shine { 0% { background-position: 0% 0%; } 50% { background-position: 100% 100%; } 100% { background-position: 0% 0%; } }

/* Pulsating button: Log work ripples until something is logged today. */
.pulse { animation: pulse 1.8s ease-out infinite; animation-delay: var(--sync, 0ms); }
@keyframes pulse { from { box-shadow: var(--shadow-float), 0 0 0 0 var(--pulse); } to { box-shadow: var(--shadow-float), 0 0 0 12px transparent; } }

/* Progressive blur: content blurs more the lower it slides under the tab bar. */
.edge-blur { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; height: calc(var(--nav-h) + 40px + env(safe-area-inset-bottom)); pointer-events: none; }
.edge-blur i { position: absolute; inset: 0; }
.edge-blur i:nth-child(1) { -webkit-backdrop-filter: blur(1px); backdrop-filter: blur(1px); -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 25%, #000 50%, transparent 75%); mask-image: linear-gradient(to bottom, transparent 0%, #000 25%, #000 50%, transparent 75%); }
.edge-blur i:nth-child(2) { -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); -webkit-mask-image: linear-gradient(to bottom, transparent 25%, #000 50%, #000 75%, transparent 100%); mask-image: linear-gradient(to bottom, transparent 25%, #000 50%, #000 75%, transparent 100%); }
.edge-blur i:nth-child(3) { -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); -webkit-mask-image: linear-gradient(to bottom, transparent 50%, #000 75%); mask-image: linear-gradient(to bottom, transparent 50%, #000 75%); }
.edge-blur i:nth-child(4) { -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); -webkit-mask-image: linear-gradient(to bottom, transparent 75%, #000 100%); mask-image: linear-gradient(to bottom, transparent 75%, #000 100%); }

/* Dot pattern: a faded dot grid behind sign-in and setup. */
.auth-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--dot) 1px, transparent 1.5px);
  background-size: 18px 18px;
  -webkit-mask-image: radial-gradient(ellipse 80% 55% at 50% 22%, #000 25%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 55% at 50% 22%, #000 25%, transparent 75%);
  pointer-events: none;
}

/* Changing the theme (app.js blurTheme): the old screen blurs and fades on
   top while the new one underneath plays the page's own blur fade. */
:root[data-theme-vt]::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
:root[data-theme-vt]::view-transition-old(root) { z-index: 1; mix-blend-mode: normal; animation: theme-blur-out 0.3s ease-out both; }
@keyframes theme-blur-out { to { opacity: 0; filter: blur(6px); } }

/* ---------- Build check page ---------- */
.check-page .check { max-width: 560px; margin: 0 auto; padding: 40px 20px; display: grid; gap: 20px; }
.check-summary { font-weight: var(--w-semibold); padding: 12px 14px; border-radius: var(--r-m); }
.check-summary.check-ok { background: var(--mint-bg); color: var(--mint-ink); }
.check-summary.check-warn { background: var(--butter-bg); color: var(--butter-ink); }
.check-summary.check-fail { background: var(--rose-bg); color: var(--rose-ink); }
.check-list { list-style: none; margin: 0; padding: 0; border-radius: var(--r-l); background: var(--surface); box-shadow: var(--shadow-card); }
.check-list li { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.check-list li:last-child { border-bottom: 0; }
.check-mark { width: 24px; height: 24px; border-radius: var(--r-pill); display: grid; place-items: center; font-weight: var(--w-bold); font-size: 13px; flex-shrink: 0; }
.check-ok .check-mark { background: var(--mint-bg); color: var(--mint-ink); }
.check-warn .check-mark { background: var(--butter-bg); color: var(--butter-ink); }
.check-fail .check-mark { background: var(--rose-bg); color: var(--rose-ink); }
.check-text { display: grid; gap: 2px; min-width: 0; }
.check-text span { color: var(--ink-2); font-size: 14px; }
.check-text code { font-size: 12px; color: var(--ink-3); word-break: break-all; }
.check-foot { font-size: 13px; color: var(--ink-3); }

@keyframes sheet-up { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
@keyframes dialog-in { from { opacity: 0; transform: translate(-50%, -48%) scale(0.98); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px) scale(0.98); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes blink { 50% { opacity: 0; } }
/* A redrawn sheet is already up. */
.sheet.stay, .sheet-backdrop.stay { animation: none; }
/* Animated tile icons: each line draws in when the screen opens, then the
   icon pops, floats, wiggles or slides now and then. --sync keeps the loop
   in step across redraws; each tile is a little behind the one before. */
.tile-icon svg > * { stroke-dasharray: 1; stroke-dashoffset: 0; }
.page.enter .tile-icon svg > * { animation: icon-draw 0.9s ease-out both; animation-delay: calc(var(--enter-offset, 0ms) + 250ms); }
.tile-icon svg { transform-origin: 50% 50%; animation: none 3.5s ease-in-out infinite both; animation-delay: calc(var(--sync, 0ms) - var(--lag, 0ms)); }
.tile-icon.m-pop svg { animation-name: icon-pop; }
.tile-icon.m-float svg { animation-name: icon-float; }
.tile-icon.m-wiggle svg { animation-name: icon-wiggle; }
.tile-icon.m-slide svg { animation-name: icon-slide; }
.tiles > :nth-child(2) { --lag: 700ms; }
.tiles > :nth-child(3) { --lag: 1400ms; }
.tiles > :nth-child(4) { --lag: 2100ms; }
@keyframes icon-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes icon-pop { 0%, 72%, 100% { transform: scale(1); } 80% { transform: scale(1.18); } 88% { transform: scale(0.95); } 94% { transform: scale(1.03); } }
@keyframes icon-float { 0%, 100% { transform: translateY(1.5px); } 50% { transform: translateY(-2.5px); } }
@keyframes icon-wiggle { 0%, 74%, 100% { transform: rotate(0); } 80% { transform: rotate(-12deg); } 86% { transform: rotate(9deg); } 92% { transform: rotate(-4deg); } }
@keyframes icon-slide { 0%, 70%, 100% { transform: translateX(0); } 79% { transform: translateX(3px); } 88% { transform: translateX(-2px); } 94% { transform: translateX(1px); } }
@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet-backdrop, .toast, .menu { animation: none; }
  .tile .tile-icon svg, .page.enter .tile-icon svg > * { animation: none !important; }
  .item-icon .ia, .item-icon .iw { animation: none !important; }
  .glider, .glide-tab, .glide-count { transition: none; }
  .page.enter > *, .page.enter .ring-value, .shine::after, .pulse { animation: none; }
  .amount-value .caret { animation: none; }
}
