/* Drishti design system v1 — tokens + shared components (from the design handoff pack).
   Light theme only. Inter. Flat colour, no shadows. */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/inter-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 800; font-display: swap; src: url('fonts/inter-latin-800-normal.woff2') format('woff2'); }

.ds {
  /* neutrals */
  --ink: #111418;
  --muted: #5B6470;
  --page: #F4F5F7;
  --card: #FFFFFF;
  --line: #E4E7EB;
  --chip-grey: #F1F3F5;
  --placeholder: #C9CED6;
  /* status */
  --red: #D63B3A; --red-soft: #FDE8E7; --red-text: #8F1D17;
  --orange: #C46A0A; --orange-soft: #FDF0DD;
  --green: #1C9A5C; --green-soft: #E6F4EC; --green-text: #1C6B3F;
  --grey-status: #5B6470; --grey-soft: #F1F3F5;
  /* departments (main / soft / text on soft / on main / faded icon / label on main) */
  --opd: #2F6FEB; --opd-soft: #E8F0FE; --opd-text: #1F5BD1; --opd-on: #FFFFFF; --opd-faded: #5B8EF2; --opd-label: #DCE7FD;
  --lab: #E08A1E; --lab-soft: #FDF0DD; --lab-text: #8A4B06; --lab-on: #2B1600; --lab-faded: #F2B25E; --lab-label: #4A2700;
  --pharmacy: #1C9A5C; --pharmacy-soft: #E6F4EC; --pharmacy-text: #1C6B3F; --pharmacy-on: #FFFFFF; --pharmacy-faded: #3DBE7E; --pharmacy-label: #D3F5E3;
  --surgery: #6E56CF; --surgery-soft: #EEEDFB; --surgery-text: #463C9E; --surgery-on: #FFFFFF; --surgery-faded: #8C78DD; --surgery-label: #E6E0FA;
  --optical: #E0478F; --optical-soft: #FCE3EF; --optical-text: #A2215F; --optical-on: #FFFFFF; --optical-faded: #EC79AE; --optical-label: #FCE3EF;

  font-family: Inter, system-ui, sans-serif;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.35;
}
.ds *, .ds *::before, .ds *::after { box-sizing: border-box; }
.ds p, .ds h1, .ds h2, .ds h3 { margin: 0; }
.ds button { font-family: inherit; cursor: pointer; }
.ds a { color: inherit; text-decoration: none; }
.ds :focus-visible { outline: 3px solid var(--opd); outline-offset: 2px; }

/* department colour sets: put .d-<dept> on any element, then use var(--d-*) */
.d-opd      { --d: var(--opd);      --d-soft: var(--opd-soft);      --d-text: var(--opd-text);      --d-on: var(--opd-on);      --d-faded: var(--opd-faded);      --d-label: var(--opd-label); }
.d-lab      { --d: var(--lab);      --d-soft: var(--lab-soft);      --d-text: var(--lab-text);      --d-on: var(--lab-on);      --d-faded: var(--lab-faded);      --d-label: var(--lab-label); }
.d-pharmacy { --d: var(--pharmacy); --d-soft: var(--pharmacy-soft); --d-text: var(--pharmacy-text); --d-on: var(--pharmacy-on); --d-faded: var(--pharmacy-faded); --d-label: var(--pharmacy-label); }
.d-surgery  { --d: var(--surgery);  --d-soft: var(--surgery-soft);  --d-text: var(--surgery-text);  --d-on: var(--surgery-on);  --d-faded: var(--surgery-faded);  --d-label: var(--surgery-label); }
.d-optical  { --d: var(--optical);  --d-soft: var(--optical-soft);  --d-text: var(--optical-text);  --d-on: var(--optical-on);  --d-faded: var(--optical-faded);  --d-label: var(--optical-label); }

/* ---------- type ---------- */
.ds-hero { font-size: 46px; font-weight: 800; letter-spacing: -1.8px; line-height: 1; }
.ds-hero-xl { font-size: 64px; font-weight: 800; letter-spacing: -2.5px; line-height: 1; }
.ds-section { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.ds-muted { color: var(--muted); }
.ds-label { font-size: 14px; color: var(--muted); }

/* ---------- DepartmentCard ---------- */
.ds .ds-dept-card, .ds-dept-card {
  position: relative; display: block; overflow: hidden;
  background: var(--d); color: var(--d-on);
  border-radius: 30px; padding: 18px; height: 176px;
}
.ds-dept-card.full { border-radius: 32px; padding: 22px; height: 196px; }
.ds-dept-card .bg-icon { position: absolute; right: -24px; bottom: -22px; width: 120px; height: 120px; color: var(--d-faded); }
.ds-dept-card.full .bg-icon { right: -36px; top: -30px; bottom: auto; width: 200px; height: 200px; }
.ds-dept-card .lbl { position: relative; display: block; font-size: 15px; color: var(--d-label); }
.ds-dept-card .amt { position: relative; display: block; margin-top: 4px; font-size: 28px; font-weight: 800; letter-spacing: -1px; }
.ds-dept-card.full .amt { font-size: 42px; letter-spacing: -1.5px; }
.ds-dept-card .share { position: relative; display: block; margin-top: 2px; font-size: 13px; color: var(--d-label); }
.ds-dept-card.full .share { font-size: 14px; }

/* ---------- CutoutArrow ---------- */
.ds-cutout { position: absolute; right: -10px; bottom: -10px; width: 88px; height: 88px; border-radius: 44px;
  background: var(--page); display: flex; align-items: center; justify-content: center; }
.ds-cutout > span { width: 58px; height: 58px; border-radius: 29px; background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center; }

/* ---------- Ring ---------- */
.ds-ring { position: relative; flex-shrink: 0; }
.ds-ring svg { display: block; }
.ds-ring circle.seg { transition: stroke-dasharray .5s ease-out, stroke-dashoffset .5s ease-out; }
.ds-ring .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ds-ring .big { font-size: 24px; font-weight: 800; }
.ds-ring .small { font-size: 11px; color: var(--muted); }

/* ---------- DayStrip ---------- */
.ds-daystrip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.ds-daystrip button { height: 62px; border-radius: 18px; border: none; background: var(--card); color: var(--ink);
  font-size: 12px; font-weight: 500; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0; }
.ds-daystrip button .n { font-size: 17px; font-weight: 700; }
.ds-daystrip button.today { border: 1.5px dashed #9AA1AB; }
.ds-daystrip button.on { background: var(--ink); color: #fff; border: none; }

/* ---------- RoundShortcut ---------- */
.ds-shortcuts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; text-align: center; }
.ds-shortcut { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; color: var(--ink); background: none; border: none; padding: 0; }
.ds-shortcut .disc { position: relative; width: 58px; height: 58px; border-radius: 29px; background: var(--card); color: var(--ink);
  display: flex; align-items: center; justify-content: center; }
.ds-shortcut.primary .disc { background: var(--ink); color: #fff; }
.ds-shortcut.alert .disc { color: var(--red); }
.ds-shortcut .badge { position: absolute; top: -2px; right: -2px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px;
  background: var(--red); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid var(--page); }

/* ---------- ProblemRow ---------- */
.ds-rows { display: flex; flex-direction: column; gap: 10px; }
.ds-row { display: flex; align-items: center; gap: 14px; background: var(--card); border-radius: 24px; padding: 16px; color: var(--ink);
  width: 100%; border: none; text-align: left; font: inherit; transition: opacity .25s; }
.ds-row .tile { width: 52px; height: 52px; min-height: 0; padding: 0; gap: 0; border: none; box-shadow: none; border-radius: 16px; display: flex; flex-direction: row; align-items: center; justify-content: center; flex-shrink: 0; }
.ds-row .tile.sm { width: 50px; height: 50px; }
.ds-row .body { flex: 1; min-width: 0; }
.ds-row .title { display: block; font-size: 16px; font-weight: 600; }
.ds-row .hint { display: block; font-size: 13px; color: var(--muted); }
.ds-row .amount { font-size: 17px; font-weight: 800; white-space: nowrap; }
.ds-rows.dimmed .ds-row:not(.lit) { opacity: .4; }
.tile-red { background: var(--red-soft); color: #B42318; }
.tile-orange { background: var(--orange-soft); color: var(--lab-text); }
.tile-grey { background: var(--chip-grey); color: #3B4250; }
.tile-dept { background: var(--d-soft); color: var(--d-text); }

/* ---------- StatusChip ---------- */
.ds-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; border-radius: 14px; padding: 6px 10px;
  white-space: nowrap; transition: background-color .3s, color .3s; }
.ds-chip .dot { width: 7px; height: 7px; border-radius: 4px; background: currentColor; }
.ds-chip.new { background: var(--red-soft); color: var(--red-text); }
.ds-chip.new .dot { background: var(--red); }
.ds-chip.fixing { background: var(--orange-soft); color: #8A4B06; }
.ds-chip.fixed { background: var(--green-soft); color: var(--green-text); }
.ds-chip.ignored { background: var(--grey-soft); color: var(--grey-status); }
.ds-chip.alert { background: var(--red-soft); color: var(--red-text); font-weight: 600; border-radius: 12px; }

/* ---------- SentencePicker ---------- */
.ds-sentence { font-size: 22px; font-weight: 600; line-height: 1.75; text-align: center; color: var(--muted); }
.ds-pill { border: none; font-size: 22px; font-weight: 700; border-radius: 14px; padding: 2px 12px; margin: 0 2px; }
.ds-pill.amber { background: var(--orange-soft); color: #8A4B06; }
.ds-pill.blue { background: #E8F0FE; color: #1F5BD1; }
.ds-pill.grey { background: var(--chip-grey); color: var(--ink); }

/* ---------- BottomSheet ---------- */
.ds-sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; justify-content: flex-end;
  background: rgba(17, 20, 24, 0); transition: background-color .3s; }
.ds-sheet-wrap.open { background: rgba(17, 20, 24, .45); }
.ds-sheet-wrap .scrim { flex: 1; border: none; background: transparent; }
.ds-sheet { background: #fff; border-radius: 32px 32px 0 0; padding: 12px 20px 34px; max-height: 85vh; overflow-y: auto;
  transform: translateY(100%); transition: transform .3s cubic-bezier(.2, 1.1, .3, 1); width: 100%; max-width: 560px; margin: 0 auto; }
.ds-sheet-wrap.open .ds-sheet { transform: translateY(0); }
.ds-sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: #D5D9DE; margin: 0 auto 16px; }
.ds-sheet .sheet-title { margin: 0 0 14px; font-size: 22px; font-weight: 800; letter-spacing: -0.4px; }
.ds-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ds-choice { min-height: 56px; border-radius: 18px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 10px; padding: 0 14px; text-align: left; }
.ds-choice.on { border: 2px solid var(--ink); background: var(--chip-grey); }
.ds-choice .dot { width: 12px; height: 12px; border-radius: 6px; flex-shrink: 0; background: var(--dot, var(--muted)); }

/* ---------- Numpad ---------- */
.ds-numpad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ds-numpad button { height: 58px; border: none; border-radius: 18px; background: transparent; color: var(--ink); font-size: 26px; font-weight: 600; }
.ds-numpad button:active { background: var(--chip-grey); }
.ds-amount { text-align: center; font-size: 72px; font-weight: 800; letter-spacing: -2px; line-height: 1; color: var(--ink); }
.ds-amount.long { font-size: 56px; }
.ds-amount.zero { color: var(--placeholder); }
.ds-amount .last { display: inline-block; animation: ds-drop .15s ease-out; }
@keyframes ds-drop { 0% { transform: translateY(-10px); opacity: 0 } 70% { transform: translateY(2px) } 100% { transform: none; opacity: 1 } }

/* ---------- SwipeButton ---------- */
.ds-swipe { position: relative; height: 64px; border-radius: 32px; background: var(--ink); color: #fff; padding: 6px;
  display: flex; align-items: center; touch-action: none; user-select: none; -webkit-user-select: none; }
.ds-swipe .knob { position: relative; z-index: 1; width: 52px; height: 52px; border-radius: 26px; background: #fff; color: var(--ink);
  display: flex; align-items: center; justify-content: center; border: none; padding: 0; cursor: grab; }
.ds-swipe .knob.snap { transition: transform .2s ease-out; }
.ds-swipe .swipe-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding-left: 52px;
  font-size: 16px; font-weight: 600; color: var(--placeholder); pointer-events: none; }
.ds-swipe.disabled { opacity: .5; }

/* ---------- NavBar ---------- */
.ds-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; justify-content: center;
  padding: 20px 0 calc(28px + env(safe-area-inset-bottom)); pointer-events: none; }
.ds-nav .bar { pointer-events: auto; display: flex; gap: 4px; background: var(--ink); border-radius: 32px; padding: 6px; }
.ds-nav a { width: 48px; height: 48px; border-radius: 24px; color: #fff; display: flex; align-items: center; justify-content: center; }
.ds-nav a.on { width: auto; padding: 0 18px; background: #fff; color: var(--ink); gap: 6px; font-size: 14px; font-weight: 600; }

/* ---------- small parts ---------- */
.ds-icon-btn { width: 44px; height: 44px; border-radius: 22px; border: none; background: var(--chip-grey); color: var(--ink);
  display: flex; align-items: center; justify-content: center; padding: 0; flex-shrink: 0; }
.ds-avatar { width: 44px; height: 44px; border-radius: 22px; border: none; background: var(--ink); color: #fff; font-size: 16px; font-weight: 700; }
.ds-btn { height: 60px; border-radius: 30px; border: none; background: var(--ink); color: #fff; font-size: 17px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.ds-btn.dept { background: var(--d); color: var(--d-on); }
.ds-btn.ghost { background: #fff; color: var(--ink); height: 56px; font-size: 16px; font-weight: 600; }
.ds-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.ds-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ds-legend i { width: 10px; height: 10px; border-radius: 5px; background: var(--d); }

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

/* ---------- pages (step 2/3: role landing + Owner home) ---------- */
.app.bare > .topbar { display: none; }
.app.bare > .view { max-width: 560px; padding: 0; }
.app.bare { background: var(--page, #F4F5F7); }
.ds-page { min-height: 100vh; padding: max(28px, env(safe-area-inset-top)) 20px 128px; display: flex; flex-direction: column; }
.ds-greet { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
.ds-greet .hi { font-size: 15px; color: var(--muted); }
.ds-greet .name { margin-top: 2px; font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.ds-page .ds-daystrip { margin-top: 18px; }
.ds-daystrip button:disabled { opacity: .4; cursor: default; }
.ds-daycard { margin-top: 14px; background: var(--card); border-radius: 30px; padding: 22px; display: flex; align-items: center; gap: 16px; }
.ds-daycard .txt { flex: 1; min-width: 0; }
.ds-daycard .ds-hero { margin-top: 4px; font-variant-numeric: tabular-nums; }
.ds-gap { margin-top: 12px; display: inline-block; font-size: 13px; font-weight: 600; color: var(--red-text); background: var(--red-soft); border-radius: 12px; padding: 6px 10px; }
.ds-gap.ok { color: var(--green-text); background: var(--green-soft); }
.ds-page > .ds-legend { margin-top: 10px; padding: 0 4px; }
.ds-page > .ds-shortcuts { margin-top: 20px; }
.ds-shortcuts.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ds-month { margin-top: 26px; display: flex; justify-content: space-between; align-items: baseline; }
.ds-month-sub { margin-top: 2px; font-size: 13px; color: var(--muted); }
.ds-page > .ds-dept-card.full { margin-top: 14px; }
.ds-two { margin-top: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ds-note { margin-top: 20px; background: var(--card); border-radius: 24px; padding: 18px; }
.ds-note .title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.ds .ds-gap-top { margin-top: 24px; margin-bottom: 12px; }
.ds-row .hint.ok { color: var(--green-text); }
.ds-account { display: flex; flex-direction: column; gap: 6px; }
.ds-account-name { font-size: 18px; font-weight: 700; margin-bottom: 14px; }

/* ---------- step 4–7: staff home, department page, expense, problems, account ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.ds-page.flush { padding: 0 0 128px; }
.ds-page.white { background: #fff; }
.ds-pad { padding: 0 20px; }
.ds-grow { flex: 1; min-height: 16px; }
.ds-empty { padding: 24px 8px; text-align: center; color: var(--muted); font-size: 15px; }

/* coloured department header (staff home, department page, task page) */
.ds-head { position: relative; overflow: hidden; background: var(--d); color: var(--d-on);
  padding: max(28px, env(safe-area-inset-top)) 20px 30px; border-radius: 0 0 36px 36px; }
.ds-head > * { position: relative; }
.ds-head .bg-icon { position: absolute; right: -60px; top: 0; width: 230px; height: 230px; color: var(--d-faded); }
.ds-head .ds-greet { margin-top: 16px; }
.ds-head .ds-greet .hi, .ds-head .sub, .ds-head .head-label, .ds-head .head-sub { color: var(--d-label); }
.ds-head.small { padding-bottom: 22px; }
.ds-head .sub.center { text-align: center; margin-top: 8px; font-size: 15px; }
.ds-avatar.on-dept { background: rgba(17, 20, 24, .18); color: var(--d-on); display: flex; align-items: center; justify-content: center; }
.ds-icon-btn.on-dept { background: rgba(17, 20, 24, .16); color: var(--d-on); }
.ds-head-ring { margin-top: 22px; display: flex; align-items: center; gap: 18px; }
.ds-head-ring .big { font-size: 22px; font-weight: 800; line-height: 1.2; }
.ds-head-ring .sub { margin-top: 6px; font-size: 14px; }
.ds-ring.on-dept .big { color: var(--d-on); font-size: 26px; }
.ds-ring.on-dept .small { color: var(--d-label); font-size: 12px; }
.ds-head .head-label { margin-top: 26px; font-size: 15px; }
.ds-head .head-amt { margin-top: 4px; font-size: 52px; font-weight: 800; letter-spacing: -2px; line-height: 1; font-variant-numeric: tabular-nums; }
.ds-head .head-sub { margin-top: 8px; font-size: 14px; }

/* top bar: back / title / action */
.ds-head-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; }
.ds-head-bar .ttl { font-size: 17px; font-weight: 700; text-align: center; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ds-head-bar .spacer { width: 44px; flex-shrink: 0; }
.ds-head-bar.plain { margin: 16px 0 18px; }
.ds-icon-btn.done { background: var(--green-soft); color: var(--green-text); }

/* staff tiles */
.ds-tiles { margin-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ds-tile { position: relative; height: 120px; border-radius: 26px; background: var(--card); color: var(--ink); padding: 16px;
  display: flex; flex-direction: column; justify-content: space-between; }
.ds-tile .lbl { font-size: 17px; font-weight: 700; line-height: 1.2; }
.ds-tile.primary { background: var(--ink); color: #fff; }
.ds-tile.soon { opacity: .55; }
.ds-tile .soon-tag { position: absolute; top: 14px; right: 14px; font-size: 12px; font-weight: 600; background: rgba(255,255,255,.18); border-radius: 10px; padding: 3px 8px; }
.ds-tile:not(.primary) .soon-tag { background: var(--chip-grey); }
.ds-note-row { margin-top: 18px; background: var(--card); border-radius: 24px; padding: 16px; display: flex; align-items: center; gap: 12px; font-size: 14px; color: #3B4250; }
.ds-note-row .tick { width: 44px; height: 44px; border-radius: 22px; background: var(--green-soft); color: var(--green-text);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tile-green { background: var(--green-soft); color: var(--green-text); }
.ds-row .title { overflow-wrap: anywhere; }
.ds-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

/* department page: white card overlapping the header */
.ds-overlap { margin-top: -18px; position: relative; background: var(--card); border-radius: 28px; padding: 18px 20px; display: flex; align-items: center; gap: 16px; }
.ds-overlap .title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.ds-overlap .ds-ring .big { font-size: 17px; }

/* problems */
.ds-filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.ds-filters::-webkit-scrollbar { display: none; }
.ds-filter { height: 44px; padding: 0 16px; border-radius: 22px; border: none; background: var(--card); color: var(--ink);
  font-size: 15px; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.ds-filter[class*=" d-"] { border: 2px solid var(--d-soft); }
.ds-filter.on { background: var(--ink); color: #fff; border-color: transparent; }
.ds-filter.on[class*=" d-"] { background: var(--d); color: var(--d-on); }
.ds-counts { margin: 12px 4px; font-size: 14px; }
.ds-sheet .sheet-h { margin: 18px 0 10px; font-size: 15px; font-weight: 700; }
.ds-sheet .sheet-sub { margin: -6px 0 4px; }

/* add expense */
.ds-expense { padding-bottom: 24px; min-height: 100vh; }
.ds-expense .ds-amount { margin-top: 18px; }
.ds-expense .ds-sentence { margin-top: 22px; }
.ds-swipe-wrap { margin: 10px 0 calc(10px + env(safe-area-inset-bottom)); }
.ds-expense.blur { filter: blur(6px); transition: filter .2s; }

/* Expense evidence fields: retain the existing amount, sentence and swipe flow. */
.ds-expense .expense-details { display: grid; gap: 8px; margin: 12px 0; }
.ds-expense .expense-details label { font-size: 14px; font-weight: 600; color: var(--muted); }
.ds-expense .expense-details input { min-height: 44px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--page); font: inherit; }
.ds-expense .expense-details .hint { font-size: 12px; color: var(--muted); }
/* expense saved */
.ds-saved { position: relative; overflow: hidden; align-items: center; text-align: center; padding-top: 110px; padding-bottom: 34px; min-height: 100vh; }
.ds-saved > * { position: relative; }
.ds-saved .glow { position: absolute; left: -60px; right: -60px; bottom: -160px; height: 420px; animation: ds-rise .9s ease-out both; pointer-events: none; }
.ds-saved .glow i { position: absolute; border-radius: 50%; filter: blur(60px); }
.ds-saved .glow .g1 { left: 0; bottom: 60px; width: 260px; height: 260px; background: #FAC775; opacity: .8; }
.ds-saved .glow .g2 { left: 150px; bottom: 30px; width: 260px; height: 260px; background: #9FE1CB; opacity: .9; }
.ds-saved .glow .g3 { right: 0; bottom: 70px; width: 240px; height: 240px; background: #B5D4F4; opacity: .9; }
.ds-saved .tick { width: 84px; height: 84px; border-radius: 42px; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center;
  animation: ds-pop .5s .2s ease-out both; }
.ds-saved .saved-chip { margin-top: 22px; font-size: 13px; font-weight: 700; letter-spacing: 1px; color: var(--green-text); background: var(--green-soft); border-radius: 14px; padding: 6px 12px; }
.ds-saved .saved-amt { margin-top: 18px; font-variant-numeric: tabular-nums; }
.ds-saved .saved-line { margin-top: 14px; font-size: 17px; color: var(--muted); line-height: 1.5; }
.ds-photo-row { margin-top: 26px; width: 100%; background: var(--page); border-radius: 24px; padding: 16px; display: flex; align-items: center; gap: 12px; text-align: left; }
.ds-photo-row .ico { width: 44px; height: 44px; border-radius: 14px; background: var(--orange-soft); color: #8A4B06; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ds-photo-row .ico.green { background: var(--green-soft); color: var(--green-text); }
.ds-photo-row .txt { flex: 1; font-size: 15px; }
.ds-photo-row .mini { height: 44px; padding: 0 16px; border-radius: 22px; border: none; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; }
.saved-btns { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.ds-saved .ds-grow { flex: 1; }
@keyframes ds-rise { from { transform: translateY(180px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes ds-pop { 0% { transform: scale(.4); opacity: 0 } 70% { transform: scale(1.12) } 100% { transform: scale(1); opacity: 1 } }

/* account / install */
.ds-install { margin-top: 12px; }

/* login */
.ds-login { background: #fff; }
.ds-login .login-card { background: #fff; border: none; box-shadow: none; max-width: 390px; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.ds-login .login-logo { border-radius: 20px; margin-bottom: 10px; }
.ds-login .login-logo.brand { width: 200px; height: auto; border-radius: 0; margin-bottom: 4px; }
.ds-login h1 { font-size: 32px; font-weight: 800; letter-spacing: -1px; }
.ds-login .ds-login-form { width: 100%; margin-top: 22px; text-align: left; gap: 16px; }
.ds-login .field .label, .ds-login label { font-size: 14px; font-weight: 600; color: var(--muted); }
.ds-login input { height: 56px; border-radius: 18px; border: 1px solid var(--line); background: var(--page); color: var(--ink); -webkit-text-fill-color: var(--ink); caret-color: var(--ink); font-size: 17px; padding: 0 16px; width: 100%; font-family: inherit; }
.ds-login input::placeholder { color: #9AA1AB; -webkit-text-fill-color: #9AA1AB; }
.ds-login input:focus { outline: 2px solid var(--ink); outline-offset: 0; background: #fff; }
.ds-login .ds-btn { margin-top: 8px; }
.ds-login .form-error { color: var(--red-text); background: var(--red-soft); border-radius: 14px; padding: 10px 14px; font-size: 14px; }
.ds a.ds-btn { color: #fff; }
.ds a.ds-btn.ghost { color: var(--ink); }
.ds a.ds-btn.dept { color: var(--d-on); }

/* Manual collection entry, existing design tokens. */
.finance-entry-form { display: grid; gap: 12px; }
.finance-entry-form .field input, .finance-entry-form .field select { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--page); font: inherit; }
.finance-entry-form .check { min-height: 44px; display: flex; align-items: center; gap: 8px; }

.finance-mode-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.finance-mode { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 52px; background: var(--page); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); font: inherit; font-weight: 600; }
.finance-mode[aria-pressed="true"] { border: 2px solid var(--ink); background: #fff; }
.finance-mode:disabled { opacity: .65; }

.finance-page { gap: 16px; }
.finance-actions, .finance-metrics { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.finance-actions .ds-btn { height:auto; min-height:56px; padding:8px; font-size:15px; text-align:center; line-height:1.2; }
.finance-breakdown { padding:0 12px; background:var(--card); border-radius:20px; margin:12px 0; }
.finance-line { display:grid; align-items:center; grid-template-columns:minmax(0,1.4fr) repeat(2,minmax(0,1fr)); gap:6px; min-height:52px; padding:8px 0; border-bottom:1px solid var(--line); font-variant-numeric:tabular-nums; }
.finance-line:last-child { border-bottom:0; }
.finance-line > span { text-align:right; overflow-wrap:anywhere; }
.finance-line.labels { font-size:13px; color:var(--muted); }
.finance-dept { display:flex; align-items:center; gap:5px; font-weight:600; }
.finance-dept svg, .finance-actions svg { flex-shrink:0; }
.finance-dept small { display:block; font-size:12px; color:var(--muted); font-weight:400; }
.finance-page summary { min-height:44px; padding:12px 0; cursor:pointer; }
.finance-page .field select, .expense-details select { width:100%; min-width:0; min-height:44px; }
.finance-page .finance-entry-form { padding:16px; background:var(--card); border-radius:18px; }
.finance-page .ds-note { margin:0; }
.finance-dept svg { color:var(--d,var(--muted)); }
.finance-dept { color:var(--ink); text-decoration:none; }
.finance-dept[href] { min-height:44px; }

.collection-panel { display:grid; grid-template-columns:minmax(0,1fr); overflow:hidden; background:var(--card); border-radius:28px; }
.collection-lead { display:flex; flex-direction:row-reverse; justify-content:space-between; align-items:center; gap:12px; padding:clamp(16px,3vw,32px); min-width:0; }
.collection-lead img { width:clamp(60px,16vw,116px); height:auto; flex:none; }
.collection-lead > div { min-width:0; }
.collection-lead .ds-hero { font-size:clamp(26px,6vw,46px); overflow-wrap:anywhere; }
.collection-trend { margin:0 16px 12px; }
.collection-trend summary { display:flex; align-items:center; gap:12px; list-style:none; padding:10px 4px; }
.collection-trend summary::-webkit-details-marker { display:none; }
.collection-trend summary > svg { margin-left:auto; }
.collection-trend[open] summary > svg { transform:rotate(90deg); }
.collection-trend small { display:block; color:var(--muted); font-size:13px; }
.trend-bars { display:flex; align-items:end; gap:4px; height:28px; flex:none; border-bottom:1px solid var(--line); }
.trend-bars i { width:8px; background:#b2c8c2; border-radius:3px 3px 0 0; }
.trend-bars i:last-child { background:#22705a; }
.trend-detail { padding:8px 4px 14px; }
.trend-detail p { display:flex; justify-content:space-between; gap:12px; padding:6px 0; }
.trend-detail small { margin-top:8px; }
.department-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:12px 0; }
.department-grid .full { grid-column:1/-1; }
.department-grid .amt { font-size:clamp(20px,5.2vw,28px); overflow-wrap:anywhere; }
.department-grid .full .amt { font-size:clamp(30px,7vw,42px); }
.d-other,.d-shared { --d:#e2e9ec; --d-on:#182d37; --d-label:#384e59; --d-faded:#c3d1d6; }
@media screen and (min-width:700px) {
  .app.bare > .view { max-width: min(92vw, 920px); }
  .app.bare > .view:has(.department-grid) { max-width: min(94vw, 1180px); }
  .collection-panel { grid-template-columns:minmax(0,1fr) minmax(0,1fr); align-items:center; }
  .collection-trend { margin:16px 24px; }
  .department-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .department-grid .full { grid-column:span 2; }
  .department-grid .ds-dept-card { height:180px; }
  .ds-page:has(.finance-entry-form):not(:has(.department-grid)), .ds-expense { max-width:740px; margin:auto; }
}
@media screen and (min-width:1100px) {
  .department-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
}

.daily-departments .ds-dept-card .bg-icon {
  width:var(--daily-icon-size);
  height:var(--daily-icon-size);
  right:-8px;
  bottom:-6px;
}
.daily-departments .ds-dept-card.full .bg-icon { top:auto; }

/* v1.1 optical stock */
.optical-page .ds-filters { margin-top: 4px; }
.optical-page .ds-row .ds-right .amount { font-size: 16px; }
.ds-saved-mini { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 28px 18px; }
.ds-saved-mini .tick { width: 64px; height: 64px; border-radius: 32px; background: var(--green); color: #fff; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; animation: ds-pop .45s ease-out both; }
.finance-updated { text-align: center; }
