/* Apex theme layer (loaded after styles.css). Light = style A "Clean Pro"; dark = style C "Premium Dark". Shared layout, Inter. */
html{--font:Inter,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif}
html[data-theme=light]{--r:#d81f26;--k:#0f0f10;--bg:#ffffff;--surface:#ffffff;--surface2:#f5f5f6;--line:#ececee;--line2:#f3f3f4;--text:#0f0f10;--muted:#6b6b73;--faint:#8a8a92;--accent:#d81f26;--accent-fg:#d81f26;--accent-soft:#fdeced;--chip:#f3f3f4;--chip-on:#0f0f10;--chip-on-fg:#fff;--radius:10px;--radius-lg:12px;--head:#ffffff;--nav:#ffffff}
html[data-theme=dark]{--r:#e5484d;--k:#0e0f12;--bg:#0e0f12;--surface:#17191e;--surface2:#22242b;--line:#23252c;--line2:#1d1f25;--text:#ecebef;--muted:#8b8d96;--faint:#6f717b;--accent:#e5484d;--accent-fg:#ff6b70;--accent-soft:#ff5a5f1c;--chip:#22242b;--chip-on:#ecebef;--chip-on-fg:#0e0f12;--radius:14px;--radius-lg:20px;--head:#0e0f12;--nav:#17191ecc;color-scheme:dark}
html body,html button,html input,html select,html textarea,html table,html .btn,html nav button,html .chips button,html .tabsw button,html .rsw button,html .av{font-family:var(--font)!important;letter-spacing:-.005em}
html body{background:var(--bg);color:var(--text);-webkit-font-smoothing:antialiased}
html .phone{background:var(--bg);box-shadow:none}
html h1{font-weight:700;letter-spacing:-.02em}html h2,html h3{font-weight:650;letter-spacing:-.01em}
html .sub,html .tx div{color:var(--muted)}html .sec{color:var(--faint);font-weight:600;letter-spacing:.06em}
/* header */
html header{background:var(--head);border-bottom:1px solid var(--line)}
html header img{background:transparent;padding:0;border-radius:0}
html[data-theme=dark] header{border-bottom-color:transparent}html[data-theme=dark] header img,html[data-theme=dark] .authwrap .brand img,html[data-theme=dark] .auth .logo,html[data-theme=dark] img[src*='logo']{filter:invert(1) hue-rotate(180deg) saturate(1.4)}
html[data-theme=dark] .authwrap .brand img{background:transparent}
html .av{background:var(--accent);color:#fff;font-weight:600}
html[data-theme=dark] .av{background:var(--surface2);color:var(--accent-fg);box-shadow:inset 0 0 0 1.5px #ff5a5f55}
#thtog{width:34px;height:34px;border-radius:50%;border:1px solid var(--line);background:var(--surface);color:var(--muted);display:grid;place-items:center;cursor:pointer;margin-left:auto;margin-right:8px;font-size:17px;flex:none;padding:0}
#thtog:hover{color:var(--text)}#thtog.float{position:fixed;top:12px;right:12px;z-index:50;margin:0}
header>#thtog+*{margin-left:0}
/* cards / surfaces */
html .card{background:var(--surface);border:1px solid var(--line);box-shadow:none;border-radius:var(--radius-lg)}
html[data-theme=dark] .card{border-color:var(--line)}
html .ic{background:var(--accent-soft);color:var(--accent-fg);font-size:20px}
html[data-theme=light] .ic{background:transparent;color:var(--muted);width:32px;height:32px}
html .hero{background:var(--surface);color:var(--text);border:1px solid var(--line)}html .hero:after{opacity:.12}html .hero small{color:var(--faint)}
html .note{background:var(--surface);color:var(--muted);border:1px solid var(--line);border-left:3px solid var(--accent)}
html .bub{background:var(--surface);border:1px solid var(--line)}html .bub.me{background:var(--accent);color:#fff;border-color:transparent}
html table{background:var(--surface);border:1px solid var(--line)}html th{background:var(--surface2);color:var(--muted);font-weight:600;text-transform:uppercase;font-size:11px;letter-spacing:.05em}html th,html td{border-bottom-color:var(--line)}
/* controls */
html .btn{border-radius:var(--radius);font-weight:600;background:var(--accent);color:#fff}
html .btn.ghost{background:var(--surface);color:var(--text);border:1px solid var(--line)}
html[data-theme=dark] .btn.ghost{background:var(--surface2);border-color:var(--line)}
html .btn:disabled{opacity:.45}
html input,html select,html textarea{background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:var(--radius)}
html[data-theme=dark] input,html[data-theme=dark] select,html[data-theme=dark] textarea{background:var(--surface2);border-color:#2c2e36}
html input:focus,html select:focus,html textarea:focus{outline:2px solid color-mix(in srgb,var(--accent) 45%,transparent);outline-offset:0;border-color:var(--accent)}
html input::placeholder,html textarea::placeholder{color:var(--faint)}
html .fl{color:var(--muted);font-weight:600}
html .chips button,html .tabsw{background:var(--chip);color:var(--text)}html .chips .on,html .tabsw .on{background:var(--chip-on);color:var(--chip-on-fg)}
html .tabsw button{color:var(--muted)}html .tabsw .on{color:var(--chip-on-fg)}
html .pill{border-radius:99px;font-weight:700}
html[data-theme=dark] .pill{background:var(--accent-soft);color:var(--accent-fg)}
html .msg{color:var(--accent-fg)}html .ok,html .msg.ok{color:#2f9e5b}html[data-theme=dark] .ok{color:#5fd08a}
html a{color:var(--accent-fg)}
html .demo{background:var(--accent-soft);color:var(--accent-fg)}
html .rsw{background:var(--surface)}html[data-theme=dark] .rsw{background:var(--surface2)}
/* nav: mobile bottom bar; dark = floating rounded bar (style C) */
html nav{background:var(--nav);border-top:1px solid var(--line)}
html nav button{color:var(--faint);font-weight:500}html nav .on{color:var(--accent-fg)}
html nav button span{font-size:22px;line-height:1;display:grid;place-items:center;height:24px}
html[data-theme=dark] .phone>nav{margin:0 12px 14px;border:1px solid #262830;border-radius:24px;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);padding:8px 0}
/* icons */
.ico{display:inline-block;vertical-align:-.14em;flex:none;stroke-width:1.9}
button .ico,.btn .ico{vertical-align:-.16em}
.btn .ico:first-child:not(:last-child),.linkbtn .ico:first-child:not(:last-child){margin-right:.3em}
html .thumb:after{content:'';background:center/22px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='m7 4 13 8-13 8z'/%3E%3C/svg%3E")}
/* desktop */
@media (min-width:900px){
 html body{background:var(--bg)}
 html .phone.app>nav{background:var(--bg);border-right:1px solid var(--line);margin:0;border-radius:0;border-top:0;backdrop-filter:none}
 html nav button{color:var(--muted);font-weight:500}html nav button span{font-size:20px;width:24px;height:24px}
 html nav button:hover{background:var(--surface2)}html nav .on{background:var(--accent-soft);color:var(--accent-fg)}html nav .on:hover{background:var(--accent-soft)}
 html[data-theme=dark] .phone.app>nav{border-right-color:var(--line)}
 html .phone.authpage{background:var(--bg)}
 html[data-theme=dark] .phone.authpage{background:radial-gradient(circle at 85% 12%,#e5484d22 0 220px,transparent 221px),var(--bg)}
 html .authwrap{background:var(--surface);border:1px solid var(--line);box-shadow:0 20px 60px #0000001f}
 html .authwrap .brand{background:var(--surface2);color:var(--text)}html .authwrap .brand p{color:var(--muted)}html .authwrap .brand:after{opacity:.14}
 html[data-theme=light] .authwrap .brand{background:#0f0f10;color:#fff}html[data-theme=light] .authwrap .brand p{color:#b5b5bb}html[data-theme=light] .authwrap .brand img{background:#fff;padding:8px;border-radius:12px}
}
html[data-theme] .lrot{background:transparent!important}html[data-theme] header img{background:transparent!important}
html[data-theme=light] .lrot.big{background:#fff!important}
html[data-theme=light]{--mut:#55555c;--field:#c9c9cf;--rt:#b3141b}
html[data-theme=dark]{--mut:#9a9ca6;--field:#3a3c45;--rt:#ff6b70}
html[data-theme=dark] .cday.today{background:#ff5a5f0a!important}html[data-theme=light] .cday.today{background:#fdf5f5}
/* Square checkout confirm dialog + admin checkout section */
dialog.sqco-confirm{border:1px solid var(--line);border-radius:var(--radius-lg);padding:20px;max-width:min(380px,calc(100vw - 32px));width:100%;background:var(--surface);color:var(--text);box-shadow:0 24px 64px #0000004d;font:14px var(--font)}
dialog.sqco-confirm::backdrop{background:#0008;backdrop-filter:blur(2px)}
dialog.sqco-confirm h2{display:flex;align-items:center;gap:8px;margin:0 0 12px;font-size:18px;font-weight:700}dialog.sqco-confirm h2 .ico{color:var(--accent-fg);font-size:20px}
.sqco-grid{display:grid;grid-template-columns:auto 1fr;gap:8px 14px;margin-bottom:16px;align-items:baseline}.sqco-grid b{display:flex;align-items:center;gap:6px;color:var(--muted);font-weight:600}.sqco-grid .ico{font-size:15px}
.sqco-note{display:flex;gap:8px;align-items:flex-start;margin:0 0 14px!important;padding:10px 12px;border-radius:var(--radius);background:var(--surface2);color:var(--muted)}.sqco-note .ico{flex:none;margin-top:2px}
.sqco-act{display:flex;gap:8px;justify-content:flex-end}
.sqco-admin .sec{display:flex;align-items:center;gap:6px}.sqco-admin .card{background:var(--surface);border:1px solid var(--line)}
/* ---- Audi part A fixes (2026-10-20): contrast to WCAG AA (4.5:1 text, 3:1 large/UI) ---- */
/* AA-safe red for filled buttons / bubbles (white text 5.6:1); light red text 5.0:1, dark red text on dark 5.3:1+ */
html[data-theme=light]{--faint:#6b6b73;--muted:#5f5f67;--accent-fg:#c62828}
html[data-theme=dark]{--faint:#9a9ca5;--muted:#a3a5ae;--accent-fg:#ff7b7f}
html .btn:not(.ghost),html .bub.me,html .rsw .on,html .chips .on.red,html .seg b.on{background:#c62828!important;color:#fff!important;border-color:#c62828!important}
html[data-theme=dark] .btn:not(.ghost):hover{background:#b71c1c!important}
html .btn.ghost.danger{color:#b3261e!important}
/* the outer .bwrap.me is a layout wrapper, not a bubble: only the inner bubble is red */
html .bwrap.me{background:none!important;color:inherit!important;border-radius:0;padding:0;max-width:none}
html .btime,html .bwho{color:var(--muted)!important}
/* family Home "Getting started": ghost button on a light hero */
html .hacts .btn.ghost{background:var(--surface2)!important;color:var(--text)!important;border:1px solid var(--line)!important}
/* sign-in / sign-up segmented tabs: the active tab must stand out in dark */
html[data-theme=dark] .tabsw{background:var(--surface2)!important}
html[data-theme=dark] .tabsw button{color:var(--muted)!important;background:transparent!important}
html[data-theme=dark] .tabsw button.on{background:#ecebef!important;color:#0e0f12!important}
/* dark header / auth logo: light backing so the red+black mark is clearly visible (no colour inversion) */
html[data-theme=dark] header img,html[data-theme=dark] .lrot.hdr img,html[data-theme=dark] .authwrap .brand img,html[data-theme=dark] .auth .logo,html[data-theme=dark] img[src*='logo']{filter:none!important}
html[data-theme=dark] .lrot.hdr,html[data-theme=dark] .lrot.big,html[data-theme=dark] header>img,html[data-theme=dark] .auth .logo,html[data-theme=dark] .authwrap .brand img{background:#fff!important;border-radius:8px!important;padding:3px!important;box-sizing:border-box}
/* athlete chips must not run under the floated sport logo; composer Send never wraps */
html main .chips{clear:right}
html #mf .btn{white-space:nowrap;flex:none}html #mf input{min-width:0;flex:1}
/* small print */
html .build{color:var(--muted)!important}html .demo{color:#b71c1c}html[data-theme=dark] .demo{color:#ff9a9d}
html[data-theme=light] nav button{color:#5f5f67}html[data-theme=light] nav button.on{color:#c62828}
html .hero small{color:var(--faint)!important}
/* libraries / studio */
html[data-theme=light] header .hs,html[data-theme=light] header .szr,html[data-theme=light] header .szr span{color:var(--muted)!important}
html[data-theme=dark] header .szr,html[data-theme=dark] header .szr span{color:#c9cad1!important}
html .tabs .on{background:#c62828!important;color:#fff!important;border-color:#c62828!important}
html[data-theme=dark] .seg b{color:#d0d0d0!important}
/* dark: filled reds use an AA red (white text 5:1); red text uses the lighter --accent-fg */
html[data-theme=dark]{--r:#cf2e2e;--accent:#cf2e2e}
html[data-theme=dark] .seg b.on,html[data-theme=dark] .sp.on,html[data-theme=dark] .tool.on{background:#c62828!important;color:#fff!important}
html[data-theme=dark] .rsw button:not(.on){color:var(--accent-fg)!important}
/* library pages, light: header title was white on white */
html[data-theme=light] .phone>header,html[data-theme=light] body>header{color:var(--text)!important}
html[data-theme=dark] .sportlogo{background:#fff!important;filter:none!important}
/* dark: danger-coloured text/links ≥4.5:1 on every dark surface (#ff8a8a on #17191e = 7.4:1, on #22242b = 6.6:1) */
html[data-theme=dark]{--danger-fg:#ff8a8a}
html[data-theme=dark] .btn.ghost.danger,html[data-theme=dark] a.danger,html[data-theme=dark] .linkbtn.danger,html[data-theme=dark] .dz summary,html[data-theme=dark] .amore summary,
html[data-theme=dark] .pbhrerr,html[data-theme=dark] .cchip.clash,html[data-theme=dark] .st.no,html[data-theme=dark] .toast.bad a,
html[data-theme=dark] [style*="color:#c0392b"],html[data-theme=dark] [style*="color:#8E1B1B"],html[data-theme=dark] [style*="color:#8e1b1b"],html[data-theme=dark] [style*="color:#a12622"],html[data-theme=dark] [style*="color:#b3261e"],html[data-theme=dark] [style*="color: rgb(192, 57, 43)"],html[data-theme=dark] [style*="color: rgb(142, 27, 27)"]{color:var(--danger-fg)!important}
html[data-theme=dark] .btn.ghost.danger{background:transparent!important;border-color:#ff8a8a66!important}
html[data-theme=dark] .st.no{background:#ff5a5f1f!important}
html[data-theme=dark] input[aria-invalid="true"]{border-color:var(--danger-fg)!important;outline-color:var(--danger-fg)}
html[data-theme=dark]{--rt:#ff8a8a}html[data-theme=dark] .linkbtn{color:var(--accent-fg)}
dialog.lrs{max-width:min(440px,calc(100vw - 32px))}dialog.lrs .cchip[aria-pressed="true"]{background:var(--chip-on);color:var(--chip-on-fg);border-color:var(--chip-on)}
.hero .hacts .btn .ico,.card .btn .ico{margin-right:4px;vertical-align:-2px}
.lrses{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;margin:2px 12px 2px 0;vertical-align:middle}
.lrlink{flex:0 0 32px;width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;padding:0;margin:0;position:static;color:var(--accent-fg)}.lrlink .ico{font-size:15px}
