@font-face {
  font-family: Pretendard;
  src: url("./fonts/PretendardVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* TONO CORE base. The tokens of the TONIFY dashboard (tono-operation/frontend/src/styles/dashboard.css and
   index.css): warm stone neutrals, hairlines of the ink at low opacity, and the TONO terracotta only for the
   primary action, the selection and the figure that matters. The two programs read as one product. */
:root {
  --ink: #171717;
  --ink-2: #525252;
  --muted: #686868;
  --line: rgba(23, 23, 23, .09);
  --line-soft: rgba(23, 23, 23, .06);
  --line-strong: rgba(23, 23, 23, .18);
  --control-line: rgba(23, 23, 23, .14);
  --control-line-hover: rgba(23, 23, 23, .26);
  --input-line: #91908e;
  --surface: #ffffff;
  --canvas: #fafaf9;
  --raised: #f5f5f4;
  --hover: #fafaf9;
  --brand: #9c6f5c;
  --accent: #8a5d47;
  --accent-strong: #7a5039;
  --accent-ink: #6f4936;
  --accent-wash: #f2eae4;
  --on-accent: #ffffff;
  --selection: #ead9cf;
  --nav: #f5f5f4;
  --nav-hover: #ececea;
  --nav-text: #525252;
  --nav-strong: #171717;
  --nav-muted: #6b6b6b;
  --nav-line: rgba(23, 23, 23, .07);
  --success: #047857;
  --success-wash: #e8f5ef;
  --danger: #b91c1c;
  --danger-wash: #fbeceb;
  --warning: #a34b08;
  --warning-wash: #fdf3e4;
  --saturday: #315db7;
  --radius: 14px;
  --radius-sm: 8px;
  --control: 36px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --shadow-sm: 0 1px 2px rgba(23, 23, 23, .04);
  --float: 0 16px 40px -12px rgba(23, 23, 23, .18), 0 2px 6px rgba(23, 23, 23, .05);
  color: var(--ink);
  background: var(--canvas);
  font: 14px/1.5 Pretendard, "Malgun Gothic", system-ui, sans-serif;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}
/* TONO night palette, mapped to CORE's existing semantic colours. */
:root[data-theme="dark"] {
  --ink: #ededed;
  --ink-2: #e4e4e7;
  --muted: #b4b4bb;
  --line: rgba(237, 237, 237, .13);
  --line-soft: rgba(237, 237, 237, .08);
  --line-strong: rgba(237, 237, 237, .25);
  --control-line: #3f3f46;
  --control-line-hover: #909099;
  --input-line: #797981;
  --surface: #1c1c21;
  --canvas: #0f0f12;
  --raised: #27272a;
  --hover: #232325;
  --brand: #c7977c;
  --accent: #b5886d;
  --accent-strong: #c79b80;
  --accent-ink: #e3b99f;
  --accent-wash: #2d2521;
  --on-accent: #1c120c;
  --selection: #533e33;
  --nav: #0f0f10;
  --nav-hover: #19191b;
  --nav-text: #b4b4bb;
  --nav-strong: #ededed;
  --nav-muted: #a1a1a6;
  --nav-line: rgba(237, 237, 237, .12);
  --success: #34d399;
  --success-wash: #14332a;
  --danger: #f87171;
  --danger-wash: #3d1515;
  --warning: #fbbf24;
  --warning-wash: #3d2e0a;
  --saturday: #8ab4f8;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --float: 0 16px 40px -12px rgba(0, 0, 0, .65), 0 2px 6px rgba(0, 0, 0, .4);
}
@media (pointer: coarse) { :root { --control: 44px; } }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; overflow-wrap: anywhere; }
h1, h2, h3, p, dl { margin: 0; }
h1 { font-size: 24px; line-height: 32px; letter-spacing: -.01em; font-weight: 600; }
h2 { font-size: 16px; line-height: 1.4; letter-spacing: -.01em; font-weight: 600; }
h3 { font-size: 14px; line-height: 1.45; font-weight: 600; }
strong, b { font-weight: 600; }
p { color: var(--muted); }
a { color: var(--accent-strong); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
::selection { background: var(--selection); color: var(--ink); }
/* Thin scrollbars, as in TONIFY. */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border: 2px solid transparent; border-radius: 8px; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--control-line-hover); }
::-webkit-scrollbar-track { background: transparent; }

.ocr-confirm:not([hidden]) { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.ocr-photo img { display: block; max-width: 100%; height: auto; margin-top: 8px; }

/* Brand */
.brand { display: inline-flex; gap: 10px; align-items: center; color: inherit; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; border-radius: var(--radius-sm); }
.brand img { display: block; width: auto; max-width: 180px; height: 36px; object-fit: contain; }
.brand-product { padding-left: 10px; border-left: 1px solid var(--line-strong); color: var(--nav-muted); font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: .08em; }
a.brand { transition: opacity .15s var(--ease); }
a.brand:hover { opacity: .78; }
.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 8px; background: var(--ink); color: var(--canvas); font: 600 17px/1 system-ui, sans-serif; }
.brand-copy { display: grid; gap: 4px; line-height: 1.3; }
.brand small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.boot { min-height: 100svh; display: grid; place-content: center; justify-items: center; gap: 16px; color: var(--muted); padding: 20px; text-align: center; }
.skip-link { position: fixed; z-index: 8; left: 12px; top: -100px; background: var(--surface); padding: 8px 12px; border: 1px solid var(--accent); border-radius: var(--radius-sm); }
.skip-link:focus { top: 12px; }

/* Shell */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100svh; }
/* The menu follows the TONIFY sidebar: 240 wide, 34px rows, the active row white with a terracotta icon. */
.sidebar { position: sticky; top: 0; height: 100svh; background: var(--nav); color: var(--nav-strong); border-right: 1px solid var(--nav-line); padding: 20px 8px 0; display: flex; flex-direction: column; }
.sidebar > .brand-bar { margin: 0 4px 0 12px; }
.brand-bar { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-width: 0; }
.theme-toggle.button { width: var(--control); height: var(--control); flex: none; padding: 0; color: var(--ink-2); }
:root[data-theme="dark"] .brand img { filter: brightness(1.55) saturate(.8); }
.side-links { display: grid; gap: 12px; margin-top: 12px; }
.nav-group { display: grid; gap: 2px; }
.nav-group-label { display: flex; align-items: center; height: 24px; padding: 0 10px; color: var(--nav-muted); font-size: 12px; font-weight: 500; }
.nav-link { border-radius: var(--radius-sm); height: 34px; display: flex; align-items: center; gap: 10px; padding: 0 10px; color: var(--nav-text); text-decoration: none; font-size: 14px; font-weight: 400; white-space: nowrap; transition: background-color .15s var(--ease), color .15s var(--ease); }
.nav-link:hover { background: var(--nav-hover); color: var(--nav-strong); }
.nav-link[aria-current] { color: var(--nav-strong); font-weight: 500; background: var(--surface); box-shadow: 0 0 0 1px rgba(23, 23, 23, .06), 0 1px 2px rgba(23, 23, 23, .05); }
.nav-link[aria-current] .nav-symbol { color: var(--accent); }
.nav-symbol { width: 16px; height: 16px; flex: 0 0 16px; color: var(--nav-muted); }
.workspace { min-width: 0; }
.quick-search { display: flex; align-items: center; gap: 8px; margin: 16px 4px 0; height: 34px; padding: 0 10px; background: var(--surface); border: 1px solid var(--nav-line); border-radius: var(--radius-sm); color: var(--nav-muted); text-align: left; font-size: 13px; transition: border-color .15s var(--ease), color .15s var(--ease); }
.quick-search:hover { border-color: rgba(23, 23, 23, .16); color: var(--nav-strong); }
.quick-search kbd { margin-left: auto; border: 1px solid var(--nav-line); border-radius: 4px; background: var(--nav); color: var(--nav-muted); padding: 0 5px; font: 11px/18px system-ui, sans-serif; }
/* The account line matches TONIFY's sidebar foot: name and role on the left, a quiet sign-out on the right. */
.account-bar { flex: none; margin: auto -8px 0; padding: 10px 12px 10px 18px; border-top: 1px solid var(--nav-line); display: flex; gap: 4px; align-items: center; }
.account-copy { flex: 1; display: flex; flex-direction: column; line-height: 16px; min-width: 0; }
.account-copy strong { font-size: 13px; font-weight: 500; color: var(--nav-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy small { color: var(--nav-muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: none; }
.logout { margin-left: 4px; color: var(--muted); }
.account-bar form { position: relative; margin-left: auto; }
.account-bar form [data-feedback] { position: absolute; z-index: 1; bottom: 100%; right: 0; width: 196px; padding: 8px; color: var(--danger); background: var(--danger-wash); border-radius: 6px; }
.account-bar .button { min-height: 32px; height: 32px; padding: 0 10px; font-size: 12px; color: var(--nav-muted); border-color: transparent; background: transparent; }
.account-bar .button:hover { color: var(--danger); background: var(--nav-hover); border-color: transparent; }
.content { min-width: 0; max-width: 1680px; padding: 24px 32px 56px; }
/* A new screen settles in rather than snapping. */
.content > * { animation: settle .26s var(--ease); }
@keyframes settle { from { opacity: 0; transform: translateY(4px); } }

/* Page header: the TONIFY dashboard head. The screen name is large and quiet, actions sit on the right. */
.page-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 20px; min-height: 40px; }
.page-head p { margin-top: 2px; font-size: 13px; line-height: 20px; color: var(--muted); }
.page-actions, .form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
/* Panels that follow one another are always 16px apart; grids space their own children. */
:where(.panel, .home-card, details.panel) + :where(.panel, .home-card, details.panel, section) { margin-top: 16px; }
/* Side-by-side layouts place their panels with gap, so a sibling margin would push the second panel down. */
:is(.stack, .detail-columns, .home-grid, .status-grid, .access-layout, .inbox-workspace, .ledger-workspace, .intake-layout, .schedule-days, .wf-branches, .finance-accounts) > * + * { margin-top: 0; }
.stack { display: grid; gap: 16px; min-width: 0; }
/* A panel head is TONIFY's card head: a 14px title over a hairline, so the 24px page title leads. */
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 20px; min-height: 56px; min-width: 0; border-bottom: 1px solid var(--line-soft); }
.panel-head h2 { font-size: 14px; line-height: 20px; }
.panel-head p { margin-top: 2px; font-size: 13px; }
.panel-head + :is(.panel-body, .panel-description, form, dl, ul, div:not(.table-wrap)) { padding-top: 16px; }
.panel-head:last-child { border-bottom: 0; }
.panel-body { padding: 0 20px 20px; }
/* A table runs edge to edge in its panel, its header band meeting the panel's sides. */
.panel-body > .table-wrap { margin-inline: -20px; }
.panel-body > .table-wrap:last-child { margin-bottom: -20px; }
.panel-head + .panel-body:has(> .table-wrap:first-child) { padding-top: 0; }
.panel-description { padding: 0 20px 16px; font-size: 13px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.toolbar > label { display: grid; gap: 4px; }
.toolbar > label > :is(input, select) { margin-top: 0; }
.search { min-width: 192px; flex: 0 1 256px; }

/* Buttons */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: var(--ink); background: var(--surface); border: 1px solid var(--control-line); border-radius: var(--radius-sm); min-height: var(--control); padding: 0 14px; font-size: 13px; font-weight: 500; line-height: 1.2; text-align: center; text-decoration: none; white-space: nowrap; transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), transform .1s var(--ease); }
.button:hover { background: var(--raised); border-color: var(--control-line-hover); }
.button:active:not(:disabled) { transform: scale(.98); }
.button[aria-pressed="true"] { background: var(--accent-wash); border-color: rgba(138, 93, 71, .35); color: var(--accent-ink); }
.button.primary { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.button.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.button.danger { color: var(--danger); border-color: rgba(185, 28, 28, .22); }
.button.danger:hover { background: var(--danger-wash); border-color: rgba(185, 28, 28, .36); }
.button.small { min-height: 30px; padding: 0 10px; font-size: 12px; }
@media (pointer: coarse) { .button.small { min-height: 44px; } }
.button.subtle { background: transparent; border-color: transparent; box-shadow: none; }
.button.subtle:hover { background: var(--nav-hover); }

/* Tables */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
thead th { height: 40px; font-size: 12px; font-weight: 500; color: var(--muted); background: var(--canvas); border-bottom-color: var(--line); white-space: nowrap; }
tbody th { font-weight: 600; font-size: 13px; }
td { font-size: 13px; height: 44px; }
tbody tr:last-child :is(td, th) { border-bottom: 0; }
tbody tr { transition: background-color .12s var(--ease); }
tbody tr:hover { background: var(--raised); }
/* A link in a row reads as the row's name; the underline comes on hover. */
:is(td, tbody th) a { color: var(--ink); font-weight: 500; text-decoration: none; }
:is(td, tbody th) a:hover { color: var(--accent-strong); text-decoration: underline; }
/* A section of summary cards: a 14px title with its action on the same line, then the cards. */
.summary-section + .panel, .panel + .summary-section, .summary-section + .summary-section { margin-top: 24px; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; min-height: 36px; margin-bottom: 12px; }
.section-head h2 { font-size: 14px; line-height: 20px; }
.section-head h2 small { margin-left: 8px; color: var(--muted); font-size: 13px; font-weight: 400; }
.cell-note { color: var(--muted); display: block; font-size: 12px; margin-top: 2px; }
.money { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.row-action { width: 1%; text-align: right; white-space: nowrap; }
.finance-flow { margin: 4px 0 12px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.finance-flow b { margin-right: 6px; color: var(--ink-2); font-weight: 500; }
.nowrap { white-space: nowrap; }

/* Status */
/* A status is a quiet pill with a dot in its own colour, so a long list reads at a glance. */
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 2px 10px 2px 8px; font-size: 12px; font-weight: 500; line-height: 18px; white-space: nowrap; color: var(--ink-2); background: var(--raised); }
.badge::before { content: ""; width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.badge.warning { background: var(--warning-wash); color: var(--warning); }
.badge.success { background: var(--success-wash); color: var(--success); }
.badge.danger { background: var(--danger-wash); color: var(--danger); }
.badge.info { background: var(--accent-wash); color: var(--accent-ink); }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line-soft); }
.empty:first-child { border-top: 0; }
.empty strong { display: block; margin-bottom: 4px; color: var(--ink); font-weight: 600; }
.loading, .error-page { padding: 24px; }
.notice { border-radius: var(--radius-sm); padding: 10px 12px; background: var(--accent-wash); color: var(--accent-strong); font-size: 13px; }
.notice.success { background: var(--success-wash); color: var(--success); }
.notice.warning { background: var(--warning-wash); color: var(--warning); }
.notice.danger { background: var(--danger-wash); color: var(--danger); }
.notice:not([hidden]) { margin-block: 12px; }
.panel .notice:first-child { margin-top: 0; }
[role="alert"]:not(.notice):not(:empty) { color: var(--danger); font-size: 13px; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.span-all { grid-column: 1 / -1; }
label, .field-label { display: block; min-width: 0; font-weight: 500; font-size: 13px; color: var(--ink-2); }
label .field-help { display: block; font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 4px; }
label > :is(input, select, textarea) { margin-top: 6px; }
input, select, textarea { width: 100%; min-width: 0; min-height: var(--control); border: 1px solid var(--input-line); background: var(--surface); color: var(--ink); padding: 6px 10px; border-radius: var(--radius-sm); font-size: 14px; transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(138, 93, 71, .14); }
input::placeholder, textarea::placeholder { color: var(--muted); }
select { appearance: none; padding-right: 30px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23898989' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 8px center; }
input[type="checkbox"], input[type="radio"] { min-height: auto; width: 16px; height: 16px; padding: 0; accent-color: var(--accent); box-shadow: none; }
input[type="file"] { padding: 6px; font-size: 13px; }
input::file-selector-button { border-radius: 6px; border: 0; padding: 4px 10px; color: var(--accent-strong); background: var(--accent-wash); margin-right: 8px; font: inherit; font-weight: 500; cursor: pointer; }
textarea { resize: vertical; min-height: 88px; padding-block: 8px; }
fieldset { margin: 0; min-width: 0; padding: 0; border: 0; }
legend { padding: 0; font-weight: 600; font-size: 13px; }
.check-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.check-list label { align-items: center; display: flex; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; font-weight: 400; color: var(--ink); }
.check-list input { margin: 0; }
.date-control { display: flex; align-items: center; gap: 8px; }
.date-control input { margin: 0; width: auto; }
.date-control label { white-space: nowrap; }
.form-actions { margin-top: 16px; }
.form-narrow { max-width: 860px; }

/* Facts and detail layouts */
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 20px; }
.facts dt { color: var(--muted); font-size: 12px; }
.facts dd { margin: 4px 0 0; font-weight: 600; }
.facts.facts-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail-columns { display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(256px, 1fr); gap: 16px; align-items: start; }
.back-link { display: inline-flex; font-size: 13px; font-weight: 500; margin-bottom: 8px; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
.entry-list { display: grid; gap: 8px; list-style: none; padding: 0; margin: 0; }
.entry-list > li { border-bottom: 1px solid var(--line-soft); padding-bottom: 10px; }
.entry-list > li:last-child { border-bottom: 0; padding-bottom: 0; }
.entry-list p { margin-top: 2px; font-size: 13px; }
.split-list { display: grid; gap: 8px; margin-top: 8px; }
.split-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 8px; align-items: end; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px; }
.split-total { min-height: 0; margin: 0; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.split-fieldset { margin: 12px 0; }
.split-controls { margin-top: 8px; }
.transaction-list { margin-top: 16px; }
.handoff-head { justify-content: space-between; margin-bottom: 12px; }
.handoff + .handoff { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.handoff details.expand:last-child { padding-bottom: 0; }

/* Disclosure: a chevron that turns, never the browser triangle. */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 10px 2px 2px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .2s var(--ease); vertical-align: middle; opacity: .6; }
details[open] > summary::before { transform: rotate(45deg); margin-bottom: 4px; }
details.expand:not(.panel) { border-top: 1px solid var(--line); padding: 12px 0; margin-top: 12px; }
details.expand summary { font-weight: 600; color: var(--ink); }
details.expand[open] summary { margin-bottom: 12px; }
details.panel.expand { padding: 0; border: 1px solid var(--line); }
details.panel.expand > summary { display: flex; align-items: center; min-height: 56px; padding: 16px 20px; font-size: 14px; }
details.panel.expand[open] > summary { margin-bottom: 0; border-bottom: 1px solid var(--line-soft); }
details.panel.expand > :not(summary) { margin-inline: 20px; }
details.panel.expand > :not(summary):first-of-type { margin-top: 16px; }
details.panel.expand > :last-child:not(summary) { margin-bottom: 20px; }
details.panel.expand > .table-wrap { margin-inline: 0; }

/* Status tiles */
.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 12px; margin-bottom: 16px; }
.status-tile { display: grid; align-content: start; text-decoration: none; gap: 8px; min-height: 108px; padding: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; transition: border-color .15s var(--ease), background-color .15s var(--ease); }
a.status-tile:hover { border-color: var(--line-strong); }
.status-tile[aria-current="true"] { border-color: var(--accent); }
.status-tile span:first-child { color: var(--ink-2); font-weight: 400; font-size: 13px; line-height: 20px; }
.status-tile strong { font-weight: 500; letter-spacing: -.01em; font-size: 30px; line-height: 36px; font-variant-numeric: tabular-nums; }
.status-tile small { color: var(--muted); font-size: 12px; line-height: 16px; }

/* Sign-in */
.login-layout { min-height: 100svh; display: grid; place-items: center; padding: 48px 24px; background: var(--canvas); }
.login-box { width: min(100%, 400px); padding: 40px 36px 36px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .03), 0 12px 32px rgba(0, 0, 0, .04); }
.login-box .brand img { height: 36px; }
.login-box h1 { margin-top: 32px; font-size: 20px; }
.login-box > p { margin: 6px 0 24px; font-size: 13px; }
.login-form { display: grid; gap: 16px; }
.login-form .button { min-height: 44px; margin-top: 4px; font-size: 14px; }
.login-form input { min-height: 44px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.booked-balances { margin-bottom: 16px; }
.booked-balances dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.booked-balances dl div { padding: 24px 28px; }
.booked-balances dl div + div { border-left: 1px solid var(--line); }
.booked-balances dt { font-size: 13px; color: var(--muted); font-weight: 500; }
.booked-balances dd { margin: 8px 0 0; font-size: 30px; line-height: 36px; letter-spacing: -.01em; font-weight: 500; font-variant-numeric: tabular-nums; }
.balance-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-top: 24px; margin-bottom: 12px; }

/* Keep the source and its transcription together while entering an expense. */
.intake-layout { display: grid; grid-template-columns: minmax(232px, .75fr) minmax(0, 1.3fr); max-width: 1160px; gap: 20px; align-items: start; }
.intake-proof, .intake-fields { padding: clamp(20px, 2.2vw, 32px); min-width: 0; }
.intake-layout h2 { margin-bottom: 20px; font-size: 16px; }
.capture-input { display: grid; justify-items: center; position: relative; gap: 8px; text-align: center; padding: 36px 16px; border: 1px dashed var(--input-line); background: var(--canvas); border-radius: var(--radius-sm); cursor: pointer; transition: background-color .15s var(--ease), border-color .15s var(--ease); }
.capture-input:hover, .capture-input.drag-over, .capture-input:focus-within { background: var(--accent-wash); border-color: var(--accent); }
.capture-input input { position: absolute; width: 1px; height: 1px; min-height: 0; opacity: 0; padding: 0; }
.capture-input .button { margin-top: 8px; }
.camera-input { display: none; position: relative; width: 100%; margin-top: 8px; }
.camera-input input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.camera-input:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 820px) and (pointer: coarse) {
  .camera-input { display: inline-flex; }
  .capture-panel :is(.ocr-photo summary, .ocr-confirm) { min-height: 44px; }
  .capture-panel .ocr-photo summary { display: flex; align-items: center; }
  html { scroll-padding-block: 64px 72px; }
  :is(.login-form, .capture-panel, .receipt-workbench, .attendance-request-dialog)
    :is(input:not([type=checkbox],[type=radio],[type=file]), select, textarea, .picker-field .datepicker-trigger) {
    font-size: 16px;
  }
  .shell:has(:is(input:not([type=checkbox],[type=radio],[type=file],[aria-hidden=true]), textarea):focus) .bottom-nav {
    display: none;
  }
}
.capture-input.has-file { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; text-align: left; justify-items: start; padding: 12px; border-style: solid; gap: 12px; }
.capture-input.has-file .field-help, .capture-input:has(.capture-thumb:not([hidden])) .upload-mark { display: none; }
.capture-input.has-file .button { margin: 0; padding-inline: 10px; }
.capture-input.has-file .capture-title { font-size: 13px; }
.capture-thumb { width: 44px; height: 52px; object-fit: cover; object-position: top; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.intake-proof:has(.has-file) .file-formats { display: none; }
.upload-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; font: 24px/1 system-ui; color: var(--accent); background: var(--accent-wash); }
.capture-title { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; max-width: 100%; }
.file-formats { margin-top: 12px; font-size: 12px; text-align: center; }
.intake-proof [data-preview], .intake-proof details { margin-top: 16px; font-size: 13px; }
.intake-proof [data-preview] { padding: 12px; background: var(--canvas); border-radius: var(--radius-sm); }
.intake-proof summary { min-height: 44px; padding-top: 12px; }
.capture-panel .intake-subhead { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 20px; }
.capture-panel input[name=amount] { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.capture-panel .form-actions { justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 20px; margin-top: 24px; }
.next-review { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.next-review input { margin: 0; }
@media (max-width: 900px) { .intake-layout { grid-template-columns: 1fr; } }
.section-eyebrow { font-size: 12px; font-weight: 600; color: var(--accent); }
.close-confirm { display: flex; gap: 8px; align-items: start; margin-top: 16px; }
.close-confirm input { margin-top: 4px; }

@media (max-width: 1100px) {
  .detail-columns { grid-template-columns: 1fr; }
}
@media (min-width: 821px) {
  /* The menu scrolls inside the sidebar, so the account bar and the switches under it stay in view. */
  .side-links { flex: 1 1 auto; min-height: 0; overflow-y: auto; align-content: start; }
}
@media (max-width: 820px) {
  .shell { display: flex; flex-direction: column; }
  .workspace { display: contents; }
  .sidebar { display: flex; flex-direction: row; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 20; height: 56px; order: 1; padding: 0 12px 0 4px; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px); border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar > .side-links, .sidebar .quick-search, .nav-group-label, .sidebar .brand small { display: none; }
  .sidebar > .brand-bar { flex: 1; margin: 0; }
  .sidebar .brand img { height: 30px; max-width: min(132px, 29vw); }
  .sidebar .brand-product { padding-left: 8px; }
  .sidebar .account-bar .button { width: var(--control); height: var(--control); padding: 0; }
  .sidebar .account-bar { margin: 0 0 0 auto; padding: 0; border: 0; }
  .account-bar form [data-feedback] { top: 100%; bottom: auto; right: 0; left: auto; }
  .customer-switch, .business-switch { padding: 6px 0; }
  .content { order: 2; width: 100%; padding-top: 24px; padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
}
@media (max-width: 600px) {
  .content { padding-inline: 16px; }
  .account-bar { gap: 6px; }
  .avatar { display: none; }
  .account-bar .logout { margin-left: 0; }
  .page-head { margin-bottom: 16px; }
  .panel-head { padding: 16px; }
  .panel-body { padding: 0 16px 16px; }
  .panel-body > .table-wrap { margin-inline: -16px; }
  .panel-body > .table-wrap:last-child { margin-bottom: -16px; }
  .search { flex: 1 1 100%; }
  .form-grid { gap: 12px; }
  .form-grid:not(.compact) { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-row .button { justify-self: start; }
  .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .status-tile { min-height: 0; padding: 12px; }
  .status-tile strong { font-size: 20px; line-height: 28px; }
  .login-layout { align-items: start; padding: 32px 16px; }
  .login-box { padding: 28px 24px; }
  th, td { padding-inline: 8px; }
  th:first-child, td:first-child, th:last-child, td:last-child { padding-inline: 12px; }
  .capture-input { padding: 20px 16px; }
  .capture-panel .form-grid { gap: 20px; }
  .capture-panel .form-actions .primary { flex: 1; min-height: 44px; }
  .content .back-link { min-height: 44px; align-items: center; }
  .booked-balances dl div { padding: 20px 16px; }
  .booked-balances dd { font-size: 24px; }
}

.menu-toggle { display: none; }
.menu-drawer { position: fixed; inset: 0 auto 0 0; margin: 0; width: min(272px, 85vw); height: 100dvh; max-height: none; padding: 16px 12px; border: 0; border-right: 1px solid var(--line); background: var(--nav); color: var(--ink); box-shadow: var(--float); }
.menu-drawer::backdrop { background: rgba(23, 23, 23, .28); }
.menu-drawer header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-left: 8px; }
.menu-drawer .side-links, .menu-drawer .nav-group { display: grid; border: 0; }
.menu-drawer .side-links { gap: 20px; margin-top: 16px; }
.menu-drawer :is(.nav-link, header .button) { min-height: 44px; }
.menu-drawer .nav-group-label, .menu-drawer .nav-symbol { display: block; }
@media (max-width: 820px) {
  .menu-toggle { display: grid; place-items: center; width: 44px; min-height: 44px; background: transparent; color: var(--ink); border: 0; border-radius: var(--radius-sm); font-size: 20px; }
}

.lodging-checklist .finance-form-fields { display: contents; }
.wf-dialog .employee-form-fields { display: contents; }

/* Sales mode: choosing and switching the customer a session works in. */
.group-choices { display: grid; gap: 8px; margin: 12px 0; }
.group-choices .button { justify-content: flex-start; text-align: left; }
.group-account { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.account-customer { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.customer-switch { padding: 0 8px 12px; }
.business-switch { display: grid; gap: 4px; padding: 12px 4px 0; font-size: 12px; }
.business-switch select { width: 100%; }
.business-choice { max-width: 520px; padding: 32px; }

/* Sales mode: customer management for TONO administrators and TONIFY accounts for a customer's owner. */
.platform-form .finance-form-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(172px, 1fr)); gap: 12px; align-items: end; border: 0; margin: 12px 0 20px; padding: 0; }
.platform-form label { display: grid; gap: 4px; }
.platform-editor h3 { margin-top: 24px; }
.tonify-accounts { margin-bottom: 16px; }

/* Sales mode: a TONO support session is always visible, and the owner can read what it did. */
.support-banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin: 0; border-radius: 0; }
.support-log { margin-top: 16px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
.money.gain { color: var(--success); }

/* A lodging code reads as a key tag, as in TONIFY's room codes. */
.key-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border: 0; border-radius: 6px; background: var(--accent-wash); color: var(--accent-ink); font: inherit; font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
button.key-tag { cursor: pointer; transition: background-color .15s var(--ease); }
button.key-tag:hover { background: var(--selection); }
.alert-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: 44px; border-bottom: 1px solid var(--line-soft); }
.alert-row:last-child { border-bottom: 0; }
.alert-row strong { font-weight: 500; }
.alert-row time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.alert-row .badge { margin-left: auto; }

/* The account bar's logout is a quiet icon, as in TONIFY's sidebar foot. */
.button.icon-only { width: 32px; min-width: 32px; padding: 0; }
@media (pointer: coarse) { .button.icon-only { width: 44px; min-width: 44px; } }

/* Phones: a bottom bar for the everyday work. */
.bottom-nav { display: none; }
@media (max-width: 820px) {
  .bottom-nav { position: fixed; inset: auto 0 0 0; z-index: 20; display: flex; height: calc(56px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 96%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
  .bottom-nav a { flex: 1; display: grid; place-items: center; align-content: center; gap: 2px; color: var(--muted); font-size: 12px; font-weight: 500; text-decoration: none; }
  .bottom-nav a .nav-symbol { width: 20px; height: 20px; }
  .bottom-nav a[aria-current="page"] { color: var(--accent); }
  .bottom-nav .bottom-nav-submit { color: var(--accent-ink); }
  .sidebar .account-copy small { display: none; }
}
@media (max-width: 600px) {
  .sidebar .account-copy { display: none; }
}

.bottom-nav .nav-symbol { display: block; color: inherit; }
/* A search that filters one panel's list sits in that panel's head. */
.panel-search { width: 280px; max-width: 100%; min-height: 32px; padding-left: 32px; font-size: 13px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23737373' stroke-width='1.5' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cpath d='m10.5 10.5 3 3'/%3E%3C/svg%3E") no-repeat 10px center; }
@media (max-width: 600px) { .panel-search { width: 100%; } }
.button.subtle.danger { color: var(--danger); }
.button.subtle.danger:hover { background: var(--danger-wash); }
.row-action .toolbar { justify-content: flex-end; flex-wrap: nowrap; align-items: center; }
.panel-count { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
/* Required documents: one 44px line each, the status lined up at the right edge. */
.doc-list { display: grid; padding-top: 0 !important; }
.doc-list details.doc-item { margin: 0; padding: 0; border-top: 0; border-bottom: 1px solid var(--line-soft); }
.doc-list details.doc-item:last-child { border-bottom: 0; }
.doc-list details.doc-item > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 0; }
.doc-list details.doc-item > summary strong { font-weight: 500; }
.doc-list details.doc-item > summary .badge { margin-left: auto; }
.doc-list details.doc-item[open] > summary { margin-bottom: 8px; }
.doc-list details.doc-item[open] { padding-bottom: 16px; }
