/* Chosen Training Center portal. Minimal reset, then the design system. */
*, ::before, ::after { box-sizing: border-box; border: 0 solid #e2e8f0; }
html { line-height: 1.5; -webkit-text-size-adjust: 100%; height: 100%; -webkit-font-smoothing: antialiased; }
body { margin: 0; min-height: 100%; line-height: inherit; }
h1, h2, h3, h4, p, figure, fieldset, legend, ol, ul { margin: 0; padding: 0; }
h1, h2, h3, h4 { font-size: inherit; font-weight: inherit; }
ol, ul { list-style: none; }
a { color: inherit; text-decoration: inherit; }
b, strong { font-weight: 700; }
table { border-collapse: collapse; text-indent: 0; }
button, input, select, textarea { font: inherit; color: inherit; margin: 0; }
button { background: transparent; cursor: pointer; }
img, svg, video, canvas { display: block; max-width: 100%; }
summary { cursor: pointer; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
[hidden] { display: none !important; }
:root {
  --brand: #0369a1;
  --bg: #f3f6f9;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #4b5a70;
  --line: #e2e8f0;
  --ok: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
}

body { background: var(--bg); color: var(--ink); font-family: var(--font-geist-sans), system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 0.9375rem; }
a { color: inherit; }
h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.card > h2 { margin-bottom: 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 0.9rem; cursor: pointer; white-space: nowrap; text-decoration: none; min-height: 40px; }
.btn:hover { background: #f8fafc; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--brand) 88%, black); }
.btn-danger { color: var(--bad); }
.btn-sm { padding: 5px 10px; min-height: 32px; font-size: 0.8rem; border-radius: 8px; }
.btn-xl { padding: 18px 28px; font-size: 1.2rem; border-radius: 16px; min-height: 64px; }

.input { width: 100%; padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; font-size: 0.95rem; min-height: 40px; }
textarea.input { min-height: 140px; font-family: inherit; }
.label { display: block; font-size: 0.8rem; font-weight: 600; color: #334155; margin-bottom: 4px; }
.form { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); align-items: end; }
.form .wide { grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.check input { width: 18px; height: 18px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.74rem; font-weight: 650; background: #e2e8f0; color: #334155; white-space: nowrap; }
.badge.ok { background: #dcfce7; color: #166534; }
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.bad { background: #fee2e2; color: #991b1b; }
.badge.info { background: #e0f2fe; color: #075985; }

.tbl { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.tbl th { text-align: left; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid #eef2f6; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.scroll { overflow-x: auto; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.flash { padding: 11px 14px; border-radius: 12px; font-weight: 550; margin-bottom: 14px; }
.flash.ok { background: #dcfce7; color: #14532d; border: 1px solid #86efac; }
.flash.err { background: #fee2e2; color: #7f1d1d; border: 1px solid #fca5a5; }

.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.stat b { display: block; font-size: 1.6rem; line-height: 1.2; }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* App shell */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { background: #0f172a; color: #cbd5e1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side a.nav { display: block; padding: 9px 12px; border-radius: 9px; text-decoration: none; font-weight: 550; font-size: 0.92rem; }
.side a.nav:hover { background: #1e293b; color: #fff; }
.side .grp { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: #64748b; padding: 12px 12px 4px; }
.brandbar { border-left: 4px solid var(--brand); padding: 4px 10px; margin-bottom: 8px; color: #fff; font-weight: 700; line-height: 1.25; }
.main { padding: 24px 28px 60px; min-width: 0; }
.head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.grid2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.stack { display: grid; gap: 16px; }

.topbar, .tabbar, .agenda { display: none; }

/* ---------- Phones and small tablets ---------- */
@media (max-width: 860px) {
  body { font-size: 1rem; }
  .shell { display: block; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; top: 0; z-index: 30; background: #0f172a; color: #fff; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); border-bottom: 3px solid var(--brand); }
  .topbar b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .menubtn { background: #1e293b; color: #fff; border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 650; font-size: 0.95rem; min-height: 44px; }
  .side { display: none; position: fixed; inset: 0; top: calc(67px + env(safe-area-inset-top)); z-index: 40; height: auto; padding: 14px 14px calc(24px + env(safe-area-inset-bottom)); }
  html[data-menu="open"] .side { display: flex; }
  html[data-menu="open"] body { overflow: hidden; }
  .side a.nav, .side form button.nav { padding: 14px 12px !important; font-size: 1.05rem !important; }
  .brandbar { display: none; }
  .main { padding: 16px 14px calc(96px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -6px 20px -14px rgba(15, 23, 42, 0.4); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 58px; padding: 6px 2px; font-size: 0.72rem; font-weight: 600; color: var(--muted); text-decoration: none; }
  .tabbar a .ico { font-size: 1.25rem; line-height: 1; }
  .tabbar a.on { color: var(--brand); box-shadow: inset 0 3px 0 var(--brand); }

  h1 { font-size: 1.3rem; }
  .head { margin-bottom: 14px; }
  .card { padding: 14px; border-radius: 12px; }
  /* 16px inputs stop iOS from zooming the page on focus; 44px is a comfortable thumb target. */
  .input { font-size: 1rem !important; min-height: 46px !important; }
  .btn { min-height: 46px; }
  .btn-sm { min-height: 40px; padding: 8px 12px; font-size: 0.85rem; }
  .form { grid-template-columns: 1fr 1fr !important; }
  .form > .wide, .form > fieldset, .form > div { grid-column: 1 / -1; }
  .grid2 { grid-template-columns: 1fr !important; }
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat b { font-size: 1.3rem; }
  .row > .input { max-width: none !important; flex: 1 1 160px; }
  .scroll { -webkit-overflow-scrolling: touch; margin: 0 -14px; padding: 0 14px; }
  .scroll .tbl { min-width: 620px; }
  .tbl td, .tbl th { padding: 9px 8px; }
  .schedwrap { display: none; }
  .agenda { display: block; }
  .agenda h3 { font-size: 0.95rem; font-weight: 700; margin: 14px 0 6px; display: flex; justify-content: space-between; align-items: center; }
  .agenda .shift { font-size: 0.9rem; padding: 9px 10px; margin-bottom: 6px; }
  .agenda .today { color: var(--brand); }
  .pubcard { padding: 20px; border-radius: 16px; }
  .pub { padding: 14px 12px; place-items: start center; }
  .qr { max-width: 100%; }
}
@media (max-width: 420px) {
  .form { grid-template-columns: 1fr !important; }
}
/* Schedule grid */
.sched { display: grid; grid-template-columns: 150px repeat(7, minmax(104px, 1fr)); min-width: 900px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--line); gap: 1px; }
.sched > div { background: #fff; padding: 6px; min-height: 58px; }
.sched .hd { background: #f8fafc; font-weight: 650; font-size: 0.8rem; min-height: 0; padding: 8px; }
.sched .today { background: #f0f9ff; }
.shift { display: block; border-left: 4px solid var(--c, #64748b); background: color-mix(in srgb, var(--c, #64748b) 10%, white); border-radius: 6px; padding: 4px 6px; font-size: 0.76rem; line-height: 1.25; margin-bottom: 4px; text-decoration: none; }
.shift.draft { border-style: dashed; border-width: 1px 1px 1px 4px; border-color: var(--c, #64748b); background: #fff; }
.shift b { display: block; }

/* Month calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cal > * { background: #fff; padding: 6px; min-height: 92px; text-decoration: none; display: block; }
.cal .hd { min-height: 0; background: #f8fafc; font-size: 0.74rem; font-weight: 650; text-align: center; }
.cal .out { background: #f8fafc; color: #94a3b8; }
.cal .sel { box-shadow: inset 0 0 0 2px var(--brand); }
.cal .dnum { font-weight: 650; font-size: 0.82rem; }
.dot { display: block; font-size: 0.7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--c); padding-left: 4px; margin-top: 2px; }
@media (max-width: 640px) { .cal > * { min-height: 56px; padding: 4px; } .dot { font-size: 0; height: 5px; border-left-width: 14px; } }

/* Public pages */
.pub { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(160deg, color-mix(in srgb, var(--brand) 16%, #f3f6f9), #f3f6f9 55%); }
.pubcard { width: 100%; max-width: 440px; background: #fff; border-radius: 20px; border: 1px solid var(--line); padding: 28px; box-shadow: 0 12px 40px -18px rgba(15, 23, 42, 0.35); }
.logo { width: 56px; height: 56px; border-radius: 16px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; margin: 0 auto 12px; }
.qr { background: #fff; padding: 10px; border-radius: 12px; border: 1px solid var(--line); display: inline-block; line-height: 0; }
.qr svg { width: 100%; height: auto; display: block; }

@media print {
  .side, .noprint, .topbar, .tabbar, .agenda { display: none !important; }
  .schedwrap { display: block !important; }
  .shell { display: block; }
  body { background: #fff; }
  .card { border: 0; }
}

.payrow { grid-template-columns: minmax(200px, 1.2fr) minmax(160px, 1fr) minmax(220px, 2fr) auto; }
@media (max-width: 860px) { .payrow { grid-template-columns: 1fr !important; } }


/* Grid children must be allowed to shrink, otherwise a wide table stretches the whole page. */
.stack > *, .grid2 > *, .form > *, .shell > * { min-width: 0; }
.card { min-width: 0; max-width: 100%; }
main code { overflow-wrap: anywhere; }
main p, main td, main h1, main h2 { overflow-wrap: break-word; }

/* Additions for the PHP version */
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.side a.nav.on { background: #1e293b; color: #fff; }
.side .navbtn { display: block; width: 100%; text-align: left; background: none; border: 0; color: inherit; padding: 9px 12px; border-radius: 9px; font-weight: 550; font-size: 0.92rem; }
.side .navbtn:hover { background: #1e293b; color: #fff; }
.qr canvas, .qr img { width: 100% !important; height: auto !important; display: block; }
.kiosk { min-height: 100vh; color: #fff; display: grid; place-items: center; padding: 24px; transition: background .2s; background: #0f172a; }
.kiosk.ok { background: #166534; } .kiosk.bad { background: #991b1b; }
/* ---------- Accessibility ---------- */
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: #0f172a; color: #fff; padding: 12px 16px; border-radius: 0 0 10px 10px; font-weight: 700; text-decoration: underline; }
.skip:focus { top: 0; }
main:focus { outline: none; }
:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 2px; }
.side :focus-visible, .topbar :focus-visible, .kiosk :focus-visible { outline-color: #fde047; }
.tbl th { color: #334155; }
/* Text for screen readers only. */
.sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.scroll, .tbl th, .tbl td, .card { position: relative; } /* keeps screen-reader-only text inside its scrolling box */
/* Contrast: text at least 4.5:1, and the edges of fields and buttons at least 3:1 against the page. */
.input { border-color: #76839a; }
.btn { border-color: #8a96a8; }
.btn-primary { border-color: var(--brand); }
.check input { accent-color: var(--brand); }
.side .btn { color: var(--ink); }
.side .grp { color: #a3b1c6; }
.cal .out { color: #55627a; }
.tabbar a { color: #3d4a5e; }
/* Targets big enough to tap or click (at least 24 by 24 pixels; most are 40 or more). */
summary { min-height: 24px; }
.sched .addday { float: right; color: var(--brand); display: inline-grid; place-items: center; min-width: 26px; min-height: 26px; margin: -4px -4px -4px 4px; border-radius: 6px; font-weight: 800; text-decoration: none; }
.sched .addday:hover { background: #e0f2fe; }
.sched .r { display: contents; }
.sched .r > div { background: #fff; padding: 6px; min-height: 58px; }
.sched .r > .hd { background: #f8fafc; min-height: 0; padding: 8px; }
.sched .r > .today { background: #f0f9ff; }
.agenda h2 { font-size: 0.95rem; font-weight: 700; margin: 14px 0 6px; display: flex; justify-content: space-between; align-items: center; }
.pubcard form > a { padding: 6px 0; }
/* On narrow screens and at larger text sizes, long button labels wrap instead of pushing the page sideways. */
@media (max-width: 860px) { .btn { white-space: normal; text-align: center; } }
html.a11y-t2 .btn, html.a11y-t3 .btn { white-space: normal; text-align: center; }
/* Figures and badges that open the area they describe. */
a.statlink { display: block; text-decoration: none; color: inherit; }
a.statlink:hover { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
a.statlink .statgo { display: block; color: var(--brand); font-weight: 600; text-decoration: underline; }
a.golink { color: inherit; text-decoration: underline; text-underline-offset: 2px; display: inline-block; min-height: 24px; }
a.golink:hover { color: var(--brand); }
a.golink .badge { text-decoration: none; cursor: pointer; }
a.golink:hover .badge { box-shadow: 0 0 0 2px var(--brand); }
/* "You are about to be signed out" notice. */
.idlebox { border: 3px solid #0f172a; border-radius: 14px; padding: 20px; max-width: min(420px, calc(100vw - 32px)); color: var(--ink); background: #fff; }
.idlebox::backdrop { background: rgba(15, 23, 42, 0.6); }
.idlebox h2 { margin-bottom: 8px; }
.idlebox .row { margin-top: 14px; }
.pubfoot { text-align: center; padding: 14px; font-size: 0.85rem; }
.pubfoot a { text-decoration: underline; color: #334155; }
main.pub + .pubfoot { margin-top: -56px; position: relative; }

/* Help */
.helpfab { position: fixed; right: 16px; bottom: 16px; z-index: 35; }
.helpfab > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; float: right; background: #0f172a; color: #fff; border-radius: 999px; padding: 10px 16px; font-weight: 700; box-shadow: 0 6px 18px -6px rgba(15, 23, 42, 0.6); min-height: 44px; }
.helpfab > summary::-webkit-details-marker { display: none; }
.helpfab > summary span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #fff; color: #0f172a; font-weight: 800; }
.helpfab[open] > summary { border-radius: 12px 12px 0 0; }
.helppanel { clear: both; width: min(420px, calc(100vw - 32px)); max-height: min(70vh, 560px); overflow-y: auto; background: #fff; color: var(--ink); border: 2px solid #0f172a; border-radius: 12px 0 12px 12px; padding: 16px; box-shadow: 0 18px 40px -16px rgba(15, 23, 42, 0.55); }
.helppanel h2 { margin-bottom: 6px; }
.helppanel ul, .helptopic ul { list-style: disc; padding-left: 20px; margin: 8px 0; display: grid; gap: 6px; }
.helppanel a, .helptopic a, .helplist a { text-decoration: underline; }
.helplist { list-style: disc; padding-left: 20px; columns: 2 220px; display: block; }
.helplist li { margin: 4px 0; break-inside: avoid; }
.helptopic:target { box-shadow: 0 0 0 3px var(--brand); }
@media (max-width: 860px) { .helpfab { bottom: calc(70px + env(safe-area-inset-bottom)); right: 10px; } }

/* Text size: everything is sized relative to the root, so this scales the whole page. */
html.a11y-t1 { font-size: 112.5%; }
html.a11y-t2 { font-size: 125%; }
html.a11y-t3 { font-size: 150%; }
html.a11y-t2 .shell, html.a11y-t3 .shell { grid-template-columns: 280px 1fr; }

/* High contrast (also follows the device setting). */
html.a11y-contrast { --muted: #1f2937; --line: #475569; --bg: #ffffff; --ink: #000000; }
html.a11y-contrast body { --brand: #0b3a53 !important; }
html.a11y-contrast .card, html.a11y-contrast .stat, html.a11y-contrast .input, html.a11y-contrast .btn { border-color: #0f172a; border-width: 2px; }
html.a11y-contrast .badge { border: 1px solid currentColor; background: #fff; color: #000; }
html.a11y-contrast .badge.ok { color: #14532d; } html.a11y-contrast .badge.bad { color: #7f1d1d; } html.a11y-contrast .badge.warn { color: #713f12; } html.a11y-contrast .badge.info { color: #0c4a6e; }
html.a11y-contrast .shift, html.a11y-contrast .dot { background: #fff; color: #000; }
html.a11y-contrast main a:not(.btn), html.a11y-links main a:not(.btn):not(.shift), html.a11y-links .pubcard a:not(.btn) { text-decoration: underline; }
@media (prefers-contrast: more) { :root { --muted: #1f2937; --line: #475569; } .card, .stat, .input, .btn { border-color: #334155; } }

/* Easier reading. */
html.a11y-spacing body { line-height: 1.8; letter-spacing: 0.03em; word-spacing: 0.12em; }
html.a11y-spacing p, html.a11y-spacing li { margin-bottom: 0.5em; }

/* Reduced motion (also follows the device setting). */
html.a11y-motion *, html.a11y-motion *::before, html.a11y-motion *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }