/* TPF Admin - dark, angular and compact. Mobile first: phones get the base styles, tablets (>= 768px) and desktops
   (>= 1200px) more room. Signature: faint grid in the background, thin corner brackets on cards, primary buttons with a
   cut corner, Rajdhani for headings/labels/buttons, monospace for times and numbers. Status pills and dots stay round.
   Fonts: fonts.css. */

:root {
  color-scheme: dark;
  --bg: #0f0f0f;
  --surface: #171817;
  --surface-2: #1d1e1d;
  --border: #2e302d;
  --text: #dddedb;
  --muted: #a3a5a0;           /* APCA Lc 52 on the surface (small labels, times) */
  --accent: #e3a72f;          /* Amber: active navigation, primary buttons, focus */
  --accent-hover: #efb64a;
  --on-accent: #15110a;
  --online: #8fbf4d;
  --offline: #e0573f;
  --warning: #e8952e;          /* Seeding */
  --updating: #a77fe0;         /* Purple: an update or job runs in the PSG panel */
  --grid: rgba(135, 137, 133, .05);
  /* Alliances of Squad factions (tickets, team labels) */
  /* Alliances of Squad factions (tickets, team heads, player rows); when both teams share an alliance, team 2 is darker
     and its bar striped (maintainer's decision 2026-11-11) */
  --nato: #4f8fe0; --redfor: #e0573f; --pac: #d4bf3b; --independent: #6fb35a;
  /* Lighter versions of red and blue for text (icons, bars and dots keep the base colors) */
  --nato-text: #82acee; --redfor-text: #f07a62; --pac-text: #d4bf3b; --independent-text: #7fbf6a; --danger-text: #f07a62;
  /* Log kinds, one hue each ('Spektrum', maintainer's choice 2026-11-17). Every kind also has its own icon shape, so
     the kind never depends on the color alone. Icons use these colors, brought close in brightness so no kind glares
     (2026-11-18: APCA Lc 51-64 on the log; bright ones darker, pale ones with more colour, reds a little lighter);
     text tags use 60 % of the color with white (Lc 60 and more). */
  --act-kill: #bbb8ae; --act-teamkill: #ff7261; --act-death: #9ea099; --act-revive: #8ac134; --act-warn: #e1b110;
  --act-kick: #fe8d44; --act-ban: #ff6f7c; --act-admin: #c58cfe; --act-join: #6ccd67; --act-leave: #d69563;
  --act-squad: #2acad2; --act-chat: #c9b878; --act-team: #6fa8ff; --act-squadchat: #5bcc98; --act-adminchat: #fba504;
  --act-broadcast: #c58cfe; --act-camera: #99a3b8; --act-command: #909cfe; --act-power: #ff7ad9; --act-round: #40baad;
  --bracket: #878985;
  --font-text: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Rajdhani", "Barlow", system-ui, sans-serif;
  --font-data: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --radius: 0;
  --gap: 12px;
  --tap: 40px;                /* Buttons and links for fingers; mouse users get compact controls (below) */
  --cut: 8px;                 /* Cut corner of primary buttons */
}
@media (pointer: fine) { :root { --tap: 32px; } }

* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* Also for elements whose class sets a display (e.g. .button) */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  font: 14px/1.45 var(--font-text);
  background-color: var(--bg);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
}
a { color: inherit; }
h1 { margin: 0; font: 700 1.5rem/1.15 var(--font-head); letter-spacing: .03em; }
h2 { margin: 0 0 4px; font: 700 1.15rem/1.2 var(--font-head); letter-spacing: .03em; }
h3 { margin: 16px 0 6px; font: 700 1rem/1.2 var(--font-head); letter-spacing: .05em; text-transform: uppercase; }
p { margin: 0 0 10px; }
code { font: .85em var(--font-data); }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- Layout -------------------------------------------------------------------- */

.page { padding: var(--gap); max-width: 1600px; margin: 0 auto; }
.centered { min-height: 100vh; display: grid; place-items: center; padding: var(--gap); }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 4px 0 var(--gap); }

/* Cards carry thin corner brackets (top left, bottom right) */
.card, .tile, .server-body .panel {
  position: relative; background: var(--surface); border: 1px solid var(--border);
}
.card { padding: 14px; }
.card::before, .card::after, .tile::before, .tile::after, .server-body .panel::before, .server-body .panel::after {
  content: ""; position: absolute; width: 6px; height: 6px; border: 1px solid var(--bracket); pointer-events: none;
}
.card::before, .tile::before, .server-body .panel::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.card::after, .tile::after, .server-body .panel::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.card.empty { text-align: center; padding: 32px 14px; }
.hero { text-align: center; max-width: 28rem; width: 100%; padding: 32px 24px; }
.hero h1 { margin-bottom: 8px; font-size: 1.8rem; text-transform: uppercase; letter-spacing: .08em; }

/* Logo mark: a potato in a square frame */
.mark { display: inline-block; position: relative; width: 20px; height: 20px; flex: none; }
.mark::before { content: ""; position: absolute; inset: 3px 2px; background: var(--accent); border-radius: 46% 54% 44% 56% / 58% 48% 52% 42%; }
.mark::after { content: ""; position: absolute; inset: 0; border: 1.5px solid var(--accent); opacity: .45; }
.mark-hero { width: 48px; height: 48px; margin-bottom: 14px; }
.mark-hero::before { inset: 8px 6px; }
.mark-hero::after { border-width: 2px; }

/* --- Controls ------------------------------------------------------------------ */

.button, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); color: var(--text); text-decoration: none; cursor: pointer;
  font: 700 .8rem/1 var(--font-head); letter-spacing: .1em; text-transform: uppercase;
}
.button:hover, button:hover { border-color: var(--muted); }
.button.primary {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent); padding-right: 18px;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);
}
.button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button.primary:focus-visible { clip-path: none; }  /* Else the cut corner hides part of the focus ring */
button:disabled { opacity: .35; cursor: default; }
.button.danger { border-color: var(--offline); color: var(--offline); background: transparent; }

/* Pills (round on purpose): status, states, counts */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 999px; font-size: .78rem;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); white-space: nowrap;
}
.badge.warn { background: color-mix(in srgb, var(--warning) 12%, transparent); border-color: var(--warning); color: var(--warning); }
.role {
  display: inline-block; padding: 1px 7px; font-size: .78rem; white-space: nowrap;
  background: var(--surface-2); border-left: 3px solid var(--role-color, var(--muted));
}

/* --- Top bar: phones get a ☰ menu (checkbox, works without JavaScript) ---------- */

.topbar {
  position: sticky; top: 0; z-index: 45;   /* Above the page's bars and heads (their menus must not cover the top bar's) */ display: flex; flex-wrap: wrap; align-items: center;
  padding: 0 var(--gap); background: rgba(15, 15, 15, .94); border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
}
.brand {
  display: flex; align-items: center; gap: 9px; min-height: 46px; text-decoration: none;
  font: 700 1rem/1 var(--font-head); letter-spacing: .12em; text-transform: uppercase;
}
.brand .logo { width: 26px; height: 26px; object-fit: contain; flex: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-button {
  margin-left: auto; display: grid; place-items: center; width: var(--tap); height: var(--tap);
  border: 1px solid var(--border); font-size: 1.2rem; cursor: pointer; color: var(--muted);
}
.nav-toggle:focus-visible + .nav-button { outline: 2px solid var(--accent); }
.nav { display: none; flex-basis: 100%; flex-direction: column; padding-bottom: 8px; }
.nav-toggle:checked ~ .nav { display: flex; }
.nav a, .nav summary {
  display: flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 12px; text-decoration: none;
  color: var(--muted); cursor: pointer; font: 600 .85rem/1 var(--font-head); letter-spacing: .1em; text-transform: uppercase;
}
.nav a:hover, .nav summary:hover { color: var(--text); background: var(--surface); }
.nav a.active, .nav summary.active { color: var(--text); box-shadow: inset 3px 0 var(--accent); }
.user-summary { gap: 10px; }
.user-summary::after { display: none; }
.user-who { display: grid; gap: 2px; text-align: right; }
.user-name { text-transform: none; letter-spacing: .02em; font: 600 .88rem/1.1 var(--font-text); color: var(--text); }
.user-rank { font: 700 .62rem/1 var(--font-head); letter-spacing: .14em; text-transform: uppercase; color: var(--role-color, var(--muted)); }
.avatar {
  display: grid; place-items: center; width: 28px; height: 28px; flex: none; background: var(--surface-2);
  border: 1px solid var(--border); border-bottom: 2px solid var(--role-color, var(--border));
  font: 700 .72rem/1 var(--font-head); letter-spacing: .05em; color: var(--text);
}
.menu-name { flex: 1; font-weight: 600; }
.dropdown-menu .dot { margin-right: 2px; }
.dropdown summary { list-style: none; }
.dropdown summary::-webkit-details-marker { display: none; }
.dropdown summary::after { content: "▾"; font-size: .75rem; }
.dropdown-menu { display: flex; flex-direction: column; padding-left: 12px; }
.dropdown-menu a, .dropdown-menu button { text-transform: none; letter-spacing: .02em; font: 500 .9rem/1 var(--font-text); }
.dropdown-menu form { margin: 0; }
.dropdown-menu button { width: 100%; justify-content: flex-start; background: none; border: 0; color: var(--muted); padding: 0 12px; }
.dropdown-menu button:hover { color: var(--text); background: var(--surface-2); }

/* Server bar: every server the user may see, with status and population; scrolls sideways on phones */
.server-strip {
  display: flex; overflow-x: auto; scrollbar-width: none; background: rgba(23, 24, 23, .9); border-bottom: 1px solid var(--border);
}
.server-strip::-webkit-scrollbar { display: none; }
.server-strip a {
  display: flex; align-items: center; gap: 7px; flex: none; min-height: 26px; padding: 0 12px; text-decoration: none;
  border-right: 1px solid var(--border); color: var(--muted); font-size: .75rem;
}
.server-strip a:hover { background: var(--surface-2); color: var(--text); }
.server-strip a.active { background: var(--bg); color: var(--text); box-shadow: inset 0 2px var(--accent); }
.server-strip b { font: 700 .8rem/1 var(--font-head); letter-spacing: .08em; color: var(--text); }
.strip-text { font-family: var(--font-data); font-size: .7rem; color: var(--muted); }

@media (min-width: 768px) {
  .page { padding: 16px; }
  .topbar { padding: 0 16px; }
  .nav-button { display: none; }
  .nav { display: flex; flex-basis: auto; flex: 1; flex-direction: row; align-items: stretch; align-self: stretch; gap: 0; padding: 0 0 0 18px; }
  .nav a, .nav summary { min-height: 46px; height: 100%; }
  .nav a.active, .nav summary.active { box-shadow: inset 0 -2px var(--accent); }
  .nav > a:hover, .nav > .dropdown > summary:hover { background: none; }
  .user-menu { margin-left: auto; }
  .dropdown { position: relative; display: flex; }
  .dropdown-menu {
    position: absolute; top: 100%; left: 0; min-width: 220px; padding: 4px;
    background: var(--surface); border: 1px solid var(--border); box-shadow: 0 10px 28px rgba(0, 0, 0, .5);
  }
  .dropdown-menu a { min-height: 34px; }
  .dropdown-menu a.active { box-shadow: inset 2px 0 var(--accent); }
  .user-menu .dropdown-menu { left: auto; right: 0; }
}
@media (min-width: 1200px) {
  .page { padding: 20px 24px; }
}

/* --- Toolbar, chips ---------------------------------------------------------- */

.toolbar { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 26px; padding: 0 9px; font-size: .72rem; color: var(--muted); background: transparent; }
.chip.selected { color: var(--text); border-color: var(--muted); background: var(--surface-2); }
.page-wide { max-width: none; }
.stale-note {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 20;
  padding: 8px 14px; background: var(--warning); color: #140b03; font-size: .9rem; font-weight: 600;
}

/* --- Status and summary --------------------------------------------------------- */

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.status-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 8px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-size: .78rem; font-weight: 600;
}
.status-online { color: var(--online); border-color: color-mix(in srgb, var(--online) 45%, transparent); background: color-mix(in srgb, var(--online) 8%, transparent); }
.status-online .dot { background: var(--online); box-shadow: 0 0 6px color-mix(in srgb, var(--online) 55%, transparent); }
.status-offline, .status-unavailable, .status-suspended { color: var(--offline); border-color: color-mix(in srgb, var(--offline) 45%, transparent); background: color-mix(in srgb, var(--offline) 8%, transparent); }
.status-offline .dot, .status-stopped .dot, .status-unavailable .dot, .status-suspended .dot { background: var(--offline); }
.status-starting, .status-stopping, .status-rcon_down { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 45%, transparent); background: color-mix(in srgb, var(--warning) 8%, transparent); }
.status-starting .dot, .status-stopping .dot, .status-rcon_down .dot { background: var(--warning); }
.summary-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 4px; }
.server-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.server-title b { font: 700 1.02rem/1.2 var(--font-head); letter-spacing: .03em; }
.round-time { font: .76rem var(--font-data); color: var(--muted); }
.server-title .next { margin-left: auto; font-size: .76rem; color: var(--muted); }
.offline-text { margin: 6px 0 0; }

/* Head of a server (tile and server page): status dot, name, then population, queue and admins */
.head-stats { display: flex; align-items: center; gap: 6px; flex: none; margin-left: auto; }
.head-pop { font: 500 .9rem var(--font-data); white-space: nowrap; }
.head-pop small { font-size: .76rem; color: var(--muted); }
.pop { position: relative; }
.pop-chip {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 7px; list-style: none; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2); font: 500 .74rem var(--font-data); color: var(--text);
}
.pop-chip::-webkit-details-marker { display: none; }
.pop-chip .icon { width: 14px; height: 14px; color: var(--muted); }
.pop-chip.admins .icon { color: var(--accent); }
.pop-chip:hover, .pop[open] > .pop-chip { border-color: var(--muted); }
.pop-panel {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 12; width: max-content; min-width: 210px; max-width: 280px;
  max-height: 320px; overflow-y: auto; padding: 6px 0; background: var(--surface-2); border: 1px solid var(--border);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .55);
}
.pop-group + .pop-group { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }
.pop-title {
  display: flex; justify-content: space-between; gap: 12px; padding: 3px 10px;
  font: 700 .66rem/1.4 var(--font-head); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.pop-title b { font: 500 .74rem var(--font-data); letter-spacing: 0; color: var(--text); }
.pop-row { display: flex; justify-content: space-between; gap: 12px; padding: 2px 10px; font-size: .85rem; text-decoration: none; }
a.pop-row:hover { background: var(--surface); color: var(--accent); }
.pop-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-meta { font: .72rem var(--font-data); color: var(--muted); }
.pop-note { margin: 0; padding: 4px 10px; font-size: .8rem; color: var(--muted); }

/* Alliances: dot, text and bar colors */
.alliance { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); vertical-align: 1px; margin-right: 6px; }
.bg-none { background: var(--muted); }
.tone-none { color: var(--text); }
.flag { width: 20px; height: 13px; object-fit: cover; vertical-align: -2px; margin-right: 6px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .12); }
.team.right .flag, .team.right .alliance { margin: 0 0 0 6px; }

/* Tickets of a tile in one line like the server page: team 1 | bar | team 2 */
.tickets { display: grid; grid-template-columns: auto minmax(40px, 1fr) auto; align-items: center; gap: 0 10px; margin-top: 8px; }
.tickets .team { display: inline-flex; align-items: center; gap: 8px; font: 700 .8rem var(--font-head); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.tickets strong { font: 500 .95rem var(--font-data); }
.tickets .flag { margin: 0; }
.ticket-bar { display: flex; gap: 2px; height: 6px; overflow: hidden; }
.ticket-bar span { display: block; height: 100%; transition: width .8s ease; }
.flash { animation: flash 1.2s ease; }
@keyframes flash { from { color: #fff; text-shadow: 0 0 8px currentColor; } to { text-shadow: none; } }
.ticket-bar span:last-child { flex: 1; }
.teams { list-style: none; margin: 8px 0 0; padding: 0; font-size: .85rem; }
.teams li { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.next, .matchup { font-size: .8rem; }
.matchup { margin-top: 6px; }


/* --- Dashboard grid: 12 columns, rows of 40px; tiles carry their place as inline style ---------------------- */

.dash-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; padding: 0 12px 10px; }
@media (max-width: 767px) {
  .tile { grid-column: auto !important; grid-row: auto !important; } /* Phones: below each other in layout order */
}
.tile.dragging, .tile.resizing { z-index: 5; border-color: var(--accent); box-shadow: 0 10px 30px rgba(0, 0, 0, .55); }
.tile-head, .server-view-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tile-head { min-height: 40px; margin: 0 -12px; padding: 0 8px 0 6px; border-bottom: 1px solid var(--border); }
.tile-name {
  flex: 0 1 auto; min-width: 0; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 700 1.05rem/1 var(--font-head); letter-spacing: .03em;
}
.tile-name:hover { color: var(--accent); }
.tile-handle {
  display: none; align-items: center; justify-content: center; width: 20px; min-height: 24px; height: 24px; padding: 0;
  border: 0; background: none; color: var(--muted); cursor: grab; touch-action: none; font-size: 1rem; line-height: 1;
}
.tile.dragging .tile-handle { cursor: grabbing; }
.tile-menu summary { display: grid; place-items: center; min-width: 28px; min-height: 28px; color: var(--muted); cursor: pointer; list-style: none; border: 1px solid transparent; }
.tile-menu summary:hover { border-color: var(--border); color: var(--text); }
.tile-menu summary::-webkit-details-marker { display: none; }
.tile-menu summary::after { content: none; }
.tile-menu .dropdown-menu { padding: 4px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 10px 28px rgba(0, 0, 0, .5);
  right: 0; left: auto; z-index: 40; min-width: 230px; max-height: 70vh; overflow-y: auto; overscroll-behavior: contain; }
.tile-menu .check { min-height: 30px; }
.menu-label { padding: 8px 12px 3px; font: 700 .62rem/1 var(--font-head); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.menu-icons { display: flex; gap: 4px; padding: 3px 12px 6px; }
.dropdown-menu .menu-icons .icon-chip { width: 30px; justify-content: center; padding: 0; border: 1px solid var(--border); background: var(--surface-2); }
.dropdown-menu > a { display: flex; align-items: center; min-height: 32px; padding: 0 12px; text-decoration: none; color: var(--muted); }
.dropdown-menu > a:hover { color: var(--text); background: var(--surface-2); }
.menu-icons .icon-chip .icon { color: var(--text); }
.menu-buttons { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 12px 8px; }
.menu-buttons button { min-height: 24px; padding: 0 8px; font-size: .66rem; width: auto; justify-content: center; border: 1px solid var(--border); background: var(--surface); }
.tile-resize { display: none; position: absolute; right: 2px; bottom: 2px; width: 14px; height: 14px; cursor: nwse-resize; touch-action: none; z-index: 1;
               background: linear-gradient(135deg, transparent 50%, var(--muted) 50%, var(--muted) 60%, transparent 60%, transparent 70%, var(--muted) 70%, var(--muted) 80%, transparent 80%); }
.tile-body { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.tile:not(.show-players) .players-panel, .tile:not(.show-log) .log-panel,
.tile:not(.show-players) .split-handle, .tile:not(.show-log) .split-handle, .is-down .split-handle { display: none; }
.tile:not(.show-players) .live-split, .tile:not(.show-log) .live-split, .is-down .live-split { grid-template-columns: minmax(0, 1fr); }
.tile:not(.show-players):not(.show-log) .tile-body { display: none; }
.is-down .players-panel { display: none; }
.check { display: flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 12px; color: var(--muted); cursor: pointer; }
.check.disabled { opacity: .45; cursor: default; }
.dropdown-menu hr { width: 100%; border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.dropdown-menu .danger-text { color: var(--danger-text); }

/* --- Status: four colors (ServerCard.tone), a short pulse on every live update ------------------------------- */

.dot.s-online { background: var(--online); color: var(--online); box-shadow: 0 0 6px color-mix(in srgb, var(--online) 50%, transparent); }
.dot.s-seeding { background: var(--warning); color: var(--warning); }
.dot.s-updating { background: var(--updating); color: var(--updating); }
.dot.s-offline { background: var(--offline); color: var(--offline); }
.tile-head .dot, .server-view-head .dot { width: 9px; height: 9px; }
.dot.beat { animation: beat .9s ease-out; }
@keyframes beat { from { box-shadow: 0 0 0 0 currentColor; } to { box-shadow: 0 0 0 6px transparent; } }

/* --- Sub bar of the dashboard (like BattleMetrics): servers shown, commands, send to several servers ------- */

.sub-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px var(--gap); background: rgba(23, 24, 23, .92); border-bottom: 1px solid var(--border); }
.sub-menu > summary {
  display: flex; align-items: center; justify-content: center; min-height: 30px; padding: 0 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
}
.sub-menu > summary::after { content: none; }   /* They look like buttons; no arrow */
.sub-menu > summary.sq { width: 32px; padding: 0; font-size: 1rem; line-height: 1; }
.sub-menu .dropdown-menu { min-width: 220px; z-index: 30; }
.sub-menu .check { min-height: 30px; }
.sub-send { flex: 1; min-width: min(100%, 22rem); padding: 0; border: 0; background: none; }

/* --- Send line (broadcast or raw RCON) under a server's log and in the sub bar ------------------------------ */

.composer { display: flex; align-items: center; gap: 4px; padding: 5px; border-top: 1px solid var(--border); background: var(--surface); }
.composer input { min-height: 28px; font-size: .82rem; padding: 0 7px; }
.composer .composer-name { width: 9rem; flex: none; }
.tile .composer .composer-name { width: 7rem; }
.composer .composer-text { flex: 1; min-width: 4rem; }
.composer .button, .composer .raw-toggle { min-height: 28px; }
.composer .raw-toggle { width: 30px; padding: 0; font: 600 .8rem var(--font-data); letter-spacing: 0; text-transform: none; }
.composer .raw-toggle[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.composer.is-raw .composer-name, .composer.is-raw .colon { display: none; }
.colon { color: var(--muted); font-weight: 600; }
@media (max-width: 767px) {
  .composer .composer-name { width: 6.5rem; }
  .sub-send { flex-wrap: wrap; }
  .sub-send .composer-text { order: 5; flex: 1 1 100%; }   /* Phones: the message gets its own line */
  .sub-send .colon { display: none; }
}

/* --- Player list | handle | log (tile body and server page) ------------------------------------------------ */

.live-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-height: 0; flex: 1; }
.split-handle { display: none; cursor: col-resize; background: var(--border); position: relative; touch-action: none; }
.split-handle::after { content: ""; position: absolute; inset: 45% 1px; border-left: 1px solid var(--muted); border-right: 1px solid var(--muted); }
.split-handle:hover, .split-handle.dragging, .split-handle:focus-visible { background: var(--accent); outline: none; }
.panel { display: flex; flex-direction: column; min-height: 0; background: var(--bg); border: 1px solid var(--border); }
.panel-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px; border-bottom: 1px solid var(--border); }
.icon-chip { min-height: 26px; width: 30px; padding: 0; }
.icon-chip .icon { width: 15px; height: 15px; }
.icon-chip:not(.selected) { opacity: .4; }
.panel-search {
  flex: 1; min-width: 7rem; min-height: 26px; padding: 0 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-size: .85rem;
}
.panel-scroll { overflow-y: auto; max-height: 320px; padding: 0 0 2px; font-size: .85rem; }
.panel-empty { padding: 8px 10px; margin: 0; }
.log-filters { display: flex; flex-wrap: wrap; gap: 4px; }
/* Team head of a tile's player list, like the server page's (.team-line): team color as text and as the line below */
.player-team {
  --team: var(--border); --team-text: var(--text);
  display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 8px; position: sticky; top: 0; z-index: 1;
  font: 700 .8rem/1.2 var(--font-head); letter-spacing: .12em; text-transform: uppercase; color: var(--team-text);
  background: var(--surface); border-bottom: 2px solid var(--team);
}

.player-list > .player-team ~ .player-team { margin-top: 10px; }   /* Space before the second team */
.player-team .flag { width: 20px; height: 13px; margin: 0; }
.player-team .alliance { margin: 0; }
.player-count { margin-left: auto; font: .7rem var(--font-data); letter-spacing: 0; color: var(--muted); }
.player-squad {
  display: flex; gap: 6px; padding: 3px 8px 2px; font: 600 .72rem/1.3 var(--font-head); letter-spacing: .08em;
  text-transform: uppercase; color: var(--text); background: rgba(29, 30, 29, .7);
}
.list-teams { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.list-teams .team-column { min-width: 0; }
.list-teams .team-column + .team-column { border-left: 1px solid var(--border); }
.list-teams .player-flags { display: none; }
.player-row {
  display: grid; grid-template-columns: 18px minmax(0, 1fr) auto auto 12px; align-items: center; gap: 6px; padding: 1px 4px 1px 8px;
  border-bottom: 1px solid rgba(46, 48, 45, .5); cursor: pointer; user-select: none;
}
.player-row:hover { background: var(--surface-2); }
.player-row:focus-visible { outline: 1px solid var(--accent); outline-offset: -1px; }
.player-row.lead { box-shadow: inset 2px 0 var(--accent); }   /* Squad leaders: the bar on the left, the name stays plain */
.player-row.open { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.player-row.picked { background: color-mix(in srgb, var(--accent) 18%, transparent); box-shadow: inset 3px 0 var(--accent); }
.player-chevron { color: var(--muted); opacity: 0; font-size: 1rem; line-height: 1; text-align: center; transition: opacity .15s; }
.player-row:hover .player-chevron, .player-row.open .player-chevron { opacity: 1; color: var(--accent); }
@media (hover: none) { .player-chevron { opacity: .5; } }
.role-icon { width: 16px; height: 16px; display: block; opacity: .9; }
.role-text { font: 700 .5rem/1 var(--font-head); color: var(--muted); text-transform: uppercase; text-align: center; overflow: hidden; }
.player-name { justify-self: start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.player-name:hover { text-decoration: underline; }
.player-flags { display: inline-flex; gap: 2px; }
.player-flag { display: inline-flex; color: var(--muted); }
.player-flag .icon { width: 13px; height: 13px; }
/* Marks next to a name: waiting for the new team after a map change (hourglass, the row is dimmed), party number
   (link icon + number), vehicle (car icon, vehicle and seat on hover / in the second line of the server page) */
.player-marks { display: inline-flex; align-items: center; gap: 4px; }
.player-mark { display: inline-flex; align-items: center; gap: 1px; color: var(--muted); font: .66rem var(--font-data); }
.player-mark .icon { width: 13px; height: 13px; }
.player-row.stale { opacity: .6; }
.player-row.stale .mark-stale { color: var(--text); }
.squad-lock { display: inline-flex; align-items: center; color: var(--muted); }
.squad-lock .icon { width: 13px; height: 13px; }
.player-squad .squad-lock, .squad-head .squad-lock { margin-left: auto; }   /* Right side, the count follows */
.squad-head .squad-lock + .count, .player-squad .squad-lock + .player-count { margin-left: 0; }
.log-panel .panel-scroll { flex: 1; }
/* Log entries (log_entry.js): time | icon | sentence. --c = the kind's color, --ls = icon size (account setting) */
/* Every part sits on the first line (--lh): time, icon and text line up, also when the text wraps; tags, badges and squad
   heads stay lower than a line, so a row with them is as high as one without */
.log-entry { --c: var(--text); --ls: 20px; --lh: 22px; display: grid; grid-template-columns: auto var(--ls) minmax(0, 1fr); gap: 2px 9px;
  align-items: start; line-height: var(--lh); min-height: 30px; padding: 4px 10px; border-bottom: 1px solid rgba(46, 48, 45, .45); overflow-wrap: anywhere; font-size: .87rem; }
body[data-log-icons="m"] .log-entry { --ls: 17px; } body[data-log-icons="s"] .log-entry { --ls: 15px; }
.log-icon { display: grid; place-items: center; height: var(--lh); color: var(--c); }
.log-icon .icon { width: var(--ls); height: var(--ls); }
.log-time { font: .72rem/var(--lh) var(--font-data); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.log-text { min-width: 0; }
.log-text .vb { color: var(--muted); }
.log-detail { font: .74rem var(--font-data); color: var(--muted); white-space: nowrap; }
.log-detail::before { content: " · "; opacity: .6; }
.log-msg { color: var(--text); }
.log-msg.q::before { content: "“"; color: var(--muted); } .log-msg.q::after { content: "”"; color: var(--muted); }
.log-strong { font-weight: 600; }
.log-person { white-space: nowrap; }
.log-flag { width: 16px; height: 10px; margin-right: 4px; vertical-align: -.5px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); }
.log-flag-code { margin-right: 4px; font: 700 .62rem/1 var(--font-head); letter-spacing: .08em; color: var(--muted); }
.log-text a.pl, .log-issuer a.pl { color: var(--text); font-weight: 600; text-decoration: none; border-bottom: 1px solid transparent; }
.log-text a.pl:hover, .log-text a.pl:focus-visible { color: #fff; border-bottom-color: var(--accent); }
.log-text span.pl { font-weight: 600; }
/* Names in team colors (account setting): the alliance's text color; both teams of one alliance: team 1 a light tint
   (Lc 74), team 2 the deep, saturated shade (Lc 46, below the text rule on purpose: bold names, maintainer's choice) */
body[data-log-names="team"] .log-text .pl.al-nato { color: var(--nato-text); }
body[data-log-names="team"] .log-text .pl.al-redfor { color: var(--redfor-text); }
body[data-log-names="team"] .log-text .pl.al-pac { color: var(--pac-text); }
body[data-log-names="team"] .log-text .pl.al-independent { color: var(--independent-text); }
body[data-log-names="team"] .log-text .pl.allied.t1.al-nato { color: #a7cdfe; }
body[data-log-names="team"] .log-text .pl.allied.t2.al-nato { color: #4196fd; }
body[data-log-names="team"] .log-text .pl.allied.t1.al-redfor { color: #ffb9aa; }
body[data-log-names="team"] .log-text .pl.allied.t2.al-redfor { color: #fe5d41; }
body[data-log-names="team"] .log-text .pl.allied.t1.al-pac { color: #dacb73; }
body[data-log-names="team"] .log-text .pl.allied.t2.al-pac { color: #a99601; }
body[data-log-names="team"] .log-text .pl.allied.t1.al-independent { color: #a4d895; }
body[data-log-names="team"] .log-text .pl.allied.t2.al-independent { color: #50a830; }
/* Tags: only for the kinds the admin chose (show-tag-<key> on the log box), the round always */
.log-tag { display: none; margin-right: 7px; padding: 3px 5px 2px; background: color-mix(in srgb, var(--c) 16%, transparent);
  color: color-mix(in srgb, var(--c) 60%, #fff); font: 700 .66rem/1 var(--font-head); letter-spacing: .14em; text-transform: uppercase;
  vertical-align: middle; position: relative; top: -1px; white-space: nowrap; }
.log-entry.round .log-tag, .show-tag-kill .tag-kill, .show-tag-teamkill .tag-teamkill, .show-tag-death .tag-death,
.show-tag-revive .tag-revive, .show-tag-join .tag-join, .show-tag-leave .tag-leave, .show-tag-squad .tag-squad,
.show-tag-chatall .tag-chatall, .show-tag-chatteam .tag-chatteam, .show-tag-chatsquad .tag-chatsquad,
.show-tag-adminchat .tag-adminchat, .show-tag-warn .tag-warn, .show-tag-kick .tag-kick, .show-tag-ban .tag-ban,
.show-tag-ban .tag-portal_ban, .show-tag-broadcast .tag-broadcast, .show-tag-camera .tag-camera, .show-tag-command .tag-command,
.show-tag-power .tag-power { display: inline-block; }
/* Issuer of an admin action: a badge at the end (icon: in game, portal, plugin, other RCON tool) */
.log-issuer { display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; padding: 1px 6px; border: 1px solid var(--border);
  background: var(--surface-2); font-size: .76rem; line-height: 16px; color: var(--muted); white-space: nowrap; vertical-align: middle;
  position: relative; top: -1px; }
.log-issuer .icon { width: 12px; height: 12px; }
.log-issuer span { color: var(--text); }
/* Squad created: number and name like the squad head of the player list */
.log-squad { display: inline-flex; align-items: stretch; border: 1px solid var(--border); background: #232522;
  font: 700 .7rem/1 var(--font-head); letter-spacing: .1em; text-transform: uppercase; vertical-align: middle; position: relative; top: -1px; }
.log-squad .no { display: grid; place-items: center; min-width: 18px; padding: 2px 4px; background: var(--bg); border-right: 1px solid var(--border);
  font: 500 .7rem/1 var(--font-data); letter-spacing: 0; color: var(--act-squad); }
.log-squad .sn { padding: 3px 6px 2px; }
.log-server { margin-left: 8px; font: .7rem var(--font-data); color: var(--muted); }
/* Rounds and danger (teamkill, kick, ban) lightly backed in their color; the icon and tag carry the kind too */
.log-entry.round { background: color-mix(in srgb, var(--c) 9%, transparent); border-top: 1px solid color-mix(in srgb, var(--c) 28%, transparent);
  border-bottom-color: color-mix(in srgb, var(--c) 28%, transparent); }
.log-entry.danger { background: color-mix(in srgb, var(--c) 7%, transparent); }
.c-kill { --c: var(--act-kill); } .c-teamkill { --c: var(--act-teamkill); } .c-death { --c: var(--act-death); }
.c-revive { --c: var(--act-revive); } .c-join { --c: var(--act-join); } .c-leave { --c: var(--act-leave); }
.c-squad { --c: var(--act-squad); } .c-chatall { --c: var(--act-chat); } .c-chatteam { --c: var(--act-team); }
.c-chatsquad { --c: var(--act-squadchat); } .c-adminchat { --c: var(--act-adminchat); } .c-warn { --c: var(--act-warn); }
.c-kick { --c: var(--act-kick); } .c-ban, .c-portal_ban { --c: var(--act-ban); } .c-broadcast { --c: var(--act-broadcast); }
.c-camera { --c: var(--act-camera); } .c-command { --c: var(--act-command); } .c-power { --c: var(--act-power); }
.c-round_start, .c-round_end { --c: var(--act-round); }
/* Log filter of a dashboard tile (squads go with rounds there) */
.hide-chat .grp-chat, .hide-kill .grp-kill, .hide-kill .grp-teamkill, .hide-kill .grp-revive, .hide-join .grp-join,
.hide-admin .grp-admin, .hide-round .grp-round, .hide-round .grp-squad { display: none; }

/* --- Player window (click on a player row), selection mode, command dialog, messages ------------------------ */

.player-pop {
  position: fixed; z-index: 50; display: flex; flex-direction: column; width: 300px; max-height: min(440px, calc(100vh - 16px));
  background: var(--bg); border: 1px solid var(--border); border-top: 2px solid var(--accent); box-shadow: 0 12px 30px rgba(0, 0, 0, .6);
}
.pop-grab { display: none; }
.pop-head { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 7px 8px; border-bottom: 1px solid var(--border); }
.pop-role { width: 22px; height: 22px; }
.pop-head strong { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font: 700 .98rem/1.1 var(--font-head); letter-spacing: .03em; overflow-wrap: anywhere; }
.pop-flags { display: inline-flex; gap: 3px; }
.pop-flags span { display: inline-flex; color: var(--muted); cursor: help; }
.pop-flags .icon { width: 15px; height: 15px; }
.pop-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; font-size: .74rem; color: var(--muted); }
.pop-sub .flag { width: 18px; height: 11px; margin: 0; }
.pop-close { width: 26px; min-height: 26px; padding: 0; border: 0; background: none; color: var(--muted); font-size: .95rem; }
.pop-body { overflow-y: auto; min-height: 0; flex: 1; }
.pop-numbers { display: grid; grid-template-columns: repeat(4, 1fr); min-height: 38px; border-bottom: 1px solid var(--border); }
.pop-numbers div { display: grid; gap: 1px; padding: 4px 8px; }
.pop-numbers div + div { border-left: 1px solid var(--border); }
.pop-numbers small { font: 700 .58rem/1 var(--font-head); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pop-numbers b { font: 500 .85rem var(--font-data); }
.pop-section { display: grid; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.pop-section .menu-label { display: flex; justify-content: space-between; align-items: center; padding: 0; }
.pop-note { display: grid; gap: 1px; margin: 0; padding-left: 7px; border-left: 2px solid var(--border); font-size: .78rem; }
.pop-note span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.pop-note small { font-size: .68rem; color: var(--muted); }
.pop-filters { display: flex; gap: 3px; }
.pop-filters button { width: 26px; min-height: 22px; height: 22px; padding: 0; }
.pop-filters button .icon { width: 13px; height: 13px; }
.pop-filters button[aria-pressed="false"] { opacity: .35; }
.pop-recent { display: grid; font-size: .78rem; }
.pop-recent .log-entry { --ls: 15px; min-height: 0; padding: 2px 0; font-size: .78rem; border-bottom: 0; }
.pop-recent p { margin: 0; font-size: .78rem; }
.pop-more { justify-self: start; min-height: 24px; padding: 0 8px; font-size: .62rem; }
.pop-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 6px 8px 8px; border-top: 1px solid var(--border); background: var(--surface); }
.pop-actions button { min-height: 28px; padding: 0 4px; font-size: .62rem; }
.pop-actions button:disabled { opacity: .3; cursor: not-allowed; }
.pop-actions .warn { color: var(--act-warn); } .pop-actions .kick { color: var(--act-kick); } .pop-actions .ban { color: var(--act-ban); }
.pop-actions .page { grid-column: 1 / -1; width: 100%; }
.player-pop.sheet { left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 72vh; border-width: 2px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0px); }
.player-pop.sheet .pop-grab { display: block; width: 44px; height: 4px; margin: 6px auto 0; background: var(--muted); border-radius: 2px; flex: none; }
.player-pop.sheet .pop-actions button { min-height: 36px; }
.pop-backdrop { position: fixed; inset: 0; z-index: 49; background: rgba(0, 0, 0, .5); }
.select-toggle[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.pick-squad { display: none; min-height: 18px; height: 18px; margin-left: 6px; padding: 0 6px; font-size: .58rem; }
.selecting .pick-squad { display: inline-flex; }
.selection-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px; background: var(--surface-2); border-top: 2px solid var(--accent); }
.selection-bar[hidden] { display: none; }
.selection-bar b { margin-right: auto; font: 700 .76rem var(--font-head); letter-spacing: .08em; text-transform: uppercase; }
.selection-bar button { min-height: 28px; padding: 0 8px; font-size: .62rem; }
.command-dialog { width: min(420px, calc(100vw - 32px)); padding: 16px; background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.command-dialog::backdrop { background: rgba(0, 0, 0, .6); }
.command-dialog .stacked { max-width: none; margin-top: 8px; }
.command-dialog p:empty { display: none; }
.answer-dialog { width: min(900px, calc(100vw - 32px)); }
.answer-dialog h2 { overflow-wrap: anywhere; }
.rcon-answer { max-height: 65vh; overflow: auto; margin: 10px 0; padding: 8px 10px; background: var(--bg); border: 1px solid var(--border);
  font: .76rem/1.5 var(--font-data); white-space: pre-wrap; overflow-wrap: anywhere; }
.toast {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 60; max-width: calc(100vw - 32px);
  padding: 8px 14px; background: var(--surface-2); border: 1px solid var(--online); font-size: .88rem;
}
.toast.error { border-color: var(--offline); }

/* --- Server page ----------------------------------------------------------------------------------------- */

.server-view { display: flex; flex-direction: column; gap: var(--gap); }
.server-view-head { flex-wrap: wrap; }
.server-view-head h1 { flex: 0 1 auto; min-width: 0; font-size: 1.35rem; line-height: 1; }
.server-body .panel { background: var(--surface); }
.server-body .panel-scroll { max-height: 60vh; }

@media (min-width: 768px) {
  .dash-grid { grid-template-columns: repeat(24, minmax(0, 1fr)); grid-auto-rows: 20px; }
  .tile { overflow: hidden; }
  .tile-handle { display: inline-flex; }
  .tile-resize { display: block; }
  .live-split { grid-template-columns: var(--split, 42%) 6px minmax(0, 1fr); gap: 0; }
  .live-split .players-panel { margin-right: 4px; }
  .live-split .log-panel { margin-left: 4px; }
  .split-handle { display: block; }
  .tile .panel-scroll { max-height: none; flex: 1; }
  .tile .panel { min-height: 0; }
  .tile.tile-short .tile-body { display: none; }
  .server-body .live-split { height: calc(100vh - 330px); min-height: 320px; }
  .server-body .panel-scroll { max-height: none; flex: 1; }
}

/* --- Admin pages: tables, forms, notices ------------------------------------------------------------- */

.section { margin-bottom: var(--gap); }
.notice { margin-bottom: var(--gap); padding: 8px 12px; background: color-mix(in srgb, var(--online) 8%, transparent); border: 1px solid color-mix(in srgb, var(--online) 40%, transparent); border-left: 3px solid var(--online); }
.notice.error { background: color-mix(in srgb, var(--offline) 8%, transparent); border-color: color-mix(in srgb, var(--offline) 40%, transparent); border-left-color: var(--offline); }
.table-wrap { overflow-x: auto; margin: 8px 0; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th, .table td { padding: 6px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table th { color: var(--muted); font: 700 .7rem/1.2 var(--font-head); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.table tbody tr:hover td { background: var(--surface-2); }
.table td a { text-decoration: none; }
.table td a:hover { color: var(--accent); }
.table td.actions { text-align: right; white-space: nowrap; }
.table td.actions form { margin: 0; display: inline; }
.matrix td.cell, .matrix th:not(:first-child) { text-align: center; width: 4.5rem; }
.matrix td.cell label { display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); cursor: pointer; }
.matrix input[type=checkbox], .check input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.inline-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 10px 0 0; }
.inline-form label:not(.check) { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--muted); }
/* Levels of notes on the roles page: one form per level */
.level-list { display: flex; flex-direction: column; }
.level-list .level-row { padding: 8px 0; border-bottom: 1px solid var(--border); margin: 0; }
.level-no { align-self: center; min-width: 2.2em; font: 500 1.1rem var(--font-data); color: var(--text); text-align: center; }
input:not([type=checkbox]):not([type=color]), select {
  min-height: var(--tap); padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--text); font: inherit;
}
input:not([type=checkbox]):not([type=color]):focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
input[type=color] { width: 56px; height: var(--tap); padding: 2px; border: 1px solid var(--border); background: var(--bg); }
.check.everything { padding-left: 0; }
.form-actions { margin-top: var(--gap); }
label.stacked { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--muted); max-width: 32rem; }
.server-checks { display: flex; flex-wrap: wrap; gap: 0 8px; }
.table tr.dimmed td { color: var(--muted); }
.compare-ids { word-break: break-all; font: .8rem var(--font-data); }
.compare-block { margin: 8px 0; }
.section h2 + .inline-form + h2, .section .inline-form + h2, .section .server-checks + h2 { margin-top: 24px; }
[data-compare-result] { margin-top: 12px; }

/* Tables marked .stack become one card per row on phones (each cell shows its column name) */
@media (max-width: 767px) {
  .table.stack thead { display: none; }
  .table.stack, .table.stack tbody, .table.stack tr, .table.stack td { display: block; width: 100%; }
  .table.stack tr { border: 1px solid var(--border); background: var(--surface); margin-bottom: 8px; padding: 4px 2px; }
  .table.stack td { border: 0; padding: 3px 10px; }
  .table.stack td[data-label]::before {
    content: attr(data-label); display: block; color: var(--muted);
    font: 700 .66rem/1.4 var(--font-head); letter-spacing: .14em; text-transform: uppercase;
  }
  .table.stack td.actions { text-align: left; }
}
.danger-zone { margin: 24px 0; }
.danger-zone .button { border-color: var(--offline); color: var(--offline); }
.matrix th:first-child, .matrix td:first-child { position: sticky; left: 0; z-index: 1; min-width: 11rem; background: var(--surface); }
.scroll-hint { display: none; margin: 0; font-size: .8rem; }
@media (max-width: 767px) { .scroll-hint { display: block; } }

/* --- Bans and players ------------------------------------------------------------------------------------- */

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 5px 16px; margin: 0; }
.facts dt { color: var(--muted); font: 700 .72rem/1.9 var(--font-head); letter-spacing: .12em; text-transform: uppercase; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 767px) { .facts { grid-template-columns: 1fr; gap: 0; } .facts dd { margin-bottom: 8px; } }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 10px 0; }
.form-grid label, fieldset.durations > label:not(.check) { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--muted); }
@media (min-width: 768px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-grid .wide { grid-column: 1 / -1; } }
.form-grid input, .form-grid select, .form-grid textarea, label.stacked textarea { width: 100%; }
textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border); padding: 8px 10px; }
fieldset.durations { border: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 8px; margin: 10px 0; }
fieldset.durations legend { color: var(--muted); padding: 0 6px; font: 700 .72rem/1 var(--font-head); letter-spacing: .12em; text-transform: uppercase; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }
.reason-cell { max-width: 28rem; overflow-wrap: anywhere; }
/* Rules of a ban list (ban_list.html) */
.rule-list { display: flex; flex-direction: column; }
.rule-row { display: grid; grid-template-columns: 70px minmax(140px, 1fr) minmax(220px, 2.4fr) 80px auto; gap: 6px 10px; align-items: end;
  padding: 8px 0; border-bottom: 1px solid var(--border); }
.rule-row label { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: .74rem; color: var(--muted); }
.rule-row input { min-width: 0; }
.rule-acts { display: flex; gap: 6px; }
@media (max-width: 900px) { .rule-row { grid-template-columns: 70px minmax(0, 1fr); } .rule-text { grid-column: 1 / -1; } }
/* Rule choice of the ban forms (ban_form.js) */
.rule-pick { display: flex; flex-direction: column; gap: 6px; }
.rule-pick select { max-width: 100%; }
.rule-full { margin: 0; padding: 6px 8px; border-left: 2px solid var(--border); background: var(--surface-2); font-size: .82rem; overflow-wrap: anywhere; }
.rule-full .k { display: block; font: 700 .58rem var(--font-head); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.note { border-left: 2px solid var(--border); padding-left: 10px; margin-bottom: 10px; }
.note p { margin: 0 0 4px; }
.badge.state-active { color: var(--offline); border-color: color-mix(in srgb, var(--offline) 50%, transparent); background: color-mix(in srgb, var(--offline) 8%, transparent); }
.badge.state-online { color: var(--online); border-color: color-mix(in srgb, var(--online) 50%, transparent); background: color-mix(in srgb, var(--online) 8%, transparent); }
.note-line { overflow-wrap: anywhere; }
.badge.state-expired, .badge.state-revoked { color: var(--muted); }
.filters label input { min-width: 14rem; }
a.player-name { text-decoration: none; }
a.player-name:hover { color: var(--accent); }
form.card.section.inline-form { margin: 0 0 var(--gap); }

/* --- Icons (assets/icons/, embedded once per page) ---------------------------------------------------------- */

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }  /* Not display:none - some browsers then hide <use> */
.icon { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }

/* --- Player page (agreed 2026-11-25, player.html + player_page.js): head across, left identity / bans / notes /
   playtime, right the activity (the server log's panel). Classes start with pp-. ------------------------------- */

.pp { display: flex; flex-direction: column; gap: var(--gap); }
.pp .k { font: 700 .6rem/1.6 var(--font-head); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pp-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pp-name { display: inline-flex; align-items: center; gap: 8px; min-height: 0; padding: 0 4px; margin-left: -4px; border: 1px solid transparent;
  background: none; color: var(--text); text-transform: none; letter-spacing: .03em; }
.pp-name h1 { font-size: 1.6rem; overflow-wrap: anywhere; text-align: left; }
.pp-name .icon { width: 16px; height: 16px; color: transparent; }
.pp-name:hover, .pp-name:focus-visible { border-color: var(--border); background: var(--surface-2); }
.pp-name:hover .icon, .pp-name.copied .icon { color: var(--muted); }
.pp-name.copied .icon, .pp-id-copy.copied .icon { color: var(--online); }
.pp-flags { display: inline-flex; gap: 4px; align-items: center; }
.pp-flag { display: inline-flex; color: var(--muted); cursor: help; }
.pp-flag .icon { width: 18px; height: 18px; }
.pp-pill { font-weight: 600; color: var(--text); }
.pp-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--online); }
.pp-pill.on { border-color: color-mix(in srgb, var(--online) 55%, transparent); background: color-mix(in srgb, var(--online) 12%, transparent); }
.pp-pill.off .dot { background: transparent; border: 2px solid var(--muted); }
.pp-pill.ban { border-color: color-mix(in srgb, var(--act-ban) 60%, transparent); background: color-mix(in srgb, var(--act-ban) 14%, transparent);
  color: color-mix(in srgb, var(--act-ban) 55%, #fff); }
.pp-where { font-size: .84rem; color: var(--muted); }
.pp-where b { color: var(--text); font-weight: 600; }
.pp-acts { margin-left: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.pp-grid { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); align-items: start; }
.pp-left { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
@media (min-width: 1100px) {
  .pp-grid { grid-template-columns: minmax(380px, 440px) minmax(0, 1fr); }
  .pp-act { position: sticky; top: 58px; height: calc(100vh - 74px); min-height: 520px; }
}
.pp-act { display: flex; flex-direction: column; height: 70vh; min-height: 420px; }
.pp-act .logbox { flex: 1; min-height: 0; }
.pp-act .log-scroll { max-height: none; flex: 1 1 0; }
.pp-card { display: flex; flex-direction: column; gap: 8px; }
.pp-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pp-card-head h2 { display: flex; align-items: center; gap: 6px; margin: 0; font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; }
.pp-card-head h2 .icon { color: var(--muted); }
.pp-count { font: 500 .8rem var(--font-data); color: var(--muted); }
.pp-sum, .pp-sub { font-size: .74rem; }
.pp-hint { margin: 0; font-size: .74rem; }
.pp-link { min-height: 0; padding: 0; border: 0; background: none; color: var(--accent); font: 600 .78rem var(--font-text); letter-spacing: 0; text-transform: none; }

/* Popovers of the page (related players, ban notes); app.js closes them like the other menus */
.pp-pop { position: relative; display: inline-block; }
.pp-pop > summary { list-style: none; cursor: pointer; }
.pp-pop > summary::-webkit-details-marker { display: none; }
.pp-panel { position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: 340px; max-width: min(340px, 80vw); padding: 8px 10px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 10px 26px rgba(0, 0, 0, .55); }
.pp-right .pp-panel { left: auto; right: 0; }
.pp-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 0 8px; border: 1px solid var(--border);
  background: var(--surface-2); font: .76rem var(--font-data); }
.pp-chip .icon { width: 13px; height: 13px; color: var(--muted); }
.pp-warn { display: inline-flex; color: var(--act-ban); }
.pp-related { display: flex; flex-direction: column; }
.pp-rel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding: 6px 2px; border-bottom: 1px solid var(--border); text-decoration: none; }
.pp-rel:last-of-type { border-bottom: 0; }
.pp-rel b { font-weight: 600; }
.pp-rel:hover b { color: var(--accent); }
.pp-rel small { grid-column: 1 / -1; color: var(--muted); font-size: .74rem; overflow-wrap: anywhere; }
.pp-ips { display: flex; flex-direction: column; gap: 2px; padding-top: 6px; border-top: 1px solid var(--border); font-size: .74rem; color: var(--muted); }

/* Flags: '+' menu in the head (player_flags.js) - a checkbox row per flag with description and log, history view */
.pf-menu { position: relative; display: inline-block; }
.pf-menu > summary { list-style: none; cursor: pointer; }
.pf-menu > summary::-webkit-details-marker { display: none; }
.pf-plus { display: grid; place-items: center; width: 24px; height: 24px; border: 1px dashed var(--muted); color: var(--muted);
  font: 600 1rem/1 var(--font-data); }
.pf-plus:hover, .pf-menu[open] > .pf-plus { color: var(--accent); border-color: var(--accent); }
.pf-panel { position: absolute; z-index: 45; top: calc(100% + 6px); left: 0; width: 430px; max-width: min(430px, calc(100vw - 32px));
  max-height: min(70vh, 620px); overflow-y: auto; padding: 4px; background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .55); }
@media (max-width: 520px) { .pf-panel { position: fixed; left: 16px; right: 16px; top: 64px; width: auto; max-width: none; } }
.pf-row { position: relative; display: grid; grid-template-columns: 16px 18px minmax(0, 1fr) auto; gap: 0 8px; align-items: start;
  padding: 7px 8px; cursor: pointer; outline: none; }
.pf-row + .pf-row { border-top: 1px solid rgba(46, 48, 45, .7); }
.pf-row:hover, .pf-row:focus-visible { background: var(--surface-2); }
.pf-row:focus-visible { box-shadow: inset 0 0 0 1px var(--accent); }
.pf-row.locked { cursor: default; }
.pf-row .box { display: grid; place-items: center; width: 16px; height: 16px; margin-top: 1px; border: 1px solid var(--muted);
  color: transparent; font-size: .7rem; font-weight: 800; }
.pf-row.on .box { background: var(--c); border-color: var(--c); color: #111; }
.pf-row > .icon { width: 16px; height: 16px; margin-top: 1px; color: var(--muted); }
.pf-row.on > .icon { color: var(--c); }
.pf-row .name { font-weight: 600; font-size: .88rem; }
.pf-arch { margin-left: 6px; font: 700 .58rem var(--font-head); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pf-times { min-height: 20px; height: 20px; padding: 0 6px; border: 1px solid var(--border); background: none; color: var(--muted);
  font: 500 .68rem var(--font-data); letter-spacing: 0; }
.pf-times:hover, .pf-times[aria-expanded="true"] { color: var(--text); border-color: var(--muted); }
.pf-desc { grid-column: 3 / 5; margin: 1px 0 0; font-size: .78rem; line-height: 1.35; color: var(--muted); }
.pf-log { grid-column: 3 / 5; margin-top: 6px; padding: 3px 0 3px 8px; border-left: 2px solid var(--border); font: .7rem/1.5 var(--font-data);
  color: var(--muted); }
.pf-row.on .pf-log:last-of-type { border-left-color: color-mix(in srgb, var(--c) 60%, var(--border)); }
.pf-log.old { margin-top: 3px; opacity: .8; }
.pf-log .ev { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) { .pf-log .ev { white-space: normal; } }
.pf-log .w { font: 600 .72rem var(--font-text); }
.pf-log .add, .pf-hlist .add { color: color-mix(in srgb, var(--online) 65%, #fff); }
.pf-log .rem, .pf-hlist .rem { color: color-mix(in srgb, var(--act-leave) 75%, #fff); }
.pf-log .dur { color: var(--text); }
.pf-sync { grid-column: 3 / 5; margin-top: 4px; display: inline-flex; align-items: center; gap: 4px; font: 700 .6rem var(--font-head);
  letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.pf-sync.fail { color: var(--danger-text); cursor: help; }
.pf-sync .icon { width: 12px; height: 12px; }
.pf-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px 4px; border-top: 1px solid var(--border);
  font-size: .74rem; }
.pf-empty { padding: 8px; margin: 0; }
.pf-hist-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.pf-hist-head .button { min-height: 24px; height: 24px; padding: 0 8px; font-size: .66rem; }
.pf-hist-head h4 { margin: 0; font: 700 .8rem var(--font-head); letter-spacing: .1em; text-transform: uppercase; }
.pf-lanes { display: flex; flex-direction: column; gap: 4px; padding: 8px; border-bottom: 1px solid var(--border); }
.pf-lane { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 6px; align-items: center; }
.pf-lane .icon { width: 14px; height: 14px; color: var(--c); }
.pf-track { position: relative; height: 10px; background: var(--surface-2); }
.pf-track i { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--c) 70%, transparent); }
.pf-track i.open { box-shadow: inset -2px 0 #fff; }
.pf-axis { display: flex; justify-content: space-between; margin-left: 24px; font: .62rem var(--font-data); color: var(--muted); }
.pf-hlist { list-style: none; margin: 0; padding: 4px 8px 8px; max-height: 260px; overflow-y: auto; }
.pf-hlist li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 0 8px; padding: 4px 0; border-bottom: 1px dashed rgba(46, 48, 45, .8);
  font-size: .8rem; }
.pf-hlist li .icon { width: 14px; height: 14px; margin-top: 2px; color: var(--c); }
.pf-hlist .add, .pf-hlist .rem { font-weight: 600; }
.pf-hlist .m { grid-column: 2; font: .68rem var(--font-data); color: var(--muted); }
.pp-flag .icon { pointer-events: none; }

/* Administration > Flags */
.flag-types { display: flex; flex-direction: column; }
.flag-type { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.flag-type.archived { opacity: .7; }
.flag-type label { display: flex; flex-direction: column; gap: 3px; font-size: .74rem; color: var(--muted); }
.flag-type label.wide { flex: 1 1 260px; }
.flag-type label.check { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 6px; }
.flag-type-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; }
.flag-type-head .badge .icon { width: 12px; height: 12px; }
.flag-type-icon { display: inline-flex; }
.flag-type-icon .icon { width: 18px; height: 18px; }
.flag-type-use { margin-left: auto; font: .74rem var(--font-data); }
.flag-type-desc { width: 100%; margin: 0; font-size: .82rem; }

/* Identity */
.pp-ids { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.pp-id { display: grid; grid-template-columns: minmax(0, 1fr) 24px; align-items: center; border-bottom: 1px solid var(--border); }
.pp-id-copy { display: grid; grid-template-columns: 54px minmax(0, 1fr) 18px; align-items: center; gap: 4px; min-height: 32px; padding: 0 2px;
  border: 0; background: none; color: var(--text); text-align: left; text-transform: none; letter-spacing: 0; font: inherit; }
button.pp-id-copy:hover { background: var(--surface-2); }
.pp-id-copy code { font-size: .78rem; overflow-wrap: anywhere; }
.pp-id-copy .icon { width: 14px; height: 14px; color: transparent; }
button.pp-id-copy:hover .icon, button.pp-id-copy:focus-visible .icon { color: var(--muted); }
.pp-ext { display: grid; place-items: center; color: var(--muted); }
.pp-ext:hover { color: var(--accent); }
.pp-ext .icon { width: 14px; height: 14px; }
.pp-names ol { list-style: none; margin: 2px 0 0; padding: 0; }
.pp-names li { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; font-size: .86rem; }
.pp-names li span:last-child { font: .72rem var(--font-data); color: var(--muted); white-space: nowrap; }
.pp-names li .now { color: var(--online) !important; }
.pp-names-list { position: relative; }
.pp-names-list.folded ol { max-height: 98px; overflow: hidden; }
.pp-names-list.folded::after { content: ""; position: absolute; inset: auto 0 0 0; height: 36px; background: linear-gradient(transparent, var(--surface)); pointer-events: none; }
.pp-more { position: relative; z-index: 1; display: flex; margin: -6px auto 0; min-height: 24px; padding: 0 12px; border-radius: 999px;
  font: 700 .64rem var(--font-head); letter-spacing: .12em; color: var(--muted); background: var(--surface-2); }
.pp-more:hover { color: var(--text); }
.pp-seen { margin: 0; font-size: .76rem; }

/* Bans: rule number, rule, times, duration */
.pp-ban { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr) 74px; gap: 0 10px; align-items: start;
  padding: 9px 6px 9px 10px; border-top: 1px solid var(--border); cursor: pointer; }
.pp-ban:first-of-type { border-top: 0; }
.pp-ban:hover, .pp-ban:focus-visible { background: rgba(255, 255, 255, .03); }
.pp-ban.active { background: color-mix(in srgb, var(--act-ban) 6%, transparent); }
.pp-ban.active::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 3px; background: var(--act-ban); }
.pp-rule { align-self: center; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 46px;
  border: 1px solid var(--border); background: var(--surface-2); }
.pp-rule .rk { font: 700 .5rem/1 var(--font-head); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.pp-rule .rv { font: 700 1.25rem/1.05 var(--font-head); }
.pp-ban.active .pp-rule { border-color: color-mix(in srgb, var(--act-ban) 50%, var(--border)); }
.pp-ban-main { min-width: 0; }
.pp-ban-title { display: block; margin-bottom: 3px; font-weight: 600; font-size: .95rem; line-height: 1.3; overflow-wrap: anywhere; }
.pp-ban:not(.active) .pp-ban-title { color: color-mix(in srgb, var(--text) 82%, var(--muted)); }
.pp-note-pop { margin-left: 6px; vertical-align: -2px; }
.pp-note-pop > summary { display: inline-flex; color: var(--muted); }
.pp-note-pop > summary .icon { width: 14px; height: 14px; }
.pp-note-pop[open] > summary, .pp-note-pop > summary:hover { color: var(--accent); }
.pp-note-pop .pp-panel { font-weight: 400; cursor: default; }
.pp-times { --end: #8a8c87; display: grid; grid-template-columns: 50px max-content minmax(0, 1fr); gap: 3px 7px; align-items: center; font: .74rem/1.5 var(--font-data); }
.pp-ban.active .pp-times { --end: var(--act-ban); }
.pp-ban.lifted .pp-times { --end: var(--act-revive); }
.pp-times .lb { display: inline-flex; justify-content: center; padding: 3px 0 2px; background: rgba(255, 255, 255, .06);
  font: 700 .56rem/1 var(--font-head); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pp-times .lb.z { background: color-mix(in srgb, var(--end) 18%, transparent); color: color-mix(in srgb, var(--end) 60%, #fff); }
.pp-times .v { white-space: nowrap; }
.pp-times .by { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 .74rem var(--font-text); color: var(--muted); }
.pp-len { align-self: center; display: flex; flex-direction: column; align-items: flex-end; font: 500 .8rem var(--font-data); white-space: nowrap; }
.pp-len .new { color: var(--accent); }
.pp-len .was { color: var(--muted); text-decoration: line-through; font-size: .7rem; }
.pp-len .left { color: color-mix(in srgb, var(--act-ban) 55%, #fff); font-size: .7rem; }
@media (max-width: 520px) { .pp-ban { grid-template-columns: 46px minmax(0, 1fr) 84px; } .pp-times { grid-template-columns: 50px max-content; } .pp-times .by { grid-column: 2; } }

/* Ban notes in their popover */
.pp-note-text { padding: 8px 10px; font-size: .88rem; line-height: 1.45; overflow-wrap: anywhere; }
.pp-note-text p { margin: 0 0 4px; }
.pp-note-text ul, .pp-note-text ol { margin: 4px 0; padding-left: 20px; }
.pp-note-text blockquote { margin: 4px 0; padding-left: 10px; border-left: 2px solid var(--border); color: var(--muted); }
.pp-note-text code { padding: 0 4px; background: rgba(0, 0, 0, .35); font: .82em var(--font-data); }
.pp-note-text a { color: var(--accent); }
.pp-panel .pp-note-text { padding: 0; }

/* Notes card (player_notes.js): cards, restricted notes in the level's color, edit in place, write box */
.pn-list { display: flex; flex-direction: column; gap: 8px; }
.pn-note { border: 1px solid var(--border); background: var(--surface-2); transition: background .2s; }
.pn-note.restricted { border-color: color-mix(in srgb, var(--rank) 55%, var(--border)); box-shadow: inset 3px 0 var(--rank); }
.pn-note.expired { opacity: .6; }
.pn-note.expired .pn-text { text-decoration: line-through; text-decoration-color: rgba(163, 165, 160, .5); }
.pn-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 5px 10px; border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, .18); font-size: .8rem; }
.pn-bar b { font-weight: 600; }
.pn-bar time { font: .7rem var(--font-data); color: var(--muted); }
.pn-edited { font-size: .7rem; font-style: italic; color: var(--muted); }
.pn-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.pn-tag { display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; border: 1px solid var(--border); font: 700 .6rem/1.6 var(--font-head);
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.pn-tag .icon { width: 11px; height: 11px; }
.pn-tag.lvl { color: color-mix(in srgb, var(--rank) 60%, #fff); border-color: color-mix(in srgb, var(--rank) 50%, var(--border)); }
.pn-tag.lvl .icon { color: var(--rank); }
.pn-tag.exp { color: color-mix(in srgb, var(--act-warn) 60%, #fff); border-color: color-mix(in srgb, var(--act-warn) 40%, var(--border)); }
.pn-tag.wait { color: var(--accent); }
.pn-tag.fail { color: var(--danger-text, #ff8a8a); border-color: color-mix(in srgb, var(--act-ban) 50%, var(--border)); cursor: help; }
.pn-actions { display: inline-flex; gap: 2px; }
.pn-ib { display: grid; place-items: center; width: 22px; min-height: 22px; height: 22px; padding: 0; border: 0; background: none; color: var(--muted); }
.pn-ib:hover, .pn-ib:focus-visible { color: var(--text); background: rgba(255, 255, 255, .06); }
.pn-ib .icon { width: 13px; height: 13px; }
.pn-text { padding: 8px 10px; font-size: .88rem; line-height: 1.45; overflow-wrap: anywhere; outline: none; transition: background .2s, box-shadow .2s; }
.pn-text p { margin: 0 0 4px; }
.pn-text p:last-child { margin-bottom: 0; }
.pn-text ul, .pn-text ol { margin: 4px 0; padding-left: 20px; }
.pn-text blockquote { margin: 4px 0; padding-left: 10px; border-left: 2px solid var(--border); color: var(--muted); }
.pn-text code { padding: 0 4px; background: rgba(0, 0, 0, .35); font: .82em var(--font-data); }
.pn-text a { color: var(--accent); }
.pn-note.is-editing { background: color-mix(in srgb, var(--surface-2) 70%, #2a2b29); }
.pn-note.is-editing .pn-text { background: rgba(0, 0, 0, .22); box-shadow: inset 0 -2px var(--accent); }
.pn-empty { margin: 0; }
.pn-expired-toggle { align-self: flex-start; margin: 0; }
.pn-write { margin-top: 4px; background: var(--surface-2); border: 1px solid var(--border); transition: border-color .2s; }
.pn-write:focus-within { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.pn-area { min-height: 46px; max-height: 320px; overflow-y: auto; padding: 9px 10px 4px; transition: min-height .2s; }
.pn-write:focus-within .pn-area, .pn-write.has .pn-area { min-height: 84px; }
.pn-area:empty::before { content: attr(data-placeholder); color: var(--muted); }
/* Toolbar: slides in under the text while editing */
.pn-tb { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .2s ease; }
.pn-tb.open { grid-template-rows: 1fr; }
.pn-tb > div { overflow: hidden; }
.pn-tb.done > div { overflow: visible; }
.pn-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0; padding: 4px; }
.pn-tools button { display: grid; place-items: center; width: 25px; min-height: 26px; height: 26px; padding: 0; border: 0; background: none;
  color: var(--muted); font: 600 .9rem var(--font-text); letter-spacing: 0; text-transform: none; }
.pn-tools button:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.pn-tools button[aria-pressed="true"] { color: var(--accent); }
.pn-tools svg { width: 16px; height: 16px; }
.pn-tools .sep { width: 1px; height: 14px; margin: 0 3px; background: var(--border); }
.pn-tools .f-b { font-weight: 800; }
.pn-tools .f-i { font-style: italic; font-family: Georgia, serif; }
.pn-tools .f-s { text-decoration: line-through; }
.pn-tools .dotbtn { width: 17px; }
.pn-tools .dot { width: 12px; height: 12px; border-radius: 50%; }
.pn-tools .dot.def { background: var(--text); }
.pn-tools .dotbtn[aria-pressed="true"] .dot { box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 3px var(--text); }
.pn-row2 { display: flex; padding: 0 6px 6px; }
.pn-tail { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; flex: 1 1 auto; }
.pn-gap { flex: 1 1 auto; }
.pn-save, .pn-cancel { height: 26px; min-height: 26px; padding: 0 12px; font: 700 .72rem var(--font-head); letter-spacing: .12em; text-transform: uppercase; }
.pn-save { border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent);
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 0 100%); }
.pn-save:hover { background: var(--accent-hover); color: var(--on-accent); }
.pn-cancel { border: 1px solid var(--border); background: var(--surface); color: var(--muted); }
.pn-cancel:hover { color: var(--text); border-color: var(--muted); }
/* Small menus: who sees the note, expiry with calendar */
.pn-menu { position: relative; }
.pn-menu > summary { list-style: none; }
.pn-menu > summary::-webkit-details-marker { display: none; }
.pn-chip { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 7px; border: 1px solid var(--border); background: var(--surface);
  font: 600 .74rem var(--font-text); white-space: nowrap; cursor: pointer; }
.pn-chip .icon { width: 12px; height: 12px; color: var(--muted); }
.pn-chip .car { font-size: .62rem; color: var(--muted); }
.pn-chip:hover, .pn-menu[open] > .pn-chip { border-color: var(--muted); }
.pn-panel { position: absolute; z-index: 40; left: 0; bottom: calc(100% + 4px); min-width: 200px; padding: 4px 0; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 10px 26px rgba(0, 0, 0, .55); }
.pn-panel > button { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 0; width: 100%; min-height: 34px; height: auto;
  padding: 4px 12px 4px 26px; border: 0; background: none; color: var(--text); font: 500 .82rem var(--font-text); letter-spacing: 0; text-transform: none; text-align: left; }
.pn-panel > button small { font-size: .7rem; color: var(--muted); }
.pn-panel > button:hover { background: var(--surface-2); }
.pn-panel > button[aria-checked="true"]::before { content: "✓"; position: absolute; left: 10px; top: 5px; color: var(--accent); font-size: .75rem; }
.pn-cal-panel { width: 252px; padding: 8px; gap: 8px; }
.pn-presets { display: flex; flex-wrap: wrap; gap: 4px; }
.pn-presets button { min-height: 24px; height: 24px; padding: 0 8px; font: 500 .76rem var(--font-text); letter-spacing: 0; text-transform: none; }
.pn-cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; font: 700 .74rem var(--font-head); letter-spacing: .1em;
  text-transform: uppercase; }
.pn-cal-nav { width: 26px; min-height: 24px; height: 24px; padding: 0; border: 0; background: none; font-size: 1rem; }
.pn-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.pn-cal-w { padding: 2px 0; text-align: center; font: 700 .58rem var(--font-head); letter-spacing: .1em; color: var(--muted); }
.pn-cal-d { min-height: 26px; height: 26px; padding: 0; border: 0; background: none; font: .76rem var(--font-data); }
.pn-cal-d:hover:not(:disabled) { background: var(--surface-2); }
.pn-cal-d:disabled { opacity: .3; cursor: default; }
.pn-cal-d.today { box-shadow: inset 0 0 0 1px var(--muted); }
.pn-cal-d.sel { background: var(--accent); color: var(--on-accent); }
.pp-undo { margin-left: 12px; min-height: 24px; height: 24px; padding: 0 10px; font-size: .66rem; }
@media (prefers-reduced-motion: reduce) { .pn-tb, .pn-note, .pn-text, .pn-area { transition: none; } }

/* Playtime */
.pp-seg { display: inline-flex; }
.pp-seg button { min-height: 24px; padding: 0 8px; font-size: .64rem; color: var(--muted); background: transparent; }
.pp-seg button + button { border-left: 0; }
.pp-seg button[aria-pressed="true"] { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  background: color-mix(in srgb, var(--accent) 10%, transparent); }
.pp-nums { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); }
.pp-nums div { display: flex; flex-direction: column; padding: 6px 8px; background: var(--surface-2); border-right: 1px solid var(--border); min-width: 0; }
.pp-nums div:last-child { border-right: 0; }
.pp-nums b { font: 500 .98rem var(--font-data); white-space: nowrap; }
@media (max-width: 420px) { .pp-nums { grid-template-columns: 1fr 1fr; } }
.pp-chart-head { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.pp-tabs { display: flex; gap: 2px; }
.pp-tabs button { min-height: 24px; padding: 0 8px; border: 0; background: none; color: var(--muted); font: 700 .64rem var(--font-head); letter-spacing: .12em;
  border-bottom: 2px solid transparent; }
.pp-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.pp-bc { margin-top: 8px; display: grid; grid-template-columns: 34px minmax(0, 1fr); grid-template-rows: 96px auto; column-gap: 6px; }
.pp-bc-scale { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; margin: -5px 0; font: .6rem var(--font-data); color: var(--muted); }
.pp-bc-plot { position: relative; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--border); }
.pp-bc-plot .grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed rgba(135, 137, 133, .18); pointer-events: none; }
.pp-bc-plot .d { position: relative; flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column-reverse; justify-content: flex-start;
  align-items: stretch; gap: 0; padding: 0; border: 0; background: none; min-height: 0; cursor: pointer; }
.pp-bc-plot .d i { display: block; width: 100%; }
.pp-bc-plot .d:hover, .pp-bc-plot .d:focus-visible { background: rgba(255, 255, 255, .04); }
.pp-bc-plot .d.sel { background: color-mix(in srgb, var(--accent) 10%, transparent); box-shadow: inset 0 -2px var(--accent); }
.pp-bc-plot .d.zero { cursor: default; }
.pp-bc-ticks { display: flex; gap: 2px; padding-top: 3px; }
.pp-bc-ticks span { flex: 1; min-width: 0; white-space: pre; line-height: 1.25; font: .6rem var(--font-data); color: var(--muted); }
.pp-bc.n7 .pp-bc-ticks span { text-align: center; }
.pp-bc-detail { min-height: 18px; font-size: .76rem; color: var(--muted); }
.pp-bc-detail b { color: var(--text); font-weight: 600; }
.pp-servers { display: flex; flex-direction: column; gap: 4px; }
.pp-servers > div { display: grid; grid-template-columns: 10px 64px minmax(0, 1fr) 56px; gap: 8px; align-items: center; font-size: .78rem; }
.pp-servers .sw { width: 10px; height: 10px; }
.pp-servers .bar { height: 5px; background: var(--surface-2); }
.pp-servers .bar i { display: block; height: 100%; }
.pp-servers .h { text-align: right; font: .74rem var(--font-data); }
.pp-sessions { border-top: 1px solid var(--border); padding-top: 8px; }
.pp-sessions summary { cursor: pointer; color: var(--accent); font-size: .8rem; font-weight: 600; list-style: none; }
.pp-sessions summary::-webkit-details-marker { display: none; }
.pp-sessions .pp-link { display: block; margin: 6px 0 2px; }
.pp-sessions ol { list-style: none; margin: 6px 0 0; padding: 0; }
.pp-sessions li { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 3px 0;
  border-top: 1px dashed rgba(46, 48, 45, .8); font: .74rem var(--font-data); color: var(--muted); }
.pp-sessions li b { color: var(--text); font-weight: 500; }
.pp-srv { padding: 0 5px; border: 1px solid var(--border); background: var(--surface-2); font: 700 .62rem/1.5 var(--font-head); letter-spacing: .1em;
  color: var(--text); text-align: center; }

/* Activity: day and round lines, Context, search hits */
.pp-act .day-sep { padding: 4px 10px; background: #1b1c1b; border-bottom: 1px solid var(--border); font: 700 .64rem var(--font-head);
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pp-act .round-sep { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 3px 10px; border-bottom: 1px solid rgba(46, 48, 45, .6);
  background: color-mix(in srgb, var(--act-round) 5%, transparent); font-size: .74rem; color: var(--muted); }
.pp-act .round-sep .rl { color: color-mix(in srgb, var(--text) 85%, var(--muted)); font-weight: 600; }
.pp-act .round-sep .vs { display: inline-flex; align-items: center; gap: 4px; font: 700 .66rem var(--font-head); letter-spacing: .08em; }
.pp-act .round-sep .vs img { width: 14px; height: 9px; object-fit: cover; }
.pp-act .round-sep time { font: .68rem var(--font-data); margin-left: auto; }
.pp-act .log-entry { position: relative; }
.pp-ctx { position: absolute; right: 8px; top: 4px; display: none; align-items: center; gap: 4px; min-height: 22px; height: 22px; padding: 0 8px;
  font-size: .6rem; background: var(--surface-2); }
.pp-ctx .icon { width: 12px; height: 12px; }
.pp-act .log-entry:hover .pp-ctx, .pp-act .log-entry:focus-within .pp-ctx { display: inline-flex; }
.pp-act .log-entry.hit { cursor: pointer; }
.pp-act .log-entry.hit:hover { background: rgba(255, 255, 255, .04); }
.pp-act .log-entry.found { box-shadow: inset 3px 0 var(--accent); animation: pp-found 2.4s ease-out; }
.pp-act .log-entry.fresh { animation: pp-fresh 1.6s ease-out; }
@keyframes pp-found { from { background: color-mix(in srgb, var(--accent) 22%, transparent); } }
@keyframes pp-fresh { from { background: color-mix(in srgb, var(--accent) 14%, transparent); } }
@media (prefers-reduced-motion: reduce) { .pp-act .log-entry.found, .pp-act .log-entry.fresh { animation: none; } }
.pp-act .menu-row { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 4px 6px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.pp-act .menu-row .mini { width: auto; min-height: 24px; padding: 0 8px; border: 1px solid var(--border); background: var(--surface-2);
  font: 700 .62rem var(--font-head); letter-spacing: .1em; }
.pp-act .check .cnt { margin-left: auto; font: .7rem var(--font-data); color: var(--muted); }
.pp-act .tb-dd .dropdown-menu { min-width: 260px; max-height: 70vh; overflow-y: auto; }
.pp-search-form { grid-template-columns: 1fr 1fr auto; }
.pp-act .fm { flex-wrap: wrap; min-width: 0; }
@media (max-width: 640px) { .pp-act .fm { width: 100%; } .pp-act .fm .tb-dd { flex: 1 1 auto; } }
@media (max-width: 640px) { .pp-search-form { grid-template-columns: 1fr 1fr; } }
.badge .icon { width: .8em; height: .8em; vertical-align: 0; }

/* Activity kinds (colors in :root) */
.act-kill .icon, .act-kill.icon-chip .icon { color: var(--act-kill); }
.act-teamkill .icon { color: var(--act-teamkill); }
.act-death .icon { color: var(--act-death); }
.act-revive .icon { color: var(--act-revive); }
.act-warn .icon { color: var(--act-warn); }
.act-kick .icon { color: var(--act-kick); }
.act-ban .icon, .act-portal_ban .icon { color: var(--act-ban); }
.act-admin .icon { color: var(--act-admin); }
.act-join .icon { color: var(--act-join); }
.act-leave .icon { color: var(--act-leave); }
.act-squad .icon { color: var(--act-squad); }
.act-chat .icon { color: var(--act-chat); }
.act-chat.chatteam .icon { color: var(--act-team); }
.act-chat.chatsquad .icon { color: var(--act-squadchat); }
.act-chat.chatadmin .icon { color: var(--act-adminchat); }
.activity-more { align-self: center; margin-bottom: 8px; }
.activity-filters { margin-bottom: 10px; }
.activity-filters summary {
  cursor: pointer; min-height: var(--tap); display: flex; align-items: center; gap: 8px;
  font: 700 .78rem/1 var(--font-head); letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.filter-group { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); }
.filter-group .group-chip { min-width: 6.5rem; }
.filter-group .chip { display: inline-flex; gap: 4px; align-items: center; }
.filter-range { margin-top: 8px; }
.mod-count .icon { vertical-align: -0.2em; }
.mod-count.act-warn .icon { color: var(--act-warn); }
.mod-count.act-kick .icon { color: var(--act-kick); }
.mod-count.act-ban .icon { color: var(--act-ban); }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .dot.beat, .flash { animation: none; }
  .ticket-bar span { transition: none; }
}
.act-chat.icon-chip .icon { color: var(--act-chat); }
.act-join.icon-chip .icon { color: var(--act-join); }
.act-admin.icon-chip .icon { color: var(--act-admin); }
.act-round.icon-chip .icon { color: var(--act-round); }

/* --- Server page (grid design, agreed 2026-11-09) ------------------------------------------------------------ */

/* Sub bar: server switch, the server's views (a menu on phones), server commands */
.srv-sub { display: flex; align-items: stretch; min-height: 40px; padding: 0 var(--gap); background: rgba(23, 24, 23, .92); border-bottom: 1px solid var(--border); }
.srv-sub .grow { flex: 1; }
.srv-sub .vsep { width: 1px; margin: 8px 10px; background: var(--border); }
.srv-sub summary::after { content: none; }
.srv-switch > summary { display: flex; align-items: center; gap: 8px; height: 100%; padding: 0 4px; cursor: pointer; }
.srv-switch > summary b { font: 700 .95rem/1 var(--font-head); letter-spacing: .08em; }
.srv-switch > summary::after { content: "▾"; font-size: .7rem; color: var(--muted); }
.srv-switch .srv-mode { max-width: 18rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; }
.srv-switch .dropdown-menu { min-width: 230px; }
/* Server commands: one button each (icon and text), power buttons after a divider with their own colors;
   narrow screens show the icons only, phones the ⋯ menu */
.srv-cmds { align-self: center; display: flex; align-items: center; gap: 4px; flex: none; }
.srv-power { display: contents; }
.cmd-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; background: none; border: 1px solid transparent; color: var(--text);
  font: 600 .74rem/1 var(--font-head); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; cursor: pointer; }
.cmd-btn .icon { width: 14px; height: 14px; color: var(--muted); }
.cmd-btn:hover { border-color: var(--border); background: var(--surface-2); }
.cmd-sep { width: 1px; height: 20px; margin: 0 6px; background: var(--border); }
.power-start, .power-start .icon { color: var(--online); }
.power-restart, .power-restart .icon { color: var(--warning); }
.power-stop, .power-stop .icon { color: var(--danger-text); }
.srv-sub .dropdown.srv-cmds-more { display: none; align-self: center; }
.srv-cmds-more > summary { display: inline-grid; place-items: center; width: 32px; height: 30px; border: 1px solid var(--border); cursor: pointer; }
.srv-sub .srv-cmds-more .dropdown-menu { left: 0; right: auto; min-width: 200px; }
.srv-cmds-more .dropdown-menu button { display: flex; align-items: center; gap: 8px; }
.srv-cmds-more .dropdown-menu .icon { width: 14px; height: 14px; }
.srv-cmds-more .dropdown-menu .cmd-btn { width: 100%; height: auto; padding: 8px 12px; border: 0; justify-content: flex-start; font: inherit; text-transform: none; letter-spacing: 0; }
.cmd-group { display: contents; }
/* Power: only what fits the panel state */
[data-panel="running"] .power-start, [data-panel="stopped"] .power-restart, [data-panel="stopped"] .power-stop { display: none; }
/* Narrow sub bar, step by step (server_page.js measures): long name, button texts, performance, then the ⋯ menu */
.srv-sub.fit-1 .srv-switch .srv-mode { display: none; }
.srv-sub.fit-2 .srv-cmds .cmd-btn span { display: none; }
.srv-sub.fit-2 .srv-cmds .cmd-btn { width: 30px; padding: 0; justify-content: center; }
.srv-sub.fit-3 .srv-res { display: none; }
.srv-sub.fit-4 .srv-cmds { display: none; }
.srv-sub.fit-4 .dropdown.srv-cmds-more { display: flex; }
@media (max-width: 640px) {
  .srv-sub { padding: 0 10px; }
  .srv-sub .vsep { margin: 8px 6px; }
}

/* Head: name, population, queue, admins and resources; layer and round time, tickets centered, next layer */
.sv-head { background: var(--surface); border: 1px solid var(--border); position: relative; }
.sv-line1 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.sv-line1 .dot { width: 9px; height: 9px; }
.sv-line1 h1 { margin: 0; min-width: 0; font-size: 1.3rem; line-height: 1.1; }
.sv-res { margin-left: auto; display: flex; gap: 12px; font: .78rem var(--font-data); color: var(--muted); }
/* CPU, RAM, uptime: values, bars or 30 min charts, plain or in colors (account settings). Colors stay away from the
   power buttons (green, orange, red); high load also gets a ▲ next to the value, not only a color */
.sv-r { --res: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.sv-r b { font-weight: 500; color: var(--text); }
.res-colors .sv-cpu { --res: #5aa7d9; } .res-colors .sv-ram { --res: #b39cf0; }
.res-colors .sv-cpu b, .res-colors .sv-ram b { color: var(--res); }
.sv-r.high { --res: var(--warning); } .sv-r.high b::after { content: " ▲"; color: var(--warning); }
.sv-r-bar, .sv-r-chart { display: none; }
.res-bars .sv-r-bar { display: block; width: 52px; height: 6px; background: var(--border); }
.res-bars .sv-r-bar i { display: block; height: 100%; background: var(--res); }
.res-charts .sv-r-chart { display: block; width: 64px; height: 20px; }
.sv-r-chart polygon { fill: var(--res); fill-opacity: .15; stroke: none; }
.sv-r-chart polyline { fill: none; stroke: var(--res); stroke-width: 1.3; vector-effect: non-scaling-stroke; }
.sv-line2 { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px 16px; padding: 9px 14px; }
.sv-left { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }
.sv-layer { font: 700 1rem/1.2 var(--font-head); letter-spacing: .02em; }
.round-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border: 1px solid var(--border); background: var(--surface-2); font: .8rem var(--font-data); }
.round-chip .icon { width: 13px; height: 13px; color: var(--muted); }
.sv-score { display: grid; grid-template-columns: auto minmax(220px, 440px) auto; align-items: center; margin: 0; }
.sv-score .team { display: inline-flex; align-items: center; gap: 10px; padding: 0 16px; font: 700 .85rem var(--font-head); letter-spacing: .06em; text-transform: uppercase; }
.sv-score .team strong { font: 500 1.05rem var(--font-data); }
.sv-score .flag { width: 24px; height: 15px; margin: 0; }
.sv-score .ticket-bar { margin: 0; height: 6px; grid-column: auto; }
.sv-teams { display: flex; gap: 12px; }
.sv-right { justify-self: end; font-size: .8rem; text-align: right; }
@media (max-width: 1000px) {
  .sv-line2 { grid-template-columns: 1fr; }
  .sv-score { grid-template-columns: auto minmax(40px, 1fr) auto; }
  .sv-score .team { padding: 0 8px; }
  .sv-right { justify-self: start; text-align: left; }
}
@media (max-width: 640px) { .sv-res { display: none; } }

/* Toolbars of both panels: search, dropdown menus, icon buttons */
.grid-panel .tb { display: flex; flex-wrap: wrap; align-items: stretch; min-height: 36px; border-bottom: 1px solid var(--border); background: var(--surface); }
.grid-panel .tb > * { min-height: 36px; }
.tb-search { display: flex; flex: 1; align-items: center; gap: 8px; min-width: 8rem; padding: 0 10px; color: var(--muted); }
.tb-search input { flex: 1; min-width: 0; min-height: 0 !important; height: 34px; padding: 0 !important; border: 0 !important; background: none !important; font-size: .88rem; outline: none; }
.tb-search:focus-within { box-shadow: inset 0 -2px var(--accent); color: var(--text); }
.tb-search .icon { width: 15px; height: 15px; }
.tb-dd { border-left: 1px solid var(--border); }
.tb-dd > summary { display: flex; align-items: center; gap: 7px; height: 100%; padding: 0 12px; cursor: pointer; white-space: nowrap; }
.tb-dd > summary::after { content: ""; width: 0; height: 0; border: 4px solid transparent; border-top-color: var(--muted); margin-top: 4px; }
.tb-dd > summary:hover, .tb-dd[open] > summary { background: var(--surface-2); }
.tb-dd .k { font: 700 .6rem/1 var(--font-head); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.tb-dd .val { font: 600 .82rem/1 var(--font-head); letter-spacing: .06em; text-transform: uppercase; }
.tb-dd .val.on { color: var(--accent); }
.tb-dd .dropdown-menu { right: -1px; left: auto; min-width: 220px; }
.tb-dd .check { min-height: 30px; }
.tb-icon { width: 38px; padding: 0; border: 0; border-left: 1px solid var(--border); background: none; color: var(--muted); display: grid; place-items: center; }
.tb-icon:hover, .tb-icon[aria-pressed="true"] { color: var(--accent); background: var(--surface-2); }
.tb-icon .icon { width: 16px; height: 16px; }
.label-grid { display: grid; grid-template-columns: 1fr 1fr; }
.kind-opt .icon { width: 14px; height: 14px; margin-right: 2px; }
.kind-opt.act-squad .icon { color: var(--act-squad); } .kind-opt.act-round .icon { color: var(--act-round); }

/* Player list: two lines per player, columns spread over the width */
.grid-list { padding: 0 0 8px; }
.grid-head, .grid-row { display: grid; grid-template-columns: var(--cols); align-items: center; gap: 10px; }
.grid-head { position: sticky; top: 0; z-index: 3; height: 26px; padding: 0 10px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  font: 700 .58rem/1 var(--font-head); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.grid-head .col-kd, .grid-cell.col-kd { text-align: center; }
.grid-head .col-online, .grid-cell.col-online { text-align: right; }
.player-row.grid-row { min-height: 40px; padding: 3px 10px 3px 7px; border-left: 3px solid var(--tc, var(--border)); border-bottom: 1px solid rgba(46, 48, 45, .6); }
.player-row.grid-row.lead { box-shadow: none; }
.grid-row .role-icon { width: 18px; height: 18px; }
.grid-row .nm { display: grid; gap: 2px; min-width: 0; }
.grid-row .l1 { display: flex; align-items: center; gap: 6px; min-width: 0; }
.grid-row .l1 .player-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-row .l2 { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-notes { display: inline-flex; align-items: center; gap: 1px; color: var(--accent); font: .66rem var(--font-data); }
.player-notes .icon { width: 12px; height: 12px; }
.grid-cell { min-width: 0; font: .72rem var(--font-data); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid-cell b { color: var(--text); font-weight: 500; }
.grid-row:hover .grid-cell { color: var(--text); }

.team-line { position: sticky; top: 26px; z-index: 2; display: flex; align-items: center; gap: 8px; height: 30px; margin-top: 6px; padding: 0 10px;
  background: var(--surface); border-bottom: 2px solid var(--tc, var(--border)); color: var(--tc-text, var(--tc, var(--text)));
  font: 700 .82rem/1 var(--font-head); letter-spacing: .12em; text-transform: uppercase; }
.team-line .flag { width: 20px; height: 13px; margin: 0; }
.team-line .count, .squad-head .count { margin-left: auto; font: .7rem var(--font-data); letter-spacing: 0; color: var(--muted); }
.squad-box { margin: 10px 8px 0; border: 1px solid var(--border); background: rgba(255, 255, 255, .012); }
.squad-box .grid-row:last-child { border-bottom: 0; }
.squad-head { display: flex; align-items: center; gap: 8px; min-height: 30px; padding-right: 8px; background: #232522; border-bottom: 1px solid var(--border);
  font: 700 .76rem/1 var(--font-head); letter-spacing: .12em; text-transform: uppercase; }
.squad-head > .squad-name:first-child { padding-left: 10px; color: var(--muted); }
.squad-no { display: grid; place-items: center; align-self: stretch; min-width: 30px; background: var(--bg); border-right: 1px solid var(--border); font: 500 .8rem var(--font-data); letter-spacing: 0; }
.squad-disband { display: grid; place-items: center; align-self: stretch; width: 28px; min-height: 0; padding: 0; border: 0; border-right: 1px solid var(--border); background: none; color: var(--muted); opacity: .7; }
.squad-disband:hover { opacity: 1; color: var(--offline); background: color-mix(in srgb, var(--offline) 12%, transparent); }
.squad-disband .icon { width: 14px; height: 14px; }
.squad-rename { display: grid; place-items: center; width: 22px; height: 22px; min-height: 0; margin-left: -4px; padding: 0; border: 0; background: none; color: var(--muted); opacity: .6; }
.squad-head:hover .squad-rename { opacity: 1; }
.squad-rename:hover { color: var(--accent); }
.squad-rename .icon { width: 12px; height: 12px; }
.grid-players.list-teams { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.grid-players.list-teams .team-column { min-width: 0; }
.grid-players.list-teams .team-column + .team-column { border-left: 1px solid var(--border); }
.grid-players.list-teams .team-line { top: 0; margin-top: 0; }
.grid-players.list-teams .grid-head { top: 30px; }
@media (max-width: 640px) { .tb-dd .not-phone { display: none; } }

/* Log: tabs, filters, labels, paused while scrolled up, search */
.lt-tabs { display: flex; border-right: 1px solid var(--border); }
.lt-tabs button { display: inline-flex; align-items: center; gap: 6px; min-height: 0; padding: 0 14px; border: 0; background: none; color: var(--muted);
  font: 700 .74rem/1 var(--font-head); letter-spacing: .14em; text-transform: uppercase; }
.lt-tabs button.on { color: var(--text); box-shadow: inset 0 -2px var(--accent); }
.lt-tabs .icon { width: 14px; height: 14px; }
.lt-tools .grow { flex: 1; }
.lt-tools .fm { display: flex; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--online); animation: live-blink 2s infinite; }
@keyframes live-blink { 50% { opacity: .35; } }
.log-panel { container-type: inline-size; }
@container (max-width: 520px) {
  .lt-tools .fm { flex-basis: 100%; border-top: 1px solid var(--border); }
  .lt-tools .fm .tb-dd { flex: 1; } .lt-tools .fm .tb-dd:first-child { border-left: 0; }
  .lt-tools .fm .tb-dd > summary { justify-content: space-between; }
  .lt-tools .fm .tb-dd .dropdown-menu { left: -1px; right: auto; }
  .lt-tools .fm .tb-dd + .tb-dd .dropdown-menu { left: auto; right: -1px; }
  .lt-tabs button { padding: 0 10px; }
}
.logbox { position: relative; display: flex; flex-direction: column; flex: 1; min-height: 0; }
.logbox .log-scroll { flex: 1; }
.new-entries { position: absolute; right: 26px; bottom: 16px; z-index: 5; width: 34px; height: 34px; min-height: 0; padding: 0; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text); box-shadow: 0 6px 18px rgba(0, 0, 0, .5);
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%); }
.new-entries[hidden] { display: none; }
.new-entries:hover { border-color: var(--accent); color: var(--accent); }
.new-entries .icon { width: 15px; height: 15px; }
.new-entries .badge { position: absolute; top: -1px; right: -1px; min-width: 15px; height: 14px; margin: 0; padding: 0 3px; border: 0; background: var(--accent);
  color: var(--on-accent); font: 600 .6rem/14px var(--font-data); text-align: center; }
.log-status[hidden] { display: none; }
.log-status { display: flex; align-items: center; gap: 8px; height: 26px; padding: 0 10px; border-top: 1px solid var(--border); font: .7rem var(--font-data); color: var(--muted); }
.log-status .grow { flex: 1; }
.log-status .st-live { display: inline-flex; align-items: center; gap: 6px; color: var(--online); }
.log-status .st-paused { color: var(--accent); }
.log-status .st-zone { color: var(--muted); opacity: .7; }
.search-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; align-items: end; padding: 8px; border-bottom: 1px solid var(--border); }
.search-form[hidden] { display: none; }
.search-form label { display: grid; gap: 3px; min-width: 0; font: 700 .58rem/1 var(--font-head); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.search-form input { min-height: 30px; height: 30px; font: .8rem var(--font-data); color-scheme: dark; min-width: 0; }
.search-form .wide { grid-column: 1 / 3; }
.search-form .button { min-height: 30px; }
.search-form .quick { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; }
.search-form .quick button { min-height: 24px; height: 24px; padding: 0 8px; font-size: .62rem; }
.result-head { padding: 6px 10px; border-bottom: 1px solid var(--border); font-size: .78rem; color: var(--muted); }
@media (max-width: 640px) { .search-form { grid-template-columns: 1fr 1fr; } .search-form .button { grid-column: 1 / -1; } }
.server-page .server-body .live-split { height: calc(100vh - 250px); min-height: 360px; }
@media (max-width: 767px) { .server-page .server-body .live-split { height: auto; } .server-page .grid-panel { height: 560px; } }

/* Account page */
.account-form select { max-width: 24rem; }



/* Layers: the bars and toolbars with menus lie above the head, the sticky list heads and the log */
.srv-sub { position: relative; z-index: 30; }
.grid-panel .tb { position: relative; z-index: 20; }
.srv-sub .dropdown-menu, .tb-dd .dropdown-menu { z-index: 40; }
.sv-line1 .head-stats { margin-left: 6px; }
/* Menus of the server page float on phones too (the top bar's menus open inline there) */
.srv-sub .dropdown, .tb-dd { position: relative; display: flex; }
.srv-sub .dropdown-menu, .tb-dd .dropdown-menu { position: absolute; top: 100%; min-width: 220px; max-height: 70vh; overflow-y: auto;
  padding: 4px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 10px 28px rgba(0, 0, 0, .5); }
.srv-switch .dropdown-menu { left: 0; right: auto; }
.srv-sub .dropdown-menu > a { min-height: 34px; }
.sv-head { z-index: 25; }   /* Queue and admin popovers above the panels below */

/* Top bar: servers shown on the dashboard (gear, left of the user) */
.shown-menu .shown-summary { display: grid; place-items: center; min-width: 40px; }
.shown-menu .shown-summary::after { content: none; }
.shown-menu .shown-summary .icon { width: 18px; height: 18px; }
.shown-menu .dropdown-menu .check { min-height: 32px; padding: 0 8px; }
@media (min-width: 768px) {
  .nav .shown-menu { margin-left: auto; }
  .nav .shown-menu + .user-menu { margin-left: 0; }
  .shown-menu .dropdown-menu { left: auto; right: 0; }
}

/* Server flags (status with icon + label, maintainer's choice 2026-11-11) and status icons in server lists */
.sflag { --c: var(--online); display: inline-flex; align-items: center; gap: 5px; flex: none; white-space: nowrap;
  font: 600 .72rem/1 var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--text); }
.sflag .icon { width: 15px; height: 15px; color: var(--c); }
.sf-seeding { --c: var(--warning); } .sf-updating { --c: var(--updating); } .sf-offline { --c: var(--offline); }
.sf-round_over, .sf-map_vote, .sf-faction_vote { --c: var(--accent); }
.sf-live .icon { animation: live-breath 2.4s ease-in-out infinite; }
.sf-updating .icon { animation: spin 2s linear infinite; }
.sflag.beat .sf-label { animation: flag-beat .6s ease-out; }
@keyframes live-breath { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes flag-beat { from { color: var(--c); } }
.tile-head .sflag { margin-left: auto; }
.tile-head .sflag + .head-stats { margin-left: 4px; }
.sv-line1 .sflag { margin-left: 2px; }
.sicon { display: inline-grid; place-items: center; flex: none; color: var(--online); }
.sicon .icon { width: 14px; height: 14px; }
.sicon.s-seeding { color: var(--warning); } .sicon.s-updating { color: var(--updating); } .sicon.s-offline { color: var(--offline); }
.dropdown-menu .sicon { margin-right: 2px; }
.srv-switch .sicon .icon { width: 15px; height: 15px; }
@media (prefers-reduced-motion: reduce) { .sf-live .icon, .sf-updating .icon, .sflag.beat .sf-label { animation: none; } }

/* Population, queue and admins in heads: figures with dividers (variant 3a) */
.head-stats { gap: 0; }
.head-stats > * + * { border-left: 1px solid var(--border); }
.hstat { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; font: 500 .82rem var(--font-data); color: var(--text); white-space: nowrap; }
.hstat .icon { width: 14px; height: 14px; color: var(--muted); }
.hstat.admins .icon { color: var(--accent); }
.hstat small { font-size: .72rem; color: var(--muted); }
summary.hstat { cursor: pointer; list-style: none; }
summary.hstat::-webkit-details-marker { display: none; }
summary.hstat:hover, .pop[open] > summary.hstat { background: var(--surface-2); }
.head-pop b { font-weight: 500; }

/* Server page sub bar (2026-11-11): server switch, Server commands, performance on the right; the head keeps name,
   server flag and the figures (right) */
.srv-res { align-self: center; display: flex; align-items: center; gap: 14px; font: .78rem var(--font-data); color: var(--muted); white-space: nowrap; }
.sv-line1 .sv-stats { margin-left: auto; }

/* Alliance colors: base color --al and text color --al-text per alliance; .same = team 2 of the same alliance (darker) */
.al-nato { --al: var(--nato); --al-text: var(--nato-text); }
.al-redfor { --al: var(--redfor); --al-text: var(--redfor-text); }
.al-pac { --al: var(--pac); --al-text: var(--pac-text); }
.al-independent { --al: var(--independent); --al-text: var(--independent-text); }
.al-none { --al: var(--muted); --al-text: var(--text); }
.al-same { --al: color-mix(in srgb, var(--al-base, var(--muted)) 60%, #0b0b0b); --al-text: color-mix(in srgb, var(--al-text-base, var(--text)) 78%, #6f716d); }
.al-nato.al-same { --al-base: var(--nato); --al-text-base: var(--nato-text); }
.al-redfor.al-same { --al-base: var(--redfor); --al-text-base: var(--redfor-text); }
.al-pac.al-same { --al-base: var(--pac); --al-text-base: var(--pac-text); }
.al-independent.al-same { --al-base: var(--independent); --al-text-base: var(--independent-text); }
.bg-al { background-color: var(--al); }
.bg-al.al-same { background-image: repeating-linear-gradient(135deg, rgba(0, 0, 0, .45) 0 3px, transparent 3px 7px); }
.tone-al { color: var(--al-text); }
.player-team.al-nato, .player-team.al-redfor, .player-team.al-pac, .player-team.al-independent, .player-team.al-same { --team: var(--al); --team-text: var(--al-text); }
.edge-al { --tc: var(--al); --tc-text: var(--al-text); }
/* Team 2 of the same alliance in player lists (maintainer's choice 2026-11-11): the row edge gets the bar's stripes,
   the team head a striped line */
.player-row.grid-row.al-same { border-left: 0; padding-left: 11px; }
.player-row.grid-row.al-same::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--al) repeating-linear-gradient(135deg, rgba(0, 0, 0, .55) 0 2px, transparent 2px 5px); }
.player-row.grid-row { position: relative; }
.team-line.al-same { border-bottom-color: transparent; }
.team-line.al-same::after, .player-team.al-same::before { content: ""; position: absolute; left: 0; right: 0; height: 3px;
  background: var(--al) repeating-linear-gradient(135deg, rgba(0, 0, 0, .55) 0 3px, transparent 3px 7px); }
.team-line.al-same::after { bottom: -2px; }
.player-team.al-same { border-bottom-color: transparent; }
.player-team.al-same::before { bottom: -2px; }
/* Round over: shown next to the layer in the summary line (the head keeps the server flag) */
.round-over { display: inline-flex; align-items: center; gap: 5px; font: 600 .72rem/1 var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--text); white-space: nowrap; }
.round-over .icon { width: 15px; height: 15px; color: var(--accent); }

/* Votes between two rounds: a line under the head with the current vote (like a live ticker), opened: every vote of
   the break in compact columns with a divided bar and a legend; the winner of a finished vote gets a trophy */
.votes-bar { position: relative; z-index: 24; margin-top: calc(var(--gap) * -1 + 2px); }
.votes-toggle { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; width: 100%; min-height: 34px; padding: 4px 14px; text-align: left; cursor: pointer;
  background: color-mix(in srgb, var(--accent) 5%, var(--surface)); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  color: var(--text); font: 500 .85rem var(--font-text); }
.votes-toggle:hover { border-color: var(--border); border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.votes-toggle:hover .votes-chev { color: var(--text); }
.votes-toggle > .icon { width: 16px; height: 16px; color: var(--accent); }
.votes-current { flex: 1 1 0; text-transform: none; letter-spacing: 0; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.votes-kind, .vote-head > b { font: 700 .76rem var(--font-head); letter-spacing: .12em; text-transform: uppercase; }
.votes-state, .vote-state { display: inline-flex; align-items: center; gap: 6px; font: .76rem var(--font-data); color: var(--muted); }
.votes-state .icon, .vote-state .icon { width: 14px; height: 14px; color: var(--muted); }
.vote-dots { display: inline-flex; gap: 3px; align-items: center; height: 14px; }
.vote-dots i { width: 4px; height: 4px; background: var(--accent); opacity: .3; animation: vote-dot 1.2s infinite; }
.vote-dots i:nth-child(2) { animation-delay: .2s; } .vote-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes vote-dot { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .vote-dots i { animation: none; opacity: .8; } }
.votes-lead { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.votes-lead b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.votes-num { font: .78rem var(--font-data); color: var(--muted); }
.votes-lead .icon, .vote-name .icon { width: 13px; height: 13px; color: var(--accent); flex: none; }
.votes-toggle .grow { display: none; }
.votes-chev { font: 600 .72rem var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.votes-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 22px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border); border-top: 0; border-left: 3px solid var(--accent); }
.votes-body[hidden] { display: none; }
.vote { display: grid; gap: 6px; align-content: start; min-width: 0; }
.vote-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 7px; margin: 0; }
.vote-head > .icon { width: 15px; height: 15px; color: var(--accent); }
.vote-head .vote-state { margin-left: auto; }
/* Team of a faction vote: number only, in a box with the cut corner */
.team-badge { display: inline-flex; align-items: center; gap: 5px; font: 700 .68rem/1 var(--font-head); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.team-badge b { display: inline-grid; place-items: center; width: 18px; height: 18px; border: 1px solid var(--muted); color: var(--text);
  font: 600 .74rem/1 var(--font-data); letter-spacing: 0; clip-path: polygon(0 0, 100% 0, 100% 70%, 70% 100%, 0 100%); }
.vote-bar { display: flex; gap: 2px; height: 6px; min-width: 0; }
.vote-bar.mini { width: 120px; flex: none; }
.vote-bar i { display: block; min-width: 3px; }
.vote-bar i.empty { flex: 1; background: var(--border); }
/* Choices of a vote: amber from light to dark in even steps (maintainer's choice 2026-11-11, variant A); every
   choice is also named in the legend in the same order, the leader is bold. 'Regenerate vote' is grey and striped. */
:root { --vote-1: #f5cf7a; --vote-2: #e3a72f; --vote-3: #c18a26; --vote-4: #9c6f22; --vote-5: #7a571e; --vote-6: #5c421a; --vote-regen: #8c8a80; }
.vote-bar i.regen, .vote-swatch.regen { background-image: repeating-linear-gradient(135deg, rgba(0,0,0,.45) 0 2px, transparent 2px 5px); }
.vote.is-waiting .vote-head { color: var(--muted); }
.vote.is-waiting .vote-head > .icon { color: var(--muted); }
.vote-legend { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 3.4em; gap: 2px 8px; align-items: center; font-size: .82rem; }
.vote-swatch { width: 10px; height: 10px; }
.vote-name { display: inline-flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vote-name.leads { font-weight: 600; }
.vote-name.regen { color: var(--muted); font-style: italic; }
.vote-count { font: .78rem var(--font-data); text-align: right; }
.vote-share { font: .74rem var(--font-data); color: var(--muted); text-align: right; }

/* Account settings: sections, performance choice, order of the server command buttons (▲/▼, account.js) */
.account-form h2 { margin: 22px 0 4px; }
.account-form h2:first-of-type { margin-top: 0; }
.choice-row { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 8px 0; padding: 0; border: 0; }
.choice-row legend { float: left; width: 100%; margin-bottom: 4px; font: 700 .72rem var(--font-head); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.order-groups, .order-items { display: grid; gap: 6px; max-width: 440px; margin: 10px 0 0; padding: 0; list-style: none; }
.order-items { gap: 0; margin: 0; }
.order-group { display: grid; gap: 4px; padding: 6px 8px; background: var(--surface-2); border: 1px solid var(--border); }
.order-row { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.order-row .grow { flex: 1; }
.order-row .icon { width: 15px; height: 15px; color: var(--muted); }
.order-items .order-row { padding-left: 8px; border-top: 1px solid var(--border); }
.order-head b { font: 700 .8rem var(--font-head); letter-spacing: .1em; text-transform: uppercase; }
.order-move { display: inline-grid; place-items: center; width: 28px; height: 26px; padding: 0; font-size: .7rem; }

/* Search fields with a clear button (× from assets/icons/close.svg, app.js); the browser's own × is hidden */
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search-box { position: relative; display: flex; flex: 1; min-width: 0; }
.search-box .panel-search { flex: 1; padding-right: 30px; }
.search-clear { display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; padding: 0; background: none; border: 0; color: var(--muted); cursor: pointer; }
.search-clear:hover, .search-clear:focus-visible { color: var(--text); }
.search-clear .icon { width: 14px; height: 14px; }
.search-box .search-clear { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); }
.search-clear[hidden] { display: none; }

/* --- Applications (Administration > Applications, agreed 2026-12-01) ------------------------------------------- */
/* Votes -2..+2: the sign and number always written; for = green, against = red, strong = filled, neutral = grey */
.score-p1, .score-p2 { --score: var(--online); --score-text: var(--online); }
.score-m1, .score-m2 { --score: var(--offline); --score-text: var(--danger-text); }
.score-z0 { --score: var(--muted); --score-text: var(--text); }
.score {
  display: inline-grid; place-items: center; min-width: 2.2em; padding: 1px 6px; font: 600 .8rem/1.3 var(--font-data);
  color: var(--score-text); border: 1px solid var(--score); border-radius: 999px;
}
.score.score-p2, .score.score-m2 { background: color-mix(in srgb, var(--score) 22%, transparent); }
.poll-state.poll-open { color: var(--online); border-color: var(--online); }
.poll-state.poll-published { color: var(--accent); border-color: var(--accent); }
.badge.round { font: 600 .72rem/1.5 var(--font-data); color: var(--text); }
.page-nav { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 8px; }
.section-head h2 { margin: 0; }

.poll-actions { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 20px; }
.poll-actions .inline-form { margin: 0; }
.poll-import { margin-top: 14px; }
.poll-import summary { cursor: pointer; font: 700 .85rem var(--font-head); letter-spacing: .1em; text-transform: uppercase; }
.poll-import p { margin-top: 8px; max-width: 70rem; }

.voter-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.voter {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; background: var(--surface-2);
  border: 1px solid var(--border); border-left: 3px solid var(--role-color, var(--border));
}
.voter-name { font-weight: 600; }
.voter-role { font-size: .78rem; }
.voter-count { display: inline-flex; align-items: center; gap: 4px; font: .8rem var(--font-data); color: var(--muted); }
.voter.done .voter-count { color: var(--online); }
.voter.former { opacity: .7; }

.ranking td.num { font-family: var(--font-data); white-space: nowrap; }
.spread { display: inline-flex; flex-wrap: wrap; gap: 3px; }
.spread-part {
  display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; font: .75rem/1.6 var(--font-data);
  color: var(--score-text); border: 1px solid color-mix(in srgb, var(--score) 55%, transparent);
}
.spread-part b { color: var(--text); }
.spread-part.none { opacity: .4; }

.app-grid { display: grid; gap: var(--gap); }
@media (min-width: 900px) { .app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1400px) { .app-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.app-card { display: flex; flex-direction: column; gap: 8px; scroll-margin-top: 70px; }
.app-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.app-name { font: 700 1.15rem/1.2 var(--font-head); letter-spacing: .03em; text-decoration: none; margin-right: 4px; }
.app-name:hover { color: var(--accent); }
.app-ids { margin: 0; font-size: .8rem; overflow-wrap: anywhere; }
.app-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; list-style: none; font-size: .85rem; }
.app-facts li { display: inline-flex; align-items: center; gap: 5px; }
.app-facts .icon { color: var(--muted); }
.app-facts li.flagged .icon { color: var(--warning); }
.app-flag { display: inline-flex; align-items: center; gap: 4px; }
.app-card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); }
.app-card-foot .button { margin-left: auto; }
.app-result { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-data); }

.vote-buttons { display: inline-flex; gap: 4px; margin: 0; }
.vote-button {
  min-width: 40px; padding: 0 8px; font: 600 .85rem var(--font-data); letter-spacing: 0;
  color: var(--score-text); border-color: color-mix(in srgb, var(--score) 45%, var(--border)); background: transparent;
}
.vote-button:hover { border-color: var(--score); }
.vote-button.selected { background: var(--score); border-color: var(--score); color: var(--on-accent); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .35); }

.app-hints { display: grid; gap: 4px; margin: 0 0 var(--gap); padding: 0; list-style: none; }
.app-card .app-hints { margin: 0; }
.app-hints li { display: flex; align-items: flex-start; gap: 8px; padding: 6px 10px; font-size: .88rem; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--muted); }
.app-hints li .icon { margin-top: 2px; }
.app-hints .hint-warn { border-left-color: var(--warning); }
.app-hints .hint-warn .icon { color: var(--warning); }

.app-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); align-items: start; }
.app-layout > * { min-width: 0; }
@media (min-width: 1100px) { .app-layout { grid-template-columns: minmax(0, 1fr) 360px; } .app-side { position: sticky; top: 64px; } }
.app-side .section { margin-bottom: var(--gap); }
.hour-strip { display: grid; grid-template-columns: repeat(24, 1fr); align-items: end; gap: 2px; height: 34px; max-width: 420px; }
.hour { background: var(--accent); min-height: 2px; }
.hour.h0 { background: var(--border); height: 2px; } .hour.h1 { height: 12.5%; } .hour.h2 { height: 25%; } .hour.h3 { height: 37.5%; }
.hour.h4 { height: 50%; } .hour.h5 { height: 62.5%; } .hour.h6 { height: 75%; } .hour.h7 { height: 87.5%; } .hour.h8 { height: 100%; }
.hour-scale { display: flex; justify-content: space-between; max-width: 420px; font: .7rem var(--font-data); }
.app-notes { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.app-notes li { padding: 6px 10px; background: var(--surface-2); border-left: 2px solid var(--border); }
.app-notes p { margin: 2px 0 0; }
.app-notes form { margin-top: 4px; }
.app-identities { display: grid; gap: 14px; }
@media (min-width: 768px) { .app-identities { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); } }
.app-identities .inline-form { margin-top: 4px; }
.app-identities input[name=eos] { width: 22rem; max-width: 100%; font-family: var(--font-data); }
.app-question + .app-question { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.app-question h3 { margin-top: 0; }
.app-answer { display: grid; justify-items: start; gap: 4px; }
.app-answer + .app-answer { margin-top: 10px; }
.answer { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 80ch; }
.asked summary { cursor: pointer; font-size: .78rem; }
.asked p { font-size: .82rem; max-width: 80ch; }
mark.redacted { color: inherit; background: color-mix(in srgb, var(--offline) 22%, transparent); text-decoration: line-through; text-decoration-color: var(--danger-text); }
.redacted-note { font-style: italic; color: var(--muted); border: 1px dashed var(--border); padding: 0 4px; }
.redaction-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .8rem; }
.vote-form { display: grid; gap: 10px; }
.vote-scale { display: grid; gap: 4px; margin: 0; padding: 0; border: 0; }
.vote-scale legend { margin-bottom: 6px; font-size: .85rem; }
.vote-option { display: flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 10px; border: 1px solid var(--border); border-left: 3px solid var(--score); cursor: pointer; }
.vote-option b { min-width: 2em; font-family: var(--font-data); color: var(--score-text); }
.vote-option:has(input:checked) { background: color-mix(in srgb, var(--score) 14%, transparent); border-color: var(--score); }
.vote-comment { display: grid; gap: 4px; font-size: .85rem; }
.vote-submit { display: flex; flex-wrap: wrap; gap: 8px; }
.app-average { margin: 4px 0 8px; font-family: var(--font-data); }
.app-average b { font-size: 1.6rem; }
.named-votes { display: grid; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.named-votes p { margin: 2px 0 0 2.8em; font-size: .88rem; }
.note-form { display: grid; gap: 8px; margin-top: 10px; }
.note-form label { display: grid; gap: 4px; font-size: .85rem; }
.excluded-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.redact-bar {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 50; display: flex; flex-wrap: wrap;
  align-items: center; gap: 8px; width: min(760px, calc(100% - 32px)); padding: 10px 12px; background: var(--surface);
  border: 1px solid var(--accent); box-shadow: 0 8px 30px rgba(0, 0, 0, .6);
}
.redact-bar input[name=reason] { flex: 1; min-width: 12rem; }
.redact-preview { flex-basis: 100%; font-size: .82rem; }

/* --- Link site (web.link_url, templates/link.html) --- */
.link-card { width: 100%; max-width: 32rem; padding: 24px 20px; display: flex; flex-direction: column; gap: 16px; }
.link-head { display: flex; gap: 12px; align-items: flex-start; }
.link-head .mark { flex: none; margin-top: 6px; }
.link-head h1 { margin: 0 0 4px; font-size: 1.6rem; text-transform: uppercase; letter-spacing: .08em; }
.link-head p { margin: 0; }
.link-card h2 { margin: 0 0 8px; font-size: 1.05rem; text-transform: uppercase; letter-spacing: .1em; }
.link-card .small { font-size: .85rem; }
.link-card p { margin: 0; }
.link-steps { margin: 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: 4px; }
.link-notice { padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--surface-2); }
.link-me { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.link-plain { min-height: auto; padding: 0; border: 0; background: none; color: var(--accent); text-decoration: underline;
  text-underline-offset: 3px; font: inherit; }
.link-plain:hover { color: var(--accent-hover); border: 0; }
.link-box { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.link-confirm { border-color: var(--accent); }
.link-code { font-family: var(--font-data); font-size: 2.2rem; font-weight: 600; letter-spacing: .14em; color: var(--accent); }
.link-command code { font-size: 1.05rem; padding: 4px 8px; background: var(--bg); border: 1px solid var(--border); user-select: all; }
.link-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.link-new .button { width: 100%; }
.link-accounts ul { list-style: none; margin: 0; padding: 0; }
.link-accounts li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0;
  border-bottom: 1px solid var(--border); }
.link-accounts li > span { display: flex; flex-direction: column; min-width: 0; }
.pp-unlink { display: contents; }
button.pp-ext { min-height: 0; height: 100%; padding: 0; border: 0; background: none; }
button.pp-ext:hover { color: var(--danger-text, var(--offline)); }
