/* ATAD Petty Cash V3 (Redesign) -- shell and small kit. Tokens come from app.css (:root dark, [data-theme=light]); same values as the canvas.
   Everything is prefixed v3- so today's screens are untouched. Phone first; >= 1024 px the sidebar replaces the header and tab bar. */
.v3-shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); }
.v3-shell * { box-sizing: border-box; }
.v3-side, .v3-pagehead, .v3-phone-only[hidden] { display: none; }
.v3-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 64px;
  padding: calc(10px + var(--atad-sat, env(safe-area-inset-top, 0px))) 16px 10px; background: var(--panel); border-bottom: 1px solid var(--line); }
.v3-top-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.v3-top-brand img { width: 36px; height: 36px; }
.v3-top-brand div { display: flex; flex-direction: column; line-height: 17px; min-width: 0; }
.v3-top-brand span { font-size: 12px; color: var(--faint); }
.v3-top-r { display: flex; gap: 8px; align-items: center; }
.v3-top.back { justify-content: flex-start; gap: 6px; }
.v3-top-title { margin: 0; font-size: 19px; line-height: 24px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v3-ibtn { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; padding: 0; flex: none; }
.v3-ibtn.plain { border-color: transparent; background: transparent; }
.v3-ic { display: inline-flex; }
.v3-main { flex: 1; width: 100%; min-width: 0; padding: 16px 16px calc(96px + var(--atad-sab, env(safe-area-inset-bottom, 0px))); }
.v3-content { display: flex; flex-direction: column; gap: 12px; min-width: 0; max-width: 1200px; margin: 0 auto; }
.v3-stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.v3-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; background: var(--panel); border-top: 1px solid var(--line);
  padding: 6px 4px calc(10px + var(--atad-sab, env(safe-area-inset-bottom, 0px))); }
.v3-tab { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 48px; padding-top: 6px; font-size: 11px; font-weight: 600;
  color: var(--muted); text-decoration: none; position: relative; border-radius: 8px; justify-content: center; }
.v3-tab.on { color: var(--accent); font-weight: 700; }
.v3-tab-ic { position: relative; display: inline-flex; }
.v3-cam { width: 44px; height: 32px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; }
.v3-tab.cam { padding-top: 0; }
.v3-badge { position: absolute; top: -6px; right: -9px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: var(--accent-ink);
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.v3-badge[hidden] { display: none; }
.v3-bell { position: relative; flex: none; }
.v3-bell .abl-btn { border-radius: 10px; background: var(--panel-2); }
.v3-tab:focus-visible, .v3-nav:focus-visible, .v3-btn:focus-visible, .v3-ibtn:focus-visible, .v3-switch:focus-visible, .v3-portal:focus-visible, .v3-card.link:focus-visible {
  outline: 2.5px solid var(--accent); outline-offset: 2px; }

/* type */
.v3-h1 { margin: 0; font-size: 26px; line-height: 32px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.v3-h2 { margin: 0; font-size: 17px; line-height: 24px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v3-sub { font-size: 13px; line-height: 18px; color: var(--muted); }
.v3-hello { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.v3-hello .v3-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v3-mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.v3-sec { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.v3-more { font-size: 13px; font-weight: 700; color: var(--accent); text-decoration: none; }
.v3-empty { padding: 18px 8px; text-align: center; color: var(--muted); }

/* kit */
.v3-card { display: flex; flex-direction: column; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; color: var(--text); text-decoration: none; min-width: 0; }
.v3-card.link:hover { background: var(--panel-2); }
.v3-chip { display: inline-block; flex: none; font-size: 12px; line-height: 16px; font-weight: 600; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.v3-chip.k-a { background: var(--amber-soft); color: var(--amber); } .v3-chip.k-t { background: var(--accent-soft); color: var(--accent); }
.v3-chip.k-r { background: var(--red-soft); color: var(--red); } .v3-chip.k-g { background: var(--green-soft); color: var(--green); }
.v3-chip.k-n { background: var(--panel-2); color: var(--muted); }
/* sql/100: a change of an approved request (approve screens) */
.v3-chg { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 18px; color: var(--muted); min-width: 0; grid-column: 1 / -1; }
.v3-chg > span:last-child { min-width: 0; overflow-wrap: anywhere; padding-top: 2px; }
.v3-btn { min-height: 44px; padding: 0 14px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); }
.v3-btn.pri { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.v3-btn.out { background: var(--panel); border-color: var(--accent); color: var(--accent); font-weight: 700; }
.v3-btn.block { display: flex; width: 100%; }
.v3-btn.sm { min-height: 36px; font-size: 13px; }
.v3-btn:disabled { opacity: .5; cursor: default; }
.v3-actions { display: flex; flex-wrap: wrap; gap: 8px; } .v3-actions .v3-btn { flex: 1; }
.v3-todo-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.v3-todo { padding: 12px; }
.v3-todo-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.v3-todo-t b { font-size: 14px; } .v3-todo-t span { font-size: 12px; color: var(--muted); }
.v3-banner { border-radius: 10px; padding: 12px 14px; font-weight: 600; } .v3-banner.bad { background: var(--red-soft); color: var(--red); }
.v3-coming { border-style: dashed; }
.v3-kvs { padding: 4px 16px; gap: 0; }
.v3-kv { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.v3-kv:last-child { border-bottom: 0; } .v3-kv span { color: var(--muted); } .v3-kv b { text-align: right; font-weight: 700; }
.v3-toggle { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.v3-toggle > div { display: flex; flex-direction: column; }
.v3-switch { appearance: none; -webkit-appearance: none; position: relative; width: 48px; height: 28px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; flex: none; padding: 0; }
.v3-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--muted); transition: left .15s; }
.v3-switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.v3-switch[aria-checked="true"]::after { left: 23px; background: var(--accent-ink); }
.v3-narrow { display: flex; flex-direction: column; gap: 14px; max-width: 560px; }

/* sub-screens (Profile, To Do) have no tab bar on a phone, as in the canvas */
@media (max-width: 1023px) { .v3-sub-screen .v3-tabs { display: none; } .v3-sub-screen .v3-main { padding-bottom: 24px; } }
@media (min-width: 1024px) {
  .v3-shell { flex-direction: row; }
  .v3-top, .v3-tabs, .v3-phone-only { display: none !important; }
  .v3-side { display: flex; flex-direction: column; gap: 4px; width: 232px; flex: none; position: sticky; top: 0; height: 100vh; overflow-y: auto;
    background: var(--panel); border-right: 1px solid var(--line); padding: 18px 14px; }
  .v3-brand { display: flex; align-items: center; gap: 10px; padding: 0 4px 4px; }
  .v3-side-role { font-size: 12px; font-weight: 600; color: var(--faint); padding: 0 12px 10px; }
  .v3-brand-t { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 17px; }
  .v3-brand-t span { font-size: 12px; font-weight: 600; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .v3-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 42px; padding: 0 12px; border-radius: 8px; font-size: 14px; font-weight: 600;
    color: var(--muted); text-decoration: none; }
  .v3-nav:hover { background: var(--panel-2); } .v3-nav.on { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
  .v3-nav .v3-badge { position: static; }
  .v3-side-foot { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 8px; }
  .v3-portal { min-height: 42px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line); color: var(--text); display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; text-decoration: none; }
  .v3-portal:hover { background: var(--panel-2); }
  .v3-side .abl-pop { left: 0; right: auto; }
  .v3-main { padding: 28px 40px 48px; }
  .v3-content { gap: 18px; margin: 0; }
  .v3-pagehead { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
  .v3-h1 { font-size: 28px; line-height: 34px; }
}
@media (max-width: 1023px) { .v3-portal { display: none; } }

/* Manager sheets (Phase 5B1): drag handle on top, no close button, as in the canvas (S1-4) */
#sheet.v3m-grab .sheet-head { position: relative; padding-top: 22px; }
#sheet.v3m-grab .sheet-head::before { content: ""; position: absolute; top: 8px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--line); }
#sheet.v3m-grab .sheet-head .icon-btn { display: none; }
.v3m-to { text-align: left; }
.v3m-to .t { display: flex; flex-direction: column; min-width: 0; } .v3m-to .t small { font-size: 12px; color: var(--muted); font-weight: 400; }
.v3m-rm { background: none; border: 0; color: var(--muted); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; min-height: 36px; padding: 4px 8px; }

/* ===== V3 Check 3.1: shared pieces matched to the boards (scoped by body.v3-on, set by V3.render, so old screens are untouched) ===== */
/* 1. bottom sheet: rounded top, drag handle, no X; one filled full-width button, the rest plain text links. PC: centred dialog, no X */
body.v3-on .sheet-panel { border-radius: 20px 20px 0 0; border-color: var(--line); }
body.v3-on .sheet-head { position: relative; padding: 24px 20px 2px; }
body.v3-on .sheet-head::before { content: ""; position: absolute; top: 9px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--line); }
body.v3-on .sheet-head .icon-btn { display: none; }
body.v3-on .sheet-head h2 { font-size: 20px; line-height: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.v3-on .sheet-body { padding: 6px 20px 14px; gap: 12px; }
body.v3-on .sheet-foot { flex-direction: column; gap: 2px; border-top: 0; padding: 4px 20px calc(10px + env(safe-area-inset-bottom)); }
body.v3-on .sheet-foot .btn { flex: none; width: 100%; min-height: 48px; border: 0; background: transparent; color: var(--muted); font-weight: 700; }
body.v3-on .sheet-foot .btn.pri, body.v3-on .sheet-foot:not(:has(.btn.pri)) .btn:first-child { background: var(--accent); color: var(--accent-ink); order: -1; }
body.v3-on .sheet-foot .btn.danger { color: var(--red); background: transparent; }
body.v3-on .sheet-foot .btn:disabled { opacity: .5; }
@media (min-width: 640px) { body.v3-on .sheet-panel { border-radius: 14px; max-width: 520px; } body.v3-on .sheet-head::before { display: none; } body.v3-on .sheet-head { padding-top: 20px; } }

/* 2. result message: green banner at the top of the page (phone, full width under the header); PC small top-right toast. Errors the same place in red */
body.v3-on .toasts { top: calc(72px + var(--atad-sat, env(safe-area-inset-top, 0px))); bottom: auto; align-items: stretch; padding: 0 16px; }
body.v3-on .toast { max-width: none; box-shadow: none; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; font-weight: 700;
  background: var(--green-soft); color: var(--green); border: 1px solid var(--green); }
body.v3-on .toast.ok::before { content: "\2713"; font-weight: 700; }
body.v3-on .toast.bad { background: var(--red-soft); color: var(--red); border-color: var(--red); }
@media (min-width: 1024px) { body.v3-on .toasts { top: 20px; right: 24px; left: auto; width: 360px; padding: 0; align-items: stretch; } body.v3-on .toast { font-size: 13px; padding: 10px 12px; } }

/* 3. success screen: tick, words, ONE filled Done */
.v3-success { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 28px 0 8px; }
.v3-success-tick { width: 64px; height: 64px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: inline-flex; align-items: center; justify-content: center; }
.v3-success .v3-btn { margin-top: 12px; width: 100%; max-width: 420px; }

/* 4. To Do card: first button filled, second neutral dark fill; "N Things" count and "K More" link; compact rows on the To Do page */
.v3-todo .v3-btn:not(.pri) { background: var(--panel-2); border-color: var(--line); color: var(--text); }
.v3-todo .v3-btn.out { background: var(--panel); border-color: var(--accent); color: var(--accent); }
.v3-todo .v3-actions .v3-btn.out ~ .v3-btn, .v3-todo .v3-actions .v3-btn ~ .v3-btn.out { background: var(--panel-2); border-color: var(--line); color: var(--text); }
.v3-count { font-size: 13px; color: var(--muted); font-weight: 600; }
.v3-more-link { align-self: center; font-size: 14px; font-weight: 700; color: var(--accent); text-decoration: none; padding: 8px 4px; }
.v3-stack.compact { gap: 10px; } .v3-stack.compact .v3-todo { padding: 12px 14px; border-radius: 12px; gap: 10px; }

/* 5. grouped list row with a chevron; PCR reference plain mono grey */
.v3-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 12px; }
.v3-row-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.v3-row-t b { font-size: 14px; line-height: 20px; } .v3-row-t span { font-size: 12px; line-height: 16px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v3-row-r { display: flex; align-items: center; gap: 8px; flex: none; color: var(--muted); }
.v3-ref { font-family: var(--mono); font-size: 12px; color: var(--muted); font-weight: 400; text-decoration: none; }
a.v3-ref { color: var(--muted); }
.v3-group { font-size: 12px; font-weight: 700; color: var(--faint); letter-spacing: .04em; text-transform: uppercase; padding: 6px 2px 0; }

/* 6. chips and badges: red bell / tab badge */
.v3-bell .abl-badge { background: var(--red); color: #1b0c0b; border: 0; }   /* bell badge salmon, tab badge teal (boards) */

/* 7. PC tiles with a chevron, PC table (Type | What | Amount | Action) */
.v3-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.v3-tile { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--text); text-decoration: none; min-width: 0; }
a.v3-tile:hover { background: var(--panel-2); }
.v3-tile-l { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); font-weight: 600; }
.v3-tile-v { font-family: var(--mono); font-size: 24px; line-height: 30px; font-weight: 700; } .v3-tile-v.k-a { color: var(--amber); } .v3-tile-v.k-g { color: var(--green); } .v3-tile-v.k-r { color: var(--red); }
.v3-tile-s { font-size: 12px; color: var(--faint); }
.v3-tablewrap { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 6px 16px 10px; overflow-x: auto; }
.v3-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.v3-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--faint); padding: 10px 8px; white-space: nowrap; border-bottom: 1px solid var(--line); }
.v3-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.v3-table tr:last-child td { border-bottom: 0; }
.v3-table .num, .v3-table th.num { text-align: right; font-family: var(--mono); font-weight: 700; white-space: nowrap; }
.v3-table .act, .v3-table th.act { text-align: right; } .v3-table .act > div { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.v3-table td b { display: block; } .v3-table td small { display: block; color: var(--muted); font-size: 12px; }
.v3-side-role { padding-bottom: 12px; }

/* 8. searchable dropdown, amount box, tally box, balance card */
.v3-field { display: flex; flex-direction: column; gap: 6px; } .v3-field > label, .v3-field > .v3-lab { font-size: 13px; font-weight: 600; color: var(--muted); }
.v3-select { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; width: 100%; }
.v3-select .v3-mono { font-size: 13px; } .v3-select .ph { color: var(--faint); } .v3-select > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v3-search { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); }
.v3-search:focus-within { border-color: var(--accent); }
.v3-search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 14px; }
.v3-opt .v3-row-t span.v3-mono { font-size: 12px; }
.v3-amount { display: flex; align-items: baseline; gap: 10px; min-height: 64px; padding: 8px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); }
.v3-amount:focus-within { border-color: var(--accent); }
.v3-amount span { font-size: 14px; font-weight: 700; color: var(--muted); align-self: center; }
.v3-amount input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--text); font-family: var(--mono); font-size: 32px; font-weight: 700; text-align: right; }
.v3-tally { display: flex; flex-direction: column; gap: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px; }
.v3-tally-r { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.v3-tally-r b { font-family: var(--mono); color: var(--text); } .v3-tally-r.total { border-bottom: 0; font-size: 15px; color: var(--text); font-weight: 700; }
.v3-tally-r.k-a b { color: var(--amber); } .v3-tally-r.k-g b { color: var(--green); } .v3-tally-r.k-r b { color: var(--red); }
.v3-balance { gap: 6px; }
.v3-balance-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }
.v3-balance-top a { color: var(--accent); font-weight: 700; text-decoration: none; }
.v3-balance-v { font-family: var(--mono); font-size: 34px; line-height: 40px; font-weight: 700; }
.v3-balance-chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* 9. Notifications page */
.v3-notes { display: flex; flex-direction: column; gap: 10px; max-width: 720px; }
.v3-notes .v3-row.unread .v3-row-t b::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--accent); }
.v3-notes-head { display: flex; justify-content: flex-end; }
.v3-linkbtn { background: none; border: 0; color: var(--accent); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; padding: 6px 2px; min-height: 36px; }
/* sheet foot built by page helpers (a wrapper div around the buttons): same rule, whatever class the page gave the link */
body.v3-on .sheet-foot > div { display: flex; flex-direction: column; gap: 2px; width: 100%; }
body.v3-on .sheet-foot button:not(.pri), body.v3-on .sheet-foot a.v3-btn:not(.pri) { background: none; border: 0; color: var(--muted); font: inherit; font-weight: 700; min-height: 48px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; width: 100%; text-decoration: none; }
body.v3-on .sheet-foot button.red, body.v3-on .sheet-foot button.danger { color: var(--red); }
body.v3-on .sheet-foot .pri { background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); min-height: 48px; border-radius: 10px; order: -1; width: 100%; }
body.v3-on .sheet-foot button:disabled { opacity: .5; }

/* ===== V3 Check 3.1 round 2 ===== */
/* To Do: the title area of a card with buttons can itself open a page; compact rows on the To Do page */
a.v3-todo-head { color: inherit; text-decoration: none; } a.v3-todo-head:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.v3-todo-row { min-height: 56px; }
.v3-more-link { align-self: auto; padding: 0; }
.v3-sec .v3-more-link { font-size: 14px; }
/* phone header note ("You Hold 640.00"), set by V3.setHeaderNote */
.v3-hold { font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; } .v3-hold[hidden] { display: none; }
@media (max-width: 380px) { .v3-hold { font-size: 12px; } }
/* profile rows */
.v3-row-ic { width: 40px; height: 40px; border-radius: 10px; background: var(--panel-2); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.v3-narrow .v3-row { gap: 12px; } .v3-narrow .v3-row .v3-row-ic + .v3-row-t { margin-left: 0; }
/* success: the one filled Done is pinned to the bottom on a phone */
.v3-success { }
@media (max-width: 1023px) {
  .v3-success { min-height: calc(100dvh - 190px); justify-content: flex-start; padding-bottom: 96px; }
  .v3-success > .v3-btn { position: fixed; left: 16px; right: 16px; bottom: calc(14px + var(--atad-sab, env(safe-area-inset-bottom, 0px))); z-index: 11; width: auto; margin: 0; max-width: none;
    box-shadow: 0 0 0 14px var(--bg); }
}
/* nothing in the page container may create a containing block: fixed / sticky bottom bars (Done, footers) must stay on the screen's edge */
.v3-shell, .v3-main, .v3-content, .v3-stack { transform: none; filter: none; perspective: none; contain: none; will-change: auto; animation: none; }
.v3-narrow .v3-row-t b { font-size: 16px; }


/* To Do page: an open card's first button is the teal outline (boards H-todo, C-todo); red = Cancel */
.v3-todo.on-page .v3-actions .v3-btn.pri { background: var(--panel); border-color: var(--accent); color: var(--accent); }
.v3-todo .v3-btn.red, .v3-todo .v3-actions .v3-btn.red ~ .v3-btn, .v3-todo .v3-actions .v3-btn ~ .v3-btn.red { background: var(--panel-2); border-color: var(--line); }
.v3-todo .v3-actions .v3-btn.red, .v3-todo .v3-actions .v3-btn.bad, .v3-todo .v3-actions .v3-btn ~ .v3-btn.bad, .v3-todo .v3-actions .v3-btn ~ .v3-btn.red { color: var(--red); }

/* ---- Approve history (7 Nov 2026, js/v3/v3-history.js): the Done tab for any dates and a request's Full Flow */
.vhist { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.vhist-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.vhist-chips::-webkit-scrollbar { display: none; }
.vhist-chip { flex: none; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.vhist-chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.vhist-sum { font-size: 13px; color: var(--muted); min-height: 16px; }
.vhist-list { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.vhist-list .v3-tablewrap { width: 100%; }
.vhist-tr { cursor: pointer; } .vhist-tr:hover td { background: var(--panel-2); }
.vhist-ref { text-decoration: none; }
.vhist-more { display: flex; justify-content: center; padding-top: 4px; }
.vhist-note { font-size: 12px; color: var(--muted); text-align: center; }
.vhist-flowcard { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.vhist-flow { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.vhist-step { display: flex; gap: 12px; align-items: flex-start; position: relative; padding-bottom: 16px; }
.vhist-step:last-child { padding-bottom: 0; }
.vhist-step:not(:last-child)::before { content: ''; position: absolute; left: 11px; top: 26px; bottom: 2px; width: 2px; background: var(--line); }
.vhist-step .dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: inline-flex; align-items: center; justify-content: center;
  color: var(--green); background: var(--panel); position: relative; }
.vhist-step.done .dot { border-color: var(--green); background: var(--green-soft); }
.vhist-step.now .dot { border-color: var(--amber); background: var(--amber-soft); }
.vhist-step.bad .dot { border-color: var(--red); background: var(--red-soft); }
.vhist-step > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 14px; }
.vhist-step b { line-height: 20px; }
.vhist-step small { font-size: 12px; line-height: 16px; color: var(--muted); }
.vhist-step q { font-size: 13px; line-height: 18px; color: var(--text); overflow-wrap: anywhere; quotes: '\201C' '\201D'; }
