/* Till design system tokens */
:root,[data-theme="light"]{--surface:#f6f4ef;--surface-raised:#ffffff;--surface-sunken:#ece9e1;--line:#d9d4c8;--line-strong:#8c877c;--ink:#1b1f1b;--ink-muted:#565d56;--cedar:#1f5c45;--on-cedar:#ffffff;--cedar-soft:#dcebe3;--tide:#1d5f8a;--tide-soft:#dceaf4;--thin:#8a5a00;--thin-soft:#f8ecd2;--loss:#a8321e;--loss-soft:#f9e0da;--focus:var(--tide);--shadow-raised:0 1px 2px rgba(27,31,27,0.08), 0 2px 8px rgba(27,31,27,0.06);--shadow-sheet:0 -4px 24px rgba(27,31,27,0.16);}[data-theme="dark"]{--surface:#141714;--surface-raised:#1d211d;--surface-sunken:#0f120f;--line:#2f352f;--line-strong:#6b736b;--ink:#eef0ea;--ink-muted:#a3aba2;--cedar:#5fbf96;--on-cedar:#0c1a14;--cedar-soft:#1c3229;--tide:#7cb8e0;--tide-soft:#1a2c3a;--thin:#f0b44c;--thin-soft:#3a2d12;--loss:#ff8a73;--loss-soft:#3d1c16;--focus:var(--tide);--shadow-raised:0 1px 2px rgba(0,0,0,0.5);--shadow-sheet:0 -4px 24px rgba(0,0,0,0.6);}:root{--space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-6:24px;--space-8:32px;--space-12:48px;--radius-sm:6px;--radius-md:10px;--radius-lg:16px;--radius-pill:999px;--tap-min:48px;--tap-field:56px;--content-max:720px;--font-sans:"Atkinson Hyperlegible Next", "Segoe UI", system-ui, sans-serif;--font-figures:"Atkinson Hyperlegible Mono", ui-monospace, "SF Mono", Menlo, monospace;}
/* Till components */

/* Till — base */
body { margin: 0; font-family: var(--font-sans); font-size: 16px; line-height: 24px; background: var(--surface); color: var(--ink); -webkit-font-smoothing: antialiased; }
.tl-num { font-family: var(--font-figures); font-variant-numeric: tabular-nums; }
.tl-muted { color: var(--ink-muted); }
.tl-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; padding: var(--space-4); }
.tl-stack { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); }
.tl-label { font-size: 13px; line-height: 16px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--ink-muted); }
.tl-card { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-raised); padding: var(--space-4); }
:where(.tl-btn, .tl-input, .tl-chip, .tl-alert__action, .tl-capture__opt):focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Button */
.tl-btn { font: inherit; font-weight: 700; font-size: 16px; min-height: var(--tap-min); padding: 0 var(--space-4); border-radius: var(--radius-md); border: 1px solid var(--line-strong); background: var(--surface-raised); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); }
.tl-btn--primary { background: var(--cedar); border-color: var(--cedar); color: var(--on-cedar); }
.tl-btn--quiet { background: transparent; border-color: transparent; color: var(--tide); }
.tl-btn--field { min-height: var(--tap-field); padding: 0 var(--space-6); }
.tl-btn--block { width: 100%; }
.tl-btn[disabled] { background: var(--surface-sunken); border-color: var(--line); color: var(--ink-muted); cursor: not-allowed; }

/* MarginBadge */
.tl-badge { display: inline-flex; align-items: center; gap: var(--space-1); font-size: 13px; line-height: 16px; font-weight: 700; padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm); }
.tl-badge__glyph { font-size: 10px; line-height: 1; }
.tl-badge--gain { background: var(--cedar-soft); color: var(--cedar); }
.tl-badge--thin { background: var(--thin-soft); color: var(--thin); }
.tl-badge--loss { background: var(--loss-soft); color: var(--loss); }
.tl-badge--neutral { background: var(--surface-sunken); color: var(--ink-muted); }

/* SourceChip */
.tl-chip { display: inline-flex; align-items: center; gap: var(--space-1); font: inherit; font-size: 13px; line-height: 16px; padding: 2px var(--space-2); border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--surface-raised); color: var(--ink-muted); }
.tl-chip__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cedar); }
.tl-chip--stale .tl-chip__dot { background: var(--thin); }
.tl-chip--estimate { border-style: dashed; }
.tl-chip--estimate .tl-chip__dot { background: var(--ink-muted); }

/* KpiTile */
.tl-kpi { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-raised); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); min-width: 200px; flex: 1; }
.tl-kpi__value { font-family: var(--font-figures); font-variant-numeric: tabular-nums; font-size: 36px; line-height: 40px; font-weight: 600; }
.tl-kpi__value--loss { color: var(--loss); }
.tl-kpi__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.tl-kpi__plain { font-size: 14px; line-height: 20px; color: var(--ink-muted); margin: 0; }

/* JobCostRow */
.tl-job { display: grid; grid-template-columns: 1fr auto; gap: var(--space-2) var(--space-4); padding: var(--space-4); background: var(--surface-raised); border-bottom: 1px solid var(--line); }
.tl-job:first-child { border-top-left-radius: var(--radius-lg); border-top-right-radius: var(--radius-lg); }
.tl-job:last-child { border-bottom: 0; border-bottom-left-radius: var(--radius-lg); border-bottom-right-radius: var(--radius-lg); }
.tl-job__name { font-weight: 700; }
.tl-job__sub { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.tl-job__right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-1); }
.tl-job__money { font-family: var(--font-figures); font-variant-numeric: tabular-nums; }
.tl-job__money--loss { color: var(--loss); font-weight: 600; }
.tl-job__bar { grid-column: 1 / -1; height: 8px; border-radius: var(--radius-pill); background: var(--surface-sunken); position: relative; overflow: hidden; }
.tl-job__cost { position: absolute; inset: 0 auto 0 0; background: var(--line-strong); }
.tl-job__bar--loss .tl-job__cost { background: var(--loss); }
.tl-job__bar--thin .tl-job__cost { background: var(--thin); }
.tl-jobs { border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-raised); }

/* Alert */
.tl-alert { display: grid; grid-template-columns: auto 1fr; gap: var(--space-1) var(--space-3); padding: var(--space-4); border-radius: var(--radius-md); border: 1px solid transparent; }
.tl-alert__glyph { font-size: 14px; line-height: 24px; font-weight: 700; }
.tl-alert__title { font-weight: 700; }
.tl-alert__body { grid-column: 2; font-size: 14px; line-height: 20px; margin: 0; }
.tl-alert__actions { grid-column: 2; display: flex; gap: var(--space-2); margin-top: var(--space-2); flex-wrap: wrap; }
.tl-alert__action { font: inherit; font-weight: 700; font-size: 14px; min-height: var(--tap-min); padding: 0 var(--space-4); border-radius: var(--radius-md); border: 1px solid currentColor; background: var(--surface-raised); color: inherit; cursor: pointer; }
.tl-alert--info { background: var(--tide-soft); color: var(--tide); }
.tl-alert--thin { background: var(--thin-soft); color: var(--thin); }
.tl-alert--loss { background: var(--loss-soft); color: var(--loss); }
.tl-alert .tl-alert__body { color: var(--ink); }

/* ShiftBlock */
.tl-sched { display: grid; grid-template-columns: 72px repeat(5, 1fr); gap: var(--space-1); padding: var(--space-4); font-size: 14px; line-height: 20px; }
.tl-sched__head { font-size: 13px; font-weight: 700; color: var(--ink-muted); padding: 0 var(--space-1) var(--space-1); }
.tl-sched__who { font-weight: 700; align-self: center; }
.tl-sched__who small { display: block; font-family: var(--font-figures); font-weight: 400; color: var(--ink-muted); font-size: 13px; line-height: 16px; }
.tl-shift { background: var(--tide-soft); color: var(--tide); border-radius: var(--radius-md); padding: var(--space-2); min-height: var(--tap-min); box-sizing: border-box; font-family: var(--font-figures); font-size: 13px; line-height: 16px; font-weight: 600; display: flex; flex-direction: column; justify-content: center; }
.tl-shift span { font-family: var(--font-sans); font-weight: 400; color: var(--ink); }
.tl-shift--ot { background: var(--loss-soft); color: var(--loss); box-shadow: inset 0 0 0 1px var(--loss); }
.tl-shift--near { background: var(--thin-soft); color: var(--thin); }
.tl-shift--open { background: transparent; color: var(--ink-muted); box-shadow: inset 0 0 0 1px var(--line-strong); border: 0; }
.tl-shift--off { background: transparent; }

/* Field */
.tl-field { display: flex; flex-direction: column; gap: var(--space-1); }
.tl-input { font: inherit; font-size: 16px; min-height: var(--tap-field); padding: 0 var(--space-4); border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface-raised); color: var(--ink); box-sizing: border-box; width: 100%; }
.tl-input::placeholder { color: var(--ink-muted); }
.tl-field__help { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.tl-field--error .tl-input { border: 2px solid var(--loss); }
.tl-field--error .tl-field__help { color: var(--loss); }
.tl-field--prefilled .tl-input { background: var(--surface-sunken); }

/* QuickCapture */
.tl-capture { background: var(--surface-raised); border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: var(--shadow-sheet); padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-4); max-width: 420px; }
.tl-capture__grip { width: 40px; height: 4px; border-radius: var(--radius-pill); background: var(--line-strong); align-self: center; }
.tl-capture__opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); }
.tl-capture__opt { font: inherit; font-size: 14px; font-weight: 700; min-height: 72px; border-radius: var(--radius-md); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-1); cursor: pointer; }
.tl-capture__opt svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.tl-capture__opt[aria-pressed="true"] { background: var(--cedar-soft); border-color: var(--cedar); color: var(--cedar); }
.tl-capture__auto { font-size: 14px; line-height: 20px; color: var(--ink-muted); margin: 0; }

/* FollowUpTimeline */
.tl-timeline { list-style: none; margin: 0; padding: var(--space-4); display: flex; flex-direction: column; }
.tl-step { display: grid; grid-template-columns: 24px 1fr auto; gap: var(--space-3); padding-bottom: var(--space-4); position: relative; }
.tl-step::before { content: ""; position: absolute; left: 11px; top: 24px; bottom: 0; width: 2px; background: var(--line); }
.tl-step:last-child::before { display: none; }
.tl-step__dot { width: 24px; height: 24px; border-radius: 50%; box-sizing: border-box; display: grid; place-items: center; font-size: 12px; font-weight: 700; border: 2px solid var(--line-strong); background: var(--surface-raised); color: var(--ink-muted); }
.tl-step--done .tl-step__dot { background: var(--cedar); border-color: var(--cedar); color: var(--on-cedar); }
.tl-step--auto .tl-step__dot { border-color: var(--tide); color: var(--tide); background: var(--tide-soft); }
.tl-step--cold .tl-step__dot { border-color: var(--thin); color: var(--thin); background: var(--thin-soft); }
.tl-step__title { font-weight: 700; }
.tl-step__sub { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.tl-step__when { font-family: var(--font-figures); font-size: 13px; line-height: 24px; color: var(--ink-muted); white-space: nowrap; }

/* App */
/* ---------- Till app shell ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
body { min-height: 100vh; }
a { color: var(--tide); }
h1, h2, h3, p { margin: 0; }
button { font: inherit; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.app { display: flex; min-height: 100vh; }
.rail { display: none; }
.main { flex: 1; min-width: 0; padding-bottom: 96px; }
.top { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); }
.top__brand { font-weight: 700; font-size: 20px; letter-spacing: -.01em; display: flex; align-items: center; gap: var(--space-2); }
.mark { width: 28px; height: 28px; border-radius: var(--radius-sm); background: var(--cedar); display: grid; place-items: center; color: var(--on-cedar); font-weight: 700; font-size: 15px; }
.top__biz { color: var(--ink-muted); font-size: 14px; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.iconbtn { min-width: var(--tap-min); min-height: var(--tap-min); border: 0; background: transparent; color: var(--ink); border-radius: var(--radius-md); display: grid; place-items: center; cursor: pointer; }
.iconbtn:hover { background: var(--surface-sunken); }
.ic { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.view { max-width: 1080px; margin: 0 auto; padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-6); }
.view__head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
.view__title { font-size: 28px; line-height: 34px; font-weight: 700; }
.view__sub { color: var(--ink-muted); font-size: 14px; line-height: 20px; margin-top: var(--space-1); }
.section { display: flex; flex-direction: column; gap: var(--space-3); }
.section__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.section__title { font-size: 20px; line-height: 26px; font-weight: 700; }
.grid-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-3); }
.tl-kpi { min-width: 0; cursor: default; }
.tl-kpi[data-act] { cursor: pointer; }
.tl-kpi__value { font-size: 32px; line-height: 38px; }
.cols { display: grid; gap: var(--space-6); }

.banner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--tide-soft); color: var(--ink); font-size: 14px; line-height: 20px; }
.banner strong { color: var(--tide); }
.banner .tl-btn { min-height: 40px; font-size: 14px; }

/* lists */
.list { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-raised); overflow: hidden; }
.item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); min-height: 64px; }
.item:last-child { border-bottom: 0; }
.item--tap { cursor: pointer; }
.item--tap:hover { background: var(--surface); }
.item__main { flex: 1; min-width: 0; }
.item__title { font-weight: 700; overflow-wrap: anywhere; }
.item__sub { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.item__end { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-1); text-align: right; flex: none; }
.empty { padding: var(--space-6) var(--space-4); text-align: center; color: var(--ink-muted); font-size: 14px; line-height: 20px; }
.tl-jobs .tl-job { cursor: pointer; }
.tl-jobs .tl-job:hover { background: var(--surface); }
.money-loss { color: var(--loss); }

/* actions list (Today) */
.todo { display: flex; flex-direction: column; gap: var(--space-3); }
.tl-alert__actions a.tl-alert__action { display: inline-flex; align-items: center; text-decoration: none; }
.tl-alert--neutral { background: var(--surface-raised); border-color: var(--line); color: var(--ink); }
.done-all { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-md); background: var(--cedar-soft); color: var(--cedar); font-weight: 700; }

/* type summary */
.types { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-3); }
.type { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-3) var(--space-4); display: flex; flex-direction: column; gap: var(--space-1); }
.type__name { font-weight: 700; }

/* segmented */
.seg { display: inline-flex; background: var(--surface-sunken); border-radius: var(--radius-md); padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; color: var(--ink-muted); font-weight: 700; font-size: 14px; min-height: 40px; padding: 0 var(--space-3); border-radius: var(--radius-sm); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface-raised); color: var(--ink); box-shadow: var(--shadow-raised); }

/* schedule */
.weeknav { display: flex; align-items: center; gap: var(--space-2); }
.sched-wrap { overflow-x: auto; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-raised); }
.tl-sched { grid-template-columns: 96px repeat(7, minmax(92px, 1fr)); min-width: 780px; }
.tl-sched__head.is-today { color: var(--cedar); }
.cell { display: flex; flex-direction: column; gap: 4px; min-height: var(--tap-min); }
.tl-shift { cursor: pointer; border: 0; text-align: left; font: inherit; font-family: var(--font-figures); font-size: 13px; line-height: 16px; font-weight: 600; }
.tl-shift span { font-size: 13px; }
.addcell { flex: 1; min-height: var(--tap-min); border: 1px dashed var(--line); border-radius: var(--radius-md); background: transparent; color: var(--ink-muted); cursor: pointer; font-size: 20px; opacity: .6; }
.addcell:hover, .addcell:focus-visible { opacity: 1; border-color: var(--line-strong); }

/* timeline inside sheets */
.tl-timeline { padding: 0; }
.tl-step__acts { display: flex; gap: var(--space-2); margin-top: var(--space-2); flex-wrap: wrap; }
.tl-step__acts .tl-btn { min-height: 40px; font-size: 14px; }

/* chart */
.chart { position: relative; background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-raised); padding: var(--space-4); }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart__line { fill: none; stroke: var(--cedar); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart__zero { stroke: var(--ink-muted); stroke-dasharray: 4 4; stroke-width: 1; }
.chart__neg { fill: var(--loss-soft); }
.chart__grid { stroke: var(--line); stroke-width: 1; }
.chart__axis { fill: var(--ink-muted); font-size: 12px; font-family: var(--font-figures); }
.chart__dot { fill: var(--cedar); stroke: var(--surface-raised); stroke-width: 2; }
.chart__dot--low { fill: var(--loss); }
.chart__lbl { fill: var(--ink); font-size: 13px; font-weight: 700; }
.chart__x { stroke: var(--ink-muted); stroke-width: 1; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--surface); border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); font-size: 13px; line-height: 18px; max-width: 240px; box-shadow: var(--shadow-raised); z-index: 2; }
.tip b { font-family: var(--font-figures); }

/* category bars */
.bars { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); }
.bar { display: grid; grid-template-columns: 140px 1fr 88px; gap: var(--space-3); align-items: center; font-size: 14px; line-height: 20px; }
.bar__track { height: 12px; border-radius: 4px; background: var(--surface-sunken); overflow: hidden; }
.bar__fill { height: 100%; background: var(--tide); border-radius: 0 4px 4px 0; }
.bar__val { text-align: right; font-family: var(--font-figures); }

/* sheet */
.scrim { position: fixed; inset: 0; background: rgba(15,18,15,.45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; background: var(--surface-raised); border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: var(--shadow-sheet); padding: var(--space-4) var(--space-4) var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.sheet__title { font-size: 20px; line-height: 26px; font-weight: 700; }
.form { display: flex; flex-direction: column; gap: var(--space-4); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
select.tl-input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%), linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
textarea.tl-input { min-height: 96px; padding: var(--space-3) var(--space-4); resize: vertical; }
.check { display: flex; gap: var(--space-3); align-items: center; min-height: var(--tap-min); cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--cedar); }
.btns { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.btns .tl-btn { flex: 1; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: var(--space-1) var(--space-4); font-size: 14px; line-height: 20px; }
.kv dt { color: var(--ink-muted); }
.kv dd { margin: 0; text-align: right; font-family: var(--font-figures); }
.kv .kv__total { font-weight: 700; color: var(--ink); border-top: 1px solid var(--line); padding-top: var(--space-1); }
.thumb { width: 100%; max-height: 220px; object-fit: cover; border-radius: var(--radius-md); border: 1px solid var(--line); }
.mic-on { background: var(--loss-soft) !important; border-color: var(--loss) !important; color: var(--loss) !important; }
.tl-capture { max-width: none; box-shadow: none; padding: 0; background: transparent; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); font-size: 14px; line-height: 20px; z-index: 40; display: flex; gap: var(--space-3); align-items: center; box-shadow: var(--shadow-raised); max-width: calc(100vw - 32px); }
.toast button { background: transparent; border: 0; color: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; min-height: 32px; }

/* bottom nav (phone) */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--surface-raised); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: env(safe-area-inset-bottom); }
.tab { border: 0; background: transparent; color: var(--ink-muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; font-size: 12px; line-height: 16px; font-weight: 700; cursor: pointer; position: relative; }
.tab[aria-current="page"] { color: var(--cedar); }
.tab__count { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--loss); color: var(--surface-raised); font-size: 11px; line-height: 18px; font-family: var(--font-figures); }
.fab { position: fixed; right: var(--space-4); bottom: 80px; z-index: 11; min-height: 56px; padding: 0 var(--space-6) 0 var(--space-4); border-radius: var(--radius-md); border: 0; background: var(--cedar); color: var(--on-cedar); font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: var(--space-2); box-shadow: var(--shadow-sheet); cursor: pointer; }

@media (min-width: 861px) {
  .tabs { display: none; }
  .main { padding-bottom: var(--space-12); }
  .rail { display: flex; flex-direction: column; gap: var(--space-1); width: 224px; flex: none; position: sticky; top: 0; height: 100vh; padding: var(--space-4) var(--space-3); border-right: 1px solid var(--line); background: var(--surface-raised); }
  .rail__brand { display: flex; align-items: center; gap: var(--space-2); font-weight: 700; font-size: 20px; padding: var(--space-2) var(--space-3) var(--space-6); }
  .rail .tab { flex-direction: row; justify-content: flex-start; gap: var(--space-3); min-height: var(--tap-min); padding: 0 var(--space-3); border-radius: var(--radius-md); font-size: 16px; }
  .rail .tab:hover { background: var(--surface); }
  .rail .tab[aria-current="page"] { background: var(--cedar-soft); }
  .rail .tab__count { position: static; margin-left: auto; }
  .rail .fab { position: static; margin-top: var(--space-4); box-shadow: none; justify-content: center; }
  .top__brand { display: none; }
  .view { padding: var(--space-8) var(--space-6); }
  .cols { grid-template-columns: 1fr 1fr; }
  .scrim { align-items: center; }
  .sheet { border-radius: var(--radius-lg); }
  .toast { bottom: var(--space-6); }
}
@media (max-width: 480px) {
  .top__biz { display: none; }
  .top { justify-content: space-between; }
  .bar { grid-template-columns: 104px 1fr 76px; }
  .form__row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: up .18s ease-out; }
  @keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
}
.sync { flex: none; white-space: nowrap; }
@media (max-width: 560px) { .sync { font-size: 0; gap: 0; padding: 6px; } .sync .tl-chip__dot { width: 8px; height: 8px; } }

.sync { cursor: pointer; font: inherit; font-size: 13px; }
.sync:not([data-act]) { cursor: default; }
.reckey { font-family: var(--font-figures); font-size: 20px; line-height: 32px; letter-spacing: .04em; text-align: center; padding: var(--space-4); border: 2px dashed var(--line-strong); border-radius: var(--radius-md); background: var(--surface-sunken); word-break: break-all; user-select: all; }
.rail__brand, .top__brand { color: inherit; text-decoration: none; }
.tl-btn[disabled] { opacity: .8; }
@media (max-width: 560px) {
  .sync { font-size: 0; gap: 0; padding: 0; width: 28px; height: 28px; justify-content: center; }
  .sync .tl-chip__dot { width: 10px; height: 10px; }
  .top { gap: var(--space-2); padding: var(--space-2) var(--space-3); }
  .top .seg button { padding: 0 var(--space-2); font-size: 13px; white-space: nowrap; }
  .top__brand { font-size: 18px; }
}
html, body { max-width: 100%; overflow-x: hidden; }
.sheet { min-width: 0; }
.sheet p { overflow-wrap: anywhere; }
