/* Fleksi's look: ACCURE's design system (inherited from MXO), as decided in D12 and described in docs/UI.md.
   Neutral canvas, hairline borders, one blue. Phones first: one column, thumb-sized controls, bottom tabs. */

:root {
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --canvas: oklch(98.75% 0 0);
  --base: #fff;
  --elevated: oklch(98% 0 0);
  --recessed: oklch(96% 0 0);
  --tint: oklch(97% 0 0);
  --fill: oklch(92.2% 0 0);
  --line: oklch(14.5% 0 0 / .1);
  --hairline: oklch(93.5% 0 0);
  --text: oklch(21% .006 285.885);
  --strong: oklch(14.5% 0 0);
  --subtle: oklch(55.6% 0 0);
  --placeholder: oklch(70.8% 0 0);
  --success: oklch(43.2% .095 166.913);
  --success-tint: oklch(96.2% .043 156.7 / .57);
  --danger: oklch(50.5% .213 27.518);
  --danger-tint: oklch(93.6% .032 17.7 / .42);
  --warning: oklch(59.7% .144 57.5);
  --warning-tint: oklch(93.1% .107 94.6 / .25);
  --info-tint: oklch(95.5% .03 262 / .6);
  --shadow: 0 0 1px .5px oklch(0% 0 0 / .12), 0 1px 2px oklch(0% 0 0 / .08);
  --radius: 9px;
  --radius-lg: 14px;
  --header: 56px;
  --tabs: 60px;

  /* The theme colour: blue. Light buttons carry white text; links use a darker blue. */
  --blue: #2563eb; --blue-hover: #1d55d6; --blue-edge: #1a4cc2; --blue-ink: #fff; --blue-text: #1d4ed8;
  --brand: var(--blue); --btn: var(--blue); --btn-hover: var(--blue-hover); --btn-edge: var(--blue-edge);
  --btn-text: var(--blue-ink); --link: var(--blue-text);
  --brand-tint: color-mix(in srgb, var(--blue) 10%, var(--base));
  --ring: color-mix(in srgb, var(--brand) 18%, transparent);
  color-scheme: light;
}

/* Dark: chosen, or the system's choice when none is made. The two blocks stay identical. */
:root[data-theme="dark"] {
  --canvas: #050505; --elevated: #0a0a0a; --base: #0f0f0f; --recessed: #111111; --tint: #2a2a2a; --fill: #2a2a2a;
  --line: #373737; --hairline: #2a2a2a;
  --text: oklch(97% 0 0); --strong: oklch(98.5% 0 0); --subtle: oklch(70.8% 0 0); --placeholder: oklch(55.6% 0 0);
  --success: oklch(90.5% .093 164.15); --success-tint: oklch(39.3% .096 152.3 / .2);
  --danger: oklch(70.4% .191 22.216); --danger-tint: oklch(42.9% .176 28.7 / .17);
  --warning: oklch(75% .183 55.934); --warning-tint: oklch(35.3% .079 65 / .37);
  --shadow: 0 0 1px .5px oklch(100% 0 0 / .1), 0 1px 2px oklch(0% 0 0 / .3);
  --blue: #4f8dff; --blue-hover: #6b9fff; --blue-edge: #4f8dff; --blue-text: #8db4ff; --blue-ink: #04122e;
  --btn-edge: #4f8dff66; --brand-tint: #4f8dff1a; --info-tint: #4f8dff1a;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #050505; --elevated: #0a0a0a; --base: #0f0f0f; --recessed: #111111; --tint: #2a2a2a; --fill: #2a2a2a;
    --line: #373737; --hairline: #2a2a2a;
    --text: oklch(97% 0 0); --strong: oklch(98.5% 0 0); --subtle: oklch(70.8% 0 0); --placeholder: oklch(55.6% 0 0);
    --success: oklch(90.5% .093 164.15); --success-tint: oklch(39.3% .096 152.3 / .2);
    --danger: oklch(70.4% .191 22.216); --danger-tint: oklch(42.9% .176 28.7 / .17);
    --warning: oklch(75% .183 55.934); --warning-tint: oklch(35.3% .079 65 / .37);
    --shadow: 0 0 1px .5px oklch(100% 0 0 / .1), 0 1px 2px oklch(0% 0 0 / .3);
    --blue: #4f8dff; --blue-hover: #6b9fff; --blue-edge: #4f8dff; --blue-text: #8db4ff; --blue-ink: #04122e;
    --btn-edge: #4f8dff66; --brand-tint: #4f8dff1a; --info-tint: #4f8dff1a;
    color-scheme: dark;
  }
}

/* ---- Base ---- */
* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--canvas); color: var(--text);
  font-family: var(--font); font-size: 15px; line-height: 1.5; letter-spacing: -.01em;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1 { font-size: 22px; font-weight: 500; letter-spacing: -.02em; line-height: 1.25; color: var(--strong); margin: 0 0 4px;
  overflow-wrap: anywhere; }
h2 { font-size: 15px; font-weight: 500; color: var(--strong); margin: 28px 0 10px; }
.card > h2:first-child { margin-top: 0; }
p { margin: 8px 0; }
.muted { color: var(--subtle); }
.small { font-size: 13px; color: var(--subtle); }
.num, .amount { font-variant-numeric: tabular-nums; }
.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }

/* ---- Shell: top bar, content, bottom tabs on phones ---- */
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--header);
  display: flex; align-items: center; gap: 8px; padding: 0 8px 0 16px;
  background: var(--canvas); border-bottom: 1px solid var(--line);
}
.topbar__name { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; color: var(--strong);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The company's name opens the company: its details, people, billing and products. */
.topbar__name--link { display: flex; align-items: center; gap: 6px; min-height: 40px; text-decoration: none; }
.topbar__name--link span { overflow: hidden; text-overflow: ellipsis; }
.topbar__name--link .ic { flex: none; width: 18px; height: 18px; color: var(--subtle); }
.topbar__name--link[aria-current="page"], .topbar__name--link[aria-current="page"] .ic { color: var(--brand); }
/* A switch between sibling pages of one tab: full width, halves of equal size. */
.pagenav { margin: 0 0 16px; }
.pagenav .segmented { display: flex; width: 100%; }
.pagenav .segmented button { flex: 1; }
.topbar__actions { display: flex; gap: 2px; align-items: center; flex: none; }
.topbar__actions .button { min-height: 40px; padding: 0 10px; font-size: 13.5px; }
.screen { max-width: 760px; margin: 0 auto; padding: 20px 16px 32px; }
.app { padding-bottom: calc(var(--tabs) + env(safe-area-inset-bottom)); }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex;
  background: var(--canvas); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--tabs); padding: 6px 4px; color: var(--subtle); font-size: 12px; font-weight: 500; text-decoration: none; }
.tabs a .ic { width: 20px; height: 20px; }
.tabs a[aria-current="page"] { color: var(--brand); }
@media (min-width: 900px) {
  .app { padding-bottom: 0; }
  .tabs { position: sticky; top: var(--header); z-index: 15; justify-content: center; gap: 4px;
    border-top: 0; border-bottom: 1px solid var(--line); padding: 6px 0; }
  .tabs a { flex: 0 0 auto; flex-direction: row; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: var(--radius);
    font-size: 14px; }
  .tabs a:hover { background: var(--tint); text-decoration: none; }
  .tabs a[aria-current="page"] { background: var(--recessed); color: var(--strong); box-shadow: inset 0 0 0 1px var(--hairline); }
  .tabs a .ic { width: 16px; height: 16px; }
  .screen { padding: 32px 24px 64px; }
}

/* ---- Page header: back link, kicker, title, one line, actions ---- */
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.pagehead__text { flex: 1 1 260px; min-width: 0; }
.pagehead__back { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; margin: -6px 0 2px;
  color: var(--subtle); font-size: 13.5px; }
.pagehead__back:hover { color: var(--text); }
.pagehead__kicker { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 12.5px; font-weight: 500;
  color: var(--subtle); }
.pagehead__kicker .ic { width: 14px; height: 14px; }
.pagehead__lead { margin: 0; color: var(--subtle); font-size: 14px; max-width: 64ch; }
.pagehead__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---- Surfaces ---- */
.card { background: var(--base); border: 1px solid var(--hairline); border-radius: var(--radius-lg); padding: 16px;
  margin: 16px 0; }
.card--flush { padding: 0; overflow: hidden; }
.card--flush > h2:first-child { padding: 16px 16px 4px; margin: 0; }
@media (min-width: 640px) { .card { padding: 20px 24px; } .card--flush { padding: 0; } }
.tiles { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 16px; }
.tiles > * { flex: 1 1 150px; min-width: 0; }
.tile { background: var(--base); border: 1px solid var(--hairline); border-radius: var(--radius-lg); padding: 12px 14px; }
.tile__label { font-size: 12.5px; color: var(--subtle); }
.tile__value { font-size: 20px; font-weight: 500; letter-spacing: -.02em; color: var(--strong); margin: 2px 0;
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile__value--bad { color: var(--danger); }
.tile__sub { font-size: 12.5px; color: var(--subtle); line-height: 1.45; }
@media (min-width: 640px) { .tile { padding: 14px 16px; } .tile__value { font-size: 22px; } }

/* ---- Tables: wide ones scroll sideways inside their card ---- */
.table-wrap { overflow-x: auto; max-width: 100%; overscroll-behavior-x: contain; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
thead th { color: var(--subtle); font-weight: 500; font-size: 12.5px; background: var(--elevated); white-space: nowrap;
  border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
tfoot td { font-weight: 600; color: var(--strong); border-top: 1px solid var(--line); border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td a { color: var(--text); }
.cell-sub { display: block; font-size: 12.5px; color: var(--subtle); }
.card > .table-wrap { margin: 0 -16px; }
.card--flush > .table-wrap { margin: 0; }
@media (min-width: 640px) { .card > .table-wrap { margin: 0 -24px; } .card--flush > .table-wrap { margin: 0; } }

/* ---- Hairline rows: lists that open something ---- */
.rows { list-style: none; padding: 0; margin: 0; }
.row { border-top: 1px solid var(--hairline); }
.row:first-child { border-top: 0; }
.row__link { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 16px; color: var(--text);
  text-decoration: none; width: 100%; background: none; border: 0; font: inherit; text-align: left; }
a.row__link:hover, button.row__link:hover { background: var(--tint); text-decoration: none; }
button.row__link { cursor: pointer; }
.row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row__title { font-weight: 500; color: var(--strong); overflow-wrap: anywhere; }
.row__detail { font-size: 13px; color: var(--subtle); overflow-wrap: anywhere; }
.row__aside { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.row__amount { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 500; color: var(--strong); }

/* ---- Controls ---- */
input, select, textarea, button { font: inherit; letter-spacing: inherit; color: var(--text); }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; min-width: 0; }
.field > label, .choice > legend { font-size: 13px; font-weight: 500; color: var(--subtle); }
.field input, .field select, .field textarea, .search input {
  width: 100%; min-height: 44px; padding: 8px 12px; font-size: 16px; background: var(--base); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .1s, box-shadow .1s;
}
.field textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--placeholder); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.field select {
  -webkit-appearance: none; appearance: none; cursor: pointer; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5M7 9l5-5 5 5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.field__hint { margin: 0; font-size: 13px; color: var(--subtle); }
.field__error { margin: 0; font-size: 13px; color: var(--danger); }
.field--error input, .field--error select, .field--error textarea { border-color: var(--danger); }
.field--error input:focus, .field--error select:focus, .field--error textarea:focus {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; }
.choice { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.choice > legend { padding: 0; margin-bottom: 6px; }
.choice__options { display: flex; flex-wrap: wrap; gap: 8px; }
.choice__option { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--base); cursor: pointer; }
.choice__option:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); color: var(--strong); }
.choice__option input { accent-color: var(--brand); margin: 0; }
.choice__option:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--ring); }
.choice--error .choice__option { border-color: var(--danger); }
.search { position: relative; flex: 1 1 200px; min-width: 0; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--subtle); }
.search input { padding-left: 36px; }

/* Buttons: primary, secondary, plain and danger. 44 px high on phones, for a thumb. */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px; border-radius: var(--radius); border: 1px solid transparent; cursor: pointer;
  font-weight: 500; white-space: nowrap; text-decoration: none; user-select: none;
  transition: background-color .1s, box-shadow .1s, transform .1s;
}
a.button:hover { text-decoration: none; }
.button--primary { background: linear-gradient(180deg, color-mix(in srgb, #fff 16%, var(--btn)), var(--btn));
  color: var(--btn-text); border-color: var(--btn-edge);
  box-shadow: inset 0 1px 0 oklch(100% 0 0 / .32), 0 1px 2px oklch(0% 0 0 / .12); }
.button--primary:hover { background: linear-gradient(180deg, color-mix(in srgb, #fff 12%, var(--btn-hover)), var(--btn-hover)); }
:root[data-theme="dark"] .button--primary { background: var(--btn); border-color: var(--btn); box-shadow: none; }
:root[data-theme="dark"] .button--primary:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .button--primary { background: var(--btn); border-color: var(--btn); box-shadow: none; }
  :root:not([data-theme="light"]) .button--primary:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
}
.button--secondary { background: var(--base); color: var(--text); box-shadow: 0 0 0 1px var(--line), var(--shadow); }
.button--secondary:hover { background: var(--tint); }
.button--plain { background: none; color: var(--subtle); padding: 0 12px; }
.button--plain:hover { background: var(--tint); color: var(--text); }
.button--danger { background: var(--base); color: var(--danger); box-shadow: 0 0 0 1px var(--line); }
.button--danger:hover { background: var(--danger-tint); }
.button--icon { min-width: 44px; padding: 0; }
.button[disabled] { opacity: .55; cursor: default; }
.button[aria-busy="true"] { cursor: progress; }
button:focus-visible, a:focus-visible { outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand), 0 0 0 4px var(--ring); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0; }
/* Form footer: cancel on the left, the one primary action on the right. */
.actionsbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 20px 0 8px; }
.actionsbar__end { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-left: auto; }
@media (max-width: 480px) { .actionsbar__end { flex: 1 1 auto; } .actionsbar__end > .button--primary { flex: 1 1 auto; } }

/* Segmented filter */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.segmented { display: inline-flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; gap: 2px; padding: 2px;
  background: var(--fill); border-radius: var(--radius); }
.segmented button { flex: none; min-height: 36px; padding: 0 12px; border: 0; border-radius: 7px; background: none;
  color: var(--subtle); font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.segmented button[aria-pressed="true"] { background: var(--base); color: var(--strong); box-shadow: var(--shadow); }

/* ---- Feedback ---- */
.notice { padding: 10px 14px; border-radius: var(--radius); margin: 12px 0; background: var(--info-tint);
  border: 1px solid var(--line); font-size: 14px; }
.notice p { margin: 4px 0; }
.notice ul { margin: 4px 0; padding-left: 20px; }
.notice--error { background: var(--danger-tint); color: var(--danger); border-color: transparent; }
.notice--ok { background: var(--success-tint); color: var(--success); border-color: transparent; }
.notice--warning { background: var(--warning-tint); color: var(--text);
  border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.st { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 99px; font-size: 12px;
  font-weight: 500; white-space: nowrap; background: var(--fill); color: var(--text); }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.st--ok { background: var(--success-tint); color: var(--success); }
.st--warn { background: var(--warning-tint); color: var(--warning); }
.st--bad { background: var(--danger-tint); color: var(--danger); }
.st--info { background: var(--info-tint); color: var(--link); }
.st--muted { background: var(--recessed); color: var(--subtle); box-shadow: inset 0 0 0 1px var(--hairline); }
/* The standard content (chart, VAT codes) is a draft until released: said on every screen that uses it. */
.draftnote { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; margin: 0 0 16px;
  border-radius: var(--radius); background: var(--warning-tint); font-size: 13.5px;
  border: 1px solid color-mix(in srgb, var(--warning) 25%, transparent); }
.draftnote .ic { color: var(--warning); margin-top: 2px; }
.draftnote p { margin: 0; }
.empty { display: flex; align-items: flex-start; gap: 14px; padding: 20px 16px; }
.empty__icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: var(--recessed); color: var(--subtle); }
.empty__text { flex: 1; min-width: 0; }
.empty__text b { display: block; color: var(--strong); font-weight: 500; }
.empty__text p { margin: 2px 0 10px; color: var(--subtle); font-size: 13.5px; }

/* ---- Dialog ---- */
dialog.dialog { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0; width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px); background: var(--base); color: var(--text); box-shadow: 0 20px 50px oklch(0% 0 0 / .35); }
dialog.dialog::backdrop { background: oklch(0% 0 0 / .45); }
.dialog__head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 16px;
  border-bottom: 1px solid var(--hairline); background: var(--base); font-weight: 500; color: var(--strong); }
.dialog__head span { flex: 1; }
.dialog__body { padding: 16px; }
.dialog__body .actionsbar { margin-bottom: 0; }

/* ---- Invoice form: one compact card per line, live totals ---- */
.line { padding: 12px 0; border-top: 1px solid var(--hairline); }
.line:first-of-type { border-top: 0; padding-top: 0; }
.line .field { margin-bottom: 8px; }
.line__row { display: grid; gap: 0 8px; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr) minmax(0, 1.2fr); }
.line__foot { display: flex; align-items: center; gap: 8px; }
.line__foot .field { flex: 1; margin-bottom: 0; }
.line__sum { flex: none; min-width: 96px; text-align: right; font-weight: 500; color: var(--strong);
  font-variant-numeric: tabular-nums; align-self: flex-end; padding-bottom: 11px; }
.sumbox { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; width: min(360px, 100%); margin-left: auto;
  font-size: 14px; }
.sumbox span:nth-child(even) { text-align: right; font-variant-numeric: tabular-nums; }
.sumbox__grand { font-size: 17px; font-weight: 600; color: var(--strong); padding-top: 6px; margin-top: 4px;
  border-top: 1px solid var(--line); }
.sumbox__note { grid-column: 1 / -1; margin: 6px 0 0; font-size: 12.5px; color: var(--subtle); text-align: right; }
.inline-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.inline-add .field { flex: 1; }
/* Aligned with the field, not its label: the label row is about 24 px high. */
.inline-add .button { margin-top: 24px; }
.address { margin: 0; font-style: normal; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.kv dt { color: var(--subtle); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* ---- Scrollbars, skeletons and motion ---- */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--subtle) 45%, transparent) transparent; }
.skel { display: block; border-radius: 6px; background: var(--fill); }
.skel--title { width: 200px; height: 24px; margin: 6px 0 12px; }
.skel--line { width: 80%; height: 12px; margin: 0 0 12px; }
.skel--card { height: 160px; border-radius: var(--radius-lg); margin: 16px 0; }
@media (prefers-reduced-motion: no-preference) {
  .button:active, .segmented button:active { transform: scale(.97); }
  .skel { animation: skel-pulse 1.1s ease-in-out infinite alternate; }
  dialog.dialog[open] { animation: dlg-in .16s cubic-bezier(.2, .8, .2, 1); }
  dialog.dialog[open]::backdrop { animation: fade-in .16s ease-out; }
}
@keyframes skel-pulse { from { opacity: .55; } to { opacity: 1; } }
@keyframes dlg-in { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes fade-in { from { opacity: 0; } }

/* ---- Accessibility: set by theme.js from this browser's saved choices, or by the system ---- */
.skiplink { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 8px 14px; border-radius: var(--radius);
  background: var(--strong); color: var(--base); font-weight: 500; }
.skiplink:focus { top: 10px; text-decoration: none; }
html[data-text="large"] body { zoom: 1.08; }
html[data-text="larger"] body { zoom: 1.18; }
html[data-contrast="more"] { --subtle: oklch(40% 0 0); --placeholder: oklch(52% 0 0); --line: oklch(14.5% 0 0 / .28);
  --hairline: oklch(82% 0 0); }
html[data-contrast="more"][data-theme="dark"] { --subtle: oklch(84% 0 0); --placeholder: oklch(70% 0 0); --line: oklch(52% 0 0);
  --hairline: oklch(40% 0 0); }
@media (prefers-color-scheme: dark) {
  html[data-contrast="more"]:not([data-theme="light"]) { --subtle: oklch(84% 0 0); --placeholder: oklch(70% 0 0);
    --line: oklch(52% 0 0); --hairline: oklch(40% 0 0); }
}
html[data-underline] a:not(.button):not(.row__link):not(.tabs a) { text-decoration: underline; text-underline-offset: 2px; }
html[data-motion="reduce"] *, html[data-motion="reduce"] *::before, html[data-motion="reduce"] *::after {
  animation-duration: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0s !important; }
#main:focus { outline: none; }

/* ---- Credit notes: a stacked list of lines to tick, and a card's footer action ---- */
.choice__options--stack { flex-direction: column; flex-wrap: nowrap; }
.choice__options--stack .choice__option { display: flex; padding: 8px 14px; }
.choice__options--stack .choice__option:has(input:disabled) { cursor: default; color: var(--subtle); }
.choice__text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.choice__aside { flex: none; font-variant-numeric: tabular-nums; color: var(--subtle); }
.card__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--hairline); }
/* A control kept for keyboards and screen readers but drawn by its label, such as a file input inside a button. */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
label.button:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--ring); }

/* ---- Work: jobs, the worker's cards, the signature pad ---- */
.pills { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: flex-end; }
.pagehead__lead .pills { justify-content: flex-start; margin-top: 4px; }
.card + .card, .card + section, section + section { margin-top: 12px; }
.golinks { margin: 12px 0 4px; }
.golinks .button { flex: 1 1 0; }
.jobcard__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.jobcard__title { font-weight: 600; font-size: 16px; color: var(--strong); overflow-wrap: anywhere; }
.jobcard__what { margin: 6px 0; white-space: pre-line; color: var(--strong); }
.jobcard > .button--primary { width: 100%; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; margin: 8px 0 0;
  font-size: 14px; }
.facts dt { color: var(--subtle); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.subform { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--hairline); }
.subform h3 { font-size: 14px; font-weight: 500; color: var(--strong); margin: 0 0 10px; }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 14px; }
.suggest__item { min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px;
  background: var(--base); cursor: pointer; }
.suggest__item:hover { background: var(--tint); }
.sigpad { margin-bottom: 8px; }
.sigpad__label { display: block; font-size: 13px; font-weight: 500; color: var(--subtle); margin-bottom: 5px; }
/* White in both themes: the signature is kept as a dark drawing on white. */
.sigpad__canvas, .sigpad__image { display: block; width: 100%; height: 180px; background: #fff;
  border: 1px dashed var(--line); border-radius: var(--radius); touch-action: none; }
.sigpad__image { height: auto; max-height: 180px; object-fit: contain; }
.photos { list-style: none; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px; }
.photos__item { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.photos__item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius);
  background: var(--recessed); border: 1px solid var(--hairline); }
.photos__item .button { align-self: flex-start; }
.jobbilling { display: flex; flex-direction: column; gap: 12px; margin: 12px 0; }
/* Reports (J9): the period picker, statement lines that open their accounts, and an archive's hash. */
.period { margin: 0 0 12px; }
.period__dates { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 12px; }
.statement__total td { font-weight: 600; color: var(--strong); }
.statement__account td { font-size: 13px; color: var(--subtle); }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--link); text-align: left; cursor: pointer; }
.linklike:hover { text-decoration: underline; text-underline-offset: 2px; }
.statement__total .linklike { font-weight: 600; }
.hash { display: block; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; overflow-wrap: anywhere; }
.source { display: inline; }
.source summary { cursor: pointer; color: var(--link); display: inline; }
.source[open] { display: block; margin-top: 6px; font-size: 12.5px; overflow-wrap: anywhere; }
/* The month of hours: the month switcher, the lock and each person's days. */
.monthnav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 12px; }
.monthnav h2 { margin: 0; font-size: 17px; text-align: center; flex: 1; }
.monthnav .button { min-width: 48px; font-size: 20px; }
.monthlock { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.monthlock:not(:last-child) { margin-bottom: 12px; }
.monthlock ~ .button { width: 100%; margin-top: 8px; }
.monthdays { margin-top: 8px; }
.monthdays summary { cursor: pointer; color: var(--link); min-height: 44px; display: flex; align-items: center; }
