/* Layout: app shell. Left sidebar (240 expanded / 56 rail; overlay under 1200; bottom tab bar under 600), sticky timer bar over every page, page header + toolbar + surface below. Drawer (desktop) / bottom sheet (phone) for editing. */
:root {
  --bg: #f6f5f7;
  --surface: #ffffff;
  --raised: #ffffff;
  --sunk: #efedf1;
  --hover: #f2f0f4;
  --ink: #1f1a22;
  --ink-2: #4a4350;
  --muted: #736b78;
  --line: #e3dfe6;
  --line-2: #d3cdd8;
  --accent: #6d2b78;
  --accent-ink: #ffffff;
  --accent-soft: #f2e8f4;
  --accent-line: #d8bfdd;
  --nav-bg: #fbfafc;
  --nav-ink: #3f3845;
  --nav-ink-2: #857c8b;
  --nav-hover: #f0edf2;
  --nav-active: #f2e8f4;
  --nav-strong: #1f1a22;
  --nav-line: #e7e3ea;
  --good: #23784d; --good-soft: #e2f3ea;
  --warn: #8d5a06; --warn-soft: #fbf0d9;
  --bad: #b2321b;  --bad-soft: #fbe6e1;
  --info: #2b5aa8; --info-soft: #e6eefb;
  --shadow: 0 1px 2px rgba(31, 18, 36, .06), 0 1px 1px rgba(31, 18, 36, .04);
  --shadow-lg: 0 18px 48px rgba(31, 18, 36, .22);
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-num: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 8px; --r-sm: 6px;
  --sn: 240px; --top: 60px; --bnav: 64px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #141116; --surface: #1c181f; --raised: #241f28; --sunk: #18151b; --hover: #26202a; --ink: #efe9f2; --ink-2: #cfc6d4; --muted: #a197a8; --line: #322b37; --line-2: #443b4a;
  --accent: #d9a6e3; --accent-ink: #1b1220; --accent-soft: #34253a; --accent-line: #5a4263;
  --nav-bg: #100d12; --nav-ink: #cfc6d4; --nav-ink-2: #8a8090; --nav-hover: #1f1a22; --nav-active: #2c2331; --nav-strong: #ffffff; --nav-line: #2c2331;
  --good: #6fd09e; --good-soft: #1b3326; --warn: #f0bb62; --warn-soft: #3a2c13; --bad: #ff8b74; --bad-soft: #3d1e18; --info: #8fb4ff; --info-soft: #1d2a44;
  --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 18px 48px rgba(0,0,0,.6); color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #141116; --surface: #1c181f; --raised: #241f28; --sunk: #18151b; --hover: #26202a; --ink: #efe9f2; --ink-2: #cfc6d4; --muted: #a197a8; --line: #322b37; --line-2: #443b4a;
  --accent: #d9a6e3; --accent-ink: #1b1220; --accent-soft: #34253a; --accent-line: #5a4263;
  --nav-bg: #100d12; --nav-ink: #cfc6d4; --nav-ink-2: #8a8090; --nav-hover: #1f1a22; --nav-active: #2c2331; --nav-strong: #ffffff; --nav-line: #2c2331;
  --good: #6fd09e; --good-soft: #1b3326; --warn: #f0bb62; --warn-soft: #3a2c13; --bad: #ff8b74; --bad-soft: #3d1e18; --info: #8fb4ff; --info-soft: #1d2a44;
  --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 18px 48px rgba(0,0,0,.6); color-scheme: dark }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: calc(var(--top) + 12px); }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font-ui); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; letter-spacing: -.005em; }
.num, .clock, .dur, .stat .v, td.n, th.n, .times, .mclock, .calhead b, .hours div, .gridtbl input.cell, svg.chart text, .otp input { font-variant-numeric: tabular-nums; font-feature-settings: "tnum", "cv11", "ss01"; }
.clock { font-weight: 600; letter-spacing: -.01em; }
.stat .v { font-weight: 650; letter-spacing: -.025em; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 40; background: var(--surface); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: var(--r-sm); }
.skip:focus { top: calc(8px + env(safe-area-inset-top, 0px)); }
svg.lucide { width: 18px; height: 18px; stroke-width: 1.9; flex: none; }
.i16 svg.lucide, svg.lucide.i16 { width: 16px; height: 16px; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: var(--sn) minmax(0, 1fr); min-height: 100vh; }
.app.rail { --sn: 56px; }
.sidenav { position: sticky; top: 0; height: 100vh; background: var(--nav-bg); color: var(--nav-ink); display: flex; flex-direction: column; border-right: 1px solid var(--nav-line); padding: calc(10px + env(safe-area-inset-top, 0px)) 8px calc(10px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px)); gap: 4px; z-index: 35; width: var(--sn); overflow: hidden; transition: width .18s ease; }
.sn-top { display: flex; align-items: center; justify-content: space-between; height: 40px; padding: 0 2px 0 6px; margin-bottom: 8px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--nav-strong); font-weight: 700; font-size: 17px; letter-spacing: -.02em; min-width: 0; }
.mark { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(160deg, #a35ab0, #6d2b78 60%); position: relative; flex: none; }
.mark::after { content: ""; position: absolute; left: 8px; top: 7px; width: 10px; height: 12px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: #f6eef8; }
.mark::before { content: ""; position: absolute; left: 12px; top: 3px; width: 2px; height: 6px; background: #9fd4a8; border-radius: 1px; z-index: 1; }
.sn-toggle { color: var(--nav-ink-2); }
.sn-toggle:hover { color: var(--nav-strong); background: var(--nav-hover); }
.sn-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; display: grid; align-content: start; gap: 14px; }
.sn-group { display: grid; gap: 2px; }
.sn-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--nav-ink-2); padding: 0 10px 4px; white-space: nowrap; }
.sn-item { position: relative; display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 10px; border-radius: var(--r-sm); color: var(--nav-ink); text-decoration: none; border: 0; background: transparent; cursor: pointer; width: 100%; text-align: left; font-size: 14px; white-space: nowrap; }
.sn-item:hover { background: var(--nav-hover); color: var(--nav-strong); }
.sn-item[aria-current="page"] { background: var(--nav-active); color: var(--accent); font-weight: 600; }
.sn-item[aria-current="page"]::before { content: ""; position: absolute; left: -8px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.sn-item .badge { margin-left: auto; font: 500 11px var(--font-num); background: var(--nav-active); color: var(--nav-ink); padding: 1px 6px; border-radius: 99px; }
.sn-foot { display: grid; gap: 2px; border-top: 1px solid var(--nav-line); padding-top: 8px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 600 11px var(--font-ui); flex: none; }
.who { display: grid; line-height: 1.2; min-width: 0; }
.who small { color: var(--nav-ink-2); font-size: 12px; }
.app.rail .lbl, .app.rail .sn-label, .app.rail .badge, .app.rail .who { display: none; }
.app.rail .sn-group + .sn-group { border-top: 1px solid var(--nav-line); padding-top: 12px; }
.app.rail .sn-top { justify-content: center; padding: 0; }
.app.rail .logo .lbl { display: none; }
.app.rail .sn-item { justify-content: center; padding: 0; }
.app.rail .sn-item[data-tip]:hover::after, .app.rail .sn-item[data-tip]:focus-visible::after { content: attr(data-tip); position: fixed; left: 62px; transform: translateY(0); background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 500; padding: 4px 8px; border-radius: 4px; white-space: nowrap; z-index: 80; pointer-events: none; }
.scrim { position: fixed; inset: 0; background: rgba(16, 8, 20, .45); z-index: 34; }

.maincol { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); min-height: var(--top); display: flex; align-items: center; }
.topbar-in { width: 100%; padding-block: 10px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); display: flex; align-items: center; gap: 8px; }
main { width: 100%; max-width: 1240px; margin: 0 auto; padding-block: 22px 72px; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); display: grid; gap: 18px; align-content: start; }
.mobtitle { display: none; font-weight: 600; font-size: 16px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap; color: var(--ink); text-decoration: none; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.go { background: var(--good); border-color: var(--good); color: #fff; }
.btn.stop { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger { color: var(--bad); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.quiet:hover { background: var(--hover); color: var(--ink); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.iconbtn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-sm); border: 0; background: transparent; color: var(--muted); cursor: pointer; flex: none; }
.iconbtn:hover { background: var(--hover); color: var(--ink); }
.iconbtn.on { color: var(--good); background: var(--good-soft); }
input[type=text], input[type=email], input[type=date], input[type=time], input[type=number], input[type=search], select, textarea { height: 36px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 0 10px; min-width: 0; }
textarea { height: auto; padding: 8px 10px; width: 100%; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
.seg { display: inline-flex; background: var(--sunk); border: 1px solid var(--line); border-radius: 8px; padding: 2px; gap: 2px; }
.seg button { display: inline-flex; align-items: center; gap: 6px; height: 30px; border: 0; background: transparent; padding: 0 11px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.switch input { appearance: none; width: 32px; height: 18px; border-radius: 99px; background: var(--line-2); position: relative; cursor: pointer; transition: background .15s; margin: 0; flex: none; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { left: 16px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.hint { font-size: 12px; color: var(--muted); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-width: 0; }
.spacer { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; padding: 1px 8px; border-radius: 99px; background: var(--sunk); color: var(--ink-2); white-space: nowrap; line-height: 20px; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.acc { background: var(--accent-soft); color: var(--accent); }
.pill svg.lucide { width: 12px; height: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.kbd { font: 500 11px var(--font-num); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--ink-2); background: var(--surface); }

/* ---------- timer bar ---------- */
.timer { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.timer .desc { flex: 1; min-width: 120px; height: 40px; border: 1px solid transparent; background: transparent; font-size: 15px; padding: 0 10px; }
.timer .desc:hover { border-color: var(--line); }
.timer .desc:focus { border-color: var(--line-2); background: var(--surface); }
.pickbtn { display: inline-flex; align-items: center; gap: 7px; height: 34px; border: 1px solid transparent; background: transparent; border-radius: var(--r-sm); padding: 0 10px; cursor: pointer; max-width: 280px; font-size: 13px; color: var(--accent); font-weight: 500; }
.pickbtn:hover { background: var(--hover); }
.pickbtn.set { color: var(--ink); }
.pickbtn .lbl2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pickbtn .cl { color: var(--muted); font-weight: 400; }
.pickbtn.boxed { border-color: var(--line-2); background: var(--surface); height: 36px; width: 100%; max-width: none; justify-content: flex-start; }
.clock { font: 600 20px var(--font-num); font-variant-numeric: tabular-nums; min-width: 6.4ch; text-align: right; padding: 0 6px; color: var(--ink); }
.running .clock { color: var(--bad); }
.timer .vsep { width: 1px; height: 24px; background: var(--line); margin: 0 2px; }
.manual { display: flex; align-items: center; gap: 6px; }
.manual input[type=date] { width: 9.6em; } .manual input[type=time] { width: 7.4em; } .manual input.hrs { width: 5.2em; }
.gobtn { width: 40px; height: 40px; border-radius: 50%; padding: 0; }
.gobtn svg.lucide { width: 18px; height: 18px; }

/* ---------- page ---------- */
.pagehead { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.pagehead h1 { font-size: 22px; margin: 0; letter-spacing: -.015em; font-weight: 600; text-wrap: balance; }
.pagehead .sub { color: var(--muted); margin: 2px 0 0; font-size: 13px; }
.pagehead .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; }
.panel-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-h h2 { margin: 0; font-size: 14px; font-weight: 600; }
.panel-b { padding: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow); min-width: 0; text-decoration: none; color: inherit; display: block; }
a.stat:hover { border-color: var(--accent-line); }
.stat .k { font-size: 12px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat .k svg.lucide { width: 14px; height: 14px; }
.stat .v { font: 600 22px var(--font-num); font-variant-numeric: tabular-nums; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.02em; }
.stat .d { font-size: 12px; color: var(--muted); margin-top: 1px; }
.empty { color: var(--muted); padding: 40px 16px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.empty svg.lucide { width: 28px; height: 28px; color: var(--line-2); }
.empty b { color: var(--ink); font-size: 15px; }

/* ---------- ledger ---------- */
.daygrp + .daygrp { margin-top: 14px; }
.dayhead { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.dayhead .num { color: var(--ink); font-weight: 600; }
.entries { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.entry { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto auto; gap: 14px; align-items: center; padding: 9px 10px 9px 16px; min-height: 56px; }
.entry + .entry { border-top: 1px solid var(--line); }
.entry:hover { background: var(--hover); }
.entry .acts { display: flex; gap: 0; opacity: 0; transition: opacity .1s; }
.entry:hover .acts, .entry:focus-within .acts { opacity: 1; }
.edesc { min-width: 0; }
.edesc input { width: 100%; height: 28px; border: 1px solid transparent; background: transparent; padding: 0 6px; margin-left: -7px; font-weight: 500; font-size: 14px; text-overflow: ellipsis; border-radius: 4px; }
.edesc input:hover { border-color: var(--line-2); background: var(--surface); }
.edesc input::placeholder { color: var(--muted); font-weight: 400; font-style: italic; }
.meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-top: 1px; }
.pj { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.flags { display: flex; gap: 4px; align-items: center; color: var(--muted); }
.flags .bill { color: var(--good); }
.times { font: 13px var(--font-num); color: var(--ink-2); white-space: nowrap; border: 0; background: none; cursor: pointer; padding: 4px 6px; border-radius: 4px; }
.times:hover { background: var(--sunk); }
.times sup { color: var(--accent); font-size: 10px; margin-left: 2px; }
.dur { font: 600 15px var(--font-num); font-variant-numeric: tabular-nums; min-width: 5ch; text-align: right; }
.flagrow { grid-column: 1 / -1; margin-top: -2px; }

/* ---------- tables ---------- */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
th, td { text-align: left; padding: 0 12px; height: 44px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.compact th, .compact td { height: 34px; }
thead th { position: sticky; top: 0; background: var(--sunk); font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; z-index: 1; height: 38px; }
tbody tr:hover td { background: var(--hover); }
tbody tr.sel td { background: var(--accent-soft); }
td.n, th.n { text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.tot td { font-weight: 600; background: var(--sunk); }
tr:last-child td { border-bottom: 0; }
td .sub2 { font-size: 12px; color: var(--muted); }
.clickrow { cursor: pointer; }
.bulkbar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--ink); color: var(--bg); flex-wrap: wrap; }
.bulkbar .btn { background: transparent; color: var(--bg); border-color: rgba(255,255,255,.28); height: 30px; font-size: 13px; }
.bulkbar .btn:hover { background: rgba(255,255,255,.1); }
.bar { height: 6px; background: var(--sunk); border-radius: 3px; overflow: hidden; min-width: 60px; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

/* week grid */
.gridtbl td:first-child, .gridtbl th:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 200px; }
.gridtbl thead th:first-child { background: var(--sunk); z-index: 2; }
.gridtbl input.cell { width: 64px; height: 32px; text-align: right; font-family: var(--font-num); padding: 0 8px; border-color: var(--line); }
.gridtbl input.cell:not(:placeholder-shown) { font-weight: 600; }
.gridtbl input.cell.multi { border-style: dashed; }
.gridtbl td.we { background: var(--sunk); }
.gridtbl th.today { color: var(--accent); }

/* calendar */
.calwrap { height: min(68vh, 680px); overflow: auto; position: relative; }
.cal { display: grid; grid-template-columns: 56px repeat(var(--days), minmax(110px, 1fr)); }
.calhead { position: sticky; top: 0; background: var(--surface); z-index: 3; border-bottom: 1px solid var(--line); padding: 8px 4px; text-align: center; font-size: 12px; color: var(--muted); }
.calhead b { display: block; color: var(--ink); font: 600 13px var(--font-num); }
.calhead.today { color: var(--accent); }
.hours div { height: 48px; font: 11px var(--font-num); color: var(--muted); text-align: right; padding-right: 8px; transform: translateY(-7px); }
.calcol { position: relative; border-left: 1px solid var(--line); background-image: repeating-linear-gradient(to bottom, transparent 0 47px, var(--line) 47px 48px); touch-action: pan-y; cursor: crosshair; }
.calcol.today { background-color: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.blk { position: absolute; border-radius: 6px; padding: 4px 6px; font-size: 12px; line-height: 1.25; overflow: hidden; cursor: pointer; border: 0; text-align: left; color: var(--ink); border-left: 3px solid; box-shadow: var(--shadow); }
.blk b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk .rs { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.ghost { position: absolute; left: 4px; right: 4px; border-radius: 6px; background: var(--accent-soft); border: 1px dashed var(--accent); font: 600 12px var(--font-num); color: var(--accent); padding: 4px 6px; pointer-events: none; z-index: 2; }
.nowline { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 2; pointer-events: none; }
.nowline::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); }
.daychips { display: none; gap: 6px; overflow-x: auto; }
.daychips button { flex: 1; min-width: 44px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); padding: 6px 0; font-size: 12px; color: var(--muted); cursor: pointer; }
.daychips button b { display: block; font: 600 14px var(--font-num); color: var(--ink); }
.daychips button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }

/* filters */
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px dashed var(--line-2); border-radius: 99px; background: transparent; cursor: pointer; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.chip:hover { background: var(--hover); }
.chip.on { border-style: solid; border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.chip svg.lucide { width: 14px; height: 14px; }
.daterange { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); height: 36px; }
.daterange button { border: 0; background: transparent; height: 34px; padding: 0 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); }
.daterange button:hover { background: var(--hover); }
.daterange .mid { border-left: 1px solid var(--line); border-right: 1px solid var(--line); font-weight: 500; }

/* chart */
svg.chart { width: 100%; height: auto; display: block; }
svg.chart text { fill: var(--muted); font: 11px var(--font-num); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* popover / menu */
.pop { position: fixed; z-index: 70; background: var(--raised); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); width: min(340px, calc(100vw - 24px)); max-height: min(440px, calc(100vh - 24px)); display: flex; flex-direction: column; overflow: hidden; }
.pop.narrow { width: 220px; }
.pop .pop-search { padding: 10px; border-bottom: 1px solid var(--line); }
.pop .pop-search input { width: 100%; }
.pop .list { overflow-y: auto; padding: 6px; }
.pop .grp { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 10px 8px 4px; display: flex; justify-content: space-between; font-weight: 600; }
.pop .opt { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; border: 0; background: transparent; padding: 0 8px; min-height: 34px; border-radius: 6px; cursor: pointer; font-size: 14px; color: var(--ink); }
.pop .opt:hover, .pop .opt.hl { background: var(--hover); }
.pop .opt.danger { color: var(--bad); }
.pop .opt .star { margin-left: auto; color: var(--muted); border: 0; background: none; cursor: pointer; padding: 4px; display: grid; }
.pop .opt .star.on { color: var(--warn); }
.pop .opt .star.on svg { fill: currentColor; }
.pop .foot { border-top: 1px solid var(--line); padding: 8px; display: grid; gap: 6px; }
.pop .presets { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 8px; }
.pop .presets button { border: 0; background: transparent; text-align: left; padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.pop .presets button:hover, .pop .presets button.on { background: var(--accent-soft); color: var(--accent); }

/* drawer / sheet */
.sheet-scrim { position: fixed; inset: 0; background: rgba(16, 8, 20, .42); z-index: 60; }
.sheet { position: fixed; z-index: 61; background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); padding-top: env(safe-area-inset-top, 0px); padding-right: env(safe-area-inset-right, 0px); animation: slidein .18s ease; }
@keyframes slidein { from { transform: translateX(24px); opacity: .4; } }
.sheet-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--line); }
.sheet-h h2 { margin: 0; font-size: 16px; font-weight: 600; }
.sheet-b { flex: 1; overflow-y: auto; padding: 18px 20px; display: grid; gap: 14px; align-content: start; }
.sheet-f { display: flex; gap: 8px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--surface); }
.grabber { display: none; }
.notice { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--ink-2); }
.notice svg.lucide { color: var(--accent); margin-top: 1px; width: 16px; height: 16px; }
.notice.warn { background: var(--warn-soft); } .notice.warn svg.lucide { color: var(--warn); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.three { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; }

/* invoice */
.invlayout { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 18px; align-items: start; }
.steps { display: grid; gap: 14px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.step-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 600; }
.step-n { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 600 12px var(--font-num); }
.step-b { padding: 14px 16px; display: grid; gap: 12px; }
.pickgrp { border: 1px solid var(--line); border-radius: var(--r-sm); }
.pickgrp summary { display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; font-size: 13px; font-weight: 500; list-style: none; }
.pickgrp summary::-webkit-details-marker { display: none; }
.pickgrp .lines { max-height: 220px; overflow-y: auto; border-top: 1px solid var(--line); }
.pickgrp label { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 5px 10px; font-size: 12px; color: var(--ink-2); }
.pickgrp label span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-wrap { position: sticky; top: calc(var(--top) + 16px); }
.invdoc { background: #fff; color: #1d1a1f; border: 1px solid var(--line); border-radius: 4px; padding: 40px 44px; box-shadow: var(--shadow-lg); font-size: 13px; line-height: 1.5; }
.invdoc .muted { color: #6f6874; }
.invdoc h3 { margin: 0; font-size: 26px; letter-spacing: .08em; font-weight: 600; color: #1d1a1f; }
.invdoc table th { position: static; background: none; color: #6f6874; border-bottom: 1.5px solid #1d1a1f; height: 34px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 0 8px; }
.invdoc table td { color: #1d1a1f; border-bottom: 1px solid #e8e4ea; height: auto; padding: 8px; background: none !important; }
.invdoc .totals { margin-left: auto; width: min(280px, 100%); margin-top: 14px; display: grid; gap: 4px; }
.invdoc .totals div { display: flex; justify-content: space-between; }
.invdoc .totals .due { border-top: 1.5px solid #1d1a1f; padding-top: 8px; margin-top: 4px; font-weight: 700; font-size: 16px; }
.invhead { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.docmark { display: flex; gap: 10px; align-items: center; font-weight: 700; font-size: 16px; }
.invmeta { display: grid; grid-template-columns: auto auto; gap: 2px 14px; text-align: right; font-size: 12px; justify-content: end; }
.invmeta dt { color: #6f6874; } .invmeta dd { margin: 0; font-family: var(--font-num); }
.billto { margin: 26px 0 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.lbl3 { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: #6f6874; font-weight: 600; margin-bottom: 3px; }
.invpages { display: grid; gap: 18px; }
.invdoc { position: relative; padding: 44px 44px 60px; overflow-x: auto; }
.inv-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid #d9d4dc; flex-wrap: wrap; }
.invdoc .inv-top h3 { font-size: 28px; font-weight: 400; letter-spacing: 0; margin: 0 0 10px; }
.inv-dates { color: #6f6874; line-height: 1.9; }
.bizlogo img { max-height: 70px; max-width: 220px; display: block; }
.bizword { text-align: center; color: #111; line-height: 1; }
.bizword b { display: block; font: 800 40px/1 var(--font-ui); letter-spacing: -.01em; }
.bizword small { display: block; font-size: 12px; letter-spacing: .45em; margin-top: 4px; padding-left: .45em; }
.parties { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 22px 0 30px; }
.plbl { font-size: 11px; color: #6f6874; }
.plbl2 { text-transform: uppercase; font-size: 12px; color: #6f6874; margin-bottom: 8px; }
.pnm { font-size: 15px; margin: 10px 0 8px; color: #1d1a1f; }
.pad { font-size: 12px; white-space: pre-line; color: #3d3841; line-height: 1.75; }
.inv-memo { margin: 0 0 16px; color: #3d3841; }
.invdoc .inv-lines th { font-weight: 400; color: #6f6874; border-bottom: 1px solid #d9d4dc; }
.invdoc .inv-lines td { padding: 10px 8px; border-bottom: 1px solid #e3dfe6; color: #3d3841; }
.invdoc td.n, .invdoc th.n { font-family: var(--font-ui); }
.inv-note { font-size: 11px; color: #6f6874; margin-top: 2px; }
.invdoc .totals { width: min(340px, 100%); margin-top: 26px; gap: 10px; font-size: 13px; color: #6f6874; }
.invdoc .totals div span:first-child { text-transform: uppercase; text-align: right; flex: 1; padding-right: 28px; }
.invdoc .totals div span:last-child { min-width: 120px; text-align: right; font-variant-numeric: tabular-nums; }
.invdoc .totals .strong { color: #1d1a1f; font-weight: 600; }
.inv-notes { margin-top: 36px; }
.inv-pg { position: absolute; right: 44px; bottom: 20px; font-size: 11px; color: #1d1a1f; display: flex; gap: 28px; }
.inv-det tr.grp td { font-weight: 600; color: #1d1a1f; background: #f6f4f7 !important; }
.inv-det td.dt { font-size: 12px; white-space: nowrap; color: #6f6874; }
.logo-svg { display: block; flex: none; }
@media (max-width: 599px) { .parties { grid-template-columns: 1fr; } .invdoc { padding: 24px 18px 52px; } .inv-pg { right: 18px; } .bizword b { font-size: 30px; } }


/* sign in */
.signin { position: fixed; inset: 0; z-index: 90; background: var(--bg); display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-left, 0px)); overflow-y: auto; }
.signcard { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 32px 28px; box-shadow: var(--shadow-lg); display: grid; gap: 16px; }
.signcard h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
.signform { display: grid; gap: 16px; margin: 0; }
.signnote { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); font-size: 14px; }
.signnote.bad { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.otp { display: flex; gap: 8px; justify-content: space-between; }
.otp input { width: 46px; height: 52px; text-align: center; font: 600 22px var(--font-num); padding: 0; }

/* misc */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: var(--r); font-size: 14px; z-index: 95; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); }
.toast button { background: none; border: 0; color: #e3b8ec; font-weight: 600; cursor: pointer; }
.skel { background: linear-gradient(90deg, var(--sunk), var(--hover), var(--sunk)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--r); height: 56px; }
@keyframes sk { to { background-position: -200% 0; } }
.bottomnav, .minibar, .fab { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1199px) {
  .app { --sn: 56px; }
  .app .lbl, .app .sn-label, .app .badge, .app .who { display: none; }
  .app .sn-group + .sn-group { border-top: 1px solid var(--nav-line); padding-top: 12px; }
  .app .sn-top { justify-content: center; padding: 0; }
  .app .sn-item { justify-content: center; padding: 0; }
  .app .sn-item[data-tip]:hover::after { content: attr(data-tip); position: fixed; left: 62px; background: var(--ink); color: var(--bg); font-size: 12px; font-weight: 500; padding: 4px 8px; border-radius: 4px; white-space: nowrap; z-index: 80; pointer-events: none; }
  .app.overlay .sidenav { position: fixed; left: 0; width: 240px; box-shadow: var(--shadow-lg); }
  .app.overlay .lbl, .app.overlay .sn-label, .app.overlay .badge, .app.overlay .who { display: initial; }
  .app.overlay .sn-label { display: block; } .app.overlay .who { display: grid; }
  .app.overlay .sn-top { justify-content: space-between; padding: 0 2px 0 6px; }
  .app.overlay .sn-item { justify-content: flex-start; padding: 0 10px; }
  .app.overlay .sn-group + .sn-group { border-top: 0; padding-top: 0; }
  .app.overlay .sn-item[data-tip]:hover::after { content: none; }
  .invlayout { grid-template-columns: 1fr; }
  .preview-wrap { position: static; }
}
@media (max-width: 899px) {
  .timer .tagbtn-lbl, .pickbtn .cl { display: none; }
  .manual input[type=date] { width: 8.4em; } .manual input[type=time] { width: 6.6em; }
  .entry { grid-template-columns: minmax(0, 1fr) auto auto; }
  .entry .times { grid-column: 1; justify-self: start; padding-left: 0; }
  .entry .acts { opacity: 1; }
}
@media (max-width: 599px) {
  :root { --top: 52px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidenav { display: none; }
  .topbar-in { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .timer { display: none; }
  .mobtitle { display: block; }
  main { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-bottom: calc(var(--bnav) + 96px + env(safe-area-inset-bottom, 0px)); gap: 14px; }
  .pagehead h1 { font-size: 20px; }
  .pagehead .acts { margin-left: 0; width: 100%; }
  .bottomnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 36; background: var(--surface); border-top: 1px solid var(--line); padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); height: calc(var(--bnav) + env(safe-area-inset-bottom, 0px)); }
  .bottomnav a, .bottomnav button { display: grid; justify-items: center; align-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 500; border: 0; background: none; cursor: pointer; min-height: 44px; }
  .bottomnav [aria-current="page"] { color: var(--accent); }
  .bottomnav svg.lucide { width: 22px; height: 22px; }
  .minibar.on { display: flex; position: fixed; left: 8px; right: 8px; bottom: calc(var(--bnav) + 8px + env(safe-area-inset-bottom, 0px)); z-index: 37; background: var(--ink); color: var(--bg); border-radius: 12px; padding: 8px 8px 8px 14px; align-items: center; gap: 10px; box-shadow: var(--shadow-lg); cursor: pointer; }
  .minibar .mtxt { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
  .minibar .mtxt b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
  .minibar .mtxt span { font-size: 12px; opacity: .75; display: flex; gap: 6px; align-items: center; }
  .minibar .mclock { font: 600 17px var(--font-num); color: #ffb3a4; }
  .minibar .btn { width: 44px; height: 44px; border-radius: 50%; padding: 0; }
  .fab.on { display: grid; place-items: center; position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(var(--bnav) + 16px + env(safe-area-inset-bottom, 0px)); width: 56px; height: 56px; border-radius: 16px; background: var(--accent); color: var(--accent-ink); border: 0; box-shadow: var(--shadow-lg); z-index: 37; cursor: pointer; }
  .fab svg.lucide { width: 24px; height: 24px; }
  .sheet { top: auto; left: 0; right: 0; width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; padding: 0 env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px); animation: slideup .2s ease; }
  @keyframes slideup { from { transform: translateY(40px); opacity: .4; } }
  .grabber { display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 8px auto 0; }
  .sheet-h { padding: 8px 12px 12px 18px; }
  .pop { left: 8px !important; right: 8px; width: auto; top: auto !important; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); max-height: 70vh; }
  .two, .three { grid-template-columns: 1fr 1fr; }
  .three > :first-child { grid-column: 1 / -1; }
  .entry { padding: 10px 6px 10px 14px; }
  .entry .acts .iconbtn.ed { display: none; }
  .daychips { display: flex; }
  .calwrap { height: 64vh; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat .v { font-size: 19px; }
  .mcard tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .mcard thead { display: none; }
  .mcard td { height: auto; padding: 0; border: 0; }
  .mcard td.hide-m { display: none; }
  .mcard td.c-main { grid-column: 2; } .mcard td.c-num { grid-column: 3; grid-row: 1; }
  .mcard td.c-sub { grid-column: 2 / -1; }
  .invdoc { padding: 24px 18px; }
  .billto { grid-template-columns: 1fr; }
  .daterange .mid { max-width: 52vw; overflow: hidden; text-overflow: ellipsis; }
}

/* wordmark */
.wm { display: inline-block; font-family: var(--font-ui); font-weight: 700; letter-spacing: -.045em; line-height: 1; color: inherit; font-feature-settings: "ss01"; white-space: nowrap; }
.wm-i { position: relative; display: inline-block; }
.wm-dot { position: absolute; left: 50%; top: -.13em; width: .44em; height: .44em; transform: translateX(-50%); color: var(--accent); overflow: visible; }
.wm.on-dark .wm-dot { color: #d9a6e3; }
.logo .wm { font-size: 21px; }
/* bigger timer */
:root { --top: 92px; }
.timer { gap: 10px; }
.timer .desc { height: 56px; font-size: 21px; font-weight: 500; padding: 0 14px; border-radius: 10px; }
.timer .desc::placeholder { font-weight: 400; }
.timer .pickbtn { height: 46px; font-size: 16px; padding: 0 12px; max-width: 320px; }
.timer .pickbtn svg.lucide { width: 20px; height: 20px; }
.timer .iconbtn { width: 44px; height: 44px; }
.timer .iconbtn svg.lucide { width: 21px; height: 21px; }
.timer .seg button { height: 38px; padding: 0 12px; }
.timer .clock { font-size: 34px; letter-spacing: -.02em; font-weight: 600; min-width: 6.2ch; }
.timer .gobtn { width: 60px; height: 60px; }
.timer .gobtn svg.lucide { width: 26px; height: 26px; }
.timer .vsep { height: 32px; }
.timer .manual input { height: 44px; font-size: 15px; }
.timer #m-add { height: 44px; padding: 0 18px; font-size: 15px; }
@media (max-width: 1199px) { .timer .clock { font-size: 24px; } .timer .desc { font-size: 16px; } }
@media (max-width: 599px) { :root { --top: 52px; } }

/* week grid cells */
.gridtbl td.n { padding: 0 6px; }
.gridtbl input.cell { appearance: none; -webkit-appearance: none; width: 76px; height: 38px; border: 1px solid transparent; border-radius: 8px; background: var(--sunk); color: var(--ink); text-align: center; font: 600 15px var(--font-ui); font-variant-numeric: tabular-nums; padding: 0 8px; transition: background .12s, border-color .12s, box-shadow .12s; box-shadow: none; }
.gridtbl input.cell:placeholder-shown { background: transparent; border-color: var(--line); border-style: dashed; }
.gridtbl input.cell:not(:placeholder-shown) { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.gridtbl input.cell:hover { border-color: var(--line-2); border-style: solid; background: var(--surface); }
.gridtbl input.cell:focus { outline: none; background: var(--surface); color: var(--ink); border: 1px solid var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.gridtbl input.cell.multi:not(:placeholder-shown) { background: repeating-linear-gradient(135deg, var(--accent-soft) 0 6px, color-mix(in srgb, var(--accent-soft) 55%, var(--surface)) 6px 12px); border-style: solid; }
.gridtbl td.we { background: color-mix(in srgb, var(--sunk) 55%, transparent); }
.gridtbl tr.tot td { height: 48px; }

/* more color */
.stat .k { gap: 8px; font-size: 13px; color: var(--ink-2); }
.stat .k svg.lucide { width: 28px; height: 28px; padding: 6px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); stroke-width: 2.1; }
.stat .v { margin-top: 8px; }
.gridtbl tr[style] input.cell:not(:placeholder-shown) { background: color-mix(in srgb, var(--pc) 17%, var(--surface)); color: color-mix(in srgb, var(--pc) 78%, var(--ink)); }
.gridtbl tr[style] input.cell.multi:not(:placeholder-shown) { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--pc) 22%, var(--surface)) 0 6px, color-mix(in srgb, var(--pc) 9%, var(--surface)) 6px 12px); }
.gridtbl tr[style] td:first-child { box-shadow: inset 4px 0 0 var(--pc); }
.gridtbl tr.tot td { background: var(--accent-soft) !important; color: var(--accent); font-size: 15px; }
.gridtbl th.today { color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 70%, var(--sunk)); }

.sumline { display: inline-flex; align-items: center; height: 36px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); overflow: hidden; }
.sumline > * { display: inline-flex; align-items: baseline; gap: 6px; padding: 0 12px; height: 100%; align-items: center; color: inherit; text-decoration: none; white-space: nowrap; }
.sumline > * + * { border-left: 1px solid var(--line); }
.sumline small { font-size: 12px; color: var(--muted); }
.sumline b { font-weight: 600; font-variant-numeric: tabular-nums; }
.sumline em { font-style: normal; font-size: 12px; color: var(--muted); }
.sumline a:hover { background: var(--hover); } .sumline a b { color: var(--accent); }
@media (max-width: 899px) { .sumline { order: 5; width: 100%; } .sumline > * { flex: 1; justify-content: center; padding: 0 6px; } .sumline em { display: none; } }

.app.rail .sn-top { flex-direction: column; height: auto; gap: 10px; padding: 4px 0 0; }
@media (max-width: 1199px) { .app:not(.overlay) .sn-top { flex-direction: column; height: auto; gap: 10px; padding: 4px 0 0; } }

#logo-slot { display: grid; }
.logo .wm { font-size: 24px; }

/* phone: open timer card, tidy toolbar, sheet fit */
.mtimer { display: none; }
.sheet-b > *, .two > *, .three > * { min-width: 0; }
.sheet .field input, .sheet .field select, .sheet .field textarea { width: 100%; }
.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 599px) {
  .mtimer { display: grid; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 12px 10px 14px; box-shadow: var(--shadow); }
  .mtimer.running { border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); }
  .mt-top { display: flex; align-items: center; gap: 10px; }
  .mt-desc { flex: 1; min-width: 0; height: 48px !important; border: 0 !important; background: transparent !important; font-size: 18px; font-weight: 500; padding: 0 !important; }
  .mt-desc:focus { outline: none; }
  .mt-go { width: 56px; height: 56px; border-radius: 50%; padding: 0; flex: none; }
  .mt-go svg.lucide { width: 24px; height: 24px; }
  .mt-row { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--line); padding-top: 8px; min-width: 0; }
  .mt-row .pickbtn { padding: 0 8px; margin-left: -8px; min-width: 0; max-width: 55%; font-size: 14px; }
  .mt-row .iconbtn { width: 40px; height: 40px; }
  .mt-clock { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
  .mtimer.running .mt-clock { color: var(--bad); }
  .toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .toolbar > .seg { display: flex; } .toolbar > .seg button { flex: 1; justify-content: center; }
  .toolbar > .daterange { width: 100%; } .toolbar > .daterange .mid { flex: 1; justify-content: center; max-width: none; }
  .toolbar > .spacer, #f-person { display: none; }
  .sumline { width: 100%; height: auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sumline > * { flex-direction: column; gap: 1px; padding: 7px 4px; justify-content: center; align-items: center; height: auto; }
  .sumline small { font-size: 11px; } .sumline b { font-size: 14px; } .sumline em { display: none; }
  .sheet-h h2 { font-size: 18px; }
  .sheet-b { padding: 16px 18px; gap: 16px; }
  .sheet .field input, .sheet .field select, .sheet .pickbtn.boxed { height: 46px; font-size: 16px; border-radius: 10px; }
  .sheet-f .btn { height: 50px !important; border-radius: 12px; font-size: 16px; }
  .fab.on { border-radius: 50%; width: 52px; height: 52px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.skel-md { height: 220px; } .skel-lg { height: 320px; }

/* Print: only the invoice pages, one article.invdoc per page, no app chrome. */
@page { margin: 0.5in; }
@media print {
  html, body { background: #fff !important; color: #1d1a1f; }
  :root { color-scheme: light; }
  .skip, .sidenav, .scrim, .topbar, .bottomnav, .minibar, .fab, .toast, .pop, .sheet, .sheet-scrim, .no-print, .signin { display: none !important; }
  .app { display: block; min-height: 0; }
  main { max-width: none; padding: 0 !important; margin: 0; display: block; }
  main > :not(.invpages):not(.invlayout) { display: none !important; }
  .invlayout { display: block; } .preview-wrap { position: static; }
  .invpages { display: block; }
  .invdoc { box-shadow: none !important; border: 0 !important; border-radius: 0; padding: 0 0 40px; overflow: visible; break-after: page; page-break-after: always; }
  .invdoc:last-child { break-after: auto; page-break-after: auto; }
  .inv-pg { right: 0; bottom: 0; }
}
/* Phone top bar: show the brand. Each page already has its own heading, and the bottom bar shows where you are. */
.mobbrand { display: none; align-items: center; gap: 8px; }
@media (max-width: 599px) { .mobtitle.mobbrand { display: flex; } }
/* Sign-in card: logo, wordmark and heading are centered; form fields stay full width. */
.signbrand { justify-content: center; }
.signtitle { text-align: center; }
