/* El!te Development back office. Light by default (people work here for long stretches), dark as a choice in My profile.
   Layout: a black sidebar of the areas each person can use, a content column with lists and forms. */
:root {
  --bg: #F3F1EE; --panel: #FFFFFF; --line: #E2DED9; --text: #1A1A1D; --soft: #5E5A57; --ink: #0C0C0E; --side: #0C0C0E; --side-text: #CFCBC7;
  --red: #E0262F; --red-dark: #C41E26; --ok-bg: #E4F4E9; --ok: #1E6B38; --warn-bg: #FFF1DD; --warn: #8A4B00; --bad-bg: #FCE4E5; --bad: #9B1620; --input: #FFFFFF;
  --display: "Big Shoulders Display", Impact, "Arial Narrow Bold", sans-serif; --body: Archivo, "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #0F0F12; --panel: #17171B; --line: #2A2A31; --text: #F2F0EE; --soft: #A8A4A0; --ink: #000; --side: #000; --side-text: #BDB9B5;
  --ok-bg: #12301D; --ok: #8FD9A6; --warn-bg: #33240C; --warn: #F2C27A; --bad-bg: #3A1215; --bad: #FF8A8F; --input: #0F0F12;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--body); }
a { color: var(--red-dark); }
html[data-theme="dark"] a { color: #FF6A70; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
h1 { font-family: var(--display); font-weight: 900; font-size: 38px; line-height: 1; text-transform: uppercase; margin: 0; }
h2 { font-size: 18px; margin: 0 0 10px; }
.loading { padding: 40px; color: var(--soft); }

/* Sign-in screens */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-left, 0px)); background: var(--ink); }
.gate-card { width: 100%; max-width: 420px; background: var(--panel); color: var(--text); border-radius: 8px; padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.gate-card .brand { display: flex; align-items: center; gap: 12px; }
.gate-card .brand img { width: 52px; height: 52px; border-radius: 50%; }
.gate-card .brand b { font-family: var(--display); font-size: 22px; text-transform: uppercase; letter-spacing: 0.04em; }
.qr { align-self: center; background: #fff; padding: 8px; border-radius: 6px; }
.secret { font-family: ui-monospace, Consolas, monospace; letter-spacing: 0.08em; word-break: break-all; background: var(--bg); padding: 8px 10px; border-radius: 4px; }

/* Shell */
.shell { display: flex; min-height: 100vh; }
.side { flex: 0 0 248px; background: var(--side); color: var(--side-text); padding: 16px 12px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 14px; color: #fff; text-decoration: none; }
.side .brand img { width: 36px; height: 36px; border-radius: 50%; }
.side .brand b { font-family: var(--display); font-size: 17px; text-transform: uppercase; letter-spacing: 0.05em; }
.side a.nav { color: var(--side-text); text-decoration: none; padding: 9px 12px; border-radius: 4px; display: flex; justify-content: space-between; gap: 8px; }
.side a.nav:hover { background: #1E1E23; color: #fff; }
.side a.nav[aria-current="page"] { background: var(--red); color: #fff; font-weight: 700; }
.side .count { background: rgba(255,255,255,0.18); border-radius: 999px; padding: 0 8px; font-size: 12px; }
.side .who { margin-top: auto; border-top: 1px solid #2A2A30; padding: 12px 8px 0; font-size: 13px; }
.side .who b { color: #fff; display: block; }
.side .who button { background: none; border: 0; color: #FF8A8F; padding: 6px 0; cursor: pointer; font-weight: 600; }
.main { flex: 1 1 auto; min-width: 0; padding: 26px 32px 60px; display: flex; flex-direction: column; gap: 18px; }
.topline { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--soft); }
.menu-toggle { display: none; }

/* Building blocks */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 4px; }
.stat b { font-family: var(--display); font-size: 40px; line-height: 1; }
.stat span { color: var(--soft); font-size: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.btn { min-height: 42px; padding: 0 16px; border-radius: 4px; border: 1.5px solid var(--text); background: var(--panel); color: var(--text); font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dark); }
.btn.ghost { border-color: transparent; color: var(--red-dark); background: transparent; }
.btn:disabled { opacity: 0.5; cursor: default; }
label.f { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 14px; }
label.f small { font-weight: 400; color: var(--soft); }
input.t, select.t, textarea.t { min-height: 42px; border: 1px solid #C9C4BE; border-radius: 4px; padding: 8px 10px; background: var(--input); width: 100%; }
html[data-theme="dark"] input.t, html[data-theme="dark"] select.t, html[data-theme="dark"] textarea.t { border-color: #3A3A42; }
textarea.t { min-height: 140px; resize: vertical; line-height: 1.5; }
textarea.t.tall { min-height: 360px; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.pill { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.new, .pill.draft, .pill.assigned { background: var(--warn-bg); color: var(--warn); }
.pill.published, .pill.closed, .pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.hidden, .pill.declined, .pill.waiting, .pill.off { background: var(--bg); color: var(--soft); border: 1px solid var(--line); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs a { text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; color: var(--text); font-size: 14px; background: var(--panel); }
.tabs a[aria-current="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
table.list { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
table.list th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--soft); padding: 10px 14px; border-bottom: 1px solid var(--line); }
table.list td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: var(--bg); }
.table-wrap { overflow-x: auto; }
.muted { color: var(--soft); }
.small { font-size: 13px; }
.orig { background: var(--bg); border-radius: 4px; padding: 12px 14px; white-space: pre-wrap; }
.thread { display: flex; flex-direction: column; gap: 10px; }
.msg { border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; white-space: pre-wrap; }
.msg.reply { border-left: 4px solid var(--red); }
.msg.note { background: var(--warn-bg); }
.msg .meta { font-size: 12px; color: var(--soft); white-space: normal; margin-bottom: 4px; }
.flash { border-radius: 6px; padding: 10px 14px; font-weight: 600; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.bad { background: var(--bad-bg); color: var(--bad); }
.flash.info { background: var(--warn-bg); color: var(--warn); }
.preview-img { max-width: 320px; max-height: 200px; border-radius: 4px; object-fit: cover; }
.roles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; }
.soon { border: 1px dashed var(--line); border-radius: 6px; padding: 18px 20px; background: var(--panel); }
.soon ul { margin: 6px 0 0; padding-left: 1.2em; }

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .side { position: static; height: auto; flex-basis: auto; }
  .side .navs { display: none; flex-direction: column; gap: 2px; }
  .side.open .navs { display: flex; }
  .side .head { display: flex; justify-content: space-between; align-items: center; }
  .menu-toggle { display: inline-flex; background: none; border: 1px solid #3A3A42; color: #fff; border-radius: 4px; min-height: 40px; padding: 0 12px; }
  .side .who { margin-top: 10px; }
  .main { padding: 18px max(16px, env(safe-area-inset-left, 0px)) 48px; }
  .split { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 30px; }
}

/* Password slip: print just the card */
@media print { .side, .topline, .crumbs, .noprint, .flash { display: none !important; } .main { padding: 0; } .slip { border: 2px solid #000; } }

/* Test / Live switch in the top bar */
.mode { display: inline-flex; align-items: center; gap: 0; border: 1px solid var(--line, #34343B); border-radius: 999px; overflow: hidden; align-self: center; }
.mode-label { padding: 8px 12px; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.7; }
.mode button { border: 0; border-left: 1px solid var(--line, #34343B); background: transparent; color: inherit; font: inherit; font-weight: 700; padding: 8px 18px; cursor: pointer; }
.mode button[aria-pressed="true"].mode-test { background: #FFD60A; color: #141416; }
.mode button[aria-pressed="true"].mode-live { background: #D91E2A; color: #fff; }
.mode button:disabled { cursor: default; }
.mode button:disabled[aria-pressed="false"] { opacity: 0.55; cursor: not-allowed; }

.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.keyrow { display: grid; grid-template-columns: 86px auto minmax(180px, 1fr) auto; gap: 10px; align-items: center; margin: 8px 0; }
.keyrow .hint { color: #8A8A92; font-size: 13px; }
.keyrow input.t { margin: 0; }
@media (max-width: 760px) { .keyrow { grid-template-columns: 1fr 1fr; } .keyrow input.t { grid-column: 1 / -1; } }

.pics { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.pic { position: relative; width: 120px; }
.pic img { width: 120px; height: 120px; object-fit: cover; border-radius: 6px; display: block; }
.pic-n { position: absolute; top: 6px; left: 6px; background: #141416; color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.pic-btns { display: flex; gap: 4px; margin-top: 4px; }
.pic-btns button { flex: 1; padding: 4px 0; border: 1px solid var(--line); background: transparent; color: inherit; border-radius: 4px; cursor: pointer; }
.pic-btns button:disabled { opacity: 0.35; cursor: default; }

/* Collapsible menu groups */
.side details.navgroup { margin: 2px 0; }
.side details.navgroup > summary { list-style: none; cursor: pointer; padding: 9px 12px; border-radius: 4px; font-weight: 700; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: #9A9AA3; display: flex; justify-content: space-between; align-items: center; }
.side details.navgroup > summary::-webkit-details-marker { display: none; }
.side details.navgroup > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid #9A9AA3; border-bottom: 2px solid #9A9AA3; transform: rotate(-45deg); transition: transform 0.15s; }
.side details.navgroup[open] > summary::after { transform: rotate(45deg); }
.side details.navgroup > summary:hover { background: #1E1E23; color: #fff; }
.side details.navgroup a.nav { padding-left: 22px; }

/* Formatted text box */
.rich-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.rich-bar button, .rich-bar .rich-pic { border: 1px solid var(--line); background: transparent; color: inherit; border-radius: 4px; padding: 5px 11px; cursor: pointer; font: inherit; font-size: 13px; }
.rich-bar button:hover, .rich-bar .rich-pic:hover { background: rgba(127,127,127,0.18); }
.rich-preview { border: 1px solid var(--line); border-radius: 6px; padding: 14px 18px; min-height: 160px; }
.rich-preview img { max-width: 100%; border-radius: 6px; }
.pill.warn { background: #FFE9A8; color: #5A4300; }

/* On/off switch at the top right of a page */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; align-self: center; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider { position: relative; width: 46px; height: 26px; border-radius: 999px; background: #4A4A52; transition: background 0.2s; flex: 0 0 auto; }
.switch .slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.switch input:checked + .slider { background: #2E9E5B; }
.switch input:checked + .slider::after { transform: translateX(20px); }
.switch input:focus-visible + .slider { outline: 2px solid #FF6A70; outline-offset: 2px; }
.switch input:disabled + .slider { opacity: 0.5; }
/* Folding lists */
.fold { border: 1px solid var(--line, #34343B); border-radius: 8px; margin: 12px 0; }
.fold > summary { cursor: pointer; padding: 12px 16px; list-style: none; display: flex; gap: 10px; align-items: center; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform 0.15s; }
.fold[open] > summary::before { transform: rotate(45deg); }
.scroll-box { max-height: 420px; overflow-y: auto; border-top: 1px solid var(--line, #34343B); }
/* Number grid */
.num-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 6px; max-width: 560px; margin: 10px 0; }
.num-cell { min-height: 38px; border-radius: 6px; border: 1px solid var(--line); background: transparent; color: inherit; font: inherit; font-variant-numeric: tabular-nums; cursor: pointer; padding: 0 6px; }
.num-cell.free { border-color: #2E9E5B; background: rgba(46,158,91,0.14); }
.num-cell.other { border-color: #D91E2A; background: rgba(217,30,42,0.18); }
.num-cell.taken { opacity: 0.35; cursor: not-allowed; text-decoration: line-through; }
.num-cell.sel { outline: 3px solid #fff; background: #D91E2A; border-color: #D91E2A; color: #fff; }
.num-legend { display: flex; gap: 10px; flex-wrap: wrap; }
.num-legend .num-cell { min-height: 26px; cursor: default; }

.test-flag { border: 1px solid #D91E2A; background: rgba(217,30,42,0.12); border-radius: 8px; padding: 10px 14px; margin: 0 0 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.test-flag b { color: #FF6A70; letter-spacing: 0.06em; }
.num-cell.cur { box-shadow: inset 0 0 0 2px #fff; }

/* Text editor */
.rte { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--input); color: var(--text); }
.rte-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px; border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 2; }
.rte-grp { display: inline-flex; gap: 2px; border-right: 1px solid var(--line); padding-right: 6px; margin-right: 2px; }
.rte-bar button, .rte-btn { border: 1px solid var(--line); background: transparent; color: inherit; border-radius: 6px; min-width: 32px; height: 32px; padding: 0 8px; font: inherit; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.rte-bar button:hover, .rte-btn:hover { background: rgba(127,127,127,0.22); }
.rte-bar select { height: 32px; border: 1px solid var(--line); border-radius: 6px; background: var(--input); color: inherit; font: inherit; padding: 0 6px; }
.rte-area { min-height: 320px; max-height: 70vh; overflow-y: auto; padding: 16px 18px; outline: none; line-height: 1.6; }
.rte-area:focus { box-shadow: inset 0 0 0 2px rgba(224,38,47,0.5); }
.rte-area h2 { font-size: 26px; margin: 18px 0 6px; } .rte-area h3 { font-size: 20px; margin: 16px 0 6px; } .rte-area h4 { font-size: 17px; margin: 14px 0 4px; }
.rte-area p { margin: 0 0 10px; } .rte-area ul, .rte-area ol { margin: 0 0 10px; padding-left: 1.4em; }
.rte-area blockquote { margin: 0 0 10px; padding-left: 14px; border-left: 3px solid #E0262F; font-style: italic; }
.rte-area a { color: #FF6A70; text-decoration: underline; }
.rte-area hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.rte-area img { max-width: 100%; border-radius: 6px; }
.rte-area table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.rte-area th, .rte-area td { border: 1px solid var(--line); padding: 8px 10px; min-width: 40px; vertical-align: top; }
.rte-area th { background: color-mix(in srgb, var(--panel) 90%, var(--text) 10%); text-align: left; }
.rte-area [align=center], .rte-area .al-center { text-align: center; } .rte-area [align=right], .rte-area .al-right { text-align: right; } .rte-area [align=justify], .rte-area .al-justify { text-align: justify; }

/* Sortable column headings */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable::after { content: "↕"; margin-left: 6px; opacity: 0.35; font-size: 0.85em; }
th.sortable:hover::after { opacity: 0.8; }
th.sortable[data-dir=asc]::after { content: "▲"; opacity: 1; color: #FF6A70; }
th.sortable[data-dir=desc]::after { content: "▼"; opacity: 1; color: #FF6A70; }
th.sortable:focus-visible { outline: 2px solid #FF6A70; outline-offset: -2px; }

/* Player numbers */
.num-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; margin-bottom: 16px; }
@media (max-width: 900px) { .num-layout { grid-template-columns: 1fr; } }
.num-main .num-grid { max-width: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch; margin-bottom: 12px; }
.chips .chip { display: grid; gap: 1px; text-align: left; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: inherit; font: inherit; cursor: pointer; }
.chips .chip small { opacity: 0.65; }
.chips .chip[aria-pressed=true] { background: #D91E2A; border-color: #D91E2A; color: #fff; }
.chip-sep { width: 1px; background: var(--line); margin: 0 4px; }
.card.flat { box-shadow: none; margin: 12px 0 0; }
.assign { border-color: #D91E2A; margin-bottom: 14px; }
.pres { display: grid; gap: 4px; margin: -4px 0 10px; }
.pres-row { text-align: left; border: 1px solid var(--line); background: transparent; color: inherit; border-radius: 8px; padding: 8px 12px; font: inherit; cursor: pointer; }
.pres-row:hover:not(:disabled) { border-color: #D91E2A; }
.pres-row:disabled { opacity: 0.5; cursor: not-allowed; }
dialog.modal { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--text); padding: 0; max-width: 460px; width: calc(100% - 32px); }
dialog.modal::backdrop { background: rgba(0,0,0,0.65); }
.modal-body { padding: 22px; display: grid; gap: 12px; }
.modal-body fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.modal-body legend { font-weight: 700; margin-bottom: 6px; }

/* Filter bars: chips for the main choice, a search box beside them */
.filterbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 4px 0 12px; }
.filterbar .chips { margin: 0; }
.filterbar input[type=search] { flex: 1 1 220px; max-width: 360px; }
.pill.hidden { background: #3a3a42; color: #ddd; }

/* Dark / light switch, top right of every page */
.theme-switch { position: fixed; top: 12px; right: 18px; z-index: 30; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line, #34343B); background: var(--card, rgba(20,20,22,0.85)); backdrop-filter: blur(6px); font-size: 14px; }
.theme-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.theme-switch .slider { position: relative; width: 38px; height: 20px; border-radius: 999px; background: #8a8a92; transition: background 0.15s; }
.theme-switch .slider::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.theme-switch input:checked + .slider { background: #D91E2A; }
.theme-switch input:checked + .slider::after { transform: translateX(18px); }
.theme-switch input:focus-visible + .slider { outline: 2px solid #FF6A70; outline-offset: 2px; }
.topline { padding-right: 120px; }
/* Profile */
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
@media (max-width: 980px) { .profile-grid { grid-template-columns: 1fr; } }
.access-row { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line, #34343B); font-size: 14px; }
.role-chip { margin: 0 4px 4px 0; display: inline-block; }

.kvs { display: grid; gap: 8px; margin: 14px 0; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 10px; }
.photos { display: flex; gap: 10px; flex-wrap: wrap; }
.photos img { height: 140px; border-radius: 8px; border: 1px solid var(--line, #34343B); }

/* ---- Design pass: calmer, more consistent cards, tables and dashboard ---- */
.main { max-width: 1320px; width: 100%; margin: 0 auto; }
.card { border-radius: 14px; box-shadow: 0 1px 0 rgba(0,0,0,0.04), 0 8px 24px -18px rgba(0,0,0,0.5); }
html[data-theme="dark"] .card { box-shadow: 0 10px 30px -20px rgba(0,0,0,0.9); }
.card h2 { margin: 0; font-size: 18px; }
table.list { border-radius: 12px; }
table.list th { font-family: ui-monospace, Consolas, monospace; font-size: 11px; background: color-mix(in srgb, var(--panel) 92%, var(--text) 8%); }
table.list tr.click:hover td { background: color-mix(in srgb, var(--panel) 94%, var(--red) 6%); }
.btn, button.btn { border-radius: 10px; }
h2.sect { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.04em; font-size: 20px; margin: 10px 0 -4px; color: var(--soft); }
.grid.small { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.stat { border-radius: 14px; transition: transform 0.15s, border-color 0.15s; }
.stat:hover { transform: translateY(-2px); border-color: var(--red); }
.stat.hot { border-color: var(--red); background: linear-gradient(180deg, color-mix(in srgb, var(--panel) 90%, var(--red) 10%), var(--panel)); }
.stat.hot b { color: var(--red); }
.dash-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .dash-cols { grid-template-columns: 1fr; } }
/* Player card */
.pcard { display: flex; gap: 18px; align-items: center; background: linear-gradient(135deg, #1b1b20, #0e0e11); color: #fff; border-radius: 16px; padding: 20px 24px; border: 1px solid #2a2a31; }
.avatar { width: 72px; height: 72px; border-radius: 50%; background: var(--red); display: grid; place-items: center; font-family: var(--display); font-size: 30px; font-weight: 900; flex: 0 0 auto; }
.pcard-name { font-family: var(--display); font-weight: 900; font-size: 34px; text-transform: uppercase; line-height: 1; }
.pcard a { color: #FF8A8F; }
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.pgrid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
@media (max-width: 980px) { .pgrid { grid-template-columns: 1fr; } }
.pside { display: grid; gap: 18px; }

.cardpics { display: flex; gap: 16px; flex-wrap: wrap; }
.cardpic { display: grid; gap: 8px; align-content: start; }
.cardpic img { max-width: 280px; max-height: 190px; border-radius: 10px; border: 1px solid var(--line); object-fit: cover; }
.cardpic-none { width: 280px; height: 120px; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 10px; }
/* The dark / light switch follows the theme: panel colour behind it, text colour for the sun and moon */
.theme-switch { background: var(--panel); color: var(--text); border-color: var(--line); }
.theme-switch .slider { background: #8a8a92; }

/* Two columns: write on the left, see it on the right */
.edit-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.preview-col { position: sticky; top: 14px; }
.livepv { width: 100%; height: calc(100vh - 150px); min-height: 480px; border: 1px solid var(--line); border-radius: 10px; background: #0B0B0D; }
@media (max-width: 1100px) { .edit-split { grid-template-columns: 1fr; } .preview-col { position: static; } .livepv { height: 560px; } }

/* Pop-ups, the editor and the number page follow the light or dark theme */
dialog.modal::backdrop { background: rgba(0,0,0,0.55); }
dialog.modal h2, dialog.modal legend, dialog.modal label, dialog.modal .muted { color: var(--text); }
dialog.modal .muted { opacity: 0.75; }
dialog.modal input.t { background: var(--input); color: var(--text); border: 1px solid var(--line); }
.rte-bar button, .rte-btn { color: var(--text); }
.rte-bar select { color: var(--text); }
.chips .chip { color: var(--text); }
.pres-row { color: var(--text); }
.num-cell { color: var(--text); }
.num-cell.sel { color: #fff; }
/* The theme switch stays at the top of the page and scrolls away with it */
.main { position: relative; }
.theme-switch { position: absolute; top: 14px; right: 18px; }

/* Schedule blocks on the session form */
fieldset.sched { border: 1px solid var(--line); margin: 0; padding: 14px 16px; }
fieldset.sched legend { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.04em; font-size: 18px; padding: 0 8px; }

.preview-img.is-logo { object-fit: contain; background: #111114; padding: 10px; width: 140px; height: 140px; }
.secs { display: flex; flex-direction: column; gap: 12px; margin: 8px 0; }
.sec { border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: var(--panel); }
.sec.is-main { border-color: #E0262F; }
.sec-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.sec-tools { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
.sec-tools .btn { padding: 4px 8px; min-height: 0; font-size: 13px; }
.sec-photo { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.sec-photo img { width: 200px; max-height: 160px; object-fit: cover; border-radius: 6px; }
.sec-fields { flex: 1 1 240px; display: flex; flex-direction: column; gap: 8px; }
.sec [hidden] { display: none !important; }
.sec .rte-area { min-height: 90px; max-height: 50vh; }
