:root {
  --bg-0: #0d1117;
  --bg-1: #151b23;
  --bg-2: #1c2430;
  --bg-3: #232c3a;
  --line: #2c3645;
  --text-0: #eef2f7;
  --text-1: #aab4c2;
  --text-2: #6e7a8a;
  --accent-red: #c8312e;
  --accent-red-dim: #7a1f1d;
  --accent-blue: #4a90d9;
  --status-live: #3ea05f;
  --status-off: #5a6472;
  --mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Arial, sans-serif;
  --radius: 4px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-0);
  color: var(--text-0);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
  background: var(--accent-red);
  border-radius: 6px;
}
.brand-name {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 14px;
}
.brand-sub {
  color: var(--text-2);
  font-size: 12px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.date-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-1);
}
.date-picker input {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text-0);
  border-radius: var(--radius);
  padding: 5px 8px;
  font-family: var(--mono);
  font-size: 12px;
}
.conn-status {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
}
.conn-status.conn-ok { color: var(--status-live); border-color: var(--status-live); }
.conn-status.conn-error { color: var(--accent-red); border-color: var(--accent-red); }
.conn-status.conn-unknown { color: var(--status-off); }

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-1);
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.tab {
  background: transparent;
  border: none;
  color: var(--text-2);
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--text-0); }
.tab.active {
  color: var(--text-0);
  border-bottom-color: var(--accent-red);
}

/* ---------- Layout ---------- */
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 80px;
}
.panel { display: none; }
.panel.active { display: block; animation: fadein .15s ease; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.panel-header h1 {
  font-size: 19px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

.panel-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.manual-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}
.manual-toggle input[type="checkbox"] {
  accent-color: var(--accent, #e8453f);
  width: 14px;
  height: 14px;
  cursor: pointer;
}
.manual-toggle:has(input:checked) {
  color: var(--text-0);
  font-weight: 600;
}
.manual-toggle:has(input:checked) span::before {
  content: '🔒 ';
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
}
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
}

.card {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.card-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-1);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.hint {
  color: var(--text-2);
  font-size: 12px;
  margin: 8px 0 12px;
  line-height: 1.5;
}

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: filter .12s, background .12s;
}
.btn:active { filter: brightness(0.85); }
.btn-primary {
  background: var(--accent-red);
  color: #fff;
  width: 100%;
  margin-top: 12px;
}
.btn-primary:hover { background: #d83a37; }
.btn-secondary {
  background: var(--bg-3);
  color: var(--text-0);
  border-color: var(--line);
}
.btn-secondary:hover { background: #2a3340; }
.btn-ghost {
  background: transparent;
  color: var(--text-1);
  border-color: var(--line);
}
.btn-ghost:hover { color: var(--text-0); border-color: var(--text-2); }
.btn-danger-ghost {
  background: transparent;
  color: var(--accent-red);
  border: 1px solid var(--accent-red-dim);
  padding: 4px 9px;
  font-size: 11px;
}

/* ---------- Forms ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-1);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.form-grid label:has(input[type="text"]),
.form-grid label:has(select) {}
.form-grid input, .form-grid select {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text-0);
  border-radius: var(--radius);
  padding: 9px 10px;
  font-size: 13.5px;
  font-family: var(--sans);
}
.form-grid input:focus, .form-grid select:focus {
  outline: none;
  border-color: var(--accent-blue);
}
.form-grid button { grid-column: 1 / -1; }

#tab-crosspromo .form-grid,
#tab-reglages .form-grid { grid-template-columns: 1fr; }

/* generic standalone label/select outside form-grid */
.card > label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-1);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 12px;
}
.card > label select, .card > label input {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text-0);
  border-radius: var(--radius);
  padding: 9px 10px;
  font-size: 13.5px;
  font-family: var(--sans);
}

/* Global select style — tous les selects de l'app en sombre */
select {
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text-0);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 13px;
  font-family: var(--sans);
  appearance: auto;
}
select:focus {
  outline: none;
  border-color: var(--accent-blue);
}

/* Section envoi XPression : aligner les deux colonnes en haut,
   boutons de même hauteur via align-items:stretch */
.xp-send-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.xp-send-col label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
  color: var(--text-1);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.xp-send-col label select {
  width: 100%;
}
.xp-send-col .xp-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.xp-send-col .xp-btns .btn {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Playoff — bloc envoi Xpression ---------- */
.po-send-block {
  background: linear-gradient(135deg, var(--bg-2) 0%, var(--bg-3) 100%);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent-red);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
}
.po-send-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  margin-bottom: 10px;
}
.po-send-row {
  display: flex;
  gap: 12px;
  align-items: center;
}
.po-send-select {
  flex: 1;
  height: 46px;
  font-size: 15px;
  font-weight: 600;
  padding: 0 14px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text-0);
}
.po-send-select:focus {
  outline: none;
  border-color: var(--accent-red);
}
.po-send-btn {
  height: 46px;
  padding: 0 24px;
  background: var(--accent-red);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 0.01em;
}
.po-send-btn:hover  { background: #c0392b; }
.po-send-btn:active { transform: scale(0.98); }
.po-send-btn-icon {
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

/* ---------- Play-in ---------- */
.pi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}
.pi-agg {
  font-size: 26px;
  font-weight: 800;
  text-align: center;
  color: var(--text-0);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  padding: 10px 0;
  background: var(--bg-3);
  border-radius: var(--radius);
}
.pi-match-row {
  display: grid;
  grid-template-columns: 48px 1fr 36px 16px 36px 56px;
  gap: 4px;
  align-items: center;
  margin-top: 6px;
}
.pi-match-row-no-ot {
  grid-template-columns: 48px 1fr 36px 16px 36px;
}
.pi-match-sep {
  text-align: center;
  font-weight: 700;
  color: var(--text-2);
  font-size: 13px;
}
.pi-match-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pi-match-row input,
.pi-match-row select {
  font-size: 12px;
  padding: 4px 6px;
  height: 28px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  color: var(--text-0);
  border-radius: var(--radius);
  font-family: var(--sans);
  min-width: 0;
  box-sizing: border-box;
}
.pi-match-row input:focus,
.pi-match-row select:focus {
  outline: none;
  border-color: var(--accent-blue);
}
.pi-grid .form-grid {
  margin-bottom: 8px;
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
table.data-table th {
  text-align: left;
  color: var(--text-2);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
table.data-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--bg-2);
  font-family: var(--mono);
}
table.data-table td.team-name { font-family: var(--sans); font-weight: 600; }
table.data-table tr:hover td { background: var(--bg-2); }
table.data-table .rank-cell {
  background: var(--bg-3);
  color: var(--text-1);
  font-weight: 700;
  text-align: center;
  width: 28px;
}
table.data-table input[type="text"] {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text-0);
  border-radius: var(--radius);
  padding: 5px 7px;
  font-family: var(--mono);
  font-size: 12px;
}
table.data-table input[type="number"] {
  width: 64px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text-0);
  border-radius: var(--radius);
  padding: 5px 7px;
  font-family: var(--mono);
  font-size: 12px;
}
table.data-table select {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text-0);
  border-radius: var(--radius);
  padding: 5px 4px;
  font-family: var(--mono);
  font-size: 12px;
}
table.data-table .reorder-cell {
  white-space: nowrap;
  width: 1%;
}
table.data-table .reorder-cell button {
  background: none;
  border: 1px solid var(--line);
  color: var(--text-2);
  border-radius: var(--radius);
  width: 22px;
  height: 22px;
  line-height: 1;
  cursor: pointer;
  font-size: 11px;
}
table.data-table .reorder-cell button:hover {
  color: var(--text-0);
  border-color: var(--text-2);
}
table.data-table .reorder-cell button:disabled {
  opacity: 0.25;
  cursor: default;
}
tr.row-manual td.rank-cell {
  background: #4a3a1f;
  color: #f0c97a;
}
.manual-badge {
  display: inline-block;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f0c97a;
  background: #4a3a1f;
  border-radius: 3px;
  padding: 2px 5px;
  margin-left: 8px;
  vertical-align: middle;
}

.empty-state {
  color: var(--text-2);
  font-size: 13px;
  text-align: center;
  padding: 30px 10px;
}

/* ---------- JSON preview ---------- */
.json-preview {
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
  color: #8fd19e;
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ---------- Item lists (guests, players, program) ---------- */
.item-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
  max-height: none;
  overflow-y: auto;
}
.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
}
.item-row-main { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.item-row-title { font-size: 13px; font-weight: 600; }
.item-row-sub { font-size: 11px; color: var(--text-2); font-family: var(--mono); }

.item-row-reorder {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-right: 8px;
  flex-shrink: 0;
}
.item-row-reorder button {
  background: none;
  border: 1px solid var(--line);
  color: var(--text-2);
  border-radius: var(--radius);
  width: 20px;
  height: 18px;
  line-height: 1;
  cursor: pointer;
  font-size: 10px;
  padding: 0;
}
.item-row-reorder button:hover { color: var(--text-0); border-color: var(--text-2); }
.item-row-reorder button:disabled { opacity: 0.25; cursor: default; }

.item-row-actions { display: flex; gap: 6px; flex-shrink: 0; }
.item-row-actions .btn { white-space: nowrap; }

.item-row-editing { align-items: stretch; }
.item-row-edit-inputs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  margin-right: 10px;
}
.item-row-edit-inputs input,
.item-row-edit-inputs select {
  background: var(--bg-1);
  border: 1px solid var(--line);
  color: var(--text-0);
  border-radius: var(--radius);
  padding: 6px 8px;
  font-size: 12.5px;
  font-family: var(--sans);
}
.item-row-edit-inputs input:focus,
.item-row-edit-inputs select:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.item-row-check {
  cursor: pointer;
  gap: 10px;
  justify-content: flex-start;
}
.item-row-check input[type="checkbox"] {
  accent-color: var(--accent-red);
  width: 15px;
  height: 15px;
  cursor: pointer;
  flex-shrink: 0;
}
.item-row-check-locked {
  cursor: not-allowed;
  opacity: 0.4;
}
.item-row-check-locked input[type="checkbox"] {
  cursor: not-allowed;
}

.select-actions {
  display: flex;
  gap: 8px;
  margin: -2px 0 14px;
}
.btn-sm {
  padding: 5px 10px;
  font-size: 11px;
}

/* ---------- Lowerthird preview ---------- */
.lt-preview {
  background: linear-gradient(90deg, var(--bg-3), var(--bg-2));
  border-left: 4px solid var(--accent-red);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.lt-line1 { font-size: 17px; font-weight: 700; color: var(--text-0); }
.lt-line2 { font-size: 12.5px; color: var(--text-1); margin-top: 3px; font-weight: 600; letter-spacing: 0.02em; }
.lt-sep { border: none; border-top: 1px solid var(--line); margin: 10px 0; opacity: 0.6; }

/* ---------- Crosspromo preview ---------- */
.cp-preview {
  background: var(--bg-0);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}
.cp-line1 {
  display: inline-block;
  background: var(--accent-red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 2px;
  margin-bottom: 10px;
}
.cp-line2 {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-0);
  margin-bottom: 6px;
}
.cp-line3 {
  font-size: 12.5px;
  color: var(--text-1);
  background: var(--bg-3);
  display: inline-block;
  padding: 5px 10px;
  border-radius: 2px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--text-0);
  padding: 11px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.toast-error { border-color: var(--accent-red); color: #ff8d8a; }
.toast.toast-success { border-color: var(--status-live); color: #8fe0a8; }
/* =========================================================
   IMAGES TABS
   ========================================================= */
.images-list { gap: 6px; }

.img-row {
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
}
.img-row-index {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-2);
  min-width: 18px;
  text-align: right;
  flex-shrink: 0;
}
.img-row-thumb-wrap {
  width: 96px;
  height: 54px;
  flex-shrink: 0;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.img-row-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* =========================================================
   CROSSPROMO — badge hasPhoto
   ========================================================= */
.cp-photo-badge {
  display: inline-block;
  margin-left: 10px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 99px;
  font-family: var(--mono);
  letter-spacing: 0.02em;
  vertical-align: middle;
}
.cp-photo-badge--on  { background: #2a3f2a; color: #8fe0a8; border: 1px solid #3a5e3a; }
.cp-photo-badge--off { background: var(--bg-3); color: var(--text-2); border: 1px solid var(--line); }

.form-grid label.cp-photo-toggle,
.cp-photo-toggle {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 6px 0 2px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-2);
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}
.form-grid label.cp-photo-toggle input[type="checkbox"],
.cp-photo-toggle input[type="checkbox"] {
  accent-color: var(--accent-red);
  width: 14px;
  height: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

/* ── TABS — sélection / envoi (panneau droite) ── */
.tabs-no-selection {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 80px;
  color: var(--text-2);
  font-size: 13px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.tabs-selection-preview {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.tabs-preview-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: block;
}
.tabs-preview-meta { display: flex; flex-direction: column; gap: 3px; }
.tabs-preview-comment {
  font-size: 11.5px;
  color: var(--text-1);
  font-style: italic;
  margin-top: 4px;
}

/* ── TABS — commentaire dans la liste ── */
.img-comment-input,
.sp-comment-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  color: var(--text-2);
  font-size: 11.5px;
  font-family: var(--sans);
  font-style: italic;
  padding: 2px 0;
  margin-top: 3px;
  transition: border-color .15s, color .15s;
  outline: none;
}
.img-comment-input:focus,
.img-comment-input:not(:placeholder-shown),
.sp-comment-input:focus,
.sp-comment-input:not(:placeholder-shown) {
  color: var(--text-1);
  border-bottom-color: var(--line);
}
.img-comment-input::placeholder,
.sp-comment-input::placeholder { color: var(--text-2); opacity: 0.55; }

.img-comment-input:focus,
.img-comment-input:not(:placeholder-shown) {
  color: var(--text-1);
  border-bottom-color: var(--line);
}
.img-comment-input::placeholder { color: var(--text-2); opacity: 0.55; }

/* ── TABS — ligne sélectionnée ── */
.img-row--selected { border-color: var(--accent-red) !important; background: rgba(232,71,68,0.06) !important; }
.img-btn-selected { background: var(--accent-red) !important; color: #fff !important; border-color: var(--accent-red) !important; }

/* ── Crosspromo — édition inline ── */
.cp-edit-row { flex-direction: column; align-items: stretch; gap: 10px; }

.cp-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.cp-edit-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cp-edit-grid input[type="text"],
.cp-edit-grid input[type="date"],
.cp-edit-grid input[type="time"],
.cp-edit-grid select {
  background: var(--bg-1);
  border: 1px solid var(--line);
  color: var(--text-0);
  border-radius: var(--radius);
  padding: 6px 8px;
  font-size: 12.5px;
  font-family: var(--sans);
}
.cp-edit-grid input:focus,
.cp-edit-grid select:focus {
  outline: none;
  border-color: var(--accent-blue);
}
.cp-edit-photo-label {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  padding-top: 18px;
  font-size: 12px !important;
  color: var(--text-1) !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}
.cp-edit-photo-label input[type="checkbox"] {
  accent-color: var(--accent-red);
  width: 14px; height: 14px;
}
/* =========================================================
   STUDIO
   ========================================================= */
.studio-screen-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
  margin-bottom: 8px;
}
.studio-mode-btn.active {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}
.studio-layer-cfg {
  margin: 0 0 4px 0;
}

/* Details/summary studio panels */
.studio-logo-panel summary::-webkit-details-marker { display: none; }
.studio-logo-panel[open] .details-arrow { transform: rotate(90deg); }
.details-arrow { transition: transform 0.15s; display: inline-block; }
/* =========================================================
   SCOREBOARD
   ========================================================= */
.sb-hint { color: var(--text-2); font-size: 11px; font-weight: 400; }

.sb-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 12px; }
.sb-team { display: flex; flex-direction: column; gap: 6px; }
.sb-team > label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); }
.sb-team input, .sb-team select {
  background: var(--bg-0); border: 1px solid var(--line); color: var(--text-0);
  border-radius: var(--radius); padding: 7px 9px; font-size: 13px; width: 100%;
}
.sb-score { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.sb-score span {
  font-family: var(--mono); font-size: 30px; font-weight: 700; min-width: 46px;
  text-align: center; color: var(--text-0);
}
.sb-score .btn { padding: 4px 12px; font-size: 16px; }

.sb-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.sb-row > label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); min-width: 78px; }
.sb-row input[type=text] {
  background: var(--bg-0); border: 1px solid var(--line); color: var(--text-0);
  border-radius: var(--radius); padding: 6px 9px; font-size: 13px; flex: 1; min-width: 120px;
}
.sb-period-num { font-family: var(--mono); font-size: 20px; font-weight: 700; min-width: 28px; text-align: center; }

.sb-seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sb-seg button {
  background: var(--bg-1); border: 0; color: var(--text-1); padding: 6px 12px;
  font-size: 12px; cursor: pointer; border-right: 1px solid var(--line);
}
.sb-seg button:last-child { border-right: 0; }
.sb-seg button:hover { color: var(--text-0); }
.sb-seg button.active { background: var(--accent-blue); color: #fff; }

.sb-clock-block { margin-bottom: 16px; }
.sb-clock-block:last-child { margin-bottom: 0; }
.sb-clock-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-1); margin-bottom: 4px; }
.sb-clock-head label { color: var(--text-2); font-size: 11px; }
.sb-mini {
  background: var(--bg-0); border: 1px solid var(--line); color: var(--text-0);
  border-radius: var(--radius); padding: 4px 6px; font-size: 12px; width: 68px;
  font-family: var(--mono); text-align: center;
}
.sb-clock-display {
  font-family: var(--mono); font-size: 44px; font-weight: 700; letter-spacing: 1px;
  color: var(--text-1); background: var(--bg-0); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 8px 0; text-align: center; margin-bottom: 6px;
}
.sb-clock-display.running { color: var(--status-live); }
.sb-clock-ctrl { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sb-clock-ctrl .btn { padding: 5px 10px; font-size: 12px; }

.sb-pen-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.sb-pen-count { font-size: 10px; opacity: .75; margin-left: 4px; }
.sb-pen-col .empty-state { padding: 8px; font-size: 12px; }
.sb-pen-row {
  display: flex; align-items: center; gap: 8px; padding: 5px 7px; margin-bottom: 4px;
  background: var(--bg-0); border: 1px solid var(--line); border-radius: var(--radius);
}
.sb-pen-team {
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: #fff; border-radius: 3px; padding: 2px 5px; min-width: 34px; text-align: center;
}
.sb-pen-clock { font-family: var(--mono); font-weight: 700; color: var(--accent-red); min-width: 44px; }
.sb-pen-player { flex: 1; font-size: 13px; }
.sb-pen-min { color: var(--text-2); font-size: 12px; }
.btn.sb-xs { padding: 2px 6px; font-size: 11px; }
