/* Time Tracker — app styles
   Ledger palette: pale ledger-paper background, deep green ink, one green accent for
   money and primary actions, red only for the running timer and destructive actions. */

@font-face { font-family: 'Plex Sans'; src: url('fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: block; }
@font-face { font-family: 'Plex Sans'; src: url('fonts/ibm-plex-sans-latin-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: block; }
@font-face { font-family: 'Plex Sans'; src: url('fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: block; }
@font-face { font-family: 'Plex Sans'; src: url('fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: block; }
@font-face { font-family: 'Plex Serif'; src: url('fonts/ibm-plex-serif-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: block; }
@font-face { font-family: 'Plex Serif'; src: url('fonts/ibm-plex-serif-latin-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: block; }
@font-face { font-family: 'Plex Serif'; src: url('fonts/ibm-plex-serif-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: block; }
@font-face { font-family: 'Plex Serif'; src: url('fonts/ibm-plex-serif-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: block; }

:root, :root[data-theme='light'] {
  color-scheme: light;
  --paper: #F2F4F0;
  --surface: #FFFFFF;
  --surface-2: #F7F9F6;
  --sunken: #EAEEE9;
  --ink: #17241D;
  --ink-2: #4C5A52;
  --ink-3: #7F8B84;
  --rule: #DEE4DE;
  --rule-2: #C7D1C9;
  --ledger: #1E6B47;
  --ledger-hover: #175A3B;
  --ledger-ink: #FFFFFF;
  --ledger-soft: #E1EEE5;
  --ledger-tint: #F0F6F2;
  --rec: #CF3F2E;
  --rec-soft: #FBE8E5;
  --weekend: rgba(23, 36, 29, 0.035);
  --focus: 0 0 0 3px rgba(30, 107, 71, 0.2);
  --shadow-1: 0 1px 2px rgba(23, 36, 29, 0.07);
  --shadow-2: 0 2px 6px rgba(23, 36, 29, 0.06), 0 18px 44px rgba(23, 36, 29, 0.16);
  --toast-bg: #17241D;
  --toast-ink: #EEF4F0;
  --toast-action: #8FD9B0;
  --sans: 'Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --serif: 'Plex Serif', Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --paper: #0F1512;
    --surface: #161E1A;
    --surface-2: #1A231E;
    --sunken: #111814;
    --ink: #E2E9E4;
    --ink-2: #A3B1A8;
    --ink-3: #6F7D75;
    --rule: #25302A;
    --rule-2: #35423B;
    --ledger: #48B77E;
    --ledger-hover: #5BC78F;
    --ledger-ink: #07150E;
    --ledger-soft: #1B3326;
    --ledger-tint: #17231D;
    --rec: #FF6B57;
    --rec-soft: #3A201B;
    --weekend: rgba(255, 255, 255, 0.02);
    --focus: 0 0 0 3px rgba(72, 183, 126, 0.28);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, 0.3), 0 18px 48px rgba(0, 0, 0, 0.5);
    --toast-bg: #E2E9E4;
    --toast-ink: #121A16;
    --toast-action: #1E6B47;
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --paper: #0F1512;
  --surface: #161E1A;
  --surface-2: #1A231E;
  --sunken: #111814;
  --ink: #E2E9E4;
  --ink-2: #A3B1A8;
  --ink-3: #6F7D75;
  --rule: #25302A;
  --rule-2: #35423B;
  --ledger: #48B77E;
  --ledger-hover: #5BC78F;
  --ledger-ink: #07150E;
  --ledger-soft: #1B3326;
  --ledger-tint: #17231D;
  --rec: #FF6B57;
  --rec-soft: #3A201B;
  --weekend: rgba(255, 255, 255, 0.02);
  --focus: 0 0 0 3px rgba(72, 183, 126, 0.28);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, 0.3), 0 18px 48px rgba(0, 0, 0, 0.5);
  --toast-bg: #E2E9E4;
  --toast-ink: #121A16;
  --toast-action: #1E6B47;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 13px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
  cursor: default;
}
input, textarea, select, button { font: inherit; color: inherit; }
input, textarea { user-select: text; }
button { cursor: pointer; }
h1, h2, h3 { font-weight: 500; }
.num { font-variant-numeric: tabular-nums; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--ledger); outline-offset: 2px; }
::selection { background: var(--ledger-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--rule-2); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
kbd {
  display: inline-block; min-width: 18px; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--rule-2);
  background: var(--surface); color: var(--ink-2); font: 500 11px/1.4 var(--sans); text-align: center;
}
.muted { color: var(--ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-rows: 52px minmax(0, 1fr); height: 100vh; }
.topbar {
  display: flex; align-items: center; gap: 18px; padding: 0 14px 0 18px; position: relative; z-index: 5;
  background: var(--surface); border-bottom: 1px solid var(--rule);
}
.topbar .grow { flex: 1; align-self: stretch; }
.tabs { display: flex; align-self: stretch; gap: 2px; }
.tab {
  position: relative; display: flex; align-items: center; padding: 0 10px; border: 0; background: none;
  color: var(--ink-2); font-weight: 500;
}
.tab:hover { color: var(--ink); }
.tab[aria-current='page'] { color: var(--ink); }
.tab[aria-current='page']::after {
  content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px 2px 0 0; background: var(--ledger);
}
.main { min-height: 0; position: relative; }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 12px;
  border-radius: 6px; border: 1px solid var(--rule-2); background: var(--surface); color: var(--ink);
  font-weight: 500; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn.primary { background: var(--ledger); border-color: var(--ledger); color: var(--ledger-ink); }
.btn.primary:hover { background: var(--ledger-hover); border-color: var(--ledger-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--sunken); color: var(--ink); }
.btn.danger { color: var(--rec); }
.btn.danger:hover { border-color: var(--rec); background: var(--rec-soft); }
.btn.danger.solid { background: var(--rec); border-color: var(--rec); color: #fff; }
.btn.small { height: 26px; padding: 0 9px; font-size: 12px; }
.btn.icon { width: 30px; padding: 0; }
.btn.icon.small { width: 26px; }
.btn svg { flex: none; }
.btn.pressed { background: var(--ledger-soft); border-color: var(--ledger); color: var(--ledger); }

.input, .textarea, .select select {
  width: 100%; height: 30px; padding: 0 10px; border: 1px solid var(--rule-2); border-radius: 6px;
  background: var(--surface); outline: none; transition: border-color 0.12s, box-shadow 0.12s;
}
.textarea { height: auto; min-height: 76px; padding: 7px 10px; resize: vertical; line-height: 1.5; }
.input:focus, .textarea:focus, .select select:focus { border-color: var(--ledger); box-shadow: var(--focus); }
.input.invalid { border-color: var(--rec); }
.input.invalid:focus { box-shadow: 0 0 0 3px var(--rec-soft); }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
input[type='date'].input { padding-right: 6px; }
input[type='date']::-webkit-calendar-picker-indicator { opacity: 0.55; cursor: pointer; }
input[type='number'].input::-webkit-inner-spin-button { opacity: 0.4; }
input[list]::-webkit-calendar-picker-indicator { display: none !important; }

.select { position: relative; display: block; min-width: 0; }
.select select { appearance: none; padding-right: 28px; text-overflow: ellipsis; }
.select::after {
  content: ''; position: absolute; right: 11px; top: 50%; width: 6px; height: 6px; margin-top: -5px; pointer-events: none;
  border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: rotate(45deg);
}
.select.client select { padding-left: 26px; }
.select.client::before {
  content: ''; position: absolute; left: 10px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%;
  background: var(--c, var(--ink-3)); pointer-events: none;
}
.select.small select { height: 26px; font-size: 12px; }
.select.inline select { border-color: transparent; background: transparent; }
.select.inline select:hover { background: var(--sunken); }

.seg { display: inline-flex; padding: 2px; border-radius: 7px; background: var(--sunken); border: 1px solid var(--rule); }
.seg button {
  border: 0; background: transparent; padding: 0 10px; height: 24px; border-radius: 5px; color: var(--ink-2); font-weight: 500; white-space: nowrap;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed='true'] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.seg.full { display: flex; }
.seg.full button { flex: 1; }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; }
.switch input {
  appearance: none; flex: none; width: 30px; height: 18px; margin: 0; border-radius: 9px; background: var(--rule-2);
  position: relative; transition: background 0.15s; cursor: pointer;
}
.switch input::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.15s;
}
.switch input:checked { background: var(--ledger); }
.switch input:checked::after { transform: translateX(12px); }

.field { display: grid; gap: 5px; margin-bottom: 14px; min-width: 0; }
.field > .label, .label { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.hint { font-size: 12px; color: var(--ink-3); line-height: 1.45; }
.hint.err { color: var(--rec); }
.row { display: flex; gap: 10px; align-items: center; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.cols-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--ink-3)); flex: none; display: inline-block; }

/* ---------- Timer ---------- */
.timer {
  display: flex; align-items: center; height: 34px; width: min(540px, 48vw); overflow: hidden;
  border: 1px solid var(--rule-2); border-radius: 8px; background: var(--surface-2);
}
.timer:focus-within { border-color: var(--ink-3); }
.timer.running { border-color: var(--rec); background: var(--surface); box-shadow: 0 0 0 3px var(--rec-soft); }
.timer .select { flex: 0 1 180px; border-right: 1px solid var(--rule); }
.timer .select select { height: 32px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.timer .t-desc { flex: 1; min-width: 60px; height: 100%; border: 0; padding: 0 12px; background: transparent; outline: none; }
.timer .t-desc::placeholder { color: var(--ink-3); }
.timer .t-clock { padding: 0 10px 0 6px; min-width: 76px; text-align: right; color: var(--ink-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.timer.running .t-clock { color: var(--ink); }
.timer .t-btn {
  display: grid; place-items: center; height: 100%; width: 40px; flex: none; border: 0; border-left: 1px solid var(--rule);
  background: transparent; color: var(--ledger);
}
.timer .t-btn:hover { background: var(--ledger-tint); }
.timer .t-btn.stop { color: var(--rec); }
.timer .t-btn.stop:hover { background: var(--rec-soft); }
.timer .t-btn.discard { width: 30px; color: var(--ink-3); }
.timer .t-btn:disabled { color: var(--ink-3); pointer-events: none; }
.rec-dot { width: 8px; height: 8px; margin-left: 12px; border-radius: 50%; background: var(--rec); flex: none; animation: rec 1.6s ease-in-out infinite; }
@keyframes rec { 50% { opacity: 0.3; } }

/* ---------- Timesheet ---------- */
.timesheet { display: grid; grid-template-columns: minmax(0, 1fr) 384px; height: 100%; min-height: 0; }
.month { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.month-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 28px 10px; }
.month-title { margin: 0; font: 500 27px/1.1 var(--serif); letter-spacing: -0.01em; }
.month-nav { display: flex; align-items: center; gap: 4px; margin-top: 10px; }
.figures { display: flex; gap: 30px; text-align: right; padding-top: 2px; }
.figure .val { font: 500 22px/1.15 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.figure .val.money { color: var(--ledger); }
.figure .lbl { color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.month-tools { display: flex; align-items: center; gap: 8px; padding: 2px 28px 12px; }
.month-tools .select { width: 190px; }
.month-tools .grow { flex: 1; }

.timeline { flex: 1; min-height: 0; overflow-y: auto; padding: 0 28px 24px; }
.tl { --label: 78px; --total: 62px; position: relative; }
.tl-axis {
  position: sticky; top: 0; z-index: 3; display: grid; grid-template-columns: var(--label) 1fr var(--total);
  height: 26px; background: var(--paper); border-bottom: 1px solid var(--rule);
}
.tl-ticks { position: relative; }
.tl-tick { position: absolute; bottom: 6px; transform: translateX(-50%); font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tl-tick:first-child { transform: none; }
.tl-axis .tl-sum { align-self: end; padding: 0 8px 6px 0; text-align: right; font-size: 11px; color: var(--ink-3); }
.tl-row {
  position: relative; display: grid; grid-template-columns: var(--label) 1fr var(--total); align-items: center;
  height: 27px; border-radius: 5px; cursor: pointer; scroll-margin: 32px 0 12px;
}
.tl-row:hover { background: var(--ledger-tint); }
.tl-row.week-start { box-shadow: inset 0 1px 0 var(--rule-2); border-radius: 0 0 5px 5px; }
.tl-row.selected { background: var(--ledger-soft); }
.tl-row.week-start.selected { box-shadow: inset 0 1px 0 var(--rule-2); }
.tl-label { display: flex; align-items: baseline; gap: 6px; padding-left: 8px; color: var(--ink-2); }
.tl-label .wd { width: 28px; color: var(--ink-3); font-size: 11.5px; }
.tl-label .dn { font-weight: 500; font-variant-numeric: tabular-nums; }
.tl-row.today .tl-label .dn { color: var(--ledger-ink); background: var(--ledger); border-radius: 9px; padding: 0 6px; margin-left: -6px; }
.tl-row.weekend .tl-label { opacity: 0.75; }
.tl-track {
  position: relative; height: 15px; border-radius: 3px;
  background-image: linear-gradient(to right, var(--rule) 1px, transparent 1px);
  background-size: calc(100% / var(--span)) 100%;
}
.tl-row.weekend .tl-track { background-color: var(--weekend); }
.tl-clip {
  position: absolute; top: 0; bottom: 0; min-width: 3px; border-radius: 3px; background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.07);
}
.tl-clip:hover { filter: brightness(1.1) saturate(1.05); }
.tl-clip.nb { background: repeating-linear-gradient(135deg, var(--c) 0 3px, color-mix(in srgb, var(--c) 35%, transparent) 3px 6px); }
.tl-clip.live { background: repeating-linear-gradient(90deg, var(--c) 0 6px, color-mix(in srgb, var(--c) 60%, transparent) 6px 8px); }
.tl-clip.existing { background: var(--rule-2); box-shadow: none; }
.tl-clip.fresh { animation: clip-in 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both; transform-origin: left center; animation-delay: calc(var(--i, 0) * 9ms); }
@keyframes clip-in { from { transform: scaleX(0); opacity: 0; } }
.tl-playhead { position: absolute; top: -6px; bottom: -6px; width: 2px; margin-left: -1px; border-radius: 1px; background: var(--rec); pointer-events: none; }
.tl-total { padding-right: 8px; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }
.tl-total.zero { color: var(--ink-3); font-weight: 400; }

.day { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-left: 1px solid var(--rule); }
.day-head { padding: 20px 20px 12px; }
.day-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.day-title h2 { margin: 0; font: 500 19px/1.25 var(--serif); }
.day-title .total { font: 500 19px/1 var(--sans); font-variant-numeric: tabular-nums; }
.day-sub { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; color: var(--ink-3); font-size: 12px; }
.day-sub .nav { display: flex; gap: 2px; align-items: center; }
.day-sub .nav .btn.small:not(.icon) { margin-right: 4px; }
.quick { margin: 0 14px 6px; padding: 12px; border: 1px solid var(--rule); border-radius: 10px; background: var(--surface-2); display: grid; gap: 8px; }
.quick-row { display: flex; gap: 8px; }
.quick .q-time { width: 128px; flex: none; font-variant-numeric: tabular-nums; }
.quick .select { flex: 1; }
.quick-hint { min-height: 18px; font-size: 12px; color: var(--ink-3); display: flex; justify-content: space-between; gap: 8px; }
.quick-hint .ok { color: var(--ink-2); }
.quick-hint .err { color: var(--rec); }
.entries { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 0 12px; }
.entry {
  position: relative; display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 12px; align-items: start;
  padding: 10px 20px; border-top: 1px solid var(--rule); cursor: pointer;
}
.entry:first-child { border-top-color: transparent; }
.entry:hover { background: var(--surface-2); }
.entry .when { color: var(--ink-2); font-size: 12px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.entry .when .to { color: var(--ink-3); display: block; }
.entry .what { min-width: 0; }
.entry .desc { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.entry .desc.empty { color: var(--ink-3); font-style: italic; }
.entry .who { display: flex; align-items: center; gap: 6px; margin-top: 2px; color: var(--ink-3); font-size: 12px; }
.entry .dur { font: 500 15px/1.3 var(--sans); font-variant-numeric: tabular-nums; text-align: right; }
.tag { font-size: 11px; line-height: 16px; padding: 0 5px; border-radius: 4px; border: 1px solid var(--rule-2); color: var(--ink-3); }
.entry .actions {
  position: absolute; right: 14px; top: 8px; display: none; gap: 2px; padding-left: 10px;
  background: linear-gradient(to right, transparent, var(--surface-2) 10px);
}
.entry:hover .actions, .entry:focus-within .actions { display: flex; }
.day-foot { display: flex; justify-content: space-between; padding: 10px 20px; border-top: 1px solid var(--rule); color: var(--ink-2); font-size: 12px; }
.day-foot .money { color: var(--ledger); font-weight: 500; }
.empty-note { padding: 26px 26px; color: var(--ink-3); text-align: center; line-height: 1.65; }
.empty-note strong { color: var(--ink-2); font-weight: 500; }

.welcome { max-width: 420px; margin: 12vh auto 0; padding: 0 24px; }
.welcome h2 { font: 500 24px/1.2 var(--serif); margin: 0 0 8px; }
.welcome p { color: var(--ink-2); margin: 0 0 18px; line-height: 1.6; }

/* ---------- Modal ---------- */
.backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(12, 18, 15, 0.4); animation: fade 0.12s ease-out; }
.modal {
  width: min(var(--w, 520px), calc(100vw - 48px)); max-height: calc(100vh - 56px); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 12px; box-shadow: var(--shadow-2); animation: pop 0.14s ease-out;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 8px; }
.modal-head h2 { margin: 0; font: 500 19px/1.25 var(--serif); }
.modal-body { padding: 8px 22px 16px; overflow: auto; min-height: 0; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 22px; border-top: 1px solid var(--rule); background: var(--surface-2); border-radius: 0 0 12px 12px; }
.modal-foot .left { margin-right: auto; display: flex; gap: 6px; align-items: center; }
@keyframes pop { from { transform: translateY(6px) scale(0.99); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* ---------- Fill hours ---------- */
.fill { display: grid; grid-template-columns: 330px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); min-height: 0; flex: 1; }
.modal.tall { height: min(800px, calc(100vh - 56px)); }
.fill-form { padding: 8px 22px 16px; overflow-y: auto; border-right: 1px solid var(--rule); }
.fill-preview { display: flex; flex-direction: column; min-height: 0; background: var(--surface-2); }
.fill-summary { display: flex; gap: 26px; padding: 14px 22px 12px; border-bottom: 1px solid var(--rule); }
.fill-summary .figure { text-align: left; }
.fill-summary .figure .val { font-size: 19px; }
.fill-rows { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 22px 16px; }
.plan-row { display: grid; grid-template-columns: 74px 1fr 50px; align-items: center; height: 23px; border-radius: 4px; cursor: pointer; }
.plan-row:hover { background: var(--ledger-tint); }
.plan-row.week-start { box-shadow: inset 0 1px 0 var(--rule-2); }
.plan-row.off .tl-track, .plan-row.off .tl-label, .plan-row.off .tl-total { opacity: 0.35; }
.plan-row .tl-track { height: 13px; }
.plan-row .tl-total { font-size: 12px; }
.plan-row .why { font-size: 11px; color: var(--ink-3); text-align: right; padding-right: 8px; }
.wd-toggles { display: flex; gap: 4px; }
.wd-toggles button {
  width: 34px; height: 28px; border-radius: 6px; border: 1px solid var(--rule-2); background: var(--surface); color: var(--ink-2); font-weight: 500;
}
.wd-toggles button[aria-pressed='true'] { background: var(--ledger); border-color: var(--ledger); color: var(--ledger-ink); }
.disclosure { display: flex; align-items: center; gap: 6px; padding: 0; margin: 4px 0 12px; border: 0; background: none; color: var(--ink-2); font-weight: 500; }
.disclosure svg { transition: transform 0.15s; }
.disclosure[aria-expanded='true'] svg { transform: rotate(90deg); }
.batches { margin-top: 6px; border-top: 1px solid var(--rule); padding-top: 10px; }
.batch { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-2); padding: 3px 0; }

/* ---------- Clients ---------- */
.split { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: 100%; min-height: 0; }
.list-pane { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-right: 1px solid var(--rule); }
.list-pane > header { display: flex; align-items: center; justify-content: space-between; padding: 22px 20px 14px; }
.list-pane h1, .page-title { margin: 0; font: 500 24px/1.2 var(--serif); }
.list-items { flex: 1; min-height: 0; overflow-y: auto; }
.list-item {
  display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%;
  padding: 11px 20px; border: 0; border-top: 1px solid var(--rule); background: transparent; text-align: left;
}
.list-item:hover { background: var(--surface-2); }
.list-item[aria-selected='true'] { background: var(--ledger-soft); }
.list-item .name { font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.list-item .meta { color: var(--ink-3); font-size: 12px; }
.list-item .hours { text-align: right; font-variant-numeric: tabular-nums; }
.list-item.archived .name { color: var(--ink-3); }
.detail-pane { overflow-y: auto; padding: 26px 36px 48px; }
.detail-pane form { max-width: 640px; }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.detail-head h2 { margin: 0; font: 500 24px/1.2 var(--serif); }
.stat-line { display: flex; gap: 28px; margin: 4px 0 22px; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 22px; height: 22px; padding: 0; border-radius: 50%; border: 0; background: var(--c); }
.swatch:hover { transform: scale(1.08); }
.swatch[aria-pressed='true'] { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--c); }
.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.form-actions .grow { flex: 1; }

/* ---------- Reports ---------- */
.reports { display: grid; grid-template-columns: 312px minmax(0, 1fr); height: 100%; min-height: 0; }
.report-panel { overflow-y: auto; padding: 22px 20px 24px; background: var(--surface); border-right: 1px solid var(--rule); }
.report-panel .page-title { margin-bottom: 18px; }
.report-actions { display: grid; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rule); }
.report-stage { overflow: auto; padding: 32px 32px 48px; }
.sheet-holder { margin: 0 auto; }

/* ---------- Settings ---------- */
.settings { height: 100%; overflow-y: auto; }
.settings-inner { max-width: 820px; margin: 0 auto; padding: 26px 36px 64px; }
.settings-inner > .page-title { margin-bottom: 4px; }
.settings-inner > .lede { color: var(--ink-3); margin: 0 0 18px; }
.section { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 28px; padding: 24px 0; border-top: 1px solid var(--rule); }
.section > header h2 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.section > header p { margin: 0; color: var(--ink-3); font-size: 12px; line-height: 1.55; }
.pref { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; align-items: center; margin-bottom: 12px; }
.pref > .label { font-size: 13px; font-weight: 400; color: var(--ink-2); }
.card { border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); padding: 14px 16px; }
.card + .card { margin-top: 10px; }
.card-row { display: flex; align-items: center; gap: 10px; }
.card .path { font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; margin-top: 4px; user-select: text; }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 10px; background: var(--sunken); color: var(--ink-2); font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.badge.good { background: var(--ledger-soft); color: var(--ledger); }
.badge.warn { background: var(--rec-soft); color: var(--rec); }
.code { margin: 10px 0 0; padding: 10px 12px; border-radius: 7px; border: 1px solid var(--rule); background: var(--sunken); font: 11.5px/1.5 ui-monospace, Menlo, monospace; white-space: pre-wrap; word-break: break-all; user-select: text; }
.backup-list { margin-top: 10px; max-height: 180px; overflow-y: auto; border-top: 1px solid var(--rule); }
.backup { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: 12px; color: var(--ink-2); }
.examples { margin: 10px 0 0; padding-left: 18px; color: var(--ink-2); line-height: 1.7; }
.choice {
  display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; width: 100%; padding: 12px 14px; margin-bottom: 8px; text-align: left;
  border: 1px solid var(--rule-2); border-radius: 9px; background: var(--surface);
}
.choice:hover { border-color: var(--ink-3); }
.choice[aria-pressed='true'] { border-color: var(--ledger); background: var(--ledger-tint); box-shadow: var(--focus); }
.choice .radio { width: 16px; height: 16px; margin-top: 1px; border-radius: 50%; border: 1.5px solid var(--rule-2); background: var(--surface); }
.choice[aria-pressed='true'] .radio { border: 5px solid var(--ledger); }
.choice .t { font-weight: 500; }
.choice .s { color: var(--ink-3); font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; }
.error-panel { max-width: 560px; margin: 14vh auto 0; padding: 0 24px; }
.error-panel h2 { font: 500 22px/1.25 var(--serif); margin: 0 0 8px; }
.error-panel p { color: var(--ink-2); line-height: 1.6; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 22px; z-index: 90; display: grid; gap: 8px; justify-items: center; transform: translateX(-50%); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 14px; max-width: 620px; padding: 9px 10px 9px 16px; border-radius: 9px;
  background: var(--toast-bg); color: var(--toast-ink); box-shadow: var(--shadow-2); font-weight: 500; pointer-events: auto; animation: rise 0.18s ease-out;
}
.toast.error { background: var(--rec); color: #fff; }
.toast button { border: 0; background: transparent; color: var(--toast-action); font-weight: 600; padding: 4px 6px; border-radius: 5px; }
.toast.error button { color: #fff; }
.toast button:hover { background: rgba(127, 127, 127, 0.18); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 1180px) {
  .timesheet { grid-template-columns: minmax(0, 1fr) 340px; }
  .figures { gap: 18px; }
}

/* ---------- Web: sign-in, team ---------- */
.signin { margin-top: 18vh; }
.signin form .input { flex: 1; }
.table { width: 100%; border-collapse: collapse; margin: 0 0 22px; }
.table th { text-align: left; font-size: 12px; font-weight: 500; color: var(--ink-3); padding: 0 10px 8px 0; border-bottom: 1px solid var(--rule); }
.table td { padding: 9px 10px 9px 0; border-bottom: 1px solid var(--rule); }
.table .num { text-align: right; padding-right: 0; padding-left: 10px; }
.table .dot { margin-right: 8px; }
.table tr.muted td { color: var(--ink-3); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 14px; padding: 4px 0; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { accent-color: var(--ledger); margin: 0; }
.who-select { max-width: 200px; }
.code.inline { display: inline; margin: 0; padding: 1px 6px; }
ol.examples li { margin-bottom: 6px; }
.hint a { color: var(--ledger); }
