/* Gydien Practice. Cool white page, deep teal-ink frame, one bold device: the money trail. */
:root {
  --bg: #f3f7f7;
  --surface: #ffffff;
  --ink: #18343b;
  --ink-2: #4f666c;
  --ink-3: #7c9095;
  --line: #dbe6e8;
  --line-2: #c5d6d9;
  --brand: #087f99;
  --brand-ink: #066276;
  --soft: #e8f7fa;
  --focus: #ffbf47;
  --frame: #133036;
  --ok: #2f8f5b;   --ok-soft: #e4f3ea;
  --warn: #a96d14; --warn-soft: #fbf0dc;
  --bad: #c2414b;  --bad-soft: #fbe8ea;
  --mute: #6b7c80; --mute-soft: #eceff0;
  --display: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r-sm: 6px; --r: 10px; --r-lg: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--body); font-variant-numeric: tabular-nums; font-feature-settings: 'cv11', 'ss01'; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.booting { padding: 40px; color: var(--ink-3); }
/* !important so a form rule like input[type=password] { width: 100% } can never re-size a hidden field and push the page sideways */
.sr { position: absolute !important; top: 0; left: 0; width: 1px !important; height: 1px !important; min-width: 0 !important; min-height: 0 !important; padding: 0 !important; margin: -1px !important; border: 0 !important; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: 30px; line-height: 1.15; }
h2 { font-size: 20px; line-height: 1.25; }
h3 { font-size: 17px; line-height: 1.3; }
p { margin: 0; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 14px; }
.num { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 700; }
.red { color: var(--bad); }

/* ---------- frame ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--frame); color: #dceef1; display: flex; flex-direction: column; padding: 22px 14px 18px; position: sticky; top: 0; height: 100vh; }
.mark { display: block; padding: 0 10px 20px; text-decoration: none; }
/* Her logo is lettering only (no tile), so it sits straight on the dark sidebar. */
.mark .logo { display: block; width: 132px; height: auto; }
.mark:focus-visible { outline: 2px solid #fff; outline-offset: 4px; border-radius: 6px; }
.signin .brandside .mark { padding: 0; }
.signin .brandside .mark .logo { width: 176px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; color: #c4dde2; text-decoration: none; font-size: 15px; }
.nav a svg { width: 19px; height: 19px; flex: none; opacity: .8; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a[aria-current="page"] { background: #fff; color: var(--ink); }
.nav a[aria-current="page"] svg { opacity: 1; color: var(--brand); }
.nav .count { margin-left: auto; font-size: 12px; font-weight: 700; background: var(--focus); color: var(--ink); border-radius: 999px; padding: 1px 8px; }
.side .log-btn { margin: 18px 4px 0; }
.side-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,.1); font-size: 14px; }
.side-foot button { background: none; border: 0; color: #94b7be; padding: 0; cursor: pointer; text-decoration: underline; }

.main { padding: 32px 40px 80px; max-width: 1240px; width: 100%; }
.topbar, .tabbar { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.banner { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; background: var(--warn-soft); color: #6e4708; border-radius: var(--r); padding: 10px 14px; margin-bottom: 20px; font-size: 15px; }
.banner a { color: inherit; font-weight: 600; white-space: nowrap; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 999px; padding: 9px 18px; font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; background: var(--brand); color: #fff; white-space: nowrap; }
.btn:hover { background: var(--brand-ink); }
.btn.big { padding: 13px 24px; font-size: 16px; }
.btn.bright { background: var(--focus); color: var(--ink); }
.btn.bright:hover { background: #ffb21f; }
.btn.quiet { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.btn.quiet:hover { border-color: var(--ink-3); background: var(--surface); }
.btn.ghost { background: none; color: var(--brand-ink); padding-left: 6px; padding-right: 6px; }
.btn.ghost:hover { background: var(--soft); }
.btn.danger { background: var(--surface); color: var(--bad); border-color: #eab9be; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.sm { padding: 5px 12px; font-size: 14px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.linkish { background: none; border: 0; padding: 0; color: var(--brand-ink); text-decoration: underline; cursor: pointer; font-weight: 700; }

/* ---------- surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 16px 20px 0; }
.panel-body { padding: 14px 20px 18px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.stack { display: grid; gap: 20px; }
.empty { padding: 28px 20px; color: var(--ink-2); text-align: center; }
.empty strong { display: block; color: var(--ink); font-family: var(--display); font-size: 18px; margin-bottom: 4px; }

/* the opening sentence on Today */
.hero { padding: 6px 0 28px; display: flex; gap: 28px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.hero .greet { color: var(--ink-2); margin-bottom: 10px; }
.hero h1 { font-size: clamp(28px, 3.6vw, 40px); line-height: 1.12; font-weight: 600; max-width: 22ch; letter-spacing: -0.03em; }
.hero .sub { margin-top: 10px; color: var(--ink-2); max-width: 56ch; }

.band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 24px; }
.band a { padding: 16px 20px; text-decoration: none; color: var(--ink); border-left: 1px solid var(--line); display: block; }
.band a:first-child { border-left: 0; }
.band a:hover { background: var(--soft); }
.band .v { font: 600 24px/1.2 var(--display); display: block; }
.band .k { font-size: 14px; color: var(--ink-2); }
.band .v.warn { color: var(--bad); }

/* ---------- lists & tables ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { border-top: 1px solid var(--line); }
.rows > li:first-child { border-top: 0; }
.row-btn { display: grid; width: 100%; text-align: left; background: none; border: 0; padding: 12px 0; cursor: pointer; gap: 2px 14px; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.row-btn:hover .who { text-decoration: underline; }
.who { font-weight: 700; }
.act-list li { padding: 9px 0; font-size: 14px; color: var(--ink-2); display: flex; gap: 12px; justify-content: space-between; }
.act-list time { color: var(--ink-3); white-space: nowrap; }

.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 15px; }
table.grid th { text-align: left; font-weight: 400; font-size: 13px; color: var(--ink-2); padding: 10px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap; background: var(--surface); }
table.grid td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid tbody tr[data-act] { cursor: pointer; }
table.grid tbody tr[data-act]:hover td { background: #f7fbfb; }
table.grid tbody tr[data-act]:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
table.grid tfoot td { font-weight: 700; border-bottom: 0; }
table.grid .num { text-align: right; }
.cell-sub { display: block; font-size: 13px; color: var(--ink-2); }
.cell-sub.red { color: var(--bad); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.filters label { display: grid; gap: 3px; font-size: 13px; color: var(--ink-2); }
.filters input, .filters select { min-width: 0; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 14px; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* ---------- pills, dots, the money trail ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.att-attended { background: var(--ok-soft); color: var(--ok); }
.att-late_cancel { background: var(--warn-soft); color: var(--warn); }
.att-no_show { background: var(--bad-soft); color: var(--bad); }
.att-cancelled { background: var(--mute-soft); color: var(--mute); }
.tdot { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.tdot::before { content: ''; width: 9px; height: 9px; border-radius: 3px; background: var(--c, var(--brand)); flex: none; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 4px; background: var(--warn-soft); color: #7a4f0d; margin-left: 6px; white-space: nowrap; }
.tag.info { background: var(--soft); color: var(--brand-ink); }

.trail { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.trail .dots { display: inline-flex; align-items: center; }
.trail .dots i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--line-2); background: var(--surface); }
.trail .dots b { width: 14px; height: 2px; background: var(--line-2); }
.trail .dots i.on { border-color: var(--brand); background: var(--brand); }
.trail .dots b.on { background: var(--brand); }
.trail .dots i.now { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px var(--soft); }
.trail.paid .dots i, .trail.paid .dots b { border-color: var(--ok); background: var(--ok); }
.trail.warn .dots i.now { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.trail.none .dots i, .trail.none .dots b { border-color: var(--line); background: var(--line); }
.trail .lbl { font-size: 13px; color: var(--ink-2); }
.trail.warn .lbl { color: var(--bad); font-weight: 700; }
.trail.paid .lbl { color: var(--ok); font-weight: 700; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field > span, .field > legend, .lab { font-weight: 700; font-size: 15px; }
.field .hint { font-size: 13px; color: var(--ink-2); font-weight: 400; }
fieldset.field { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
input[type=text], input[type=tel], input[type=email], input[type=date], input[type=time], input[type=number], input[type=search], input[type=password], select, textarea {
  width: 100%; border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; background: var(--surface); min-height: 44px;
}
textarea { min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: 3px solid var(--soft); outline-offset: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chips span { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 8px 16px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); cursor: pointer; font-size: 15px; }
.chips input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.chips input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.chips.att input:checked + span.attended { background: var(--ok); border-color: var(--ok); }
.chips.att input:checked + span.late_cancel { background: var(--warn); border-color: var(--warn); }
.chips.att input:checked + span.no_show { background: var(--bad); border-color: var(--bad); }
.chips.att input:checked + span.cancelled { background: var(--mute); border-color: var(--mute); }
.chips .tdot::before { background: var(--c); }
.chips input:checked + span.tdot::before { box-shadow: 0 0 0 2px #fff; }

.picker { position: relative; }
.picked { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--brand); background: var(--soft); border-radius: 8px; padding: 9px 12px; min-height: 44px; }
.results { list-style: none; margin: 6px 0 0; padding: 4px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); max-height: 280px; overflow-y: auto; }
.results button { width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 6px; cursor: pointer; }
.results button:hover, .results button:focus-visible { background: var(--soft); }
.results .add { color: var(--brand-ink); font-weight: 700; }
.mini { border: 1px dashed var(--line-2); border-radius: var(--r); padding: 14px; margin-top: 8px; background: #fbfdfd; }

.fee-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--soft); border-radius: var(--r); padding: 12px 16px; margin-bottom: 18px; }
.fee-line .amt { font: 600 22px/1 var(--display); }
.form-error { color: var(--bad); font-weight: 700; margin-bottom: 12px; }
.form-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* the therapist's log form is a single phone-width column */
.log-wrap { max-width: 620px; }
.log-wrap .panel { padding: 24px; }
.logging-as { display: flex; align-items: center; gap: 10px; background: var(--soft); border-radius: var(--r); padding: 10px 14px; margin-bottom: 20px; }
.done { text-align: left; padding: 8px 0; }
.done .tick { width: 52px; height: 52px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; margin-bottom: 14px; }
.done .tick svg { width: 28px; height: 28px; }
.done h2 { font-size: 26px; margin-bottom: 6px; }

/* ---------- to bill: one row per session, three ticks ---------- */
.bill-list ul { list-style: none; margin: 0; padding: 0; }
/* The four ticks always get their own line under the session; beside it they squeezed the patient details. */
.bill-item { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; gap: 8px 20px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); }
.bill-item:first-child { border-top: 0; }
.bi-main, .bi-meta { display: grid; gap: 2px; min-width: 0; }
.bi-main .who { justify-self: start; font-size: 16px; }
.bi-meta { color: var(--ink-2); }
.bi-meta .tag { margin-left: 2px; }
.bi-amt { font: 600 18px/1.2 var(--display); text-align: right; white-space: nowrap; }
.bi-ticks { grid-column: 1 / -1; justify-self: start; }
.bill-foot { margin: 0; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.ticks { display: flex; flex-wrap: wrap; gap: 6px; }
.ticks .tick { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px 6px 8px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); color: var(--ink-2); text-align: left; line-height: 1.2; }
button.tick { cursor: pointer; }
button.tick:hover { border-color: var(--brand); color: var(--ink); }
.ticks .tick svg { width: 20px; height: 20px; flex: none; padding: 2px; border-radius: 6px; border: 1.5px solid var(--line-2); stroke: transparent; }
.ticks .tick b { display: block; font-size: 14px; font-weight: 600; }
.ticks .tick small { display: block; font-size: 12px; color: var(--ink-3); }
.ticks .tick.on { border-color: var(--ok); background: var(--ok-soft); color: var(--ink); }
.ticks .tick.on svg { background: var(--ok); border-color: var(--ok); stroke: #fff; }
.ticks .tick.on small { color: var(--ok); }
.ticks .tick:disabled { opacity: .6; cursor: wait; }
.icd { font-weight: 600; color: var(--ink); letter-spacing: .02em; }
.icd-field input { text-transform: uppercase; max-width: 280px; }
.icd-field input::placeholder { text-transform: none; }

/* ---------- reports ---------- */
.stackbar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--line); margin: 4px 0 14px; }
.stackbar i { display: block; height: 100%; }
.stackbar .warn, .sw.warn { background: var(--warn); }
.stackbar .info, .sw.info { background: var(--brand); }
.stackbar .ok, .sw.ok { background: var(--ok); }
.money-rows .tm-row { border-top: 1px solid var(--line); }
.money-rows .tm-row a { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.money-rows .tm-row a:hover { color: var(--brand-ink); text-decoration: underline; }
.sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.money-rows .num { text-align: right; }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bar { height: 8px; border-radius: 4px; background: var(--line); min-width: 60px; position: relative; overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; background: var(--brand); border-radius: 4px; width: 0; }
.bar.ok i { background: var(--ok); }
.show-cell { display: flex; align-items: center; gap: 10px; }
.show-cell .bar { flex: 1; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 15px; margin: 0 0 16px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; }
.section { padding: 18px 0; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: 0; padding-top: 0; }
.section > h3 { margin-bottom: 10px; }

/* ---------- drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 30; display: flex; justify-content: flex-end; }
.drawer .scrim { position: absolute; inset: 0; background: rgba(19, 48, 54, .38); }
.drawer .sheet { position: relative; width: min(560px, 100%); height: 100%; background: var(--bg); overflow-y: auto; box-shadow: -12px 0 40px rgba(19, 48, 54, .18); display: flex; flex-direction: column; }
.drawer .sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 22px 24px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.drawer .sheet-head p { margin-top: 3px; }
.drawer .sheet-body { padding: 20px 24px 40px; }
.x { border: 0; background: none; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; flex: none; }
.x:hover { background: var(--soft); }
.x svg { width: 20px; height: 20px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 40; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--bad); }

/* ---------- sign in ---------- */
.signin { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 520px); }
.signin .brandside { background: var(--frame); color: #dceef1; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.signin .brandside h1 { font-size: clamp(36px, 5vw, 60px); color: #fff; max-width: 12ch; line-height: 1.02; letter-spacing: -0.03em; }
.signin .brandside p { max-width: 40ch; color: #9fc1c8; margin-top: 16px; }
.signin .trail-art { display: flex; align-items: center; gap: 0; margin-top: 36px; }
.signin .trail-art i { width: 18px; height: 18px; border-radius: 50%; background: #fff; }
.signin .trail-art i:last-of-type { background: var(--focus); }
.signin .trail-art b { width: 70px; height: 3px; background: rgba(255,255,255,.4); }
.signin .trail-art span { margin-left: 14px; color: #9fc1c8; font-size: 14px; }
.signin form { padding: 48px; display: flex; flex-direction: column; justify-content: center; max-width: 420px; width: 100%; margin: 0 auto; }
.signin form h2 { font-size: 26px; margin-bottom: 6px; }
.pin-dots { display: flex; gap: 12px; margin: 26px 0 8px; height: 18px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); }
.pin-dots i.on { background: var(--ink); border-color: var(--ink); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.keypad button { height: 62px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font: 600 24px var(--display); cursor: pointer; }
.keypad button:hover { border-color: var(--brand); }
.keypad button.fn { font: 700 15px var(--body); color: var(--ink-2); }
.pin-err { color: var(--bad); font-weight: 700; min-height: 24px; }

/* ---------- phones and small tablets ---------- */
@media (max-width: 1100px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .band a:nth-child(3) { border-left: 0; }
  .band a:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 820px) {
  .shell { display: block; }
  .side { display: none; }
  .main { padding: 18px 16px 110px; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; background: var(--frame); color: #fff; position: sticky; top: 0; z-index: 20; }
  .topbar .mark { padding: 0; }
  .topbar .mark .logo { width: auto; height: 52px; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 12px; color: var(--ink-2); text-decoration: none; padding: 4px 0; border-radius: 8px; position: relative; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--brand-ink); font-weight: 700; }
  .tabbar .count { position: absolute; top: 0; right: calc(50% - 22px); font-size: 10px; background: var(--focus); color: var(--ink); border-radius: 999px; padding: 0 5px; font-weight: 700; }
  h1 { font-size: 26px; }
  .hero { padding-bottom: 20px; }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .bill-item { grid-template-columns: minmax(0, 1fr) auto; padding: 14px 16px; }
  .bi-meta { grid-column: 1 / -1; grid-row: 2; }
  .bi-amt { grid-column: 2; grid-row: 1; align-self: start; }
  .bi-ticks { grid-column: 1 / -1; justify-self: stretch; }
  .bi-ticks .ticks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ticks .tick { padding: 6px 8px; }
  .bill-foot { padding: 12px 16px 16px; }
            .log-wrap .panel { padding: 18px 16px; border-radius: var(--r); }
  .log-submit { position: sticky; bottom: 76px; padding: 10px 0; background: linear-gradient(transparent, var(--surface) 30%); }
  .log-submit .btn { width: 100%; }
  .signin { grid-template-columns: minmax(0, 1fr); }
  .signin .brandside { padding: 28px 20px; }
  .signin .brandside .mark { margin-bottom: 28px; }
  .signin .brandside .mark .logo { width: 140px; }
  .signin .brandside .trail-art { display: none; }
  .signin form { padding: 28px 20px 40px; }
  table.grid.cards thead { display: none; }
  table.grid.cards, table.grid.cards tbody, table.grid.cards tr, table.grid.cards td { display: block; width: 100%; }
  table.grid.cards tr { border-bottom: 1px solid var(--line); padding: 10px 4px; }
  table.grid.cards td { border: 0; padding: 2px 8px; }
  table.grid.cards td.num { text-align: left; }
  table.grid.cards td[data-k]::before { content: attr(data-k) ': '; color: var(--ink-3); font-size: 13px; }
  table.grid.cards tfoot { display: block; }
  .drawer .sheet-head { padding: 16px; }
  .drawer .sheet-body { padding: 16px 16px 40px; }
}
@media (max-width: 480px) {
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .band { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .band a { padding: 12px 14px; }
  .band .v { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  .side, .topbar, .tabbar, .drawer, .toast { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
}

/* log form extras */
.date-quick { display: flex; gap: 6px; }
.field .policy:empty, .field .pay-hint:empty { display: none; }
.field .policy, .field .pay-hint { margin: 2px 0 0; }
.mini h3 { margin: 0 0 12px; font-size: 17px; }
.done-trail { margin: 14px 0 6px; }
.day-group { margin-bottom: 14px; }
.mine-right { text-align: right; line-height: 1.9; }

/* ---------- screens added with Today, Patients, To bill, Reports, Settings ---------- */
.tm-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; }
.tm-row .bar { flex: 1; max-width: 160px; }
label.check { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; cursor: pointer; }
label.check input { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; }
.summary-kv { margin-bottom: 20px; }
.edit-details { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 14px; }
.edit-details > summary { cursor: pointer; font-weight: 700; color: var(--brand-ink); list-style: none; }
.edit-details > summary::-webkit-details-marker { display: none; }
.edit-details > summary::before { content: '+ '; }
.edit-details[open] > summary::before { content: '− '; }
.edit-details[open] > summary { margin-bottom: 16px; }

.count-inline { display: inline-block; margin-left: 6px; font-size: 12px; font-weight: 700; background: var(--focus); color: var(--ink); border-radius: 999px; padding: 0 7px; }
.seg button[aria-pressed="true"] .count-inline { background: #fff; }
.grow { flex: 1; min-width: 0; }
.field.inline { display: inline-grid; grid-auto-flow: column; align-items: center; gap: 8px; margin: 0; }
.field.inline > span { font-weight: 400; font-size: 14px; color: var(--ink-2); }
.field.inline input { width: 160px; }

.rep-block { margin-bottom: 20px; }
.set-form { max-width: 820px; }
/* The price grid has a fixed-price column plus four bands, so it gets the full width. */
.set-form.prices-form { max-width: none; }
.set-form.panel-body { padding: 22px 24px; }
.set-h { margin: 8px 0 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.set-h:first-child { border-top: 0; padding-top: 0; }
.settings-tabs { margin-bottom: 4px; }
.price-grid td { padding: 6px 8px; }
.price-grid input[type=text] { width: 100%; min-width: 210px; }
.price-grid input.short { min-width: 0; width: 96px; text-align: right; }
.price-cell { display: grid; gap: 4px; justify-items: end; }
.price-grid input.short.code { width: 96px; font-size: 12px; padding-top: 4px; padding-bottom: 4px; text-align: left; color: var(--ink-3); }
.price-grid input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); }
.price-grid tr[data-type=new] td { background: var(--soft); }
.team-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; flex-wrap: wrap; }
.team-row input[type=text] { flex: 1; min-width: 140px; }
.team-row input[type=color] { width: 40px; height: 36px; padding: 2px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); cursor: pointer; }
.team-row.add { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 14px; }

@media (max-width: 820px) {
  .rep-block table.grid.cards tfoot { display: none; }
  .field.inline { display: grid; grid-auto-flow: row; }
  .field.inline input { width: 100%; }
  .tm-row { flex-wrap: wrap; }
}
