/* The frame of the panel: a menu that folds, a slim event bar, pages of cards with one topic at a time, the personal dashboard, the search.
   Colours only through the tokens in styles.css / ui.css, so light, high contrast and colour-blind settings keep working. Loaded last. */
:root { --side-w: 248px; --card-r: 12px; --hairline: rgba(var(--lift), .07); }

/* ---------- the menu */
.shell { grid-template-columns: var(--side-w) minmax(0, 1fr); }
.savebar { left: var(--side-w); }
a.btn { color: var(--bone); text-decoration: none; }
a.btn.primary { color: var(--hazard-ink); }
a.btn.danger { color: var(--danger); }
.side { padding: 16px 12px 10px; gap: 12px; overflow: hidden; }
.side-head { display: flex; align-items: flex-start; gap: 8px; }
.side .brand { display: block; flex: 1; min-width: 0; padding: 4px 8px; border-radius: 8px; color: var(--bone); text-decoration: none; transition: background .15s; }
.side .brand:hover { background: rgba(var(--lift), .05); }
.side .brand small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.server-pick { font-weight: 600; font-size: 14px; }
.find-btn { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--steel-700); background: rgba(var(--well), .5); color: var(--bone-faint); font-size: 13.5px; text-align: left; cursor: pointer; transition: border-color .15s, color .15s; }
.find-btn:hover { border-color: var(--steel-600); color: var(--bone); }
.find-btn span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.find-btn kbd { font: 600 11px var(--font-body); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--steel-600); color: var(--bone-faint); }
.ico-nav { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav { flex: 1; min-height: 0; overflow-y: auto; gap: 2px; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; scrollbar-color: var(--steel-600) transparent; }
.nav a { justify-content: flex-start; gap: 10px; padding: 6px 10px; border-radius: 7px; font-size: 14px; }
.nav a:hover { padding-left: 10px; }
.nav a > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav a.active { background: rgba(242, 194, 48, .12); box-shadow: inset 2px 0 0 var(--hazard); color: var(--bone); font-weight: 600; }
.nav a.active .ico-nav { color: var(--accent-text); opacity: 1; }
.nav-top { padding-bottom: 6px; margin-bottom: 4px; border-bottom: 1px solid var(--hairline); }
.nav-group > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px 5px; border-radius: 6px; font: 700 12px var(--font-body); letter-spacing: .05em; text-transform: uppercase; color: var(--bone-faint); cursor: pointer; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary:hover { color: var(--bone); }
.nav-group.holds-page > summary { color: var(--bone-dim); }
.chev { width: 13px; height: 13px; flex: none; transition: transform .16s; }
details[open] > summary > .chev { transform: rotate(90deg); }
.nav-group[open] { padding-bottom: 6px; }
details.nav-group[open] > :not(summary) { animation: none; }

.side .who { margin: 0; padding: 8px 0 0; border-top: 1px solid var(--hairline); font-size: 13.5px; }
.who-alert { display: inline-flex; margin: 0 0 8px 6px; text-decoration: none; }
.who-menu > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.who-menu > summary::-webkit-details-marker { display: none; }
.who-menu > summary:hover { background: rgba(var(--lift), .05); }
.who-menu > summary .chev { transform: rotate(-90deg); margin-left: auto; color: var(--bone-faint); }
.who-menu[open] > summary .chev { transform: rotate(90deg); }
.avatar { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--hazard); color: var(--hazard-ink); font: 700 13px var(--font-body); }
.who-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.side .who .who-name b { color: var(--bone); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-name small { color: var(--bone-faint); }
.who-body { display: flex; flex-direction: column; gap: 2px; padding: 4px 0 2px; }
.who-body > a, .side .who .who-out { display: block; width: 100%; padding: 6px 10px; border-radius: 6px; color: var(--bone-dim); font-size: 13.5px; text-align: left; text-decoration: none; }
.who-body > a:hover, .side .who .who-out:hover { background: rgba(var(--lift), .05); color: var(--bone); }
.langpick, .who .devmode { padding: 4px 10px; margin: 0; }
.langpick select { padding: 4px 8px; font-size: 13px; }
.side .who .devmode button { color: inherit; text-decoration: none; padding: 4px 10px; }
.side .who .devmode .btn.primary { color: var(--hazard-ink); }

/* ---------- the event bar: everything at a glance on one low line */
.strip { grid-template-columns: minmax(180px, auto) minmax(0, 1fr) auto; gap: 20px; padding: 8px 28px; }
.strip .title .event { font-size: 12px; }
.strip .title .phase { font-size: 21px; line-height: 1.1; }
.strip .title .status { margin-top: 3px; gap: 4px; }
.strip .chip { padding: 2px 7px; font-size: 11.5px; }
.track { height: 30px; }
.track .seg span { font-size: 13px; }
.clock { gap: 12px; }
.timer { font-size: 34px; line-height: 1; min-width: 3.4ch; }
.flow { flex-direction: row; gap: 6px; }
.flow .btn { padding: 5px 12px; font-size: 13px; }

/* ---------- pages */
.page { padding: 24px 28px 110px; max-width: 1280px; }
.page > h1 { font-size: 32px; line-height: 1.1; margin-bottom: 10px; }
.page > h1 .info-btn { top: -3px; margin-left: 8px; }
.info-btn { width: 24px; height: 24px; }
.tabs { overflow: visible; margin-bottom: 18px; flex-wrap: wrap; gap: 0; }
.tabs a { white-space: nowrap; padding-left: 11px; padding-right: 11px; }
.tabs a.tab-gap { margin-left: 14px; position: relative; }
.tabs a.tab-gap::before { content: ""; position: absolute; left: -8px; top: 25%; bottom: 25%; width: 1px; background: var(--steel-600); }

/* sections are cards */
.section, .section:first-of-type { background: var(--plate); border: 1px solid var(--steel-700); border-radius: var(--card-r); padding: 18px 20px; margin: 0 0 14px; box-shadow: var(--plate-shadow); }
.section > header { margin-bottom: 14px; align-items: center; }
.section > header h2 { font-size: 20px; }
.section .section { box-shadow: none; }
.section.card { padding: 18px 20px; }
.panel { border-radius: var(--card-r); }
.table-wrap, .item { border-radius: 10px; }
.cols { gap: 16px; }

/* ---------- one topic at a time, the list of topics beside it */
.topical { display: grid; grid-template-columns: 196px minmax(0, 1fr); column-gap: 24px; row-gap: 0; align-items: start; }
.topical > * { grid-column: 2; }
.page.topical > h1, .page.topical > .tabs, .page.topical > .info-text, .page.topical > .banner:first-of-type { grid-column: 1 / -1; }
.topical > .rail { grid-column: 1; grid-row-end: span 80; position: sticky; top: 76px; display: flex; flex-direction: column; gap: 8px; }
.rail-find { font-size: 13px; padding: 6px 9px !important; }
.rail-list { display: flex; flex-direction: column; gap: 1px; }
.rail-list a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 7px; color: var(--bone-dim); font-size: 14px; font-weight: 500; line-height: 1.25; text-decoration: none; transition: background .12s, color .12s; }
.rail-list a:hover { background: rgba(var(--lift), .05); color: var(--bone); }
.rail-list a.active { background: rgba(242, 194, 48, .12); color: var(--bone); font-weight: 600; box-shadow: inset 2px 0 0 var(--hazard); }
.rail-list a.miss { color: var(--bone-faint); opacity: .6; }
.rail-list small { flex: none; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--hazard); color: var(--hazard-ink); font-weight: 700; text-align: center; }
.topic-miss { display: none !important; }
.topic-none { background: var(--plate); border: 1px dashed var(--steel-600); border-radius: var(--card-r); }

/* ---------- settings read as a list of switches */
:is(#page, .modal) label.check:has(> input[type=checkbox]) { display: inline-flex; align-items: center; gap: 10px; min-height: 28px; }
:is(#page, .modal) label.check > input[type=checkbox] { appearance: none; -webkit-appearance: none; flex: none; width: 34px; height: 20px; margin: 0; border-radius: 999px; border: 1px solid var(--steel-500); background: var(--steel-700); position: relative; cursor: pointer; transition: background .16s, border-color .16s; }
:is(#page, .modal) label.check > input[type=checkbox]::before { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--bone); transition: transform .16s var(--ease-out, ease); }
:is(#page, .modal) label.check > input[type=checkbox]:checked { background: var(--hazard); border-color: var(--hazard-deep); }
:is(#page, .modal) label.check > input[type=checkbox]:checked::before { transform: translateX(14px); background: var(--hazard-ink); }
:is(#page, .modal) label.check > input[type=checkbox]:focus-visible { outline: 2px solid var(--hazard); outline-offset: 2px; }
:is(#page, .modal) label.check > input[type=checkbox]:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- one box per game server: a line until it is opened */
.server-card > summary { list-style: none; cursor: pointer; }
.server-card > summary::-webkit-details-marker { display: none; }
.server-card[open] > summary { margin-bottom: 12px; }

/* ---------- my dashboard */
.page-home > h1 { margin-bottom: 2px; }
.home-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.home-hello { margin: 0; color: var(--bone-dim); }
.home-links { margin-bottom: 18px; }
.home-links > h2 { font-size: 17px; margin-bottom: 10px; color: var(--bone-dim); }
.home-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.home-tile { display: flex; align-items: center; gap: 12px; min-height: 66px; padding: 12px 14px; border-radius: var(--card-r); border: 1px solid var(--steel-700); background: var(--plate); box-shadow: var(--plate-shadow); color: var(--bone); text-decoration: none; text-align: left; transition: transform .14s var(--ease-out, ease), border-color .14s; position: relative; }
a.home-tile:hover { border-color: var(--hazard); transform: translateY(-2px); }
.home-tile-ico { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 10px; background: rgba(242, 194, 48, .13); color: var(--accent-text); }
.home-tile-ico .ico-nav { width: 20px; height: 20px; opacity: 1; }
.home-tile-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.home-tile-text b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-tile-text small { color: var(--bone-faint); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-tile.editing { flex-wrap: wrap; cursor: grab; border-style: dashed; border-color: var(--steel-600); }
.home-tile.editing .home-tile-text { flex: 1; }
.home-tile.editing.dragging { opacity: .45; }
.home-tile.editing.drop { border-color: var(--hazard); }
.home-tile.gone { opacity: .6; }
.home-tile-tools { display: flex; width: 100%; gap: 2px; justify-content: flex-end; }
.home-tile-tools .btn { min-width: 32px; padding: 2px 6px; }
.home-add { justify-content: center; gap: 8px; cursor: pointer; border-style: dashed; border-color: var(--steel-600); background: transparent; box-shadow: none; color: var(--bone-dim); }
.home-add:hover { border-color: var(--hazard); color: var(--bone); }
.home-add > span { font: 700 22px/1 var(--font-display); color: var(--accent-text); }
.home-boxes { columns: 2 340px; column-gap: 14px; }
.home-box { break-inside: avoid; margin-bottom: 14px; padding: 16px 18px; background: var(--plate); border: 1px solid var(--steel-700); border-radius: var(--card-r); box-shadow: var(--plate-shadow); }
.home-box > h2 { font-size: 19px; margin-bottom: 10px; }
.home-box > .row + * { margin-top: 10px; }
.home-event-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 10px 0 12px; }
.home-event-name > b { font: 700 24px/1.1 var(--font-display); }
.home-event-time { margin-left: auto; font: 700 24px/1 var(--font-display); }
.home-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.home-nums > div { padding: 10px 12px; border-radius: 8px; background: rgba(var(--well), .5); border: 1px solid var(--steel-700); }
.home-nums b { display: block; font: 700 26px/1 var(--font-display); }
.home-nums span { color: var(--bone-faint); font-size: 12.5px; }
.home-list { display: flex; flex-direction: column; gap: 3px; }
.home-list > p { margin: 0; }
.home-clear { color: var(--ok); }
.home-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--bone); text-decoration: none; text-align: left; font-size: 14px; cursor: pointer; }
a.home-row:hover, button.home-row:hover { background: rgba(var(--lift), .05); }
.home-row.current { cursor: default; background: rgba(var(--well), .5); }
.home-row > i { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--info); }
.home-row.warn > i { background: var(--accent-text); }
.home-row.err > i { background: var(--danger); }
.home-server-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-choose { max-width: 560px; }
.home-choose-row { display: flex; align-items: center; gap: 6px; min-height: 36px; border-top: 1px solid var(--hairline); }
.home-choose-row:first-of-type { border-top: 0; }
.pick-list { display: flex; flex-direction: column; gap: 2px; max-height: min(44vh, 400px); overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.pick-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--bone); text-align: left; cursor: pointer; }
.pick-row:hover { background: rgba(var(--lift), .05); }
.pick-row > span { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.pick-row small { color: var(--bone-faint); font-size: 12.5px; }
.pick-row b { font-weight: 600; }
.pick-row > i { font-style: normal; font-weight: 700; color: var(--bone-faint); width: 18px; text-align: center; }
.pick-row.on > i { color: var(--ok); }
.modal:has(.pick-list) { width: min(600px, 100%); }
.more-row { text-align: center; }

/* ---------- the search over the whole panel */
.palette-back { position: fixed; inset: 0; z-index: 95; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: rgba(8, 10, 12, .66); backdrop-filter: blur(3px); animation: fade-in .12s ease-out; }
.palette { width: min(620px, 100%); max-height: 70vh; display: flex; flex-direction: column; overflow: hidden; background: var(--steel-850); border: 1px solid var(--steel-600); border-radius: 14px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8); }
input.palette-input[type=text] { border: 0; border-bottom: 1px solid var(--steel-700); border-radius: 0; background: transparent; box-shadow: none; padding: 15px 18px; font-size: 17px; }
input.palette-input[type=text]:focus { box-shadow: none; border-color: var(--hazard); }
.palette-list { overflow-y: auto; padding: 6px; }
.palette-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 8px; color: var(--bone); text-decoration: none; }
.palette-row > span { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.palette-row b { font-weight: 600; }
.palette-row small { color: var(--bone-faint); font-size: 12.5px; }
.palette-row.on, .palette-row:hover { background: rgba(242, 194, 48, .13); }

/* ---------- narrower windows */
@media (max-width: 1180px) {
  .strip { grid-template-columns: minmax(0, 1fr) auto; }
  .strip .track { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 960px) {
  .topical { grid-template-columns: minmax(0, 1fr); }
  .topical > * { grid-column: 1; }
  .topical > .rail { position: static; grid-row-end: auto; margin-bottom: 14px; }
  .rail-list { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 4px; scrollbar-width: thin; }
  .rail-list a { flex: none; white-space: nowrap; border: 1px solid var(--steel-700); }
  .rail-list a.active { box-shadow: none; border-color: var(--hazard); }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .savebar { left: 0; }
  .side { position: static; height: auto; overflow: visible; flex-direction: column; align-items: stretch; flex-wrap: nowrap; padding: 10px 14px; gap: 10px; }
  .side .nav { flex-direction: column; flex-wrap: nowrap; }
  .side .nav a span { display: inline; }
  .side .nav a { padding: 10px; }
  .server-pick { width: 100%; }
  .strip { position: static; grid-template-columns: minmax(0, 1fr) auto; }
  .strip .title .status { display: flex; }
  .side .find-btn { display: none; }
  .side.open .find-btn { display: flex; }
  .side.open .nav { max-height: none; overflow: visible; }
  .side-head { width: 100%; align-items: center; }
  .page { padding: 18px 14px 110px; }
  .page > h1 { font-size: 28px; }
  .strip { padding: 8px 14px; gap: 8px 14px; }
  .timer { font-size: 28px; }
  .section, .section:first-of-type { padding: 14px; }
  .home-tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .find-btn kbd { display: none; }
}
@media (pointer: coarse) { .rail-list a, .home-row, .pick-row { min-height: 44px; } }
@media (prefers-reduced-motion: reduce) { .home-tile, .chev { transition: none; } a.home-tile:hover { transform: none; } }
