:root {
  --page: #f3f7fa;
  --surface: #ffffff;
  --ink: #102536;
  --muted: #465a6b;
  --faint: #6f8191;
  --line: #d6e0e8;
  --line-soft: #e8eef3;

  --blue: #3ea8ff;
  --blue-ink: #0a63b0;
  --blue-wash: #e7f3ff;
  --green: #00bf63;
  --green-ink: #00703f;
  --green-btn: #007d48;
  --green-btn-hover: #006a3d;
  --green-wash: #e3f7ec;
  --danger: #b8322b;
  --amber: #f0a020;
  --amber-wash: #fff2d9;
  --amber-ink: #7a4b00;

  /* work types */
  --c-patient: #3ea8ff;
  --c-leads: #00bf63;
  --c-meetings: #24407a;
  --c-training: #8a5cd6;
  --c-other: #9aa9b7;

  /* billing */
  --client: #0a63b0;
  --client-wash: #e7f3ff;
  --internal: #7a4b00;
  --internal-wash: #fff2d9;

  --slab: "Roboto Slab", Georgia, serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius-lg: 18px;
  --radius: 12px;
  --shadow-pop: 0 18px 50px rgba(16, 37, 54, 0.2);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 17px/1.55 var(--sans);
  font-variant-numeric: tabular-nums;
}
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border-radius: var(--radius); border: 1.5px solid transparent;
  font-weight: 600; font-size: 17px; white-space: nowrap; background: transparent;
}
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--green-btn); color: #fff; }
.btn-primary:hover { background: var(--green-btn-hover); }
.btn-primary:disabled { opacity: .6; cursor: progress; }
.btn-outline { border-color: var(--line); background: var(--surface); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue-ink); }
.btn-quiet { color: var(--blue-ink); }
.btn-quiet:hover { background: var(--blue-wash); }
.btn-danger-quiet { color: var(--danger); padding-left: 4px; padding-right: 4px; }
.btn-danger-quiet:hover { text-decoration: underline; }
.btn-link { border: 0; background: none; color: var(--muted); padding: 6px 2px; font-size: 16px; font-weight: 500; white-space: nowrap; }
.btn-link:hover { color: var(--ink); text-decoration: underline; }
.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center; flex: none;
  border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface);
}
.icon-btn:hover { border-color: var(--blue); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:disabled { opacity: .35; cursor: default; }

/* ---------- forms ---------- */
label { display: grid; gap: 6px; font-weight: 600; font-size: 16px; align-content: start; }
input, select, textarea {
  width: 100%; min-height: 50px; padding: 10px 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--surface); font-size: 17px; font-weight: 400;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: 3px solid rgba(62,168,255,.25); outline-offset: 0; }
input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--green-btn); margin: 0; flex: none; }
.check { display: flex; align-items: flex-start; gap: 12px; font-weight: 500; }
.check small { display: block; color: var(--muted); font-weight: 400; font-size: 15px; }
.opt { color: var(--faint); font-weight: 400; }
.hint { font-size: 15px; color: var(--muted); font-weight: 400; }
.form-error { color: var(--danger); font-weight: 600; }
.form-error:empty { display: none; }
.note { background: var(--blue-wash); border-radius: var(--radius); padding: 14px 16px; font-size: 16px; }
.note.warn { background: var(--amber-wash); color: var(--amber-ink); }

/* ---------- sign in ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  width: min(440px, 100%); background: var(--surface); padding: 40px 32px 32px;
  border-radius: var(--radius-lg); border: 1px solid var(--line); display: grid; gap: 16px;
}
.login-logo { width: 220px; height: auto; }
.login h1 { font-family: var(--slab); font-weight: 600; font-size: 34px; }
.login .lead { color: var(--muted); font-size: 18px; margin-top: -6px; }
.gsi-btn { min-height: 44px; }
.dev-login { display: grid; gap: 10px; padding-top: 6px; border-top: 1px dashed var(--line); }

/* ---------- header ---------- */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-inner { max-width: 1200px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { width: 140px; height: auto; display: block; }
.brand-product { font-family: var(--slab); font-weight: 600; font-size: 21px; color: var(--muted); padding-left: 12px; border-left: 1.5px solid var(--line); line-height: 1; }
.tabs { display: flex; gap: 4px; }
.tabs button { border: 0; background: none; padding: 10px 14px; border-radius: 10px; font-weight: 600; font-size: 17px; color: var(--muted); }
.tabs button:hover { color: var(--ink); background: var(--page); }
.tabs button[aria-current="page"] { color: var(--ink); background: var(--blue-wash); }
.clocks { margin-left: auto; display: flex; gap: 20px; }
.clock { display: grid; line-height: 1.2; text-align: right; white-space: nowrap; }
.clock-zone { font-size: 14px; color: var(--muted); }
.clock-time { font-family: var(--slab); font-weight: 600; font-size: 19px; }
.who { display: flex; align-items: center; gap: 12px; padding-left: 20px; border-left: 1.5px solid var(--line); }
.who-name { font-weight: 600; font-size: 15px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.subbar { border-top: 1px solid var(--line-soft); background: var(--surface); }
.subbar-inner { max-width: 1200px; margin: 0 auto; padding: 8px 24px; display: flex; align-items: center; gap: 12px; }
.subbar label { font-size: 16px; color: var(--muted); }
.subbar select { width: auto; min-width: 240px; min-height: 42px; padding: 6px 12px; font-weight: 600; }

/* ---------- layout ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 28px 24px 72px; }
.view { display: grid; gap: 24px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px 24px 24px; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.panel-head h3 { font-size: 20px; font-weight: 700; }
.lower { display: grid; grid-template-columns: minmax(300px, 1fr) 1.9fr; gap: 24px; align-items: start; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.page-head h2 { font-family: var(--slab); font-weight: 600; font-size: 30px; }
.page-head p { color: var(--muted); margin-top: 4px; }

/* ---------- hero ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
}
.capture { padding: 28px; display: grid; gap: 16px; align-content: start; border-right: 1px solid var(--line); }
.summary { padding: 28px; display: grid; gap: 16px; align-content: start; }
.capture h2 { font-size: 22px; font-weight: 700; }
.capture p { color: var(--muted); }
.capture-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn-timer { min-height: 58px; padding: 0 26px; font-size: 19px; border-radius: 14px; }
.btn-timer .dot { width: 12px; height: 12px; border-radius: 50%; background: #fff; }
.started-ago { display: flex; align-items: center; gap: 8px; font-size: 16px; color: var(--muted); font-weight: 500; }
.started-ago select { width: auto; min-height: 44px; padding: 6px 10px; font-size: 16px; }

.running { background: var(--green-wash); }
.run-head { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--green-ink); }
.pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--green); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(0,191,99,.55); } 70% { box-shadow: 0 0 0 11px rgba(0,191,99,0); } 100% { box-shadow: 0 0 0 0 rgba(0,191,99,0); } }
.elapsed { font-family: var(--slab); font-weight: 600; font-size: clamp(46px, 6vw, 64px); line-height: 1; }
.run-meta { color: var(--muted); font-size: 16px; }
.run-fields { display: grid; gap: 10px; }
.run-fields select, .run-fields input { background: #fff; }
.mini-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.mini-seg button { min-height: 46px; border: 1.5px solid var(--line); background: #fff; font-weight: 600; font-size: 16px; padding: 4px 10px; }
.mini-seg button:first-child { border-radius: 12px 0 0 12px; }
.mini-seg button:last-child { border-radius: 0 12px 12px 0; border-left: 0; }
.mini-seg button[aria-pressed="true"].is-client { background: var(--client); border-color: var(--client); color: #fff; }
.mini-seg button[aria-pressed="true"].is-internal { background: var(--amber-ink); border-color: var(--amber-ink); color: #fff; }
.warn-line { background: var(--amber-wash); color: var(--amber-ink); padding: 10px 14px; border-radius: 10px; font-size: 16px; font-weight: 500; }

.total-label { color: var(--muted); font-weight: 600; font-size: 18px; }
.total-big { font-family: var(--slab); font-weight: 600; font-size: clamp(54px, 7vw, 76px); line-height: 1; letter-spacing: -0.02em; }
.total-big small { font-size: .42em; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 2px; }
.total-dec { color: var(--muted); margin-top: -6px; font-size: 17px; }
.progress { height: 12px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--green)); border-radius: inherit; transition: width .5s ease; }
.progress-text { font-size: 16px; color: var(--muted); margin-top: -6px; }
.billsplit { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.billtile { border-radius: 14px; padding: 14px 16px; display: grid; gap: 2px; }
.billtile .bt-label { font-weight: 700; font-size: 16px; }
.billtile .bt-val { font-family: var(--slab); font-weight: 600; font-size: 30px; line-height: 1.15; }
.billtile .bt-sub { font-size: 15px; }
.billtile.client { background: var(--client-wash); color: var(--client); }
.billtile.internal { background: var(--internal-wash); color: var(--internal); }
.stats { display: flex; flex-wrap: wrap; gap: 0; border-top: 1px solid var(--line-soft); padding-top: 14px; }
.stat { padding-right: 22px; margin-right: 22px; border-right: 1px solid var(--line-soft); display: grid; }
.stat:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.stat-val { font-family: var(--slab); font-weight: 600; font-size: 23px; }
.stat-key { font-size: 15px; color: var(--muted); }

/* ---------- private money band (admin only) ---------- */
.hero.solo { grid-template-columns: 1fr; }
.money { background: var(--ink); color: #fff; border-radius: 16px; padding: 16px 18px 18px; display: grid; gap: 12px; }
.money-head { display: flex; align-items: center; gap: 8px; font-size: 15px; color: #b9c8d4; font-weight: 500; }
.lock { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.lock.inline { width: 17px; height: 17px; vertical-align: -3px; margin-right: 2px; }
.money-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.money-grid > div { display: grid; gap: 2px; align-content: start; }
.m-label { font-size: 15px; font-weight: 600; color: #d6e2ea; }
.m-val { font-family: var(--slab); font-weight: 600; font-size: 26px; line-height: 1.2; }
.m-sub { font-size: 14px; color: #a8bac7; }
.m-profit .m-val { color: #3ee08f; }
.money-lg { padding: 22px 24px 24px; gap: 16px; }
.money-lg .m-val { font-size: 40px; }
.money-lg .m-label { font-size: 17px; }
.money-lg .m-sub { font-size: 15px; }
td.profit-cell { color: var(--green-ink); }

/* ---------- week bar ---------- */
.weekbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.weeknav { display: flex; align-items: center; gap: 12px; }
.week-label { font-family: var(--slab); font-weight: 600; font-size: 26px; min-width: 240px; text-align: center; }
.weekstatus { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: 16px; font-weight: 600; }
.pill::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.pill-open { background: var(--line-soft); color: var(--muted); }
.pill-submitted { background: var(--amber-wash); color: var(--amber-ink); }
.pill-approved { background: var(--green-wash); color: var(--green-ink); }
.pill-void { background: var(--line-soft); color: var(--faint); }
.pill-paid { background: var(--green-wash); color: var(--green-ink); }
.pill-issued { background: var(--blue-wash); color: var(--blue-ink); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; padding: 3px 12px; border-radius: 999px; white-space: nowrap; }
.badge-client { background: var(--client-wash); color: var(--client); }
.badge-internal { background: var(--internal-wash); color: var(--internal); }
.chip { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; }
.sw { width: 13px; height: 13px; border-radius: 4px; display: inline-block; flex: none; }
.sw-round { border-radius: 50%; }
.sw-hatch { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.7) 0 3px, transparent 3px 7px); }
.tag { font-size: 14px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px; white-space: nowrap; }

/* ---------- timeline ---------- */
.legend { margin: -6px 0 16px; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 15px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.sw-band { background: repeating-linear-gradient(135deg, rgba(62,168,255,.22) 0 4px, rgba(62,168,255,.07) 4px 8px); border: 1px solid rgba(62,168,255,.4); }
.timeline { --label-w: 90px; --total-w: 84px; display: grid; gap: 4px; }
.tl-axis, .tl-row { display: grid; grid-template-columns: var(--label-w) 1fr var(--total-w); align-items: center; gap: 12px; }
.tl-axis { font-size: 14px; color: var(--muted); }
.tl-axis .zone { font-weight: 700; color: var(--ink); font-size: 14px; }
.tl-axis.secondary .zone { color: var(--muted); font-weight: 600; }
.tl-ticks { position: relative; height: 22px; }
.tl-ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.tl-ticks span:first-child { transform: none; }
.tl-ticks span:last-child { transform: translateX(-100%); }
.tl-day { font-weight: 700; font-size: 16px; line-height: 1.15; }
.tl-day small { display: block; font-weight: 400; color: var(--muted); font-size: 14px; }
.tl-row.today .tl-day { color: var(--blue-ink); }
.tl-track {
  position: relative; height: 42px; border-radius: 10px; background-color: var(--page);
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px);
  background-size: calc(100% / 8) 100%;
}
.tl-row.today .tl-track { background-color: var(--blue-wash); }
.tl-band { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, rgba(62,168,255,.18) 0 4px, rgba(62,168,255,.05) 4px 8px); }
.tl-block {
  position: absolute; top: 6px; bottom: 6px; min-width: 5px; border: 0; padding: 0;
  border-radius: 5px; background-color: var(--c); box-shadow: 0 0 0 1.5px #fff;
}
.tl-block.internal { background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.7) 0 3px, transparent 3px 7px); }
.tl-block:hover { filter: brightness(1.08); transform: scaleY(1.1); }
.tl-now { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--danger); border-radius: 2px; }
.tl-now::before { content: ""; position: absolute; top: -4px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); }
.tl-total { text-align: right; font-family: var(--slab); font-weight: 600; font-size: 18px; }
.tl-total.zero { color: var(--faint); font-family: var(--sans); font-weight: 400; }

/* ---------- category split ---------- */
.split-group + .split-group { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.split-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 10px 0; }
.split-name { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.split-val { font-family: var(--slab); font-weight: 600; font-size: 18px; }
.split-val small { font-family: var(--sans); font-weight: 500; color: var(--muted); margin-left: 8px; font-size: 15px; }
.split-bar { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.split-bar span { display: block; height: 100%; background: var(--c); border-radius: inherit; }
.split-row.zero { color: var(--faint); }
.billbar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--line-soft); margin: 4px 0 12px; }
.billbar .c { background: var(--client); }
.billbar .i { background: var(--amber); background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.55) 0 3px, transparent 3px 7px); }

/* ---------- entries ---------- */
.day-group + .day-group { margin-top: 22px; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.day-head h4 { font-size: 18px; }
.day-head span { font-family: var(--slab); font-weight: 600; font-size: 18px; }
.entry { display: grid; grid-template-columns: 170px 1fr auto auto; gap: 16px; align-items: start; padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.entry-time { font-weight: 700; font-size: 17px; }
.entry-time small { display: block; color: var(--muted); font-weight: 400; font-size: 15px; margin-top: 2px; }
.entry-what { min-width: 0; display: grid; gap: 6px; }
.entry-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.entry-notes { overflow-wrap: anywhere; }
.entry-dur { font-family: var(--slab); font-weight: 600; font-size: 19px; text-align: right; min-width: 72px; }
.entry-actions { display: flex; gap: 4px; margin-top: -6px; }
.entry-actions .icon-btn { border-color: transparent; background: none; color: var(--muted); }
.entry-actions .icon-btn:hover { border-color: var(--line); color: var(--ink); }
.empty { text-align: center; padding: 32px 12px; color: var(--muted); }
.empty strong { display: block; color: var(--ink); font-size: 19px; margin-bottom: 6px; }

/* ---------- reports / invoices / settings ---------- */
.range-controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.range-controls label { font-size: 15px; }
.range-controls input, .range-controls select { min-height: 48px; height: 48px; padding-top: 6px; padding-bottom: 6px; }
.report-totals { display: flex; flex-wrap: wrap; gap: 16px 0; }
.report-totals .stat { padding: 4px 30px 4px 0; margin-right: 30px; }
.report-totals .stat-val { font-size: 32px; }
.report-totals .stat.client .stat-val { color: var(--client); }
.report-totals .stat.internal .stat-val { color: var(--internal); }
.report-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 24px; align-items: start; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 17px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th { font-size: 15px; color: var(--muted); font-weight: 600; border-bottom: 1.5px solid var(--line); }
td.num, th.num { text-align: right; white-space: nowrap; }
td.num { font-family: var(--slab); font-weight: 600; }
td.actions { white-space: nowrap; text-align: right; }
.week-link { border: 0; background: none; padding: 0; color: var(--blue-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-align: left; }

.inv-preview { display: grid; gap: 18px; }
.inv-amount { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
.inv-amount .big { font-family: var(--slab); font-weight: 600; font-size: 56px; line-height: 1; color: var(--green-ink); }
.inv-amount .sub { font-size: 18px; color: var(--muted); }
.inv-lines { display: grid; gap: 0; }
.inv-lines div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.inv-lines b { font-family: var(--slab); font-weight: 600; }
.inv-notes { display: grid; gap: 8px; }
.inv-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.inv-cta .btn-primary { min-height: 56px; font-size: 18px; padding: 0 26px; }

.settings-grid { display: grid; gap: 24px; max-width: 820px; }
.settings-form { display: grid; gap: 18px; }
.settings-form .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.people { display: grid; gap: 0; }
.person { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.person:first-child { padding-top: 0; }
.person-name { font-weight: 700; font-size: 18px; }
.person-meta { color: var(--muted); font-size: 15px; }
.setup { max-width: 640px; }

/* ---------- dialogs ---------- */
dialog { width: min(640px, calc(100vw - 24px)); padding: 0; border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); color: var(--ink); }
dialog::backdrop { background: rgba(16, 37, 54, .5); }
dialog[open] { animation: rise .18s ease-out; }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
dialog form { padding: 22px 24px 24px; display: grid; gap: 18px; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; }
.dlg-head h2 { font-family: var(--slab); font-weight: 600; font-size: 26px; }
.dlg-head .icon-btn { border-color: transparent; }
.billto { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.billto legend { font-weight: 700; font-size: 17px; margin-bottom: 8px; padding: 0; }
.billto .hint { grid-column: 1 / -1; }
.bill-card { display: block; cursor: pointer; }
.bill-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bill-card span { display: grid; gap: 2px; align-content: start; padding: 14px 16px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface); height: 100%; }
.bill-card strong { font-size: 17px; }
.bill-card small { font-size: 15px; color: var(--muted); font-weight: 500; }
.bill-client input:checked + span { border-color: var(--client); background: var(--client-wash); }
.bill-client input:checked + span strong { color: var(--client); }
.bill-internal input:checked + span { border-color: var(--amber-ink); background: var(--internal-wash); }
.bill-internal input:checked + span strong { color: var(--internal); }
.bill-card input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.billto.needs span { border-color: var(--amber); }
.seg { border: 0; padding: 0; margin: 0; display: flex; gap: 0; flex-wrap: wrap; align-items: center; }
.seg legend { float: left; font-weight: 600; font-size: 16px; margin-right: 14px; padding: 0; }
.seg label { display: block; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: block; padding: 10px 16px; border: 1.5px solid var(--line); font-weight: 600; font-size: 16px; background: var(--surface); cursor: pointer; }
.seg label:first-of-type span { border-radius: 12px 0 0 12px; }
.seg label:last-of-type span { border-radius: 0 12px 12px 0; border-left: 0; }
.seg input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.seg input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 14px; background: var(--page); border-radius: var(--radius); }
.quick-label { font-size: 16px; font-weight: 600; margin-right: 4px; }
.quick button { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px; font-size: 16px; font-weight: 600; }
.quick button:hover { border-color: var(--green); color: var(--green-ink); }
.grid3 { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1.5fr; gap: 12px; }
.calc { margin-top: -6px; font-size: 16px; color: var(--muted); min-height: 24px; }
.calc strong { color: var(--ink); font-family: var(--slab); font-weight: 600; }
.dlg-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.profile-fields { display: grid; gap: 16px; }
.profile-fields h3 { font-size: 17px; margin-top: 6px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 17px;
  transition: opacity .2s, transform .2s; pointer-events: none; z-index: 50; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .clocks { display: none; }
}
@media (max-width: 1080px) {
  .lower, .report-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 17px; }
  .top-inner { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .brand img { width: 118px; }
  .brand-product { font-size: 18px; }
  .who { margin-left: auto; border-left: 0; padding-left: 0; }
  .who-name { display: none; }
  .tabs { order: 3; width: 100%; justify-content: space-between; }
  .tabs button { flex: 1; padding: 10px 6px; font-size: 16px; }
  .subbar-inner { padding: 8px 16px; }
  .subbar select { min-width: 0; flex: 1; }
  .wrap { padding: 18px 16px 56px; }
  .view { gap: 18px; }
  .hero { grid-template-columns: 1fr; }
  .capture { border-right: 0; border-bottom: 1px solid var(--line); padding: 20px; }
  .summary { padding: 20px; }
  .summary .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
  .summary .stat { border-right: 0; margin-right: 0; padding-right: 0; }
  .billtile .bt-val { font-size: 26px; }
  .week-label { font-size: 21px; min-width: 0; }
  .weekbar { flex-direction: column; align-items: stretch; }
  .weeknav { justify-content: space-between; }
  .panel { padding: 18px 16px; }
  .timeline { --label-w: 46px; --total-w: 58px; }
  .tl-axis, .tl-row { gap: 6px; }
  .tl-day small { display: none; }
  .tl-axis .zone { font-size: 12px; }
  .tl-ticks span:nth-child(even) { display: none; }
  .tl-total { font-size: 15px; }
  .entry { grid-template-columns: 1fr auto auto; gap: 6px 10px; }
  .entry-what { grid-column: 1 / -1; grid-row: 2; }
  .entry-dur { min-width: 0; }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .grid3 label:first-child { grid-column: 1 / -1; }
  .grid2, .settings-form .grid2 { grid-template-columns: 1fr; }
  .billto { grid-template-columns: 1fr 1fr; }
  .bill-card span { padding: 12px; }
  dialog { width: 100vw; max-width: 100vw; max-height: 94dvh; margin: auto 0 0; border-radius: 20px 20px 0 0; }
  dialog form { padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .dlg-actions .btn-primary { flex: 1; }
  .report-totals .stat { margin-right: 20px; padding-right: 20px; }
  .report-totals .stat-val { font-size: 26px; }
  .inv-amount .big { font-size: 44px; }
  .money-grid { grid-template-columns: 1fr; gap: 10px; }
  .money-lg .m-val { font-size: 32px; }
  .page-head h2 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- studies ---------- */
.study-tag { display: inline-flex; align-items: center; font-size: 15px; font-weight: 700; padding: 2px 10px; border-radius: 8px; background: #eef1fb; color: #24407a; border: 1px solid #cfd8f0; white-space: nowrap; }

/* ---------- work type colours ---------- */
.swatches { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.swatches legend { font-weight: 600; font-size: 16px; margin-bottom: 8px; padding: 0; }
.swatch { display: block; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatch span { display: block; width: 36px; height: 36px; border-radius: 10px; border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--line); }
.swatch input:checked + span { box-shadow: 0 0 0 3px var(--ink); }
.swatch input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 3px; }
