/* RSP Ledger: a simple finishing flag, drawn for small screens. */
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
.brand-mark::before, .brand-mark::after { content: none; }
.brand-mark :is(img, svg) { display: block; width: 100%; height: 100%; }
.identity { gap: 11px; padding: 20px 19px; }
.brand-copy strong { font-size: 19px; font-weight: 720; letter-spacing: -.7px; line-height: 1.2; }
.brand-copy strong .brand-word-secondary { display: inline; font-size: inherit; font-weight: 430; letter-spacing: inherit; color: var(--ink); }
.brand-copy > span { display: none; }
/* The identity stays visible when a mode hides the sidebar. */
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .page-heading h1::before { content:none; display:none; }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .header-flag { display:flex; width:36px; height:36px; min-width:36px; }

/* The open sidebar carries the identity; retain only its toggle in the header. */
html[data-experience=raceday] .app-shell:not(.filters-hidden) .page-heading > :is(.header-flag,div) { display:none; }

#auth-screen {
  --auth-ink: #1b2835;
  --auth-muted: #687482;
  --auth-rule: #273b511a;
  --auth-field: #f7f9fb;
  --auth-accent: #286d8a;
  padding: 24px;
  overflow-y: auto;
  background: radial-gradient(ellipse at 50% 0, #dfeaf45c, transparent 64%), #f4f6f8;
  color: var(--auth-ink);
}
#auth-screen .auth-wrap {
  width: min(416px, 100%);
  margin: auto;
  padding: 44px 36px 40px;
  text-align: center;
  border: 1px solid #ffffff;
  border-radius: 26px;
  background: linear-gradient(145deg, #fffffffa, #ffffffc9);
  box-shadow: 0 18px 54px #24384d0b, 0 2px 8px #24384d05, inset 0 0 0 1px #233c5105;
}
#auth-screen .auth-logo { display: flex; flex-direction: column; gap: 19px; align-items: center; margin-bottom: 31px; }
#auth-screen .auth-logo .brand-mark { width: 72px; height: 72px; min-width: 72px; }
#auth-screen .auth-logo b { font-size: 21px; line-height: 1.2; font-weight: 720; letter-spacing: -.65px; }
#auth-screen .auth-logo b span { font-weight: 430; letter-spacing: inherit; }
#auth-screen h1 { margin: 0 0 9px; font-size: 22px; line-height: 1.25; font-weight: 600; letter-spacing: -.5px; }
#auth-screen p { color: var(--auth-muted); font-size: 14px; line-height: 1.6; }
#auth-screen #login-form { text-align: left; }
#auth-screen label { display: block; margin: 21px 0 7px; color: var(--auth-ink); font-size: 12px; font-weight: 570; }
#auth-screen input {
  display: block;
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--auth-rule);
  border-radius: 11px;
  color: var(--auth-ink);
  background: var(--auth-field);
  outline: none;
  font-size: 16px;
  line-height: 1.4;
  box-shadow: inset 0 1px 2px #233c5103;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
#auth-screen input:focus { border-color: var(--auth-accent); box-shadow: 0 0 0 3px #3f8aa519; }
#auth-screen .primary {
  width: 100%;
  margin: 24px 0 0;
  padding: 12px 16px;
  border: 1px solid #ffffffdc;
  border-radius: 14px;
  background: linear-gradient(145deg,#e2f7f9d9,#acd8e5b8);
  box-shadow: 0 8px 28px #29465b0e,inset 0 1px 0 #fffffff2,inset 0 -1px 0 #ffffff38;
  color: #205b70;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  transition: filter 140ms ease, opacity 140ms ease, transform 140ms ease;
}
#auth-screen .primary:hover:not(:disabled) { filter: brightness(1.035); }
#auth-screen .primary:active:not(:disabled) { transform: translateY(1px); }
#auth-screen .primary:disabled { opacity: .65; cursor: wait; }
#auth-screen .primary:focus-visible, #auth-screen #retry-load:focus-visible { outline: 3px solid #3f8aa54d; outline-offset: 3px; }
#auth-screen .auth-error { margin: 12px 0 0; min-height: 0; font-size: 13px; }
#auth-screen .auth-error:empty { display: none; }
#auth-screen #login-error:not(:empty) + .primary { margin-top: 16px; }
#auth-screen #loading-section { animation: ledger-arrive 220ms ease-out both; }
#auth-screen #loading-section h1 { font-size: 22px; letter-spacing: -.5px; }
#auth-screen #load-message { margin: 0; font-size: 13px; min-height: 42px; }
#auth-screen .load-track {
  position:relative; height:10px; padding:2px; margin:24px 0 0; border-radius:999px;
  border:1px solid #ffffffd9; background:linear-gradient(180deg,#b9cdd63b,#ffffff8c);
  box-shadow:inset 0 1px 3px #1e425b18,0 1px 0 #ffffff,0 3px 16px #4da1be13;
}
#auth-screen .load-track i {
  position:relative; width:0; border-radius:999px; overflow:hidden;
  background:linear-gradient(90deg,#2d7b94 0%,#48b3be 48%,#8db5ea 100%);
  box-shadow:inset 0 1px 0 #ffffff7a,0 0 8px #61bfc65c;
  transition:width 560ms cubic-bezier(.2,.7,.3,1);
}
#auth-screen .load-track i::after {
  content:""; position:absolute; inset:0; border-radius:inherit;
  background:linear-gradient(105deg,transparent 25%,#ffffffa8 50%,transparent 75%);
  transform:translateX(-100%); animation:ledger-load-glint 1800ms ease-in-out infinite;
}
@keyframes ledger-load-glint { to { transform:translateX(100%); } }
html[data-theme=dark] #auth-screen .load-track { border-color:#bfdbea29; background:linear-gradient(180deg,#0e1d2c,#31445666); box-shadow:inset 0 1px 3px #0005,0 1px 0 #ffffff0a,0 2px 18px #59bbd211; }
#auth-screen .auth-wrap:has(#loading-error:not(:empty)) .load-track i::after { animation:none; opacity:0; }
#auth-screen #retry-load { margin-top: 20px; border-radius: 10px; color: var(--auth-ink); background: var(--auth-field); border-color: var(--auth-rule); }
#auth-screen .auth-wrap:has(#loading-section:not([hidden])) .load-track { width: min(232px,100%); margin-inline: auto; }
#auth-screen .auth-wrap:has(#loading-section:not([hidden])) .ledger-glyph { animation: ledger-trace 900ms cubic-bezier(.2,.7,.3,1) both; }
#auth-screen .auth-wrap:has(#loading-section:not([hidden])) .ledger-row { animation-delay: 120ms; }
#auth-screen .auth-wrap:has(#loading-section:not([hidden])) .ledger-signal { animation-delay: 240ms; }
#auth-screen .auth-wrap:has(#loading-error:not(:empty)) .ledger-glyph { animation: none; }

html[data-theme=dark] #auth-screen {
  --auth-ink: #edf2f7;
  --auth-muted: #9aa8b6;
  --auth-rule: #c8deef23;
  --auth-field: #18212a;
  --auth-accent: #8bd6ed;
  background: radial-gradient(ellipse at 50% 0, #243d5352, transparent 64%), #10161d;
}
html[data-theme=dark] #auth-screen .auth-wrap { border-color: #bcd6ee19; background: linear-gradient(145deg, #202c37f5, #1a232cf2); box-shadow: 0 18px 54px #00000026, inset 0 1px 0 #ffffff06; }
html[data-theme=dark] #auth-screen .auth-error { color: #ff9eac !important; }
@keyframes ledger-trace { from { stroke-dasharray: 1; stroke-dashoffset: 1; opacity: .2; } to { stroke-dasharray: 1; stroke-dashoffset: 0; opacity: 1; } }
@keyframes ledger-arrive { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 480px) {
  #auth-screen { padding: 20px; }
  #auth-screen .auth-wrap { padding: 28px; border-radius: 23px; }
  #auth-screen .auth-logo b { font-size: 21px; }
  #auth-screen .auth-logo .brand-mark { width: 64px; height: 64px; min-width: 64px; }
  #auth-screen h1 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  #auth-screen *, #auth-screen *::before, #auth-screen *::after { animation: none !important; transition: none !important; }
}

/* Shared layout and liquid-glass materials across every ledger view. */
html:is([data-experience=raceday],[data-experience=pricing]) {
  --ink:#202631; --muted:#6b7380; --accent:#356dcc; --accent-soft:#356dcc0d;
  --positive:#25805e; --negative:#b94858;
  --surface:#fff; --surface2:#f4f6f8; --line:#25334b0d; --line-strong:#25334b19;
  --rd-ink:var(--ink); --rd-muted:var(--muted); --rd-rule:var(--line);
  --rd-panel:linear-gradient(145deg,#ffffffa8,#ffffff57); --rd-control:linear-gradient(150deg,#ffffffd9,#ffffff6b);
  --rd-table:#ffffffad; --rd-stroke:#ffffffbc; --rd-shadow:0 8px 28px #29465b0e,inset 0 1px 0 #fffffff2,inset 0 -1px 0 #ffffff38;
  --ledger-canvas:radial-gradient(ellipse at 1% 2%,#a8d7df 0%,transparent 53%),radial-gradient(ellipse at 100% 0%,#b9c9ed 0%,transparent 52%),radial-gradient(ellipse at 83% 105%,#eadbcc 0%,transparent 48%),radial-gradient(ellipse at 0% 100%,#bfe1d7 0%,transparent 46%),#e9eff5; --ledger-shell:#f0f7fc57; --ledger-header:linear-gradient(125deg,#f4fbfff2,#edf2fff0);
  --ledger-selected:linear-gradient(145deg,#fffffff2,#ffffff85); --ledger-selected-shadow:0 3px 10px #29475c18,inset 0 1px 0 #fff,inset 0 -1px 0 #ffffff8a;
}
html:is([data-experience=raceday],[data-experience=pricing])[data-theme=dark] {
  --ink:#edf0f5; --muted:#9ca6b5; --accent:#87b3fc; --accent-soft:#87b3fc12;
  --positive:#79d3aa; --negative:#f69ba7;
  --surface:#1e2530; --surface2:#252d39; --line:#dce7fa0c; --line-strong:#dce7fa1a;
  --rd-panel:linear-gradient(145deg,#49617a75,#24354c80); --rd-control:linear-gradient(145deg,#aac8de38,#30455d8a);
  --rd-table:#17283bd1; --rd-stroke:#d8ecfa30; --rd-shadow:0 8px 28px #00000024,inset 0 1px 0 #ffffff24,inset 0 -1px 0 #ffffff07;
  --ledger-canvas:radial-gradient(ellipse at 0% 0%,#1c5261 0%,transparent 56%),radial-gradient(ellipse at 100% 0%,#3b4776 0%,transparent 54%),radial-gradient(ellipse at 80% 100%,#3e354d 0%,transparent 48%),#101c2a; --ledger-shell:#14263b69; --ledger-header:linear-gradient(125deg,#243d50f5,#25334bf5);
  --ledger-selected:linear-gradient(145deg,#c0ddec4a,#779ebd2e); --ledger-selected-shadow:0 3px 10px #0002,inset 0 1px 0 #ffffff3b;
}
html:is([data-experience=raceday],[data-experience=pricing]) body {
  padding:18px; background:var(--ledger-canvas); -webkit-font-smoothing:antialiased;
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Text","Helvetica Neue",sans-serif;
}
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell {
  max-width:1840px; width:100%; margin-inline:auto; border-radius:24px; border:1px solid var(--rd-stroke);
  background:var(--ledger-shell); box-shadow:0 20px 64px #18375022,0 2px 8px #18375008,inset 0 1px 0 #ffffffc7;
  backdrop-filter:none; -webkit-backdrop-filter:none;
}
html:is([data-experience=raceday],[data-experience=pricing])[data-theme=dark] .app-shell { background:var(--ledger-shell); box-shadow:0 16px 56px #0002; }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .main-column { background:transparent; }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .topbar {
  min-height:82px; padding:18px 30px; gap:22px; background:var(--ledger-header); border-bottom:1px solid var(--line);
  backdrop-filter:blur(24px) saturate(155%); -webkit-backdrop-filter:blur(24px) saturate(155%);
}
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .page-heading { gap:12px; }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .page-heading h1 { font-size:19px; font-weight:620; letter-spacing:-.65px; gap:11px; }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .page-heading h1::before { width:31px; height:31px; flex-basis:31px; }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .page-heading p { margin:3px 0 0; font-size:10px; line-height:1.2; font-weight:450; letter-spacing:.15px; text-transform:none; color:var(--muted); }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .header-tools { gap:10px; }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell :is(.icon-btn,.experience-toggle,.timeline-toggle) { clip-path:none; backdrop-filter:none; -webkit-backdrop-filter:none; box-shadow:none; border:1px solid var(--line); }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .icon-btn { width:36px; height:36px; border-radius:11px; color:var(--muted); background:var(--rd-control); }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .icon-btn:hover { color:var(--ink); background:var(--surface2); }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .experience-toggle { border-radius:999px; padding:4px; gap:2px; background:var(--surface2); }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .experience-toggle button { padding:8px 15px; border-radius:999px; font-size:12px; font-weight:550; color:var(--muted); background:transparent; }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell :is(.experience-toggle button[aria-pressed=true],.timeline-toggle button.active) { background:var(--ledger-selected); color:var(--ink); border-color:transparent; box-shadow:var(--ledger-selected-shadow); }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .timeline-bar,
html[data-experience=raceday] .app-shell:not(.filters-hidden) .timeline-bar {
  position:static; top:auto; left:auto; transform:none; display:flex; align-items:center; justify-content:space-between;
  width:100%; padding:14px 30px; gap:20px; background:transparent; border-bottom:1px solid var(--line);
}
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .timeline-toggle { width:300px; max-width:100%; border-radius:999px; padding:4px; gap:3px; background:var(--surface2); }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .timeline-toggle button { min-width:0; min-height:34px; padding:8px 16px; border-radius:999px; text-align:center; }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .timeline-toggle button span { font-size:12px; font-weight:560; letter-spacing:0; color:inherit; }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .timeline-toggle button small { display:none; }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .timeline-sync,
html[data-experience=raceday] .app-shell:not(.filters-hidden) .timeline-sync { width:auto; margin:0; padding:0; text-align:right; font-size:10px; color:var(--muted); }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell #main-content { padding:28px 30px 30px; }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell :is(.btn,.upcoming-selection-controls select,.accounting select) { border:1px solid var(--line-strong); border-radius:10px; background:var(--rd-control); box-shadow:0 1px 2px #182d4204; }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .btn { padding:9px 13px; font-size:12px; }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .btn.primary { background:linear-gradient(145deg,#e2f7f9d9,#acd8e5b8); border-color:var(--rd-stroke); color:#205b70; box-shadow:var(--rd-shadow); }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell :is(.kpis,.upcoming-kpis) { gap:16px; margin:0; padding:0 0 22px; border:0; }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell :is(.kpi,.kpi:first-child,.upcoming-kpis>div) {
  clip-path:none; padding:22px 24px; min-height:140px; background:var(--rd-panel); border:1px solid var(--rd-stroke); border-radius:18px;
  box-shadow:var(--rd-shadow); backdrop-filter:none; -webkit-backdrop-filter:none;
}
html[data-experience=raceday] .app-shell .kpi.emphasis { background:linear-gradient(120deg,#edf3fe,#f8faff); border-color:#356dcc24; }
html[data-experience=raceday][data-theme=dark] .app-shell .kpi.emphasis { background:linear-gradient(120deg,#293b56,#253144); border-color:#87b3fc27; }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell :is(.kpi-label,.upcoming-kpis small) { font-size:11px; font-weight:500; line-height:1.4; letter-spacing:0; text-transform:none; color:var(--muted); }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell :is(.kpi-number,.upcoming-kpis strong) { margin:15px 0 9px; font-size:34px; line-height:1.1; letter-spacing:-1.5px; font-weight:540; font-variant-numeric:tabular-nums; }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .kpi-sub { font-size:10px; color:var(--muted); line-height:1.5; }
html[data-experience=raceday] .app-shell #shared-preset-bar { padding:5px 0; margin:0 0 24px; background:transparent; border:0; border-radius:0; box-shadow:none; backdrop-filter:none; -webkit-backdrop-filter:none; clip-path:none; }
html[data-experience=raceday] .app-shell #quick-presets { gap:6px; flex-wrap:nowrap; padding:3px 1px; scrollbar-width:thin; }
html[data-experience=raceday] .app-shell .preset-chip { min-height:34px; padding:7px 12px; border:1px solid var(--line); border-radius:999px; color:var(--muted); background:transparent; font-size:11px; font-weight:500; box-shadow:none; }
html[data-experience=raceday] .app-shell .preset-chip.active { color:#195c70; background:linear-gradient(145deg,#e9fbffc9,#b7dfeac2); border-color:var(--rd-stroke); box-shadow:var(--ledger-selected-shadow); }
html[data-experience=raceday] .app-shell .preset-chip:hover:not(.active):not(:disabled) { background:var(--accent-soft); color:var(--ink); border-color:var(--line-strong); }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell :is(.view-surface,.surface,.strategy-card,.journal-card) { border-radius:17px; border:1px solid var(--rd-stroke); background:var(--rd-table); box-shadow:var(--rd-shadow); }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell :is(.table-toolbar,.table-footer,.surface-heading) { background:var(--rd-table); border-color:var(--line); color:var(--muted); }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .table-toolbar { padding:12px 18px; }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .table-footer { padding:12px 18px; font-size:10px; }
html:is([data-experience=raceday],[data-experience=pricing]) th { background:var(--surface2); border-color:var(--line-strong); color:var(--muted); font-size:10px; font-weight:550; padding-block:13px; }
html:is([data-experience=raceday],[data-experience=pricing]) td { border-color:var(--line); font-size:12px; }
html:is([data-experience=raceday],[data-experience=pricing]) tbody tr:not(.pad):hover { background:var(--accent-soft); }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .selection-line { min-height:38px; margin-bottom:13px; }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .selection-name strong { font-size:16px; letter-spacing:-.4px; font-weight:600; }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .selection-name .muted { font-size:11px; color:var(--muted); }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .statusline { padding:11px 30px; background:var(--ledger-header); border-top:1px solid var(--line); font-size:10px; color:var(--muted); }
html[data-experience=raceday] .app-shell .sidebar { background:var(--surface2); border-color:var(--line); backdrop-filter:none; -webkit-backdrop-filter:none; }
html:is([data-experience=raceday],[data-experience=pricing]) :is(dialog,.tool-dialog) { border:1px solid var(--line-strong); border-radius:22px; background:var(--surface); box-shadow:0 24px 90px #101b3933; }
html:is([data-experience=raceday],[data-experience=pricing]) dialog::backdrop { background:#101b3940; backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px); }
html[data-experience=raceday] .app-shell .raceday-heading { padding:0 0 21px; gap:24px; }
html[data-experience=raceday] .app-shell .raceday-heading h2 { margin:0 0 6px; font-size:30px; letter-spacing:-1.1px; font-weight:570; }
html[data-experience=raceday] .app-shell .raceday-heading p { font-size:12px; line-height:1.5; }
html[data-experience=raceday] .app-shell .day-picker { font-size:10px; gap:7px; }
html[data-experience=raceday] .app-shell .day-picker select { clip-path:none; border-radius:11px; padding:11px 36px 11px 38px; min-width:185px; box-shadow:none; font-size:12px; }
html[data-experience=raceday] .app-shell #explorer { height:clamp(550px,calc(100dvh - 350px),850px); min-height:550px; }
html[data-experience=raceday] .app-shell #previous-imports { background:var(--rd-panel); box-shadow:none; border:1px solid var(--rd-stroke); border-radius:14px; }
html[data-experience=raceday] .app-shell :is(.journal-workspace-bar,.journal-sync-row) { border-color:var(--line); }
html[data-experience=raceday] .app-shell .journal-tabs button { border-radius:9px; font-size:12px; padding:9px 14px; }
html[data-experience=raceday] .app-shell .journal-tabs button[aria-pressed=true] { background:var(--ledger-selected); color:var(--ink); box-shadow:var(--ledger-selected-shadow); }
@media (max-width:1100px) {
  html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .topbar { padding-inline:22px; min-height:78px; flex-wrap:wrap; }
  html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .timeline-bar { padding-inline:22px; }
  html:is([data-experience=raceday],[data-experience=pricing]) .app-shell #main-content { padding:24px 22px; }
  html:is([data-experience=raceday],[data-experience=pricing]) .app-shell :is(.kpi,.kpi:first-child,.upcoming-kpis>div) { padding:20px 18px; }
}
/* Two metric rows need room above the table's minimum scroll area and footer. */
@media (max-width:1050px) {
  html[data-experience=raceday] .app-shell #explorer { height:720px; min-height:720px; }
}
@media (max-width:720px) {
  html:is([data-experience=raceday],[data-experience=pricing]) body { padding:0; }
  html:is([data-experience=raceday],[data-experience=pricing]) .app-shell { border:0; border-radius:0; }
  html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .topbar { padding:16px; gap:16px; }
  html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .header-tools { gap:7px; margin-left:0; width:100%; flex-wrap:nowrap; }
  html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .experience-toggle { flex:1; justify-content:space-between; }
  html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .experience-toggle button { flex:1; padding:8px 9px; font-size:11px; }
  html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .timeline-bar,
  html[data-experience=raceday] .app-shell:not(.filters-hidden) .timeline-bar { padding:11px 16px; }
  html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .timeline-toggle { width:100%; max-width:none; }
  html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .timeline-sync { display:none; }
  html:is([data-experience=raceday],[data-experience=pricing]) .app-shell #main-content { padding:22px 16px; }
  html:is([data-experience=raceday],[data-experience=pricing]) .app-shell :is(.kpis,.upcoming-kpis) { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; padding-bottom:20px; }
  html:is([data-experience=raceday],[data-experience=pricing]) .app-shell :is(.kpi,.kpi:first-child,.upcoming-kpis>div) { padding:18px 15px; min-height:126px; border-radius:15px; }
  html:is([data-experience=raceday],[data-experience=pricing]) .app-shell :is(.kpi-number,.upcoming-kpis strong) { font-size:29px; margin:12px 0 8px; letter-spacing:-1px; }
  html[data-experience=raceday] .app-shell .raceday-heading { gap:17px; padding-bottom:19px; }
  html[data-experience=raceday] .app-shell .raceday-heading h2 { font-size:28px; }
  html[data-experience=raceday] .app-shell .day-picker { width:100%; display:flex; align-items:center; justify-content:space-between; }
  html[data-experience=raceday] .app-shell .day-picker select { max-width:74%; min-width:0; }
  html[data-experience=raceday] .app-shell #shared-preset-bar { margin-bottom:20px; }
  html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .statusline { padding:10px 16px; }
  html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .selection-line { flex-wrap:wrap; }
}
@media (prefers-reduced-transparency:reduce) {
  html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .topbar { background:var(--surface); backdrop-filter:none; -webkit-backdrop-filter:none; }
  html:is([data-experience=raceday],[data-experience=pricing]) dialog::backdrop { backdrop-filter:none; -webkit-backdrop-filter:none; }
}
@media (forced-colors:active) {
  html:is([data-experience=raceday],[data-experience=pricing]) .app-shell :is(.topbar,.kpi,.pricing-metric,.pricing-glass,.timeline-toggle,.experience-toggle,.preset-chip,.icon-btn) { background:Canvas; color:CanvasText; border:1px solid CanvasText; box-shadow:none; }
  html:is([data-experience=raceday],[data-experience=pricing]) .app-shell :is(button[aria-pressed=true],.timeline-toggle button.active) { outline:2px solid Highlight; outline-offset:-3px; }
}
/* Dark-mode specificity matches the older per-mode rules without a second palette. */
html:is([data-experience=raceday],[data-experience=pricing])[data-theme=dark] body { background:var(--ledger-canvas); }
html:is([data-experience=raceday],[data-experience=pricing])[data-theme=dark] .app-shell :is(.experience-toggle button[aria-pressed=true],.timeline-toggle button.active) { background:var(--ledger-selected); color:var(--ink); box-shadow:var(--ledger-selected-shadow); border-color:transparent; }
html[data-experience=raceday][data-theme=dark] .app-shell .preset-chip.active { background:linear-gradient(145deg,#7fb5c94d,#477e9a61); color:#e1faff; border-color:var(--rd-stroke); box-shadow:var(--ledger-selected-shadow); }
html[data-experience=raceday][data-theme=dark] .app-shell .sidebar { background:var(--surface2); }
html:is([data-experience=raceday],[data-experience=pricing])[data-theme=dark] th { background:var(--surface2); color:var(--muted); }
html:is([data-experience=raceday],[data-experience=pricing])[data-theme=dark] .app-shell .btn.primary { background:linear-gradient(145deg,#69a7b557,#39748b66); color:#e1faff; border-color:#b6e2f343; box-shadow:var(--rd-shadow); }

/* Reflections are confined to surfaces; text and data rows stay crisp. */
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell :is(.icon-btn,.experience-toggle,.timeline-toggle) {
 background:var(--rd-control); border-color:var(--rd-stroke); box-shadow:var(--rd-shadow);
 backdrop-filter:blur(18px) saturate(160%); -webkit-backdrop-filter:blur(18px) saturate(160%);
}
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell :is(.kpi,.kpi:first-child,.upcoming-kpis>div,.view-surface) {
 backdrop-filter:blur(20px) saturate(135%); -webkit-backdrop-filter:blur(20px) saturate(135%);
}
html[data-experience=raceday] .app-shell .kpi.emphasis { background:linear-gradient(135deg,#d8ecffaf,#ffffff66); border-color:#ffffffc9; }
html[data-experience=raceday][data-theme=dark] .app-shell .kpi.emphasis { background:linear-gradient(135deg,#749ed14f,#32557655); border-color:#cce8ff36; }
html[data-experience=pricing] #pricing-view :is(.pricing-glass,.pricing-metric,.pricing-controls,.pricing-profit) {
 background:var(--rd-panel); border-color:var(--rd-stroke); box-shadow:var(--rd-shadow);
 backdrop-filter:blur(20px) saturate(135%); -webkit-backdrop-filter:blur(20px) saturate(135%);
}
html[data-experience=pricing] #pricing-view .pricing-metric:nth-child(2) { background:linear-gradient(135deg,#d8ecffaf,#ffffff66); }
html[data-experience=pricing][data-theme=dark] #pricing-view .pricing-metric:nth-child(2) { background:linear-gradient(135deg,#749ed14f,#32557655); }
html[data-experience=pricing] #pricing-view .pricing-profile-controls { background:var(--rd-control); border-color:var(--rd-stroke); box-shadow:var(--rd-shadow); }
html[data-experience=pricing] #pricing-view .pricing-profile-controls button[aria-pressed=true] { background:var(--ledger-selected); box-shadow:var(--ledger-selected-shadow); }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell :is(.view-surface,.sidebar) { background:var(--rd-table); }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell th { background:#eff5fa; }
html:is([data-experience=raceday],[data-experience=pricing])[data-theme=dark] .app-shell th { background:#22374b; }
#auth-screen { background:radial-gradient(ellipse at 0 0,#acd9e1,transparent 60%),radial-gradient(ellipse at 100% 20%,#ccd3f4,transparent 58%),#edf3f7; }
#auth-screen .auth-wrap { background:linear-gradient(145deg,#ffffffac,#ffffff61); backdrop-filter:blur(28px) saturate(150%); -webkit-backdrop-filter:blur(28px) saturate(150%); }
@media (min-width:721px) and (max-height:850px) {
 html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .topbar { min-height:70px; padding-top:12px; padding-bottom:12px; }
 html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .timeline-bar { padding-top:9px; padding-bottom:9px; }
 html:is([data-experience=raceday],[data-experience=pricing]) .app-shell #main-content { padding-top:18px; }
 html[data-experience=raceday] .app-shell .raceday-heading { padding-bottom:13px; }
 html[data-experience=raceday] .app-shell .raceday-heading h2 { font-size:27px; }
 html[data-experience=raceday] .app-shell #shared-preset-bar { margin-bottom:17px; }
 html:is([data-experience=raceday],[data-experience=pricing]) .app-shell :is(.kpis,.upcoming-kpis) { padding-bottom:16px; }
 html:is([data-experience=raceday],[data-experience=pricing]) .app-shell :is(.kpi,.kpi:first-child,.upcoming-kpis>div) { min-height:112px; padding:16px 20px; }
 html:is([data-experience=raceday],[data-experience=pricing]) .app-shell :is(.kpi-number,.upcoming-kpis strong) { margin:10px 0 7px; font-size:30px; }
}
@media (prefers-reduced-transparency:reduce) {
 html:is([data-experience=raceday],[data-experience=pricing]) .app-shell :is(.topbar,.icon-btn,.experience-toggle,.timeline-toggle,.kpi,.upcoming-kpis>div,.view-surface,.pricing-glass,.pricing-metric,.pricing-controls,.pricing-profit),#auth-screen .auth-wrap { background:var(--surface,#fff); backdrop-filter:none; -webkit-backdrop-filter:none; }
}

/* One calendar control, shared with Race Day. */
html[data-experience=pricing] #pricing-view :is(.pricing-meeting-date,.pricing-commission) { display:flex; flex-direction:column; align-items:stretch; gap:8px; min-width:0; font-size:10px; line-height:1.2; color:var(--muted); font-weight:500; }
html[data-experience=pricing] #pricing-view :is(.pricing-meeting-date,.pricing-commission) select { appearance:none; width:100%; height:40px; border:1px solid var(--rd-stroke); border-radius:11px; padding:0 32px 0 37px; font:500 12px -apple-system,BlinkMacSystemFont,"SF Pro Text",sans-serif; color:var(--ink); background-color:#ffffff70; background-image:var(--pricing-control-icon,url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2376818e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='3'/%3E%3Cpath d='M16 3v4M8 3v4M3 11h18'/%3E%3C/svg%3E")),url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2376818e' stroke-width='1.5'%3E%3Cpath d='m3 4 3 3 3-3'/%3E%3C/svg%3E"); background-position:13px center,right 12px center; background-repeat:no-repeat; }
html[data-experience=pricing][data-theme=dark] #pricing-view :is(.pricing-meeting-date,.pricing-commission) select { background-color:#adc9e21a; color-scheme:dark; }
html[data-experience=pricing] #pricing-view :is(.pricing-meeting-date,.pricing-commission) select:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
@media(max-width:980px) { .pricing-meeting-date { grid-column:span 4; max-width:300px; width:100%; } }
@media(max-width:720px) { .pricing-meeting-date { grid-column:span 2; max-width:none; } }

html[data-experience=pricing] #pricing-view .pricing-commission { --pricing-control-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2376818e' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='m6 18 12-12'/%3E%3Ccircle cx='7' cy='7' r='2.5'/%3E%3Ccircle cx='17' cy='17' r='2.5'/%3E%3C/svg%3E"); }
html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .btn.primary:hover:not(:disabled) { filter:brightness(1.035); }
@media(forced-colors:active) { html:is([data-experience=raceday],[data-experience=pricing]) .app-shell .btn.primary { background:Highlight; color:HighlightText; border-color:Highlight; box-shadow:none; } }

/* A compact welcome panel, with the same teal glass action as Upload RSPs. */
#auth-screen .auth-wrap:has(#auth-form-section:not([hidden])) { width:min(392px,100%); padding:32px 32px 30px; }
#auth-screen .auth-wrap:has(#auth-form-section:not([hidden])) .auth-logo { gap:14px; margin-bottom:24px; }
#auth-screen .auth-wrap:has(#auth-form-section:not([hidden])) .brand-mark { width:64px; height:64px; min-width:64px; }
#auth-screen #auth-form-section h1 { font-size:21px; margin-bottom:0; }
#auth-screen #login-form label { margin-top:18px; }
#auth-screen #login-submit { min-height:48px; margin-top:22px; }
html[data-theme=dark] #auth-screen .primary { background:linear-gradient(145deg,#69a7b557,#39748b66); color:#e1faff; border-color:#b6e2f343; box-shadow:0 8px 28px #00000024,inset 0 1px 0 #ffffff24; }
/* Historical commission and the Upcoming profile share one dropdown treatment. */
html[data-experience=raceday] .app-shell .accounting { flex-direction:column; align-items:stretch; gap:7px; }
html[data-experience=raceday] .app-shell .accounting label { font-size:10px; line-height:1.2; font-weight:500; color:var(--muted); }
html[data-experience=raceday] .app-shell :is(.accounting,.upcoming-selection-controls) select {
 appearance:none; -webkit-appearance:none; min-height:38px; height:38px; padding:0 34px 0 13px;
 border:1px solid var(--line-strong); border-radius:10px; font:500 13px -apple-system,BlinkMacSystemFont,"SF Pro Text",sans-serif;
 color:var(--ink); background-color:#ffffff85; box-shadow:inset 0 1px 0 #ffffff9c,0 1px 2px #182d4204;
 background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2376818e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 4 3 3 3-3'/%3E%3C/svg%3E");
 background-position:right 12px center; background-repeat:no-repeat;
}
html[data-experience=raceday] .app-shell .accounting select { min-width:112px; }
html[data-experience=raceday][data-theme=dark] .app-shell :is(.accounting,.upcoming-selection-controls) select { background-color:#adc9e21a; box-shadow:inset 0 1px 0 #ffffff12; color-scheme:dark; }
@media(max-width:480px) { #auth-screen .auth-wrap:has(#auth-form-section:not([hidden])) { padding:28px 24px; } }
@media(forced-colors:active) {
 #auth-screen .primary { background:Highlight; color:HighlightText; border-color:Highlight; box-shadow:none; }
 html[data-experience=raceday] .app-shell :is(.accounting,.upcoming-selection-controls) select { appearance:auto; background:Canvas; color:CanvasText; box-shadow:none; }
}
