/*
 * DSP Timecards: design system "Friendly Flat" (+ "Pro Console" tables for admin).
 * Every text/background pair below meets WCAG 2.0 AA (4.5:1 for text,
 * 3:1 for borders of form controls and focus indicators), as AODA requires.
 * Ratios are noted next to each token. Don't swap in the raw logo colours
 * (#008FA3 teal, #DB5A28 orange, #7D8A17 lime): all three fail with text.
 */
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("assets/fonts/pjs-400.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("assets/fonts/pjs-600.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("assets/fonts/pjs-700.woff2") format("woff2"); }

:root {
    --navy: #2C3286;        /* 11:1 on white */
    --navy-deep: #1B1F4B;
    --navy-soft: #E6E8F7;   /* navy text on it 9:1 */
    --on-navy-muted: #C9CCF2; /* 7:1 on navy */
    --ink: #1B1F45;         /* body text, 15:1 */
    --muted: #4E537A;       /* secondary text, 7.4:1 on white, 6.8:1 on bg */
    --bg: #F4F5FB;
    --surface: #FFFFFF;
    --line: #DCDFF0;        /* decorative dividers only */
    --control: #767BA6;     /* input borders, 4:1 on white (needs 3:1) */
    --action: #B8461A;      /* primary buttons, white text 5.3:1 */
    --action-hover: #9C3A14;
    --focus: #2C3286;
    --ok-fg: #1E6B2F;  --ok-bg: #E3F4E7;    /* 5.7:1 */
    --warn-fg: #7A4E00; --warn-bg: #FDF0D5; /* 6.4:1 */
    --err-fg: #A32D2D; --err-bg: #FBEAEA;   /* 6.1:1 */
    --info-fg: #00505B; --info-bg: #D6F0F2; /* 7.7:1 */

    --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --radius: 16px;
    --radius-sm: 10px;
    --tap: 48px;            /* minimum touch target */
    --tabbar-h: 64px;
    --side-w: 232px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
}
h1, h2, h3 { line-height: 1.25; text-wrap: balance; margin: 0; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--navy); text-underline-offset: 3px; }
a:hover { color: var(--navy-deep); }
img { max-width: 100%; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
[hidden], .hidden { display: none !important; }

/* Focus is always visible: 3px navy ring with a white gap. */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 2px #fff; border-radius: 6px; }
.app-header :focus-visible, .side-nav :focus-visible { outline-color: #fff; box-shadow: 0 0 0 2px var(--navy); }

.skip-link {
    position: absolute; left: 12px; top: -60px; z-index: 100;
    background: var(--navy); color: #fff; padding: 12px 16px; border-radius: var(--radius-sm); font-weight: 700;
}
.skip-link:focus { top: 12px; }

.icon { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- Shell ---------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.app-header {
    position: sticky; top: 0; z-index: 20;
    background: var(--navy); color: #fff;
    padding-top: env(safe-area-inset-top, 0px);
}
.app-header-inner {
    display: grid; grid-template-columns: minmax(var(--tap), 72px) 1fr minmax(var(--tap), 72px); align-items: center; gap: 8px;
    max-width: 960px; margin: 0 auto; min-height: 60px;
    padding: 6px max(12px, env(safe-area-inset-right, 0px)) 6px max(12px, env(safe-area-inset-left, 0px));
}
.app-header h1 { font-size: 1.125rem; font-weight: 700; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-logo { width: auto; height: 32px; justify-self: center; background: #fff; border-radius: 8px; padding: 3px; }
.header-action { display: flex; justify-content: flex-end; }
.icon-btn {
    width: var(--tap); height: var(--tap); display: inline-grid; place-items: center;
    border: 0; border-radius: 12px; background: transparent; color: inherit; cursor: pointer; text-decoration: none;
}
.app-header .icon-btn { color: #fff; }
.app-header .icon-btn:hover { background: rgba(255,255,255,.12); color: #fff; }

.content {
    width: 100%; max-width: 640px; margin: 0 auto; flex: 1;
    padding: 20px max(16px, env(safe-area-inset-right, 0px)) 32px max(16px, env(safe-area-inset-left, 0px));
    display: flex; flex-direction: column; gap: 16px;
}
.content.wide { max-width: 960px; }
.content:focus { outline: none; }
body.has-nav .content { padding-bottom: calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom, 0px)); }

/* Bottom tab bar on phones */
.tab-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: grid; grid-template-columns: repeat(5, 1fr);
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
.tab-bar a {
    min-height: var(--tabbar-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    font-size: .75rem; font-weight: 600; color: var(--muted); text-decoration: none;
}
.tab-bar a[aria-current="page"] { color: var(--navy); }
.tab-bar a[aria-current="page"] .icon { stroke-width: 2.5; }
.tab-bar a[aria-current="page"] span { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* Side rail on desktop */
.side-nav { display: none; }
@media (min-width: 900px) {
    body.has-nav { padding-left: var(--side-w); }
    body.has-nav .content { padding-bottom: 40px; }
    .tab-bar { display: none; }
    .side-nav {
        display: flex; flex-direction: column; gap: 8px;
        position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 25;
        background: var(--navy-deep); color: #fff; padding: 16px 12px;
    }
    .side-nav ul { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; flex: 1; }
    .side-nav a { display: flex; align-items: center; gap: 12px; min-height: var(--tap); padding: 0 12px; border-radius: 12px; color: #fff; text-decoration: none; font-weight: 600; }
    .side-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
    .side-nav a[aria-current="page"] { background: #fff; color: var(--navy-deep); }
    .side-brand img { background: #fff; border-radius: 8px; padding: 3px; }
    .side-brand { font-size: 1rem; }
    body.has-nav .app-header .header-logo { visibility: hidden; }
}

/* ---------- Building blocks ---------- */
.card { background: var(--surface); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--line); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-title h2 { font-size: 1.05rem; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row2 > * { min-width: 0; }
.spacer { flex: 1; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

.hero {
    background: var(--navy); color: #fff; border-radius: var(--radius);
    padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 4px;
}
.hero .label { color: var(--on-navy-muted); font-size: .875rem; }
.hero .big { font-size: 2rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hero .hero-row { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--on-navy-muted); font-size: .875rem; }
.hero a { color: #fff; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: var(--tap); padding: 10px 18px; border-radius: 12px;
    font: inherit; font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer;
    border: 2px solid transparent; background: var(--navy-soft); color: var(--navy);
}
.btn:hover { background: #D6D9F1; color: var(--navy-deep); }
.btn-primary { background: var(--action); color: #fff; }
.btn-primary:hover { background: var(--action-hover); color: #fff; }
.btn-outline { background: var(--surface); border-color: var(--navy); color: var(--navy); }
.btn-danger { background: var(--surface); border-color: var(--err-fg); color: var(--err-fg); }
.btn-danger:hover { background: var(--err-bg); color: var(--err-fg); }
.btn-small { min-height: 40px; padding: 6px 12px; font-size: .875rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { background: #E4E5EE; color: #5A5E78; cursor: not-allowed; border-color: transparent; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-row.single { grid-template-columns: 1fr; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field .label { font-weight: 600; font-size: .9375rem; }
.hint { font-size: .875rem; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], input[type="search"], input[type="file"], select, textarea {
    width: 100%; min-height: var(--tap); padding: 10px 12px;
    border: 1.5px solid var(--control); border-radius: 10px; background: var(--surface);
    font: inherit; font-size: 1rem; color: var(--ink);
}
textarea { min-height: 120px; resize: vertical; }
input:disabled, select:disabled, textarea:disabled { background: var(--bg); color: var(--muted); border-style: dashed; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--err-fg); border-width: 2px; }
.field-error { color: var(--err-fg); font-size: .875rem; font-weight: 600; }
.check { display: flex; align-items: center; gap: 10px; min-height: var(--tap); font-weight: 600; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--navy); flex: none; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 600; font-size: .9375rem; margin-bottom: 6px; padding: 0; }
.chips-choice { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-choice label { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border: 1.5px solid var(--control); border-radius: 10px; background: var(--surface); cursor: pointer; font-weight: 600; }
.chips-choice input { width: 18px; height: 18px; accent-color: var(--navy); }

/* Notices */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: .9375rem; }
.notice .icon { margin-top: 1px; width: 20px; height: 20px; }
.notice a { color: inherit; font-weight: 700; }
.notice-success { background: var(--ok-bg); color: var(--ok-fg); }
.notice-warning { background: var(--warn-bg); color: var(--warn-fg); }
.notice-error   { background: var(--err-bg); color: var(--err-fg); }
.notice-info    { background: var(--info-bg); color: var(--info-fg); }

/* Chips */
.chip { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; font-size: .8125rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.chip-ok { background: var(--ok-bg); color: var(--ok-fg); }
.chip-warn { background: var(--warn-bg); color: var(--warn-fg); }
.chip-err { background: var(--err-bg); color: var(--err-fg); }
.chip-info { background: var(--navy-soft); color: var(--navy); }
.chip-teal { background: var(--info-bg); color: var(--info-fg); }

/* Avatars: logo colours, darkened for contrast */
.avatar { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 700; flex: none; }
.av-teal   { background: #D6F0F2; color: #00505B; }
.av-navy   { background: #DADCF0; color: #2C3286; }
.av-lime   { background: #EEF3CF; color: #4A5410; }
.av-orange { background: #FBE0D4; color: #A8401A; }

/* Home tiles */
.tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 6px; min-height: 168px; }
.tile:hover { border-color: var(--control); }
.tile .name { font-weight: 700; font-size: 1rem; overflow-wrap: anywhere; }
.tile .name a { color: var(--ink); text-decoration: none; }
.tile .name a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); } /* whole tile is the link */
.tile .name a:focus-visible { outline: none; box-shadow: none; }
.tile .name a:focus-visible::after { outline: 3px solid var(--focus); outline-offset: 2px; }
.tile .sub { font-size: .875rem; color: var(--muted); }
.tile-actions { position: absolute; top: 6px; right: 6px; display: flex; gap: 2px; z-index: 2; }
.tile-actions .icon-btn { width: 40px; height: 40px; color: var(--muted); }
.tile-actions .icon-btn:hover { background: var(--bg); color: var(--navy); }
.tile-actions .icon { width: 18px; height: 18px; }
.tile.add { align-items: center; justify-content: center; border: 2px dashed var(--control); color: var(--navy); font-weight: 700; cursor: pointer; font: inherit; font-weight: 700; }
.tile.add:hover { background: var(--navy-soft); }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); display: flex; flex-direction: column; gap: 12px; align-items: center; }

/* Segmented control (tabs / view toggle) */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--navy-soft); border-radius: 12px; padding: 4px; gap: 4px; }
.seg a, .seg button { min-height: 44px; display: grid; place-items: center; border-radius: 9px; font: inherit; font-weight: 700; font-size: .9375rem; color: var(--navy); text-decoration: none; border: 0; background: transparent; cursor: pointer; }
.seg [aria-current="page"], .seg [aria-selected="true"] { background: var(--surface); box-shadow: 0 1px 2px rgba(27,31,69,.15); }

/* Timer */
.timer { align-items: center; text-align: center; }
.timer-ring {
    width: 148px; height: 148px; border-radius: 50%; display: grid; place-items: center;
    border: 10px solid var(--navy-soft); font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.timer-ring.running { border-color: var(--navy); }
.timer .btn { width: 100%; }

/* Shift list */
.shift-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.shift { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.shift.needs-confirm { border: 2px solid #C98F1A; background: #FFFBF2; }
.shift .when { font-weight: 700; }
.shift .meta { font-size: .875rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.shift .actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Review & send cards */
.period-nav { display: grid; grid-template-columns: minmax(var(--tap), 72px) 1fr minmax(var(--tap), 72px); align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; }
.period-nav .icon-btn { color: var(--navy); border: 1.5px solid var(--line); }
.period-nav .period { text-align: center; font-weight: 700; }
.period-nav .period small { display: block; font-weight: 600; color: var(--muted); }
.tc-card .tc-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.tc-card .tc-name { font-weight: 700; font-size: 1.05rem; }
.tc-card .tc-total { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; list-style: none; margin: 0; padding: 0; }
.cal li { background: var(--bg); border-radius: 8px; padding: 6px 2px; text-align: center; min-height: 58px; font-size: .75rem; color: var(--muted); display: flex; flex-direction: column; gap: 1px; }
.cal li .d { font-weight: 700; font-size: .875rem; color: var(--ink); }
.cal li.on { background: var(--navy-soft); }
.cal li.on .h { color: var(--navy); font-weight: 700; }
.status-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* Data tables ("Pro Console" style) */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: .9375rem; }
table.data caption { text-align: left; padding: 12px 14px; font-weight: 700; }
table.data th { text-align: left; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: #EEF0F8; padding: 10px 12px; white-space: nowrap; }
table.data td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .rate-form { display: flex; gap: 8px; align-items: center; }
table.data .rate-form input { width: 110px; min-height: 44px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.kpi .v { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* History list */
.doc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.doc { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.doc .info { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }

/* Dialogs (native <dialog>, focus handled by the browser + app.js) */
dialog.modal {
    width: min(480px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 0;
    border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(27,31,69,.35);
}
dialog.modal::backdrop { background: rgba(27,31,69,.55); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 14px 0 20px; }
.modal-head h2 { font-size: 1.15rem; }
.modal-body { padding: 12px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 560px) {
    dialog.modal { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 20px 20px 0 0; max-height: 92vh; padding-bottom: env(safe-area-inset-bottom, 0px); }
}

/* Toast */
.toast {
    position: fixed; left: 50%; transform: translateX(-50%); z-index: 60;
    bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom, 0px));
    background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600;
    max-width: calc(100vw - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
@media (min-width: 900px) { .toast { bottom: 24px; } }

/* Auth screens */
body.auth { background: var(--navy); }
body.auth .app-header { background: transparent; position: static; }
body.auth .content { max-width: 460px; padding-top: 8px; }
.auth-card { background: var(--surface); border-radius: 20px; padding: 24px 20px; display: flex; flex-direction: column; gap: 16px; }
.auth-card .center { text-align: center; }
.auth-links { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: .9375rem; }
.auth-links a { min-height: 44px; display: inline-flex; align-items: center; }

/* Landing (public, indexable) */
.landing { display: flex; flex-direction: column; gap: 28px; }
.landing-hero { background: var(--navy); color: #fff; border-radius: 24px; padding: 28px 22px; display: flex; flex-direction: column; gap: 14px; }
.landing-hero h2 { font-size: clamp(1.6rem, 5vw, 2.3rem); }
.landing-hero p { color: var(--on-navy-muted); max-width: 52ch; font-size: 1.05rem; }
.landing-hero .row .btn-outline { background: transparent; color: #fff; border-color: #fff; }
.features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.features li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.features .icon { color: var(--navy); width: 26px; height: 26px; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.site-footer { font-size: .875rem; color: var(--muted); text-align: center; padding: 8px 0 0; }

/* Password meter (lib/password_policy.php + assets/password_meter.js) */
.pw-meter { display: flex; flex-direction: column; gap: 4px; margin-top: -6px; }
.pw-bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.pw-fill { height: 100%; width: 0; border-radius: 4px; }
.pw-fill.weak { width: 25%; background: var(--err-fg); }
.pw-fill.fair { width: 50%; background: #B07A12; }
.pw-fill.good { width: 75%; background: var(--navy); }
.pw-fill.strong { width: 100%; background: var(--ok-fg); }
.pw-label { font-size: .875rem; font-weight: 700; }
.pw-label.weak { color: var(--err-fg); }
.pw-label.fair { color: var(--warn-fg); }
.pw-label.good { color: var(--navy); }
.pw-label.strong { color: var(--ok-fg); }
.pw-hint { font-size: .875rem; color: var(--muted); }
.pw-match { font-size: .875rem; font-weight: 600; min-height: 1.3em; margin-top: -6px; }
.pw-match.ok { color: var(--ok-fg); }
.pw-match.bad { color: var(--err-fg); }

@media (prefers-reduced-motion: no-preference) {
    .btn, .tile, .icon-btn, .side-nav a { transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
}
@media (max-width: 380px) {
    .row2 { grid-template-columns: 1fr; }
    .btn-row { grid-template-columns: 1fr; }
}
@media (forced-colors: active) {
    .btn, .chip, .tile, .card { border: 1px solid CanvasText; }
}
@media print {
    .tab-bar, .side-nav, .app-header .icon-btn, .btn { display: none !important; }
    body.has-nav { padding-left: 0; }
}
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
table.data th.row-head { text-transform: none; letter-spacing: 0; font-size: .9375rem; background: none; color: var(--ink); font-weight: 700; white-space: normal; border-top: 1px solid var(--line); }
.content > * { min-width: 0; max-width: 100%; }
/* Admin table becomes stacked cards on phones (no sideways scrolling). */
@media (max-width: 640px) {
    table.data thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    table.data, table.data tbody, table.data tr, table.data th.row-head, table.data td { display: block; width: 100%; }
    table.data tr { padding: 12px 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
    table.data tr:first-child { border-top: 0; }
    table.data th.row-head, table.data td { padding: 0; border: 0; }
    table.data .rate-form input { flex: 1; width: auto; }
}
table.data .rate-label { font-size: .875rem; font-weight: 600; white-space: nowrap; }
@media (min-width: 641px) { table.data .rate-label { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }
@media (max-width: 640px) { table.data .rate-form { flex-wrap: wrap; } }
.send-summary { margin: 0; display: flex; flex-direction: column; gap: 8px; background: var(--bg); border-radius: 12px; padding: 12px 14px; }
.send-summary div { display: grid; grid-template-columns: 76px 1fr; gap: 8px; }
.send-summary dt { font-weight: 700; color: var(--muted); font-size: .875rem; }
.send-summary dd { margin: 0; overflow-wrap: anywhere; font-size: .9375rem; }

/* On/off switch (checkbox with role="switch"); 3:1 borders, 48px row */
.switch-row { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.switch-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.switch-label { font-weight: 700; }
input.switch {
    appearance: none; -webkit-appearance: none; flex: none; margin: 4px 0 0;
    width: 56px; height: 32px; border-radius: 999px; cursor: pointer; position: relative;
    background: var(--surface); border: 2px solid var(--control);
}
input.switch::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
    background: var(--control);
}
input.switch:checked { background: var(--navy); border-color: var(--navy); }
input.switch:checked::after { left: 27px; background: #fff; }
@media (prefers-reduced-motion: no-preference) { input.switch::after { transition: left .15s ease; } }
@media (forced-colors: active) { input.switch { appearance: auto; -webkit-appearance: auto; width: 22px; height: 22px; } input.switch::after { display: none; } }
