/* =========================
   THEME TOKENS
   ========================= */

:root{
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 12px 28px rgba(0,0,0,.28);

  --ed-bg: #0b0f14;
  --ed-surface: #0f1520;
  --ed-card: #121a27;
  --ed-card-2: #0f1722;
  --ed-border: #253449;
  --ed-border-soft: #1c293a;
  --ed-text: #e6edf6;
  --ed-text-muted: #9fb0c4;
  --ed-accent: #f59e0b;
  --ed-success: #22c55e;
  --ed-danger: #ef4444;
  --ed-info: #38bdf8;

  --card-bg: rgba(10,16,24,.72);
  --card-brd: rgba(173,216,255,.45);
  --card-brd-win: rgba(132,255,80,.85);
  --txt-main: #eaf6ff;
  --txt-muted: #9ab0c4;
  --line: rgba(190,225,255,.55);
  --line-strong: rgba(210,238,255,.82);
  --chip-ready-bg: rgba(132,255,80,.2);
  --chip-ready-brd: rgba(132,255,80,.8);
}

html[data-theme="light"]{
  --ed-bg: #f4f7fc;
  --ed-surface: #ffffff;
  --ed-card: #ffffff;
  --ed-card-2: #f8fbff;
  --ed-border: #d9e1ee;
  --ed-border-soft: #e5eaf3;
  --ed-text: #0f172a;
  --ed-text-muted: #475569;
  --ed-accent: #b45309;
  --ed-success: #15803d;
  --ed-danger: #dc2626;
  --ed-info: #0369a1;

  --card-bg: #ffffff;
  --card-brd: #b7c6db;
  --card-brd-win: #39a85b;
  --txt-main: #0f172a;
  --txt-muted: #475569;
  --line: #8aa2c3;
  --line-strong: #2f7fd8;
  --chip-ready-bg: rgba(34,197,94,.12);
  --chip-ready-brd: rgba(21,128,61,.45);

  --shadow: 0 10px 24px rgba(15,23,42,.08);
}

/* =========================
   BASE
   ========================= */

.page-wrap{
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px 50px;
}

.card{
  background: var(--ed-card);
  border: 1px solid var(--ed-border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card h3{
  color: var(--ed-accent);
  margin: 0 0 12px;
  border-bottom: 1px solid var(--ed-border-soft);
  padding-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 1.05rem;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  border:1px solid var(--ed-border);
  color:var(--ed-text);
  background: var(--ed-card-2);
  border-radius:12px;
  padding:10px 12px;
  font-weight:900;
  cursor:pointer;
  transition:.15s ease;
}
.btn:hover{
  transform:translateY(-1px);
  border-color: color-mix(in srgb, var(--ed-border) 70%, var(--ed-text-muted) 30%);
}

/* =========================
   HERO
   ========================= */

.hero{
  padding: 46px 20px;
  text-align:center;
  background:
    radial-gradient(circle at 50% 0%, rgba(245,158,11,.18) 0%, transparent 55%),
    radial-gradient(circle at 80% 20%, rgba(31,138,87,.10) 0%, transparent 55%),
    var(--ed-bg);
  border-bottom: 1px solid var(--ed-border);
}
.hero h2{
  margin: 0;
  font-size: 2.6rem;
  color: var(--ed-accent);
  text-shadow: 0 10px 24px rgba(0,0,0,.25);
}
.hero p{
  margin: 10px 0 0;
  color: var(--ed-text-muted);
}

.live-pill,
.finished-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:#fff;
  font-weight:1000;
  letter-spacing:2px;
  text-transform:uppercase;
  padding: 6px 12px;
  border-radius:999px;
  margin-bottom:10px;
}
.live-pill{
  background: rgba(227,41,46,.18);
  border: 1px solid rgba(227,41,46,.55);
}
.finished-pill{
  background: rgba(245,158,11,.18);
  border: 1px solid rgba(245,158,11,.55);
}
.live-dot{
  width:10px;
  height:10px;
  border-radius:50%;
  background: var(--ed-danger);
  box-shadow: 0 0 10px var(--ed-danger);
}
html[data-theme="light"] .live-pill{
  color:#991b1b;
  background: rgba(220,38,38,.10);
  border-color: rgba(220,38,38,.45);
}
html[data-theme="light"] .finished-pill{
  color:#92400e;
  background: rgba(245,158,11,.14);
  border-color: rgba(217,119,6,.45);
}

/* =========================
   LAYOUT / TABS / SECTION
   ========================= */

.setup-grid{
  display:grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px;
  margin-top: 20px;
}

.tabs{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin: 18px 0 10px;
}
.tab{
  padding: 10px 14px;
  cursor:pointer;
  font-size:.95rem;
  font-weight:1000;
  color:var(--ed-text-muted);
  border:1px solid var(--ed-border);
  border-radius:14px;
  background: var(--ed-card-2);
  transition:.15s ease;
  user-select:none;
}
.tab:hover{ transform: translateY(-1px); }
.tab.active{
  color:var(--ed-text);
  border-color: color-mix(in srgb, var(--ed-success) 70%, white 30%);
  box-shadow: inset 0 0 0 1px rgba(31,138,87,.22);
}
.tab-content{ display:none; }
.tab-content.active{ display:block; animation: fadeIn .25s ease; }

@keyframes fadeIn{
  from{ opacity:0; transform: translateY(4px); }
  to{ opacity:1; transform: translateY(0); }
}

.section-title{
  margin: 20px 0 10px;
  border-left: 4px solid var(--ed-success);
  padding-left: 12px;
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:12px;
}
.st-left{ display:flex; flex-direction:column; gap:4px; }
.st-title{ font-weight:1000; text-transform:uppercase; letter-spacing:2px; color:var(--ed-text); }
.st-sub{ color:var(--ed-text-muted); font-size:.9rem; }
.st-pill{
  border:1px solid var(--ed-border);
  border-radius:999px;
  padding:6px 10px;
  font-weight:1000;
  font-size:.75rem;
  letter-spacing:2px;
  text-transform:uppercase;
  color:var(--ed-text-muted);
  background: var(--ed-card-2);
}

/* =========================
   PLAYERS / NEXT MATCHES
   ========================= */

.player-badge{
  background: var(--ed-card-2);
  border: 1px solid var(--ed-border);
  padding: 10px 12px;
  border-radius: 12px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:8px;
  font-weight:1000;
  color:var(--ed-text);
  gap:10px;
}
.player-badge .n{ color:var(--ed-text-muted); margin-right:8px; }

.player-match{
  background: var(--ed-card-2);
  border:1px solid var(--ed-border);
  border-radius:12px;
  padding:10px 12px;
  cursor:pointer;
  text-align:left;
}
.player-match:hover{
  border-color: color-mix(in srgb, var(--ed-border) 70%, var(--ed-text-muted) 30%);
  transform: translateY(-1px);
}
.pm-top{ display:flex; justify-content:space-between; gap:10px; }
.pm-k{
  color:var(--ed-text-muted);
  font-size:.78rem;
  text-transform:uppercase;
  letter-spacing:2px;
  font-weight:900;
}
.pm-v{ color:var(--ed-text); font-weight:1000; }

details.card[data-persist-key="next-matches"] > summary{
  color: var(--ed-accent) !important;
}
details.card[data-persist-key="next-matches"] .pm-v span{
  color: var(--ed-danger) !important;
}

/* =========================
   GROUPS
   ========================= */

.group-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap:16px;
  align-items:start;
}
.group-card{
  background: var(--ed-card);
  border:1px solid var(--ed-border);
  border-radius:16px;
  overflow:hidden;
  box-shadow: var(--shadow);
  align-self:start;
}
.group-head{
  background: linear-gradient(135deg, rgba(245,158,11,.16), transparent);
  border-bottom:1px solid color-mix(in srgb, var(--ed-accent) 45%, var(--ed-border) 55%);
  padding:10px 12px;
  text-align:center;
  font-weight:1000;
  color:var(--ed-accent);
  letter-spacing:1px;
}
.gtable{
  width:100%;
  border-collapse: collapse;
  text-align:center;
}
.gtable th{
  background: color-mix(in srgb, var(--ed-card-2) 92%, #000 8%);
  color: var(--ed-text-muted);
  font-size:.78rem;
  padding:10px 8px;
  text-transform:uppercase;
  letter-spacing:2px;
  border-bottom:1px solid var(--ed-border);
}
.gtable td{
  padding:10px 8px;
  border-bottom:1px solid var(--ed-border-soft);
  font-size:.95rem;
  color:var(--ed-text);
}
.g-match{
  display:grid;
  grid-template-columns:1fr 70px 1fr;
  align-items:center;
  padding:10px 12px;
  border-top:1px dashed var(--ed-border);
  font-size:.92rem;
  cursor:pointer;
  gap:10px;
}
.g-match:hover{ background: color-mix(in srgb, var(--ed-card-2) 92%, white 8%); }
.g-match .left,.g-match .right{
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0;
  color:var(--ed-text);
}
.g-match .left{ text-align:left; }
.g-match .right{ text-align:right; }
.g-match .mid{
  text-align:center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-weight:1000;
  color:var(--ed-text);
}

.group-matches-box{
  margin: 0 10px 10px;
  border: 1px solid var(--ed-border);
  border-radius: 12px;
  background: var(--ed-card-2);
  overflow:hidden;
}
.group-matches-title{
  padding: 10px;
  color: var(--ed-text-muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 900;
  border-bottom: 1px dashed var(--ed-border);
}

/* stabile Light-Ausgabe Gruppen */
html[data-theme="light"] .group-card{
  background:#fff !important;
  border-color:#d9e1ee !important;
}
html[data-theme="light"] .group-matches-box{
  background:#f8fbff !important;
  border-color:#dbe3f0 !important;
}
html[data-theme="light"] .group-matches-title{
  color:#64748b !important;
  border-bottom-color:#dbe3f0 !important;
}
html[data-theme="light"] .gtable th{
  background:#eef4fb !important;
  color:#475569 !important;
  border-bottom-color:#dbe3f0 !important;
}
html[data-theme="light"] .gtable td{
  color:#0f172a !important;
  border-bottom-color:#e5eaf3 !important;
}
html[data-theme="light"] .g-match{
  border-top-color:#dbe3f0 !important;
}
html[data-theme="light"] .g-match:hover{
  background:#f1f6fd !important;
}
html[data-theme="light"] .g-match .left,
html[data-theme="light"] .g-match .right,
html[data-theme="light"] .g-match .mid{
  color:#0f172a !important;
}

/* =========================
   MODALS / READONLY / STATS
   ========================= */

.modal-overlay{
  display:none;
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.70);
  z-index:12000;
  justify-content:center;
  align-items:center;
  padding:12px;
}
html[data-theme="light"] .modal-overlay{
  background: rgba(15,23,42,.45);
}
.modal-box{
  width:100%;
  max-width:720px;
  background: var(--ed-surface);
  border:1px solid var(--ed-border);
  border-radius:18px;
  padding:18px;
  text-align:center;
  max-height: calc(100vh - 24px);
  overflow:auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.modal-kicker{
  color:var(--ed-text-muted);
  font-size:.78rem;
  text-transform:uppercase;
  letter-spacing:2px;
  font-weight:1000;
  margin-top:-6px;
}
.stat-input-row{
  display:flex;
  justify-content:space-between;
  margin-bottom:8px;
  align-items:center;
  gap:10px;
}
.stat-input-row label{
  width:84px;
  text-align:center;
  font-size:.78rem;
  color:var(--ed-text-muted);
  font-weight:1000;
  text-transform:uppercase;
  letter-spacing:2px;
}
.stat-input-row input,
.stat-input-row select{
  width:120px;
  text-align:center;
  padding:8px;
  background: var(--ed-card-2);
  border:1px solid var(--ed-border);
  color:var(--ed-text);
  border-radius:12px;
}

.ro-grid{
  display:grid;
  grid-template-columns: 1fr 80px 1fr;
  gap:10px;
  align-items:center;
  background: var(--ed-card-2);
  padding:12px;
  border-radius:14px;
  border:1px solid var(--ed-border);
  margin-bottom:12px;
}
.ro-name{
  color:var(--ed-text);
  font-weight:1000;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.ro-mid{ color:var(--ed-danger); font-weight:1000; }
.ro-stats{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:12px;
}
.ro-stat{
  background: var(--ed-card-2);
  border:1px solid var(--ed-border);
  border-radius:12px;
  padding:10px;
  text-align:left;
}
.ro-stat .k{
  color:var(--ed-text-muted);
  font-size:.78rem;
  text-transform:uppercase;
  letter-spacing:2px;
  font-weight:900;
}
.ro-stat .v{
  color:var(--ed-text);
  font-weight:1000;
  margin-top:4px;
}

/* stats table */
.stats-table{
  width:100%;
  border-collapse: collapse;
  min-width:980px;
  position:relative;
  z-index:2;
}
.stats-table th{
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--ed-card-2) 92%, #000 8%);
  color: var(--ed-text-muted);
  font-size:.78rem;
  padding:10px;
  text-transform:uppercase;
  letter-spacing:2px;
  border-bottom:1px solid var(--ed-border);
  cursor:pointer;
  user-select:none;
  white-space:nowrap;
  pointer-events:auto !important;
  z-index:5;
}
.stats-table td{
  padding:10px;
  border-bottom:1px solid var(--ed-border-soft);
  color:var(--ed-text);
  text-align:center;
  white-space:nowrap;
}
.stats-table tr:hover td{ background: color-mix(in srgb, var(--ed-card-2) 92%, white 8%); }
.stats-table .st-name{
  text-align:left;
  font-weight:1000;
  color:var(--ed-text);
  max-width:320px;
  overflow:hidden;
  text-overflow:ellipsis;
}
.sort-ind{ margin-left:6px; font-weight:1000; color:var(--ed-text-muted); }

/* =========================
   DETAILS / ACCORDIONS
   ========================= */

details.card > summary{
  list-style:none;
  cursor:pointer;
  user-select:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
details.card > summary::-webkit-details-marker{ display:none; }
details.card > summary::after{
  content:"▾";
  font-size:1.05rem;
  color:var(--ed-text-muted);
  transition: transform .15s ease, color .15s ease;
}
details.card[open] > summary::after{
  transform: rotate(180deg);
  color: var(--ed-success);
}
details.card > summary:hover::after{ color:var(--ed-text); }
details.card > summary + *{ margin-top:12px; }

/* =========================
   LEGACY BRACKET
   ========================= */

.bracket{
  display:flex;
  gap:26px;
  overflow-x:auto;
  padding:20px 14px;
  background: radial-gradient(circle at 40% 0%, rgba(48,159,106,.06), transparent 60%), var(--ed-card-2);
  border-radius:16px;
  border:1px solid var(--ed-border);
  -webkit-overflow-scrolling:touch;
}
.round{
  min-width:260px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.round-title{
  position:sticky;
  top:0;
  z-index:5;
  text-align:center;
  color:var(--ed-text-muted);
  font-size:.82rem;
  text-transform:uppercase;
  letter-spacing:2px;
  background: var(--ed-card);
  padding:8px;
  border-radius:12px;
  border:1px solid var(--ed-border);
}
.match-card{
  background: var(--ed-card-2);
  border:1px solid var(--ed-border);
  border-radius:14px;
  overflow:hidden;
  box-shadow: var(--shadow);
  cursor:pointer;
  transition: transform .12s ease, border-color .12s ease;
}
.match-card:hover{
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--ed-success) 60%, var(--ed-border) 40%);
}
.match-card.finished{ opacity:.92; }

.prow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:9px 12px;
  background: var(--ed-card);
  border-bottom:1px solid var(--ed-border-soft);
  font-weight:1000;
  color:var(--ed-text);
}
.prow:last-child{ border-bottom:none; }
.prow.winner{
  background: color-mix(in srgb, var(--ed-success) 16%, var(--ed-card) 84%);
}
.pname{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.pscore{
  background: color-mix(in srgb, var(--ed-card) 90%, #000 10%);
  border:1px solid var(--ed-border);
  border-radius:10px;
  padding:2px 8px;
  min-width:36px;
  text-align:center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* =========================
   SVG BRACKET
   ========================= */

.bracket-wrap{
  position: relative;
  overflow:auto;
  padding-bottom:6px;
  margin-bottom:18px;
  border-radius:14px;
  border:1px solid var(--ed-border);
  background: var(--ed-card-2);
}
.bracket-grid{
  position:relative;
  z-index:2;
  display:grid;
  grid-auto-flow:column;
  grid-auto-columns:minmax(240px,280px);
  gap:24px;
  align-items:start;
  min-width:max-content;
  padding:8px 8px 14px;
}
.bracket-col{ min-width:240px; }
.bracket-col-title{
  color: var(--ed-text-muted);
  font-size:.76rem;
  font-weight:900;
  letter-spacing:1.8px;
  text-transform:uppercase;
  padding:0 4px;
}
.bracket-empty{
  color: var(--ed-text-muted);
  border:1px dashed var(--ed-border);
  border-radius:10px;
  padding:12px;
  text-align:center;
  font-size:.85rem;
}
.bracket-slot{ position:relative; }
.bracket-slot + .bracket-slot{ margin-top:14px; }

.bracket-lines{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  z-index:1;
  pointer-events:none;
  overflow:visible;
}
.bracket-line{
  fill:none;
  stroke: var(--line);
  stroke-width:2.25;
  stroke-linecap:round;
  stroke-linejoin:round;
  vector-effect:non-scaling-stroke;
  opacity:.92;
}
.bracket-line.win{
  stroke: var(--line-strong);
  stroke-width:2.9;
  opacity:1;
}
.bracket-line.live{ animation: bracketPulse 1.9s ease-in-out infinite; }
@keyframes bracketPulse{
  0%,100%{ opacity:.82; }
  50%{ opacity:1; }
}

.bracket-match{
  position:relative;
  z-index:2;
  background: var(--card-bg) !important;
  border:1px solid var(--card-brd) !important;
  border-radius:12px;
  padding:10px 10px 9px;
  cursor:pointer;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.bracket-match:hover{
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--card-brd) 70%, white 30%);
}
.bracket-match.is-winner{
  border-color: var(--card-brd-win) !important;
  box-shadow:
    0 0 0 1px rgba(132,255,80,.34),
    0 10px 26px rgba(80,255,120,.14);
}
.bracket-match .pm-top{
  display:flex;
  justify-content:space-between;
  gap:8px;
  margin-bottom:7px;
}
.bracket-match .pm-k{
  font-size:.73rem;
  font-weight:800;
  color:var(--txt-muted) !important;
  letter-spacing:.2px;
}
.bracket-match .bm-row{
  display:grid;
  grid-template-columns: 1fr auto;
  gap:8px;
  align-items:center;
  padding:2px 0;
}
.bracket-match .name{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--txt-main) !important;
  font-weight:900;
}
.bracket-match .score{
  min-width:24px;
  text-align:center;
  color:var(--ed-text);
  font-weight:1000;
  border:1px solid var(--ed-border);
  background: color-mix(in srgb, var(--ed-card) 85%, #000 15%);
  border-radius:8px;
  padding:1px 6px;
}

.name.winner,
.left.winner,
.right.winner{
  color: var(--ed-success) !important;
  font-weight:1000;
}

/* =========================
   STATUS CHIPS
   ========================= */

.status-chip,
.badge-status{
  border-radius:999px;
  padding:2px 9px;
  font-size:.74rem;
  font-weight:900;
  letter-spacing:.3px;
  border:1px solid var(--ed-border);
}
.status-chip.ready,.badge-status.ready{
  background: var(--chip-ready-bg);
  border-color: var(--chip-ready-brd);
}
.status-chip.live,.badge-status.live{
  background: color-mix(in srgb, var(--ed-accent) 18%, transparent);
  border-color: color-mix(in srgb, var(--ed-accent) 55%, transparent);
}
.status-chip.done,.badge-status.done{
  background: color-mix(in srgb, var(--ed-info) 15%, transparent);
  border-color: color-mix(in srgb, var(--ed-info) 45%, transparent);
}

/* overlays */
.bracket-wrap,.board-wrap,.tab-content{ position:relative; }
.bracket-wrap::before,
.board-wrap::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none !important;
  z-index:0 !important;
  background: linear-gradient(
    to bottom,
    rgba(5,8,14,.12),
    rgba(5,8,14,.06) 35%,
    rgba(5,8,14,.12)
  );
}
html[data-theme="light"] .bracket-wrap::before,
html[data-theme="light"] .board-wrap::before{
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,.18),
    rgba(255,255,255,.06) 35%,
    rgba(255,255,255,.14)
  );
}

.board-toolbar{
  display:flex;
  justify-content:flex-end;
  margin: 8px 0 12px;
}
#toggleAllSectionsBtn{ min-height:40px; }
#compactToggleBtn{ display:none; }

/* =========================
   SCORE MODAL LIGHT FIX + INLINE CATCH
   ========================= */

html[data-theme="light"] #scoreModal .modal-box,
html[data-theme="light"] #matchStatsModal .modal-box,
html[data-theme="light"] #playerModal .modal-box{
  background:#fff !important;
  border-color:#d9e1ee !important;
  color:#0f172a !important;
  box-shadow: 0 20px 50px rgba(15,23,42,.18) !important;
}

html[data-theme="light"] #scoreModal h3,
html[data-theme="light"] #scoreModal .modal-title{
  color:#0f172a !important;
}
html[data-theme="light"] #scoreModal .modal-kicker,
html[data-theme="light"] #scoreModal .pm-k,
html[data-theme="light"] #scoreModal label{
  color:#64748b !important;
}
html[data-theme="light"] #scoreModal .pm-v,
html[data-theme="light"] #scoreModal .player-name,
html[data-theme="light"] #scoreModal .ro-name,
html[data-theme="light"] #scoreModal #modal_n1,
html[data-theme="light"] #scoreModal #modal_n2{
  color:#0f172a !important;
}

html[data-theme="light"] #scoreModal input,
html[data-theme="light"] #scoreModal select,
html[data-theme="light"] #scoreModal textarea,
html[data-theme="light"] #scoreModal .form-input{
  background:#fff !important;
  color:#0f172a !important;
  border:1px solid #cfd8e6 !important;
}
html[data-theme="light"] #scoreModal input::placeholder,
html[data-theme="light"] #scoreModal textarea::placeholder{
  color:#94a3b8 !important;
}
html[data-theme="light"] #scoreModal input:focus,
html[data-theme="light"] #scoreModal select:focus,
html[data-theme="light"] #scoreModal textarea:focus{
  border-color:#93c5fd !important;
  box-shadow:0 0 0 3px rgba(59,130,246,.18) !important;
  outline:none !important;
}
html[data-theme="light"] #scoreModal .btn{
  background:#eef3fb !important;
  border-color:#c9d6ea !important;
  color:#0f172a !important;
}
html[data-theme="light"] #scoreModal .btn:hover{
  background:#e3ecf9 !important;
  border-color:#b8c8df !important;
}

/* =========================
   SCORE ADVANCED STATS OPEN LAYOUT
   ========================= */

.score-advanced-panel{
  background: var(--ed-card-2);
  border:1px solid var(--ed-border);
  border-radius:14px;
  padding:12px;
  margin-top:10px;
}
.score-advanced-title{
  color: var(--ed-text-muted);
  font-size:.78rem;
  text-transform:uppercase;
  letter-spacing:2px;
  font-weight:900;
  margin-bottom:10px;
}
.stat-grid{
  display:grid;
  gap:10px;
}
.stat-row{
  display:grid;
  grid-template-columns: 90px 1fr 1fr;
  gap:10px;
  align-items:center;
}
.stat-row label{
  text-align:center;
  font-size:.78rem;
  font-weight:900;
  letter-spacing:1px;
  text-transform:uppercase;
  color: var(--ed-text-muted);
}
.stat-row input{
  width:100%;
  text-align:center;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid var(--ed-border);
  background: var(--ed-card);
  color: var(--ed-text);
}

/* =========================
   MOBILE <= 900
   ========================= */

@media (max-width:900px){
  #compactToggleBtn{ display:inline-flex; }

  .page-wrap{ padding: 0 12px 28px; }
  .setup-grid{ grid-template-columns:1fr !important; gap:12px; }

  .hero{ padding:26px 12px 22px; }
  .hero h2{
    font-size: clamp(1.45rem, 6.2vw, 2rem);
    line-height:1.15;
    word-break:break-word;
    margin-bottom:6px;
  }
  .hero p{ font-size:.92rem; margin-top:4px; }

  .live-pill,.finished-pill{
    padding:5px 10px;
    font-size:.72rem;
    letter-spacing:1.4px;
    margin-bottom:8px;
  }

  .card{ border-radius:14px; padding:14px; }
  .card h3{
    font-size:.92rem;
    letter-spacing:1.4px;
    margin-bottom:10px;
    padding-bottom:8px;
  }

  .tabs{
    justify-content:flex-start;
    overflow-x:auto;
    flex-wrap:nowrap;
    gap:8px;
    padding:6px 4px 6px 0;
    -webkit-overflow-scrolling:touch;
    position:sticky;
    top:62px;
    z-index:40;
    background: color-mix(in srgb, var(--ed-bg) 88%, transparent 12%);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-bottom:1px solid var(--ed-border);
  }
  .tab{
    white-space:nowrap;
    min-height:38px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:9px 12px;
    border-radius:12px;
    font-size:.86rem;
  }

  .section-title{
    margin:14px 0 8px;
    padding-left:10px;
    align-items:center;
  }
  .st-title{ font-size:.88rem; letter-spacing:1.3px; line-height:1.2; }
  .st-sub{ font-size:.78rem; }
  .st-pill{ font-size:.66rem; padding:4px 8px; letter-spacing:1.2px; }

  .player-badge{ padding:9px 10px; border-radius:10px; gap:8px; }
  .player-match{ padding:9px 10px; border-radius:10px; }
  .pm-k{ font-size:.68rem; letter-spacing:1.2px; }
  .pm-v{ font-size:.98rem; line-height:1.3; }

  .bracket{ gap:14px; padding:12px 8px; border-radius:12px; }
  .round{ min-width:210px; gap:8px; }
  .round-title{ font-size:.7rem; padding:6px 8px; letter-spacing:1.2px; }
  .match-card{ border-radius:11px; }
  .prow{ padding:8px 9px; font-size:.86rem; }
  .pscore{ min-width:30px; padding:2px 6px; font-size:.84rem; }

  .group-grid{ grid-template-columns:1fr; gap:12px; }
  .group-card{ border-radius:12px; }
  .group-head{ padding:9px 10px; font-size:.92rem; }
  .gtable th{ font-size:.68rem; padding:8px 6px; letter-spacing:1.3px; }
  .gtable td{ padding:8px 6px; font-size:.84rem; }
  .g-match{
    grid-template-columns:1fr 56px 1fr;
    padding:9px 10px;
    gap:8px;
    font-size:.84rem;
  }

  .stats-table{ min-width:760px; }
  .stats-table th{ font-size:.66rem; letter-spacing:1.2px; padding:8px; }
  .stats-table td{ font-size:.82rem; padding:8px; }
  .stats-table .st-name{ max-width:170px; }

  .modal-overlay{ padding:6px; }
  .modal-box{
    border-radius:14px;
    padding:12px;
    max-height: calc(100vh - 12px);
  }
  .modal-box h3{ font-size:1rem; }
  .modal-kicker{ font-size:.68rem; letter-spacing:1.2px; }
  .stat-input-row{ gap:8px; margin-bottom:7px; }
  .stat-input-row label{
    width:68px;
    font-size:.64rem;
    letter-spacing:1.1px;
  }
  .stat-input-row input,
  .stat-input-row select{
    width:98px;
    padding:7px;
    border-radius:10px;
    font-size:.86rem;
  }

  .btn{ min-height:42px; }
  details.card > summary{ font-size:.95rem !important; }

  .bracket-grid{
    grid-auto-columns:minmax(220px,250px);
    gap:14px;
    padding:6px 4px 12px;
  }
  .bracket-col{ min-width:220px; }
  .bracket-match{
    border-radius:10px;
    padding:9px 9px 8px;
  }
  .bracket-line{ stroke-width:2.55; }
  .bracket-line.win{ stroke-width:3.2; }

  .stat-row{
    grid-template-columns: 72px 1fr 1fr;
    gap:8px;
  }
  .stat-row label{
    font-size:.68rem;
    letter-spacing:.8px;
  }
  .stat-row input{
    padding:7px 8px;
    font-size:.88rem;
  }
}

/* =========================
   EXTRA SMALL <= 480
   ========================= */

@media (max-width:480px){
  .page-wrap{ padding:0 10px 22px; }
  .hero{ padding:22px 10px 18px; }
  .hero h2{ font-size: clamp(1.25rem, 7vw, 1.65rem); }
  .hero p{ font-size:.84rem; }

  .card{ padding:11px; border-radius:12px; }
  .tab{ font-size:.8rem; padding:8px 10px; }
  .round{ min-width:188px; }
  .pm-v{ font-size:.84rem; }
  .g-match{ grid-template-columns:1fr 50px 1fr; font-size:.8rem; }

  .modal-box{ padding:10px; border-radius:12px; }
  .stat-input-row input,
  .stat-input-row select{
    width:88px;
    font-size:.82rem;
  }
  .stat-input-row label{
    width:62px;
    font-size:.6rem;
  }
}

/* =========================
   MOBILE COMPACT
   ========================= */

@media (max-width:900px){
  body.mobile-compact .hero{ padding:16px 10px 14px; }
  body.mobile-compact .hero h2{
    font-size: clamp(1.08rem, 5.4vw, 1.35rem);
    margin-bottom:2px;
  }
  body.mobile-compact .hero p{ font-size:.78rem; margin-top:2px; }
  body.mobile-compact .live-pill,
  body.mobile-compact .finished-pill{
    font-size:.62rem;
    padding:4px 8px;
    margin-bottom:6px;
  }

  body.mobile-compact .page-wrap{ padding:0 8px 16px; }
  body.mobile-compact .card{ padding:9px; border-radius:10px; }
  body.mobile-compact .card h3{
    font-size:.8rem;
    margin-bottom:7px;
    padding-bottom:6px;
  }

  body.mobile-compact .tabs{ gap:6px; margin:12px 0 8px; }
  body.mobile-compact .tab{
    font-size:.76rem;
    padding:7px 9px;
    border-radius:10px;
  }

  body.mobile-compact .section-title{ margin:10px 0 6px; padding-left:8px; }
  body.mobile-compact .st-title{ font-size:.78rem; letter-spacing:1px; }
  body.mobile-compact .st-sub{ font-size:.68rem; }
  body.mobile-compact .st-pill{ font-size:.58rem; padding:3px 7px; }

  body.mobile-compact .bracket{ gap:10px; padding:8px 6px; border-radius:10px; }
  body.mobile-compact .round{ min-width:168px; gap:6px; }
  body.mobile-compact .round-title{ font-size:.62rem; padding:5px 6px; }

  body.mobile-compact .prow{ padding:6px 7px; font-size:.78rem; }
  body.mobile-compact .pscore{ min-width:24px; padding:1px 5px; font-size:.74rem; }

  body.mobile-compact .group-grid{ gap:8px; }
  body.mobile-compact .group-head{ padding:7px 8px; font-size:.84rem; }
  body.mobile-compact .gtable th{ font-size:.58rem; padding:6px 4px; }
  body.mobile-compact .gtable td{ font-size:.76rem; padding:6px 4px; }
  body.mobile-compact .g-match{
    grid-template-columns:1fr 44px 1fr;
    padding:7px 8px;
    font-size:.76rem;
    gap:6px;
  }

  body.mobile-compact .player-badge{
    padding:7px 8px;
    border-radius:9px;
    margin-bottom:6px;
    font-size:.84rem;
  }
  body.mobile-compact .player-match{ padding:7px 8px; border-radius:9px; }
  body.mobile-compact .pm-k{ font-size:.6rem; }
  body.mobile-compact .pm-v{ font-size:.8rem; }

  body.mobile-compact .stats-table{ min-width:680px; }
  body.mobile-compact .stats-table th{ font-size:.58rem; padding:6px; }
  body.mobile-compact .stats-table td{ font-size:.74rem; padding:6px; }

  body.mobile-compact .modal-box{ padding:8px; border-radius:10px; }
  body.mobile-compact .modal-box h3{ font-size:.9rem; }

  body.mobile-compact .stat-input-row input,
  body.mobile-compact .stat-input-row select{
    width:82px;
    padding:6px;
    font-size:.78rem;
  }
  body.mobile-compact .stat-input-row label{
    width:56px;
    font-size:.56rem;
  }

  body.mobile-compact .btn{ min-height:36px; font-size:.82rem; }
}

/* =========================
   REDUCED MOTION
   ========================= */

@media (prefers-reduced-motion: reduce){
  .bracket-line.live{ animation:none; }
  .bracket-match,
  .match-card,
  .tab,
  .btn{ transition:none; }
}
/* ===== modals.php cleanup helper classes ===== */
.modal-title{ margin-top:0; color:var(--ed-success); }
.modal-title-accent{ color:var(--ed-accent); }

.modal-warn{
  margin-top:10px;
  padding:10px;
  border:1px solid rgba(245,158,11,.45);
  background: rgba(245,158,11,.08);
  border-radius:12px;
  color:#f59e0b;
  font-weight:900;
  text-align:left;
}

.score-form{ margin-top:14px; }
.score-panel{
  background: var(--ed-card-2);
  padding:14px;
  border-radius:14px;
  border:1px solid var(--ed-border);
  margin-bottom:14px;
}
.score-players{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.player-col{ flex:1; min-width:240px; }
.score-label{
  color:var(--ed-text-muted);
  font-size:.78rem;
  text-transform:uppercase;
  letter-spacing:2px;
  font-weight:900;
  margin-bottom:6px;
}
.score-select{
  width:100%;
  padding:10px;
}

.score-legs{
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.leg-col{ flex:1; text-align:center; }
.leg-name{ color:var(--ed-text); font-weight:1000; margin-bottom:5px; }
.leg-controls{
  display:flex;
  gap:8px;
  justify-content:center;
  align-items:center;
}
.btn-legs{ padding:8px 12px; min-width:44px; }
.leg-input{
  font-size:2rem;
  text-align:center;
  padding:10px;
  color:var(--ed-success);
  max-width:100px;
}
.legs-vs{
  font-size:1.5rem;
  font-weight:1000;
  color:var(--ed-danger);
  margin:0 10px;
}

.stat-label-hf{ color:#D4AF37 !important; }
.stat-label-180{ color:var(--ed-danger) !important; }
.stat-label-140{ color:#a855f7 !important; }
.stat-label-100{ color:#f59e0b !important; }
.stat-label-60{ color:var(--ed-success) !important; }

.score-actions{
  display:flex;
  gap:10px;
  margin-top:14px;
}
.btn-primary{ flex:2; }
.btn-cancel{
  flex:1;
  background:#333;
  border-color:#444;
}
html[data-theme="light"] .btn-cancel{
  background:#eef3fb;
  border-color:#c9d6ea;
  color:#0f172a;
}

.reset-btn-container{ margin-top:12px; }
.btn-danger-ghost{
  width:100%;
  background:transparent;
  border:1px solid var(--ed-danger);
  color:var(--ed-danger);
}

.modal-box-accent{ border-color: rgba(245,158,11,.45); }
.ro-name-right{ text-align:right; }
.meta-row{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
}
.meta-item{
  color:var(--ed-text-muted);
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:2px;
  font-size:.78rem;
}
.modal-empty{
  color:var(--ed-text-muted);
  padding:10px 0;
}
.modal-actions{
  display:flex;
  gap:10px;
  margin-top:14px;
}
.modal-actions .btn{ flex:1; }
.modal-box-player{ max-width:720px; }
.modal-mt-12{ margin-top:12px; }
.player-modal-section{
  margin-top:14px;
  text-align:left;
}

/* mobile tweaks */
@media (max-width:900px){
  .score-actions{ flex-direction:column; }
  .score-actions .btn{ width:100%; flex:unset; }
  .score-legs{ flex-direction:column; gap:10px; }
  .legs-vs{ margin:2px 0; }
}
/* ===== Inline-cleanup utility classes ===== */

.hero-strong{ color: var(--ed-text); }

.section-summary{
  cursor:pointer;
  list-style:none;
  user-select:none;
  font-weight:1000;
  font-size:1rem;
}
.section-summary-accent{ color: var(--ed-accent); }
.section-summary-gold{ color: #f59e0b; }
.section-summary-green{ color: var(--ed-success); }
.section-summary-red{ color: var(--ed-danger); }
.section-summary-silver{ color: #c0c0c0; }
.section-summary-bronze{ color: #CD7F32; }
.section-summary-final{ color: #FFD700; }

.muted-empty{ color: var(--ed-text-muted); }

.status-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:14px;
}
.status-card{
  padding:12px;
  border:1px solid var(--ed-border);
  border-radius:12px;
  background: var(--ed-card-2);
}
.status-card-wide{ grid-column:1 / -1; }
.status-k{
  color: var(--ed-text-muted);
  font-size:.78rem;
  text-transform:uppercase;
  letter-spacing:2px;
  font-weight:900;
}
.status-v{
  color: var(--ed-text);
  font-size:1.6rem;
  font-weight:1000;
}
.status-v-live{
  color: var(--ed-success);
  font-size:1.4rem;
}

.group-head-summary{
  cursor:pointer;
  list-style:none;
}
.group-matches-box-clean{
  margin:0 10px 10px;
}
.group-matches-title-clean{
  padding:10px;
}

/* Light contrast for status cards */
html[data-theme="light"] .status-card{
  background:#f8fbff;
  border-color:#dbe3f0;
}
/* ===== admin.php cleanup classes ===== */

.admin-actions-row{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}
.admin-action-form{ margin:0; }

.btn-admin{ border-width:1px; }

.btn-admin-finish{
  background: rgba(245,158,11,0.12);
  border-color: rgba(245,158,11,0.45);
  color: #f59e0b;
}
.btn-admin-reopen{
  background: rgba(48,159,106,0.12);
  border-color: rgba(48,159,106,0.45);
  color: var(--ed-success);
}
.btn-admin-groups{
  background: rgba(59,130,246,0.12);
  border-color: rgba(59,130,246,0.45);
  color: #93c5fd;
}
.btn-admin-bronze{
  background: rgba(205,127,50,0.12);
  border-color: rgba(205,127,50,0.45);
  color: #CD7F32;
}
.btn-admin-reset{
  background: rgba(227,41,46,0.12);
  border-color: rgba(227,41,46,0.45);
  color: var(--ed-danger);
}
.btn-admin-upgrade{
  background: rgba(255,255,255,0.06);
  border-color: #444;
}

.admin-tip{
  color: var(--ed-text-muted);
  margin-top: 16px;
  font-size: .95rem;
}

/* light mode fine-tuning */
html[data-theme="light"] .btn-admin-upgrade{
  background:#eef3fb;
  border-color:#c9d6ea;
  color:#334155;
}
/* =========================
   LIGHT MODE HARDENING PASS
   (append at very end)
   ========================= */
html[data-theme="light"]{
  color-scheme: light;
}

/* Base text + surfaces */
html[data-theme="light"] body,
html[data-theme="light"] .page-wrap{
  color: #0f172a;
  background: var(--ed-bg);
}
html[data-theme="light"] .card{
  background:#fff;
  border-color:#d9e1ee;
}
html[data-theme="light"] .card h3{
  color:#92400e;
  border-bottom-color:#e5eaf3;
}

/* Tabs stronger contrast */
html[data-theme="light"] .tab{
  color:#334155;
  background:#f3f7fd;
  border-color:#d3deee;
}
html[data-theme="light"] .tab.active{
  color:#0f172a;
  background:#eaf2ff;
  border-color:#93c5fd;
  box-shadow: inset 0 0 0 1px rgba(59,130,246,.22);
}

/* Buttons */
html[data-theme="light"] .btn{
  color:#0f172a;
  background:#eef3fb;
  border-color:#c9d6ea;
}
html[data-theme="light"] .btn:hover{
  background:#e3ecf9;
  border-color:#b8c8df;
}

/* Player rows */
html[data-theme="light"] .player-badge,
html[data-theme="light"] .player-match{
  background:#f8fbff;
  border-color:#dbe3f0;
}
html[data-theme="light"] .pm-k{ color:#64748b; }
html[data-theme="light"] .pm-v{ color:#0f172a; }

/* Stats table readability */
html[data-theme="light"] .stats-table th{
  background:#eef4fb;
  color:#475569;
  border-bottom-color:#dbe3f0;
}
html[data-theme="light"] .stats-table td{
  color:#0f172a;
  border-bottom-color:#e5eaf3;
}
html[data-theme="light"] .stats-table tr:hover td{
  background:#f1f6fd;
}
html[data-theme="light"] .sort-ind{ color:#64748b; }

/* Bracket cards/lines */
html[data-theme="light"] .bracket-wrap{
  background:#f8fbff;
  border-color:#dbe3f0;
}
html[data-theme="light"] .bracket-col-title,
html[data-theme="light"] .bracket-empty{
  color:#64748b;
}
html[data-theme="light"] .bracket-match{
  background:#fff !important;
  border-color:#bfd0e8 !important;
  box-shadow: 0 4px 14px rgba(15,23,42,.07);
}
html[data-theme="light"] .bracket-match .pm-k{ color:#64748b !important; }
html[data-theme="light"] .bracket-match .name{ color:#0f172a !important; }
html[data-theme="light"] .bracket-match .score{
  color:#0f172a;
  background:#f3f7fd;
  border-color:#d3deee;
}
html[data-theme="light"] .bracket-line{
  stroke:#8aa2c3;
}
html[data-theme="light"] .bracket-line.win{
  stroke:#2f7fd8;
}

/* Group section extra safety */
html[data-theme="light"] .group-head{
  background: linear-gradient(135deg, rgba(245,158,11,.12), transparent);
  border-bottom-color:#e3d3b4;
}
html[data-theme="light"] .g-rank{ color:#475569; }
html[data-theme="light"] .g-wins{ color:#166534; font-weight:900; }

/* Section labels / muted */
html[data-theme="light"] .st-title{ color:#0f172a; }
html[data-theme="light"] .st-sub,
html[data-theme="light"] .muted-empty,
html[data-theme="light"] .modal-kicker,
html[data-theme="light"] .meta-item{
  color:#64748b;
}

/* Details arrow contrast */
html[data-theme="light"] details.card > summary::after{
  color:#64748b;
}
html[data-theme="light"] details.card[open] > summary::after{
  color:#15803d;
}
/* =========================
   LIGHT MODE FINISH (clean)
   ========================= */
html[data-theme="light"]{
  color-scheme: light;
}

html[data-theme="light"] body,
html[data-theme="light"] .page-wrap{
  color:#0f172a;
  background:var(--ed-bg);
}

html[data-theme="light"] .card{
  background:#fff;
  border-color:#d9e1ee;
}
html[data-theme="light"] .card h3{
  color:#92400e;
  border-bottom-color:#e5eaf3;
}

html[data-theme="light"] .tab{
  color:#334155;
  background:#f3f7fd;
  border-color:#d3deee;
}
html[data-theme="light"] .tab.active{
  color:#0f172a;
  background:#eaf2ff;
  border-color:#93c5fd;
  box-shadow: inset 0 0 0 1px rgba(59,130,246,.22);
}

html[data-theme="light"] .btn{
  color:#0f172a;
  background:#eef3fb;
  border-color:#c9d6ea;
}
html[data-theme="light"] .btn:hover{
  background:#e3ecf9;
  border-color:#b8c8df;
}

html[data-theme="light"] .player-badge,
html[data-theme="light"] .player-match{
  background:#f8fbff;
  border-color:#dbe3f0;
}
html[data-theme="light"] .pm-k{ color:#64748b; }
html[data-theme="light"] .pm-v{ color:#0f172a; }

html[data-theme="light"] .stats-table th{
  background:#eef4fb;
  color:#475569;
  border-bottom-color:#dbe3f0;
}
html[data-theme="light"] .stats-table td{
  color:#0f172a;
  border-bottom-color:#e5eaf3;
}
html[data-theme="light"] .stats-table tr:hover td{
  background:#f1f6fd;
}
html[data-theme="light"] .sort-ind{ color:#64748b; }

html[data-theme="light"] .bracket-wrap{
  background:#f8fbff;
  border-color:#dbe3f0;
}
html[data-theme="light"] .bracket-col-title,
html[data-theme="light"] .bracket-empty{
  color:#64748b;
}
html[data-theme="light"] .bracket-match{
  background:#fff !important;
  border-color:#bfd0e8 !important;
  box-shadow:0 4px 14px rgba(15,23,42,.07);
}
html[data-theme="light"] .bracket-match .pm-k{ color:#64748b !important; }
html[data-theme="light"] .bracket-match .name{ color:#0f172a !important; }
html[data-theme="light"] .bracket-match .score{
  color:#0f172a;
  background:#f3f7fd;
  border-color:#d3deee;
}
html[data-theme="light"] .bracket-line{ stroke:#8aa2c3; }
html[data-theme="light"] .bracket-line.win{ stroke:#2f7fd8; }

html[data-theme="light"] .group-card{
  background:#fff;
  border-color:#d9e1ee;
}
html[data-theme="light"] .group-matches-box{
  background:#f8fbff;
  border-color:#dbe3f0;
}
html[data-theme="light"] .group-matches-title{
  color:#64748b;
  border-bottom-color:#dbe3f0;
}
html[data-theme="light"] .group-head{
  background:linear-gradient(135deg, rgba(245,158,11,.12), transparent);
  border-bottom-color:#e3d3b4;
}
html[data-theme="light"] .gtable th{
  background:#eef4fb;
  color:#475569;
  border-bottom-color:#dbe3f0;
}
html[data-theme="light"] .gtable td{
  color:#0f172a;
  border-bottom-color:#e5eaf3;
}
html[data-theme="light"] .g-match{
  border-top-color:#dbe3f0;
}
html[data-theme="light"] .g-match:hover{
  background:#f1f6fd;
}
html[data-theme="light"] .g-match .left,
html[data-theme="light"] .g-match .right,
html[data-theme="light"] .g-match .mid{
  color:#0f172a;
}

html[data-theme="light"] .st-title{ color:#0f172a; }
html[data-theme="light"] .st-sub,
html[data-theme="light"] .muted-empty,
html[data-theme="light"] .modal-kicker,
html[data-theme="light"] .meta-item{
  color:#64748b;
}

html[data-theme="light"] details.card > summary::after{ color:#64748b; }
html[data-theme="light"] details.card[open] > summary::after{ color:#15803d; }

html[data-theme="light"] .status-card{
  background:#f8fbff;
  border-color:#dbe3f0;
}

html[data-theme="light"] .modal-overlay{
  background:rgba(15,23,42,.45);
}
html[data-theme="light"] .modal-box{
  background:#fff;
  border-color:#d9e1ee;
  color:#0f172a;
  box-shadow:0 20px 50px rgba(15,23,42,.18);
}
html[data-theme="light"] .modal-box input,
html[data-theme="light"] .modal-box select,
html[data-theme="light"] .modal-box textarea,
html[data-theme="light"] .modal-box .form-input{
  background:#fff;
  color:#0f172a;
  border:1px solid #cfd8e6;
}
html[data-theme="light"] .modal-box input::placeholder,
html[data-theme="light"] .modal-box textarea::placeholder{
  color:#94a3b8;
}
html[data-theme="light"] .modal-box input:focus,
html[data-theme="light"] .modal-box select:focus,
html[data-theme="light"] .modal-box textarea:focus{
  border-color:#93c5fd;
  box-shadow:0 0 0 3px rgba(59,130,246,.18);
  outline:none;
}
html[data-theme="light"] .modal-box .btn{
  background:#eef3fb;
  border-color:#c9d6ea;
  color:#0f172a;
}
html[data-theme="light"] .modal-box .btn:hover{
  background:#e3ecf9;
  border-color:#b8c8df;
}