/* =====================================================================
   OddsLens UI kit (2026-10-14) -- shared by every dashboard.

   Settings Center (sidebar + one panel at a time + search + sticky save
   bar), setting rows, switches, choice chips, unit inputs, info tips,
   the Ctrl+K command palette, and button/link loaders with a top
   progress bar. Behaviour lives in js/ol-ui.js. Built on
   design-system.css tokens, so it follows each page's own theme.
   ===================================================================== */

/* ---------- Button / link loader ------------------------------------ */

@keyframes ol-spin { to { transform: rotate(360deg); } }

.is-loading {
  pointer-events: none;
  cursor: progress;
}

.button.is-loading,
.app-nav-item.is-loading,
a.is-loading {
  opacity: .92;
}

.button.is-loading::before,
a.is-loading::before {
  content: "";
  display: inline-block;
  flex: none;
  width: 1em;
  height: 1em;
  margin-right: .5em;
  vertical-align: -.15em;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-top-color: transparent;
  animation: ol-spin .6s linear infinite;
}

/* Icon-only buttons: the spinner replaces the glyph. */
.pair-balance-refresh-icon.is-loading { color: transparent !important; position: relative; }
.pair-balance-refresh-icon.is-loading::before {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 11px;
  height: 11px;
  border-color: var(--color-accent);
  border-right-color: transparent;
}
.pair-balance-refresh-icon.is-loading svg { visibility: hidden; }

/* Thin progress bar along the top edge while a user action is in flight. */
.ol-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s ease;
  overflow: hidden;
}
.ol-progress.is-active { opacity: 1; }
.ol-progress::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -40%;
  width: 40%;
  background: linear-gradient(90deg, transparent, var(--color-accent), #a855f7, transparent);
  animation: ol-progress-slide 1.1s ease-in-out infinite;
}
@keyframes ol-progress-slide {
  0% { left: -40%; }
  100% { left: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .button.is-loading::before, a.is-loading::before, .ol-progress::before { animation-duration: 2s; }
}

/* ---------- Switch on a plain checkbox ------------------------------ */

input[type="checkbox"].toggle {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  position: relative;
  width: 38px;
  height: 22px;
  margin: 0;
  border-radius: var(--radius-full);
  background: var(--color-border-strong);
  cursor: pointer;
  transition: background var(--transition-fast, .15s);
}
input[type="checkbox"].toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
  transition: transform .18s ease;
}
input[type="checkbox"].toggle:checked { background: var(--color-success); }
input[type="checkbox"].toggle:checked::after { transform: translateX(16px); }
input[type="checkbox"].toggle:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
input[type="checkbox"].toggle:disabled { opacity: .5; cursor: not-allowed; }
input[type="checkbox"].toggle.toggle-danger:checked { background: var(--color-warning); }

/* ---------- Choice chips: a checkbox list that reads like tags ------ */

.choice-chips, .settings-shell .checkbox-row {
  display: flex !important;
  flex-wrap: wrap;
  gap: var(--space-2) !important;
}
.choice-chips > label, .settings-shell .checkbox-row > label {
  display: inline-flex !important;
  align-items: center;
  gap: var(--space-2) !important;
  padding: 7px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-full);
  background: var(--color-surface-muted);
  font-size: var(--text-sm);
  cursor: pointer;
  user-select: none;
  transition: border-color .15s, background .15s, color .15s;
}
.choice-chips > label:hover, .settings-shell .checkbox-row > label:hover { border-color: var(--color-accent-soft-border); }
.choice-chips > label input[type="checkbox"], .settings-shell .checkbox-row > label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin: 0;
  border-radius: 4px;
  border: 1.5px solid var(--color-border-strong);
  display: grid;
  place-content: center;
}
.choice-chips > label input[type="checkbox"]:checked, .settings-shell .checkbox-row > label input[type="checkbox"]:checked {
  background: var(--color-accent);
  border-color: var(--color-accent);
}
.choice-chips > label input[type="checkbox"]:checked::after, .settings-shell .checkbox-row > label input[type="checkbox"]:checked::after {
  content: "";
  width: 7px;
  height: 4px;
  border-left: 2px solid #05060f;
  border-bottom: 2px solid #05060f;
  transform: rotate(-45deg) translate(1px, -1px);
}
.choice-chips > label:has(input:checked), .settings-shell .checkbox-row > label:has(input:checked) {
  border-color: var(--color-accent-soft-border);
  background: var(--color-accent-soft-bg);
  color: var(--color-text);
}
.choice-chips > label .text-muted, .settings-shell .checkbox-row > label .text-muted { font-size: var(--text-xs); }
.choice-chips > span.text-muted, .settings-shell .checkbox-row > span.text-muted { padding: 6px 0; }

/* ---------- Number input with a unit -------------------------------- */

.unit-input {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.unit-input > .input { padding-right: 2.6em; width: 100%; }
.unit-input.unit-before > .input { padding-left: 2em; padding-right: var(--space-3); }
.unit-input > .unit {
  position: absolute;
  right: 12px;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  pointer-events: none;
}
.unit-input.unit-before > .unit { left: 12px; right: auto; }

/* ---------- Info tip ------------------------------------------------ */

.info-tip {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  margin-left: 6px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--color-border-strong);
  background: transparent;
  color: var(--color-text-muted);
  font: 600 10px/1 var(--font-sans);
  font-style: italic;
  vertical-align: 1px;
  cursor: help;
}
.info-tip:hover, .info-tip[aria-expanded="true"] { color: var(--color-accent-text); border-color: var(--color-accent); }

.ol-tip-popover {
  position: fixed;
  z-index: 1200;
  max-width: 340px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-strong);
  background: #11132a;
  color: #e7e7f7;
  font-size: var(--text-sm);
  line-height: 1.5;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
}

/* ---------- Settings Center ----------------------------------------- */

.modal-overlay.settings-overlay { padding: 0; }
.modal-overlay.settings-overlay.is-open { display: flex; align-items: stretch; justify-content: center; }

.settings-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  width: min(1180px, 100%);
  height: 100vh;
  height: 100dvh;
  background: var(--color-bg, #05060f);
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  animation: settings-in .18s ease-out;
}
@keyframes settings-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.settings-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-height: 0;
  padding: var(--space-6) var(--space-4);
  border-right: 1px solid var(--color-border);
  background: rgba(255, 255, 255, .02);
  overflow-y: auto;
}
.settings-sidebar-head h2 { margin: 2px 0 0; font-size: var(--text-xl); }

.settings-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
}
.settings-search:focus-within { border-color: var(--color-accent); box-shadow: var(--shadow-focus); }
.settings-search svg { flex: none; width: 15px; height: 15px; }
.settings-search input {
  flex: 1;
  min-width: 0;
  padding: 9px 0;
  border: 0;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: var(--text-sm);
  outline: none;
}

.settings-nav { display: flex; flex-direction: column; gap: 2px; }
.settings-nav-group {
  margin: var(--space-3) 0 var(--space-1);
  padding: 0 var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
}
.settings-nav-group:first-child { margin-top: 0; }
.settings-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: 9px var(--space-3);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.settings-nav-item svg { width: 17px; height: 17px; flex: none; }
[data-secret-token-edit] { display: inline-flex; align-items: center; justify-content: center; }
[data-secret-token-edit] svg { width: 16px; height: 16px; flex: none; }
[data-secret-token-edit][hidden] { display: none; }
.settings-nav-item:hover { background: var(--color-surface-muted); color: var(--color-text); }
.settings-nav-item.is-active {
  background: var(--color-accent-soft-bg);
  color: var(--color-text);
  box-shadow: inset 2px 0 0 var(--color-accent);
}
.settings-nav-item .nav-dot {
  margin-left: auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-warning);
}

.settings-sidebar-foot {
  margin-top: auto;
  font-size: var(--text-xs);
  color: var(--color-text-subtle);
}
.kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 1px 6px;
  border: 1px solid var(--color-border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  font: 600 10px/1.6 var(--font-sans);
  text-align: center;
  color: var(--color-text-muted);
}

.settings-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.settings-main-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-8) var(--space-4);
  border-bottom: 1px solid var(--color-border);
}
.settings-main-head h3 { margin: 2px 0 4px; font-size: var(--text-xl); }
.settings-main-head p.card-description { margin: 0; max-width: 62ch; }

.settings-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-6) var(--space-8) var(--space-16);
  scroll-padding-top: var(--space-6);
}

.settings-panel { display: none; }
.settings-panel.is-active { display: block; }
.settings-content.is-searching .settings-panel { display: block; }
.settings-panel-heading { display: none; }
.settings-content.is-searching .settings-panel-heading {
  display: block;
  margin: var(--space-6) 0 var(--space-3);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-text-subtle);
}
.settings-content.is-searching .settings-panel-heading:first-child { margin-top: 0; }
.settings-content.is-searching .is-search-miss { display: none !important; }
.settings-search-empty { padding: var(--space-12) 0; text-align: center; color: var(--color-text-muted); }

/* A titled card holding setting rows. */
.setting-group {
  margin-bottom: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-muted);
}
.setting-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--color-border);
}
.setting-group-head h4 { margin: 0; font-size: var(--text-md); font-weight: 650; }
.setting-group-head p { margin: 2px 0 0; font-size: var(--text-sm); color: var(--color-text-muted); }
.setting-group-body { padding: var(--space-2) var(--space-5); }
.setting-group-body.is-padded { padding: var(--space-4) var(--space-5); }

/* One setting: text on the left, its control on the right. */
.setting {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 280px);
  align-items: center;
  gap: var(--space-3) var(--space-6);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: background .4s;
}
.setting:last-child { border-bottom: 0; }
.setting.is-wide { grid-template-columns: 1fr; }
.setting.is-switch { grid-template-columns: minmax(0, 1fr) auto; }
.setting-label {
  display: block;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
}
.setting-hint { margin: 3px 0 0; font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.45; }
.setting-control { display: flex; align-items: center; gap: var(--space-2); justify-content: flex-end; min-width: 0; }
.setting.is-wide .setting-control { justify-content: flex-start; }
.setting-control > .input, .setting-control > select.input { width: 100%; }
.setting.is-changed { box-shadow: inset 3px 0 0 var(--color-warning); padding-left: var(--space-3); }
.setting.is-flash { background: var(--color-accent-soft-bg); }

.setting-callout {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-5);
  border: 1px solid var(--color-warning-soft-border);
  border-radius: var(--radius-md);
  background: var(--color-warning-soft-bg);
  font-size: var(--text-sm);
  color: var(--color-text);
}

/* Sports x pair table. */
.pair-table { width: 100%; border-collapse: collapse; }
.pair-table th {
  padding: var(--space-3) var(--space-2) var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: left;
  color: var(--color-text-subtle);
}
.pair-table td { padding: var(--space-2); border-top: 1px solid var(--color-border); vertical-align: middle; }
.pair-table td:first-child { font-weight: 600; white-space: nowrap; width: 1%; padding-right: var(--space-4); }
.pair-table .input { width: 100%; }
.pair-table td.pair-region { width: 28%; }

/* Daily kickoff sessions table. */
.session-rows { display: flex; flex-direction: column; }
.session-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
}
.session-row:last-child { border-bottom: 0; }
.session-row-name { display: flex; align-items: center; gap: var(--space-3); font-weight: 600; }
.session-row-range { display: flex; align-items: center; gap: var(--space-2); }
.session-row-range .input { min-width: 0; }
.session-row-range .text-muted { font-size: var(--text-sm); }
.session-row:not(:has(input.toggle:checked)) .session-row-range { opacity: .45; }

/* Per-bookmaker number grids (min stake, retry window). */
.bookmaker-number-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-3) !important;
}
.bookmaker-number-grid .field-label { text-transform: capitalize; }

/* Sticky save bar. */
.save-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0 var(--space-6) var(--space-5);
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-5);
  border: 1px solid var(--color-warning-soft-border);
  border-radius: var(--radius-lg);
  background: #15172d;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
  animation: save-bar-in .2s ease-out;
}
.save-bar[hidden] { display: none; }
@keyframes save-bar-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.save-bar-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-warning); flex: none; }
.save-bar-text { flex: 1; font-size: var(--text-sm); font-weight: 500; }
.save-bar.is-error { border-color: var(--color-danger-soft-border); }
.save-bar.is-error .save-bar-dot { background: var(--color-danger); }
.save-bar.is-saved { border-color: var(--color-success-soft-border); }
.save-bar.is-saved .save-bar-dot { background: var(--color-success); }
.save-bar.is-shake { animation: save-bar-shake .35s ease; }
@keyframes save-bar-shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.settings-close {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-strong);
  background: transparent;
  color: var(--color-text-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.settings-close:hover { color: var(--color-text); border-color: var(--color-text-muted); }

.settings-mobile-nav { display: none; }

@media (max-width: 860px) {
  .settings-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); border: 0; }
  .settings-sidebar { min-width: 0; }
  .settings-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border-right: 0;
    border-bottom: 1px solid var(--color-border);
    overflow: visible;
  }
  .settings-sidebar-head, .settings-sidebar-foot { display: none; }
  .settings-search { flex: 1 1 100%; }
  .settings-nav {
    flex: 1 1 100%;
    flex-direction: row;
    gap: var(--space-1);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .settings-nav::-webkit-scrollbar { display: none; }
  .settings-nav-group { display: none; }
  .settings-nav-item { width: auto; white-space: nowrap; padding: 7px 12px; }
  .settings-nav-item svg { display: none; }
  .settings-nav-item.is-active { box-shadow: inset 0 -2px 0 var(--color-accent); }
  .settings-main-head { padding: var(--space-4); }
  .settings-content { padding: var(--space-4) var(--space-4) var(--space-12); }
  .setting { grid-template-columns: 1fr; }
  .setting.is-switch { grid-template-columns: minmax(0, 1fr) auto; }
  .setting-control { justify-content: flex-start; }
  .session-row { grid-template-columns: 1fr; gap: var(--space-2); }
  .save-bar { margin: 0 var(--space-3) var(--space-3); }
  .pair-table, .pair-table tbody, .pair-table tr, .pair-table td { display: block; width: 100% !important; }
  .pair-table thead { display: none; }
  .pair-table tr { padding: var(--space-2) 0; border-top: 1px solid var(--color-border); }
  .pair-table td { border: 0; padding: var(--space-1) 0; }
}

/* ---------- Command palette ----------------------------------------- */

.ol-palette-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: none;
  justify-content: center;
  align-items: flex-start;
  padding: 12vh var(--space-4) var(--space-4);
  background: rgba(3, 4, 12, .62);
  backdrop-filter: blur(3px);
}
.ol-palette-overlay.is-open { display: flex; }
.ol-palette {
  width: min(620px, 100%);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius-xl);
  background: #0f1126;
  color: #f5f5ff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  overflow: hidden;
  animation: settings-in .14s ease-out;
}
.ol-palette-input-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-5);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  color: #a5a5cc;
}
.ol-palette-input-row svg { width: 18px; height: 18px; flex: none; }
.ol-palette-input {
  flex: 1;
  padding: 18px 0;
  border: 0;
  background: transparent;
  color: #f5f5ff;
  font: inherit;
  font-size: var(--text-md);
  outline: none;
}
.ol-palette-list { flex: 1; overflow-y: auto; padding: var(--space-2); }
.ol-palette-group {
  padding: var(--space-3) var(--space-3) var(--space-1);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #6f6f96;
}
.ol-palette-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: 10px var(--space-3);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: #e7e7f7;
  font: inherit;
  font-size: var(--text-sm);
  text-align: left;
  cursor: pointer;
}
.ol-palette-item small { margin-left: auto; color: #6f6f96; font-size: var(--text-xs); }
.ol-palette-item.is-active { background: rgba(34, 211, 238, .12); color: #fff; }
.ol-palette-item mark { background: none; color: #22d3ee; font-weight: 700; }
.ol-palette-empty { padding: var(--space-8); text-align: center; color: #6f6f96; font-size: var(--text-sm); }
.ol-palette-foot {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-2) var(--space-5);
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: var(--text-xs);
  color: #6f6f96;
}
.ol-palette-foot .kbd { color: #a5a5cc; border-color: rgba(255, 255, 255, .18); }

/* Something the palette jumped to. */
.ol-spotlight { animation: ol-spotlight 1.6s ease; border-radius: var(--radius-md); }
@keyframes ol-spotlight {
  0%, 60% { box-shadow: 0 0 0 3px var(--color-accent), 0 0 24px rgba(34, 211, 238, .45); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Admin-style forms inside a Settings Center --------------- */

.settings-shell .field.is-changed {
  box-shadow: inset 3px 0 0 var(--color-warning);
  padding-left: var(--space-3);
  border-radius: var(--radius-sm);
}
.settings-shell .field.is-flash { background: var(--color-accent-soft-bg); border-radius: var(--radius-sm); transition: background .4s; }
.settings-shell .setting-group-body > .grid,
.settings-shell .setting-group-body .grid-2 { gap: var(--space-4) var(--space-5); }
.settings-shell .checkbox-row { height: auto !important; }
.settings-panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.settings-panel-toolbar .field { margin: 0; }
.settings-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-muted);
}
.settings-toggle-row strong { display: block; font-size: var(--text-base); }
.settings-toggle-row span.text-sm { color: var(--color-text-muted); }
.settings-session-card {
  margin-bottom: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, .02);
}
.settings-session-card > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 650;
}
.settings-session-card > summary::-webkit-details-marker { display: none; }
.settings-session-card > summary::after { content: "›"; transform: rotate(90deg); color: var(--color-text-muted); transition: transform .15s; }
.settings-session-card:not([open]) > summary::after { transform: none; }
.settings-session-card[open] > summary { margin-bottom: var(--space-4); }
.settings-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }

/* Stat tiles inside a settings panel wrap instead of overflowing. */
.settings-content .grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.settings-content .stat-value { font-size: var(--text-2xl); overflow-wrap: anywhere; }
.setting-group-head a { color: var(--color-accent-text); }

/* ---------- Side drawer (Users filters) ------------------------------ */

.modal-overlay.drawer-overlay,
.dashboard-page .modal-overlay.drawer-overlay { padding: 0; background: rgba(3, 4, 12, .16); backdrop-filter: none; -webkit-backdrop-filter: none; }
.modal-overlay.drawer-overlay.is-open { display: flex; justify-content: flex-end; align-items: stretch; }
.drawer-panel {
  display: flex;
  flex-direction: column;
  width: min(400px, 100%);
  height: 100vh;
  height: 100dvh;
  background: var(--color-bg, #05060f);
  border-left: 1px solid var(--color-border);
  box-shadow: -24px 0 60px rgba(0, 0, 0, .5);
  animation: drawer-in .2s ease-out;
}
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-6) var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--color-border);
}
.drawer-head .card-description { margin: 4px 0 0; }
.drawer-body { flex: 1; min-height: 0; overflow-y: auto; padding: var(--space-5); }
.drawer-body .live-filter-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-4); }
.drawer-range { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.drawer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--color-border);
}

/* Forms saved through the save bar keep their status line visible but
   not their own submit button. */
.settings-form-actions-managed button[type="submit"] { display: none !important; }
.settings-form-actions-managed:not(:has(.settings-form-status:not(:empty))) { display: none; }

/* Landing-style buttons get the same click spinner as .button (2026-10-16). */
.lp-button.is-loading { opacity: .92; }
.lp-button.is-loading::before {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: .5em;
  vertical-align: -.15em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: ol-spin .7s linear infinite;
}

/* Password reveal eye (any input[data-password-reveal]). */
.ol-reveal-toggle {
  position: absolute;
  top: 50%;
  right: .5rem;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: inherit;
  opacity: .7;
  cursor: pointer;
  padding: .35rem;
  line-height: 0;
}
.ol-reveal-toggle:hover, .ol-reveal-toggle:focus-visible { opacity: 1; }
.ol-reveal-toggle svg { width: 18px; height: 18px; }

/* Public site footer (templates/_site_footer.html). */
.site-footer { border-top: 1px solid rgba(255, 255, 255, .08); margin-top: var(--space-12); }
.site-footer-inner { max-width: 1160px; margin: 0 auto; padding: var(--space-8) var(--space-6); display: grid; gap: var(--space-4); font-size: var(--text-sm); color: #a5a5cc; }
.site-footer-brand { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: baseline; }
.site-footer-brand strong { color: #f5f5ff; letter-spacing: .04em; }
.site-footer-links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
.site-footer-links a { color: #c9c9ee; text-decoration: none; }
.site-footer-links a:hover { color: #22d3ee; text-decoration: underline; }
.site-footer-note { margin: 0; font-size: var(--text-xs); color: #6f6f96; line-height: 1.6; }

/* API keys / tokens: hidden like a password but NOT a password field, so
   Chrome never offers saved passwords in them or flags the page
   (Safe Browsing "possible phishing on login", 2026-10-16). */
.secret-input { -webkit-text-security: disc; text-security: disc; font-family: monospace; }

/* ---------- Connection banner (common.js connection monitor) -------- */
/* Fixed colours, not theme tokens: it has to read the same on the dark
   users' pages and the light admin pages. */

.ol-conn {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 1300;
  width: min(680px, calc(100% - 24px));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #101a33;
  border: 1px solid #2a3a63;
  color: #e8edf7;
  box-shadow: 0 18px 40px rgba(2, 6, 23, .45);
  font: 500 13px/1.45 var(--font-sans, system-ui, sans-serif);
  opacity: 0;
  transform: translate(-50%, -10px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.ol-conn.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.ol-conn-icon {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(251, 191, 36, .25);
  border-top-color: #fbbf24;
  animation: ol-spin .9s linear infinite;
}
.ol-conn.is-back .ol-conn-icon { animation: none; border-color: #22c55e; background: rgba(34, 197, 94, .25); }
.ol-conn-body { flex: 1; min-width: 0; }
.ol-conn-title { display: block; font-size: 14px; font-weight: 700; }
.ol-conn-detail { display: block; color: #a9b4cc; }
.ol-conn-eta { display: block; margin-top: 2px; color: #fbbf24; font-weight: 600; }
.ol-conn-side { flex: none; display: flex; align-items: center; gap: 8px; color: #8b97b0; font-size: 12px; }
.ol-conn-button {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid #33456f;
  background: #18264a;
  color: #e8edf7;
  font: 600 12px/1.4 var(--font-sans, system-ui, sans-serif);
  cursor: pointer;
}
.ol-conn-button:hover { background: #223464; }
.ol-conn-button:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; }
.ol-conn [hidden] { display: none !important; }
@media (max-width: 560px) {
  .ol-conn { top: 8px; flex-wrap: wrap; }
  .ol-conn-side { width: 100%; justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
  .ol-conn { transition: none; }
  .ol-conn-icon { animation: none; }
}
