/* App Team 29er · v16.31 · per-user theme settings */
:root{
  --ui-accent:#1468F3;
  --ui-accent-rgb:20,104,243;
  --ui-accent-2:#7735DF;
  --ui-accent-2-rgb:119,53,223;
  --ui-bg:#f6f8fb;
  --ui-panel:#ffffff;
  --ui-panel-2:#f4f6fb;
  --ui-text:#0a153f;
  --ui-muted:#73809a;
  --ui-line:rgba(10,21,63,.075);
  --ui-shadow:0 10px 30px rgba(17,36,79,.06),0 2px 8px rgba(17,36,79,.025);

  --bg:var(--ui-bg);
  --panel:var(--ui-panel);
  --panel2:var(--ui-panel-2);
  --text:var(--ui-text);
  --muted:var(--ui-muted);
  --line:var(--ui-line);
  --accent:var(--ui-accent);
  --accent-2:var(--ui-accent-2);
  --accent-soft:rgba(var(--ui-accent-rgb),.09);
  --violet-soft:rgba(var(--ui-accent-2-rgb),.09);
  --water:var(--ui-accent);
  --gym:var(--ui-accent-2);

  --ab-navy:var(--ui-text);
  --ab-blue:var(--ui-accent);
  --ab-blue-soft:rgba(var(--ui-accent-rgb),.09);
  --ab-violet:var(--ui-accent-2);
  --ab-violet-soft:rgba(var(--ui-accent-2-rgb),.09);
  --ab-muted:var(--ui-muted);
  --ab-border:var(--ui-line);
  --ab-shadow:var(--ui-shadow);
}

/* Accent propagation across the visual system */
.primary{background:linear-gradient(135deg,var(--ui-accent) 0%,var(--ui-accent) 58%,var(--ui-accent-2) 100%)!important;box-shadow:0 8px 18px rgba(var(--ui-accent-rgb),.20)!important}
.tab.active,.chip.active,.rating button.active,.weather-mode-switch button.active,.survey-score input:checked+span{background:linear-gradient(135deg,var(--ui-accent),var(--ui-accent-2))!important;box-shadow:0 6px 14px rgba(var(--ui-accent-rgb),.16)!important}
.bar>span,.gym-mini-progress span{background:linear-gradient(90deg,var(--ui-accent),var(--ui-accent-2))!important}
.cal-day i{background:linear-gradient(135deg,var(--ui-accent),var(--ui-accent-2))!important}
.spark.overlay.model-c0 polyline{stroke:var(--ui-accent)!important}
.model-dot.model-c0,.model-c0 .model-dot{background:var(--ui-accent)!important}
.ab-board-ready #quickAddBtn{background:linear-gradient(145deg,var(--ui-accent),color-mix(in srgb,var(--ui-accent) 82%,#000))!important;box-shadow:0 8px 18px rgba(var(--ui-accent-rgb),.22)!important}
.ab-hero{border-color:rgba(var(--ui-accent-rgb),.15)!important;background:linear-gradient(130deg,var(--ui-panel) 0%,var(--ui-panel) 48%,rgba(var(--ui-accent-rgb),.085) 100%)!important}
.ab-hero-icon{border-color:rgba(var(--ui-accent-rgb),.12)!important}
.ab-hero-chips span{border-color:rgba(var(--ui-accent-rgb),.15)!important}
.ab-hero-chips .violet-chip{color:var(--ui-accent-2)!important;background:rgba(var(--ui-accent-2-rgb),.055)!important;border-color:rgba(var(--ui-accent-2-rgb),.15)!important}
.ab-kicker.blue,.ab-footer-link.blue,.ab-hero-chevron,.ab-weather-card .ab-data,.ab-card-icon.blue,.ab-hero-chips .blue-chip{color:var(--ui-accent)!important}
.ab-card-icon.blue{background:rgba(var(--ui-accent-rgb),.09)!important}
.ab-card-icon.violet{background:rgba(var(--ui-accent-2-rgb),.09)!important;color:var(--ui-accent-2)!important}
.ab-regatta-count b,.ab-kicker.violet-text,.ab-footer-link.violet,.ab-athlete-mini b{color:var(--ui-accent-2)!important}
.ab-performance-kpis i{background:rgba(var(--ui-accent-2-rgb),.09)!important;color:var(--ui-accent-2)!important}
.ab-spark polyline{stroke:var(--ui-accent-2)!important}.ab-spark circle{fill:var(--ui-accent-2)!important}
.ab-chart-empty{border-color:rgba(var(--ui-accent-2-rgb),.16)!important;background:rgba(var(--ui-accent-2-rgb),.03)!important}
.ab-board-ready .nav-item.active{background:rgba(var(--ui-accent-rgb),.08)!important;color:var(--ui-accent)!important}
.notice{background:rgba(var(--ui-accent-rgb),.07)!important;border-left-color:var(--ui-accent)!important}
.field input:focus,.field select:focus,.field textarea:focus{border-color:rgba(var(--ui-accent-rgb),.38)!important;box-shadow:0 0 0 4px rgba(var(--ui-accent-rgb),.08)!important}

/* Keep the hero illustration in the selected accent instead of fixed blue. */
.ab-hero-art{
  background-image:none!important;
  background-color:var(--ui-accent)!important;
  opacity:.32!important;
  -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 150'%3E%3Cg%3E%3Cpath d='M90 131c42-8 82-2 126-16-33 28-90 37-147 27 6-5 13-8 21-11Z'/%3E%3Cpath d='M109 129c32-4 68-5 106-18-31 22-76 30-121 27 5-4 10-7 15-9Z'/%3E%3Cpath d='M117 111h65l-15 18h-51Z'/%3E%3Cpath d='M137 29v78H93Z'/%3E%3Cpath d='M142 35v72h43Z'/%3E%3C/g%3E%3C/svg%3E");
  -webkit-mask-repeat:no-repeat;-webkit-mask-position:right bottom;-webkit-mask-size:contain;
  mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 150'%3E%3Cg%3E%3Cpath d='M90 131c42-8 82-2 126-16-33 28-90 37-147 27 6-5 13-8 21-11Z'/%3E%3Cpath d='M109 129c32-4 68-5 106-18-31 22-76 30-121 27 5-4 10-7 15-9Z'/%3E%3Cpath d='M117 111h65l-15 18h-51Z'/%3E%3Cpath d='M137 29v78H93Z'/%3E%3Cpath d='M142 35v72h43Z'/%3E%3C/g%3E%3C/svg%3E");
  mask-repeat:no-repeat;mask-position:right bottom;mask-size:contain;
}

/* Theme settings UI */
.ui-theme-settings{display:flex;flex-direction:column;gap:14px;padding-bottom:6px}
.ui-theme-preview{position:relative;overflow:hidden;border-radius:20px;padding:16px;background:linear-gradient(145deg,var(--ui-panel),rgba(var(--ui-accent-rgb),.08));border:1px solid rgba(var(--ui-accent-rgb),.13);box-shadow:var(--ui-shadow)}
.ui-theme-preview:after{content:'';position:absolute;width:145px;height:145px;border-radius:50%;right:-55px;top:-65px;background:rgba(var(--ui-accent-rgb),.12);pointer-events:none}
.ui-theme-preview-top{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;position:relative;z-index:1}
.ui-theme-preview-top>div{display:flex;flex-direction:column}.ui-theme-preview-top span{font-size:8px;font-weight:800;letter-spacing:.16em;color:var(--ui-accent)}.ui-theme-preview-top strong{font-size:20px;letter-spacing:-.04em;color:var(--ui-text)}
.ui-theme-preview-top i{width:28px;height:28px;border-radius:10px;background:var(--ui-accent);box-shadow:0 7px 14px rgba(var(--ui-accent-rgb),.18)}
.ui-theme-preview-card{position:relative;z-index:1;margin-top:16px;padding:13px;border-radius:15px;background:var(--ui-panel);border:1px solid var(--ui-line);display:grid;grid-template-columns:1fr auto;gap:2px 10px}
.ui-theme-preview-card b{font-size:11px;color:var(--ui-text)}.ui-theme-preview-card>span{grid-column:1/-1;font-size:9px;color:var(--ui-muted)}.ui-theme-preview-card>div{grid-column:2;grid-row:1/3;display:flex;align-items:center;gap:4px}.ui-theme-preview-card em{width:7px;height:7px;border-radius:50%;background:var(--ui-accent)}.ui-theme-preview-card em:nth-child(2){background:var(--ui-accent-2)}.ui-theme-preview-card em:nth-child(3){background:var(--good)}
.ui-theme-preview-meta{display:flex;gap:7px;flex-wrap:wrap;margin-top:10px;position:relative;z-index:1}.ui-theme-preview-meta span{padding:5px 8px;border-radius:999px;background:rgba(var(--ui-accent-rgb),.075);color:var(--ui-accent);font-size:8px;font-weight:750}
.ui-setting-block{padding:14px;border-radius:18px;background:var(--ui-panel);border:1px solid var(--ui-line)}
.ui-setting-title strong{display:block;font-size:13px;color:var(--ui-text)}.ui-setting-title small{display:block;margin-top:3px;color:var(--ui-muted);font-size:9px;line-height:1.35}
.ui-mode-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:12px}
.ui-mode-grid button{min-width:0;min-height:72px;border-radius:15px;border:1px solid var(--ui-line)!important;background:var(--ui-panel-2)!important;color:var(--ui-muted)!important;box-shadow:none!important;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;padding:8px!important}
.ui-mode-grid button span{font-size:20px;line-height:1}.ui-mode-grid button strong{font-size:9px}
.ui-mode-grid button.is-active{border-color:rgba(var(--ui-accent-rgb),.28)!important;background:rgba(var(--ui-accent-rgb),.09)!important;color:var(--ui-accent)!important;box-shadow:inset 0 0 0 1px rgba(var(--ui-accent-rgb),.08)!important}
.ui-accent-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px}
.ui-accent-option{position:relative;min-width:0;display:grid;grid-template-columns:34px minmax(0,1fr);grid-template-rows:auto auto;gap:1px 8px;align-items:center;text-align:left;padding:9px!important;border-radius:14px!important;border:1px solid var(--ui-line)!important;background:var(--ui-panel-2)!important;color:var(--ui-text)!important;box-shadow:none!important}
.ui-accent-option.is-active{border-color:rgba(var(--ui-accent-rgb),.34)!important;box-shadow:inset 0 0 0 1px rgba(var(--ui-accent-rgb),.11)!important;background:rgba(var(--ui-accent-rgb),.055)!important}
.ui-accent-swatch{grid-row:1/3;width:32px;height:32px;border-radius:11px;background:linear-gradient(135deg,var(--swatch),var(--swatch2));box-shadow:0 5px 12px color-mix(in srgb,var(--swatch) 22%,transparent)}
.ui-accent-option strong{font-size:9.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ui-accent-option small{font-size:7.5px;color:var(--ui-muted)}
.ui-theme-status{min-height:34px;padding:9px 11px;border-radius:12px;background:rgba(31,166,107,.065);color:#237b58;font-size:8.5px;font-weight:650;display:flex;align-items:center}.ui-theme-status[data-mode="warn"]{background:rgba(197,138,17,.09);color:#a9750b}.ui-theme-status[data-mode="busy"]{background:rgba(var(--ui-accent-rgb),.07);color:var(--ui-accent)}
.ui-theme-note{text-align:center;margin-top:-4px!important}
.ui-menu-theme-icon{background:linear-gradient(135deg,var(--ui-accent),var(--ui-accent-2))!important;color:#fff!important;border-radius:11px!important}

/* DARK MODE */
html[data-ui-theme="dark"]{
  --ui-bg:#0b1020;
  --ui-panel:#121a2c;
  --ui-panel-2:#172238;
  --ui-text:#f4f7ff;
  --ui-muted:#9aa8bd;
  --ui-line:rgba(255,255,255,.085);
  --ui-shadow:0 12px 34px rgba(0,0,0,.25),0 2px 8px rgba(0,0,0,.16);
  --bg:var(--ui-bg);--panel:var(--ui-panel);--panel2:var(--ui-panel-2);--text:var(--ui-text);--muted:var(--ui-muted);--line:var(--ui-line);
  --ab-navy:var(--ui-text);--ab-muted:var(--ui-muted);--ab-border:var(--ui-line);--ab-shadow:var(--ui-shadow);
}
html[data-ui-theme="dark"],html[data-ui-theme="dark"] body{background:#0b1020!important;color:var(--ui-text)!important}
html[data-ui-theme="dark"] body{background:radial-gradient(circle at 90% -5%,rgba(var(--ui-accent-rgb),.16),transparent 30%),linear-gradient(180deg,#0d1425 0%,#0b1020 52%,#0b1020 100%)!important}
html[data-ui-theme="dark"] .topbar{background:rgba(13,20,37,.92)!important;border-bottom-color:var(--ui-line)!important}
html[data-ui-theme="dark"] .card,
html[data-ui-theme="dark"] .subcard,
html[data-ui-theme="dark"] .modal-card,
html[data-ui-theme="dark"] .venue-map-wrap,
html[data-ui-theme="dark"] .interactive-chart,
html[data-ui-theme="dark"] .multi-chart,
html[data-ui-theme="dark"] .chart-tooltip,
html[data-ui-theme="dark"] .app-menu-group,
html[data-ui-theme="dark"] .menu-group,
html[data-ui-theme="dark"] .menu-section,
html[data-ui-theme="dark"] .auth-card,
html[data-ui-theme="dark"] .login-card{background:var(--ui-panel)!important;border-color:var(--ui-line)!important;box-shadow:var(--ui-shadow)!important}
html[data-ui-theme="dark"] .ab-board-ready{background:var(--ui-bg)!important}
html[data-ui-theme="dark"] .ab-board-ready .topbar{background:rgba(13,20,37,.94)!important}
html[data-ui-theme="dark"] .ab-card{background:var(--ui-panel)!important;border-color:var(--ui-line)!important;box-shadow:var(--ui-shadow)!important}
html[data-ui-theme="dark"] .ab-hero{background:linear-gradient(130deg,var(--ui-panel) 0%,var(--ui-panel) 55%,rgba(var(--ui-accent-rgb),.12) 100%)!important;border-color:rgba(var(--ui-accent-rgb),.22)!important}
html[data-ui-theme="dark"] .ab-hero-icon,html[data-ui-theme="dark"] .ab-hero-chips span{background:#18243a!important;border-color:var(--ui-line)!important;color:var(--ui-text)!important}
html[data-ui-theme="dark"] .ab-hero-chips .blue-chip{color:var(--ui-accent)!important}html[data-ui-theme="dark"] .ab-hero-chips .violet-chip{color:var(--ui-accent-2)!important;background:rgba(var(--ui-accent-2-rgb),.11)!important}
html[data-ui-theme="dark"] .ab-task-row,html[data-ui-theme="dark"] .ab-crew-item,html[data-ui-theme="dark"] .ab-check-row{border-color:var(--ui-line)!important}
html[data-ui-theme="dark"] .ab-footer-link:before{background:var(--ui-line)!important}
html[data-ui-theme="dark"] .ab-chart-empty{background:rgba(var(--ui-accent-2-rgb),.06)!important}
html[data-ui-theme="dark"] .bottom-nav,html[data-ui-theme="dark"] .ab-board-ready .bottom-nav{background:rgba(18,26,44,.96)!important;border-color:var(--ui-line)!important;box-shadow:0 14px 38px rgba(0,0,0,.35)!important}
html[data-ui-theme="dark"] .nav-item{color:#9aa8bd!important}html[data-ui-theme="dark"] .nav-item.active{background:rgba(var(--ui-accent-rgb),.15)!important;color:var(--ui-accent)!important}
html[data-ui-theme="dark"] .cloud-pill,html[data-ui-theme="dark"] .ab-board-ready #cloudPill{background:#131d31!important;border-color:var(--ui-line)!important}
html[data-ui-theme="dark"] .secondary,html[data-ui-theme="dark"] .icon-btn,html[data-ui-theme="dark"] .edit-btn,html[data-ui-theme="dark"] .close-modal{background:#172238!important;color:var(--ui-text)!important;border-color:var(--ui-line)!important;box-shadow:none!important}
html[data-ui-theme="dark"] .ghost{color:var(--ui-accent)!important}
html[data-ui-theme="dark"] .tab,html[data-ui-theme="dark"] .chip,html[data-ui-theme="dark"] .rating button,html[data-ui-theme="dark"] .weather-mode-switch button{background:#172238!important;color:#9aa8bd!important;border-color:var(--ui-line)!important}
html[data-ui-theme="dark"] .tab.active,html[data-ui-theme="dark"] .chip.active,html[data-ui-theme="dark"] .rating button.active,html[data-ui-theme="dark"] .weather-mode-switch button.active{color:#fff!important}
html[data-ui-theme="dark"] .field input,html[data-ui-theme="dark"] .field select,html[data-ui-theme="dark"] .field textarea,html[data-ui-theme="dark"] .weather-mode-switch,html[data-ui-theme="dark"] .toggle-row{background:#172238!important;color:var(--ui-text)!important;border-color:var(--ui-line)!important}
html[data-ui-theme="dark"] .field input::placeholder,html[data-ui-theme="dark"] .field textarea::placeholder{color:#6f7e96!important}
html[data-ui-theme="dark"] .todo-item,html[data-ui-theme="dark"] .list-item,html[data-ui-theme="dark"] .model-row,html[data-ui-theme="dark"] .crew-sail-row,html[data-ui-theme="dark"] .sail-log{border-color:var(--ui-line)!important}
html[data-ui-theme="dark"] .empty{background:#121a2c!important;color:var(--ui-muted)!important;border-color:var(--ui-line)!important}
html[data-ui-theme="dark"] .bar,html[data-ui-theme="dark"] .gym-mini-progress{background:#202b42!important}
html[data-ui-theme="dark"] .forecast-hero,html[data-ui-theme="dark"] .performance-hero,html[data-ui-theme="dark"] .performance-overview,html[data-ui-theme="dark"] .athlete-performance-hero,html[data-ui-theme="dark"] .gym-cycle-hero,html[data-ui-theme="dark"] .gym-hero{background:linear-gradient(145deg,#121a2c 0%,#131d31 66%,rgba(var(--ui-accent-2-rgb),.10) 100%)!important}
html[data-ui-theme="dark"] .forecast-archive span,html[data-ui-theme="dark"] .cal-day,html[data-ui-theme="dark"] .home-cal-day,html[data-ui-theme="dark"] .hub-check-row,html[data-ui-theme="dark"] .hub-outcome-strip,html[data-ui-theme="dark"] .gym-log-grid>div,html[data-ui-theme="dark"] .survey-metric{background:#172238!important;border-color:var(--ui-line)!important;color:var(--ui-text)!important}
html[data-ui-theme="dark"] .cal-day.today,html[data-ui-theme="dark"] .home-cal-day.today,html[data-ui-theme="dark"] .cal-day.has-event{background:rgba(var(--ui-accent-rgb),.14)!important;color:var(--ui-accent)!important}
html[data-ui-theme="dark"] .performance-kpi,html[data-ui-theme="dark"] .perf-kpi,html[data-ui-theme="dark"] .gym-week-stat,html[data-ui-theme="dark"] .gym-cycle-week{background:#172238!important;border-color:var(--ui-line)!important;color:var(--ui-text)!important}
html[data-ui-theme="dark"] .modal-backdrop{background:rgba(2,5,12,.58)!important}
html[data-ui-theme="dark"] .modal-head{background:rgba(18,26,44,.96)!important;border-color:var(--ui-line)!important}
html[data-ui-theme="dark"] .app-menu-item,html[data-ui-theme="dark"] .menu-item,html[data-ui-theme="dark"] .menuItem{background:transparent!important;border-color:var(--ui-line)!important;color:var(--ui-text)!important}
html[data-ui-theme="dark"] .menu-search{background:#172238!important;border-color:var(--ui-line)!important}html[data-ui-theme="dark"] .menu-search input{color:var(--ui-text)!important}
html[data-ui-theme="dark"] .ui-theme-status{background:rgba(31,166,107,.12);color:#6fd7aa}html[data-ui-theme="dark"] .ui-theme-status[data-mode="warn"]{background:rgba(197,138,17,.14);color:#e9bc56}
html[data-ui-theme="dark"] .ui-theme-preview-card,html[data-ui-theme="dark"] .ui-setting-block{background:var(--ui-panel)!important}

/* Force text that was hard-coded dark in older layers to respect dark mode. */
html[data-ui-theme="dark"] h1,html[data-ui-theme="dark"] h2,html[data-ui-theme="dark"] h3,html[data-ui-theme="dark"] h4,
html[data-ui-theme="dark"] .card h3,html[data-ui-theme="dark"] .widget-title h3,html[data-ui-theme="dark"] .section-title h2,
html[data-ui-theme="dark"] .todo-item strong,html[data-ui-theme="dark"] .list-item strong,html[data-ui-theme="dark"] .model-values strong,
html[data-ui-theme="dark"] .app-menu-copy strong{color:var(--ui-text)!important}
html[data-ui-theme="dark"] .muted,html[data-ui-theme="dark"] .tiny,html[data-ui-theme="dark"] .app-menu-copy small{color:var(--ui-muted)!important}

@media(max-width:390px){
  .ui-accent-grid{grid-template-columns:1fr 1fr}.ui-mode-grid{gap:6px}.ui-mode-grid button{min-height:66px}.ui-accent-option{padding:8px!important}.ui-accent-swatch{width:29px;height:29px}.ui-theme-preview{padding:14px}
}
