/* jaxserv dashboard, in the Tonal look: Material 3 Expressive dark scheme
   grown from the desktop wallpaper, Google Sans Flex (rounded), Material
   Symbols Rounded, expressive shapes and wavy progress. Colours below are the
   fallback; app.js replaces them with the live palette from /api/palette. */

@font-face {
  font-family: "Google Sans Flex";
  src: url("fonts/sans.woff2?v=3f8e6fe2d4") format("woff2");
  font-weight: 1 1000;
  font-display: swap;
}
@font-face {
  font-family: "Material Symbols Rounded";
  src: url("fonts/symbols.woff2?v=b287b9bdd9") format("woff2");
  font-weight: 100 700;
  font-display: block;
}

:root {
  --primary: #a5c8ff;
  --on-primary: #0c2f63;
  --primary-container: #24467c;
  --on-primary-container: #d2e4ff;
  --secondary: #b9c8de;
  --secondary-container: #3b475a;
  --on-secondary-container: #d4e4fb;
  --tertiary: #d8c592;
  --tertiary-container: #554513;
  --on-tertiary-container: #f4e1ad;
  --error: #ffb4aa;
  --error-container: #93000c;
  --on-error-container: #ffdad5;
  --surface: #101419;
  --surface-container-lowest: #0b0e13;
  --surface-container-low: #181c21;
  --surface-container: #1c2025;
  --surface-container-high: #262a30;
  --surface-container-highest: #31353b;
  --on-surface: #dee3eb;
  --on-surface-variant: #bdc7d6;
  --outline: #8891a0;
  --outline-variant: #3f4754;

  --radius-xl: 28px;
  --radius-l: 20px;
  --radius-m: 14px;
  --ease: cubic-bezier(.2, 0, 0, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--surface); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--on-surface);
  font-family: "Google Sans Flex", system-ui, sans-serif;
  font-variation-settings: "ROND" 100;
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  transition: color .6s var(--ease);
}
.tnum { font-feature-settings: "tnum" 1; }

/* ---------- backdrop: the desktop wallpaper, blurred under a tonal scrim */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--surface); }
.backdrop .photo {
  position: absolute; inset: -80px;
  background: center / cover no-repeat;
  filter: blur(60px) saturate(1.15);
  opacity: 0;
  transition: opacity 1.2s var(--ease);
}
.backdrop .photo.loaded { opacity: .55; }
.backdrop::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(120% 80% at 10% 0%, transparent 0%, color-mix(in oklab, var(--surface) 70%, transparent) 60%),
    linear-gradient(to bottom, color-mix(in oklab, var(--surface) 35%, transparent), var(--surface) 85%);
}

.page { max-width: 1240px; margin: 0 auto; padding: 48px 32px 40px; display: grid; gap: 40px; }
@media (max-width: 640px) { .page { padding: 28px 16px; gap: 28px; } }

/* ---------- icons and shapes */
.sym {
  font-family: "Material Symbols Rounded";
  font-weight: normal; font-style: normal;
  font-size: 20px; line-height: 1;
  display: inline-block; width: 1em; height: 1em;
  font-variation-settings: "FILL" 0, "wght" 400, "opsz" 24;
  user-select: none;
}
.sym.fill { font-variation-settings: "FILL" 1, "wght" 400, "opsz" 24; }

.shape { position: relative; display: grid; place-items: center; flex: none; }
.shape > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.shape > svg path { fill: var(--secondary-container); transition: fill .4s var(--ease); }
.shape > .sym { position: relative; color: var(--on-secondary-container); }
.shape.primary > svg path { fill: var(--primary-container); }
.shape.primary > .sym { color: var(--on-primary-container); }
.shape.hot > svg path { fill: var(--error-container); }
.shape.hot > .sym { color: var(--on-error-container); }
.spin > svg { animation: spin 24s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- hero */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; }
.overline {
  color: var(--primary); font-size: 13px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; margin-bottom: 4px;
}
h1 {
  margin: 0; font-size: clamp(56px, 9vw, 96px); line-height: .95;
  font-weight: 640; letter-spacing: -.035em;
  font-variation-settings: "ROND" 100, "opsz" 144;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 14px 0 10px; border-radius: 10px;
  background: color-mix(in oklab, var(--surface-container-high) 80%, transparent);
  color: var(--on-surface-variant); font-size: 13px; font-weight: 520;
  backdrop-filter: blur(16px);
}
.chip .sym { font-size: 18px; }
.chip.good { background: var(--primary-container); color: var(--on-primary-container); }
.chip.warn { background: var(--error-container); color: var(--on-error-container); }
.chip.tert { background: var(--tertiary-container); color: var(--on-tertiary-container); }

.clock { text-align: right; }
.clock-time {
  font-size: clamp(48px, 7vw, 80px); font-weight: 300; line-height: 1;
  letter-spacing: -.03em; font-feature-settings: "tnum" 1;
}
.clock-date { color: var(--on-surface-variant); font-size: 15px; margin-top: 6px; font-weight: 500; }
@media (max-width: 640px) { .clock { text-align: left; } }

/* ---------- cards */
.card {
  background: color-mix(in oklab, var(--surface-container) 82%, transparent);
  border-radius: var(--radius-xl);
  padding: 24px;
  backdrop-filter: blur(24px) saturate(1.1);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--outline-variant) 45%, transparent);
}

.section-head { display: flex; align-items: baseline; gap: 12px; margin: 0 4px 16px; }
h2 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
.count { color: var(--on-surface-variant); font-size: 14px; font-feature-settings: "tnum" 1; }

/* ---------- vitals */
.vitals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1000px) { .vitals { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .vitals { grid-template-columns: 1fr; } }
.vital { display: grid; gap: 14px; }
.vital-head { display: flex; align-items: center; gap: 12px; color: var(--on-surface-variant); font-weight: 560; }
.vital-head .shape { width: 40px; height: 40px; }
.vital-value {
  font-size: 40px; font-weight: 480; line-height: 1; letter-spacing: -.02em;
  font-feature-settings: "tnum" 1; transition: color .4s var(--ease);
}
.vital-value small { font-size: 18px; color: var(--on-surface-variant); font-weight: 500; margin-left: 2px; letter-spacing: 0; }
.vital.hot .vital-value { color: var(--error); }
.vital-detail { color: var(--on-surface-variant); font-size: 13px; font-feature-settings: "tnum" 1; min-height: 1.4em; }

/* ---------- wavy progress */
.wavy { display: block; width: 100%; height: 14px; }
.wavy svg { display: block; width: 100%; height: 100%; overflow: visible; }
.wavy .wave { fill: none; stroke: var(--primary); stroke-linecap: round; stroke-linejoin: round; }
.wavy .wave.moving { animation: wave 1.4s linear infinite; }
.wavy .track { fill: var(--secondary-container); }
.wavy .stop { fill: var(--primary); }
.wavy.hot .wave, .wavy.hot .stop { stroke: var(--error); }
.wavy.hot .stop { fill: var(--error); }
@keyframes wave { to { transform: translateX(var(--wl, -22px)); } }

/* ---------- services */
.services { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.svc { display: grid; gap: 22px; }
.svc.wide { grid-column: 1 / -1; }

.svc-head { display: flex; gap: 20px; align-items: center; }
.svc-art { width: 96px; height: 96px; }
.svc-art img {
  position: relative; width: 56px; height: 56px; border-radius: 14px;
  image-rendering: pixelated; box-shadow: 0 6px 20px rgb(0 0 0 / .35);
}
.svc-art .sym { font-size: 40px; }
.svc-title { min-width: 0; flex: 1 1 220px; }
.svc-title h3 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -.015em; line-height: 1.1; }
.svc-title p { margin: 6px 0 0; color: var(--on-surface-variant); }
.svc-title .motd { font-style: italic; }
.svc-status { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.svc-status .sub { color: var(--on-surface-variant); font-size: 13px; font-feature-settings: "tnum" 1; }
@media (max-width: 640px) {
  .svc-head { flex-wrap: wrap; }
  .svc-art { width: 72px; height: 72px; }
  .svc-art img { width: 44px; height: 44px; }
  .svc-status { align-items: center; flex-direction: row; flex-wrap: wrap; width: 100%; }
  .svc-title h3 { font-size: 24px; }
}

.address {
  display: inline-flex; align-items: center; gap: 4px; padding: 6px 6px 6px 16px;
  border-radius: 999px; background: var(--surface-container-highest);
  font-size: 17px; font-weight: 560; font-feature-settings: "tnum" 1; justify-self: start;
}
.address .label { color: var(--on-surface-variant); font-weight: 500; margin-right: 6px; font-size: 14px; }
.icon-btn {
  display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 999px;
  background: transparent; color: var(--on-surface-variant); cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease), border-radius .3s var(--spring);
}
.icon-btn:hover { background: color-mix(in oklab, var(--on-surface) 10%, transparent); color: var(--on-surface); }
.icon-btn:active { border-radius: 10px; }
.icon-btn:focus-visible, .btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.icon-btn.done { color: var(--primary); }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .stats { grid-template-columns: 1fr; } }
.stat {
  background: color-mix(in oklab, var(--surface-container-high) 75%, transparent);
  border-radius: var(--radius-l); padding: 16px 18px; display: grid; gap: 6px; align-content: start;
}
.stat-label { display: flex; align-items: center; gap: 8px; color: var(--on-surface-variant); font-size: 13px; font-weight: 560; }
.stat-label .sym { font-size: 18px; }
.stat-value { font-size: 26px; font-weight: 520; letter-spacing: -.015em; line-height: 1.15; font-feature-settings: "tnum" 1; }
.stat-value small { font-size: 15px; color: var(--on-surface-variant); font-weight: 500; letter-spacing: 0; }
.stat-sub { color: var(--on-surface-variant); font-size: 13px; font-feature-settings: "tnum" 1; }
.stat .wavy { margin-top: 6px; }
.players { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.player {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px 0 4px;
  border-radius: 999px; background: var(--secondary-container); color: var(--on-secondary-container);
  font-size: 13px; font-weight: 560;
}
.player i {
  width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-style: normal;
  background: var(--primary); color: var(--on-primary); font-size: 11px; font-weight: 700;
}

.svc-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.sidecars { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 22px 0 18px;
  border: 0; border-radius: 999px; font: inherit; font-weight: 600; font-size: 15px; cursor: pointer;
  background: var(--primary); color: var(--on-primary); text-decoration: none;
  transition: border-radius .3s var(--spring), filter .2s var(--ease);
}
.btn:hover { filter: brightness(1.08); }
.btn:active { border-radius: 12px; }
.btn[aria-disabled="true"] {
  background: color-mix(in oklab, var(--on-surface) 10%, transparent);
  color: color-mix(in oklab, var(--on-surface) 50%, transparent); cursor: default; filter: none;
}
.btn[aria-disabled="true"]:active { border-radius: 999px; }

/* ---------- storage */
.storage { display: grid; gap: 4px; padding: 12px 24px; }
.disk {
  display: grid; grid-template-columns: 44px minmax(120px, 200px) 1fr auto; align-items: center; gap: 18px;
  padding: 12px 0;
}
.disk + .disk { border-top: 1px solid color-mix(in oklab, var(--outline-variant) 50%, transparent); }
.disk .shape { width: 40px; height: 40px; }
.disk-name { font-weight: 600; font-size: 16px; }
.disk-path { color: var(--on-surface-variant); font-size: 13px; font-family: ui-monospace, monospace; }
.disk-size { text-align: right; font-feature-settings: "tnum" 1; color: var(--on-surface-variant); font-size: 14px; white-space: nowrap; }
.disk-size b { color: var(--on-surface); font-weight: 560; }
@media (max-width: 640px) {
  .disk { grid-template-columns: 40px 1fr auto; }
  .disk .wavy { grid-column: 1 / -1; }
}

/* ---------- misc */
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: var(--outline); font-size: 13px; padding: 0 4px; }
.offline-banner {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: var(--radius-m);
  background: var(--error-container); color: var(--on-error-container); font-weight: 560;
}
.offline-banner[hidden] { display: none; }
.empty { color: var(--on-surface-variant); padding: 8px 0; }

.rise { animation: rise .7s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ======================================================================
   Minecraft server page
   ====================================================================== */
.crumbs { margin-bottom: -16px; }
.back {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 10px; border-radius: 999px;
  color: var(--on-surface-variant); text-decoration: none; font-weight: 560;
  background: color-mix(in oklab, var(--surface-container-high) 70%, transparent);
  transition: background .2s var(--ease), color .2s var(--ease), border-radius .3s var(--spring);
}
.back:hover { color: var(--on-surface); background: var(--surface-container-highest); }
.back:active { border-radius: 12px; }
.back:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.mc-hero { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.mc-hero .hero-art { width: 132px; height: 132px; }
.mc-hero .hero-art img { position: relative; width: 72px; height: 72px; border-radius: 18px; image-rendering: pixelated; box-shadow: 0 8px 28px rgb(0 0 0 / .4); }
.mc-hero-main { flex: 1 1 360px; min-width: 0; }
.mc-hero h1 { font-size: clamp(40px, 6vw, 68px); }
.mc-hero .motd { margin: 8px 0 0; color: var(--on-surface-variant); font-style: italic; font-size: 17px; }
.mc-hero .chips { margin-top: 16px; }
.mc-hero .address { align-self: flex-end; }
@media (max-width: 640px) { .mc-hero .hero-art { width: 96px; height: 96px; } .mc-hero .hero-art img { width: 52px; height: 52px; } }

.face { border-radius: 25%; image-rendering: pixelated; flex: none; background: var(--surface-container-highest); }
.face-fallback { display: grid; place-items: center; font-weight: 700; color: var(--on-primary); background: var(--primary); font-size: 14px; }

/* online now */
.online { padding: 20px 24px; }
.online-list { display: flex; flex-wrap: wrap; gap: 12px; }
.online-player {
  display: flex; align-items: center; gap: 14px; padding: 10px 20px 10px 10px; border-radius: 999px;
  background: var(--secondary-container); color: var(--on-secondary-container);
}
.online-player .face { border-radius: 999px; }
.pname { font-weight: 600; font-size: 16px; }
.psub { font-size: 13px; opacity: .8; }
.empty-state { display: flex; align-items: center; gap: 18px; }
.empty-art { width: 56px; height: 56px; }
.empty-title { font-weight: 600; font-size: 17px; }
.empty-sub { color: var(--on-surface-variant); font-size: 14px; }

/* segmented range control */
.segmented {
  margin-left: auto; display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px;
  background: color-mix(in oklab, var(--surface-container-high) 80%, transparent);
}
.seg {
  border: 0; background: transparent; color: var(--on-surface-variant); font: inherit; font-weight: 600; font-size: 13px;
  height: 32px; padding: 0 14px; border-radius: 999px; cursor: pointer; font-feature-settings: "tnum" 1;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.seg:hover { color: var(--on-surface); }
.seg[aria-checked="true"] { background: var(--secondary-container); color: var(--on-secondary-container); }
.seg:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

/* charts */
.charts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1100px) { .charts { grid-template-columns: 1fr; } }
.chart { display: grid; gap: 12px; transition: opacity .3s var(--ease); }
.chart.loading { opacity: .55; }
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.chart-head h3 { margin: 0; font-size: 17px; font-weight: 600; }
.chart-head p { margin: 2px 0 0; color: var(--on-surface-variant); font-size: 13px; }
.chart-latest { color: var(--on-surface); font-weight: 600; font-size: 15px; white-space: nowrap; }
.chart-box { height: 190px; }
.chart-svg { display: block; width: 100%; height: 100%; overflow: visible; touch-action: pan-y; cursor: crosshair; }
.chart-svg:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; border-radius: 8px; }
.chart-svg .grid { stroke: color-mix(in oklab, var(--outline-variant) 70%, transparent); stroke-width: 1; }
.chart-svg .tick { fill: var(--on-surface-variant); font-size: 11px; font-feature-settings: "tnum" 1; }
.chart-svg .limit { stroke: var(--tertiary); stroke-width: 1; }
.chart-svg .limit-label { fill: var(--on-surface-variant); }
.chart-svg .line { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .area { fill: var(--primary); opacity: .1; }
.chart-svg .line-dot { fill: var(--primary); }
.chart-svg .end-dot, .chart-svg .hover-dot { fill: var(--primary); stroke: var(--surface-container); stroke-width: 2; }
.chart-svg .crosshair { stroke: var(--on-surface-variant); stroke-width: 1; opacity: .6; }
.chart-svg .empty-chart { font-size: 13px; }
.table-view summary { cursor: pointer; color: var(--on-surface-variant); font-size: 13px; font-weight: 560; width: fit-content; }
.table-view summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.table-scroll { max-height: 220px; overflow: auto; margin-top: 8px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { text-align: left; padding: 6px 4px; border-bottom: 1px solid color-mix(in oklab, var(--outline-variant) 50%, transparent); }
.data-table th { color: var(--on-surface-variant); font-weight: 560; position: sticky; top: 0; background: var(--surface-container); }
.data-table td:last-child, .data-table th:last-child { text-align: right; }

.tooltip {
  position: fixed; left: 0; top: 0; z-index: 10; pointer-events: none;
  display: grid; gap: 2px; padding: 8px 12px; border-radius: 12px;
  background: var(--inverse-surface, #dee3eb); color: var(--inverse-on-surface, #2d3137);
  box-shadow: 0 6px 24px rgb(0 0 0 / .35); font-size: 13px; white-space: nowrap;
}
.tooltip strong { font-size: 15px; font-weight: 650; font-feature-settings: "tnum" 1; }

/* players */
.players-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.player-card { display: grid; gap: 18px; align-content: start; }
.player-head { display: flex; align-items: center; gap: 16px; }
.player-head h3 { margin: 0; font-size: 22px; font-weight: 600; }
.player-head p { margin: 2px 0 0; color: var(--on-surface-variant); font-size: 14px; display: flex; align-items: center; gap: 6px; }
.status-on { color: var(--primary) !important; font-weight: 600; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px color-mix(in oklab, var(--primary) 25%, transparent); }
.pstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pstat {
  display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--radius-m);
  background: color-mix(in oklab, var(--surface-container-high) 75%, transparent);
}
.pstat-label { display: flex; align-items: center; gap: 6px; color: var(--on-surface-variant); font-size: 12px; font-weight: 560; }
.pstat-label .sym { font-size: 16px; }
.pstat-value { font-size: 20px; font-weight: 540; letter-spacing: -.01em; }
.player-foot { margin: 0; color: var(--on-surface-variant); font-size: 13px; }
@media (max-width: 420px) { .pstats { grid-template-columns: repeat(2, 1fr); } }

/* leaderboards: thin bars, square at the baseline, 4px round at the data end, value at the tip */
.boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.board { display: grid; gap: 14px; align-content: start; }
.board-head { display: flex; align-items: center; gap: 8px; color: var(--on-surface-variant); }
.board-head h3 { margin: 0; font-size: 16px; font-weight: 600; color: var(--on-surface); }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; align-items: center; gap: 12px; border-radius: 8px; outline: none; }
.bar-row:focus-visible { box-shadow: 0 0 0 2px var(--primary); }
.bar-name { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 540; min-width: 0; }
.bar-name > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank { width: 16px; color: var(--on-surface-variant); font-size: 12px; font-feature-settings: "tnum" 1; text-align: right; }
.bar-track { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar-fill { height: 10px; border-radius: 0 4px 4px 0; background: var(--primary); transition: width .6s var(--ease), filter .2s; }
.bar-row:hover .bar-fill, .bar-row:focus-visible .bar-fill { filter: brightness(1.15); }
.bar-value { font-size: 13px; color: var(--on-surface); font-weight: 560; white-space: nowrap; font-feature-settings: "tnum" 1; }

/* activity + rules */
.two-col { display: grid; grid-template-columns: 3fr 2fr; gap: 16px 24px; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; gap: 40px; } }
.feed { padding: 8px 20px 16px; max-height: 620px; overflow: auto; }
.feed-list { list-style: none; margin: 0; padding: 0; }
.feed-day { color: var(--on-surface-variant); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 16px 0 6px; }
.feed-item { display: grid; grid-template-columns: 28px 24px 1fr auto; align-items: center; gap: 10px; padding: 7px 0; font-size: 14px; }
.feed-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--surface-container-highest); color: var(--on-surface-variant); }
.feed-icon .sym { font-size: 17px; }
.feed-item.death .feed-icon { background: var(--error-container); color: var(--on-error-container); }
.feed-item.adv .feed-icon { background: var(--tertiary-container); color: var(--on-tertiary-container); }
.feed-item .face { width: 24px; height: 24px; }
.feed-text b { font-weight: 600; }
.adv-name { color: var(--tertiary); font-weight: 560; }
.feed-item time { color: var(--on-surface-variant); font-size: 12px; font-feature-settings: "tnum" 1; }

.props { padding: 8px 24px; }
.props-list { margin: 0; display: grid; grid-template-columns: auto 1fr; }
.props-list dt, .props-list dd { padding: 12px 0; border-bottom: 1px solid color-mix(in oklab, var(--outline-variant) 50%, transparent); }
.props-list dt:last-of-type, .props-list dd:last-of-type { border-bottom: 0; }
.props-list dt { display: flex; align-items: center; gap: 10px; color: var(--on-surface-variant); font-size: 14px; }
.props-list dt .sym { font-size: 18px; }
.props-list dd { margin: 0; text-align: right; font-weight: 560; }

/* mods */
.search {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px;
  background: color-mix(in oklab, var(--surface-container-high) 80%, transparent); color: var(--on-surface-variant);
}
.search input { border: 0; background: transparent; color: var(--on-surface); font: inherit; width: 180px; outline: none; }
.search:focus-within { box-shadow: 0 0 0 2px var(--primary); }
.mods { padding: 16px; }
.mod-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; }
.mod { display: grid; gap: 2px; padding: 10px 14px; border-radius: var(--radius-m); background: color-mix(in oklab, var(--surface-container-high) 60%, transparent); min-width: 0; }
.mod-name { font-weight: 560; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mod-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--on-surface-variant); font-size: 12px; min-width: 0; }
.mod-meta > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.env { flex: none; padding: 0 8px; border-radius: 6px; font-weight: 600; font-size: 11px; line-height: 18px; }
.env-client { background: var(--secondary-container); color: var(--on-secondary-container); }
.env-server { background: var(--tertiary-container); color: var(--on-tertiary-container); }
.env-both { background: var(--surface-container-highest); color: var(--on-surface-variant); }

/* ======================================================================
   Admin + map
   ====================================================================== */
.crumbs-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
button.back { border: 0; font: inherit; cursor: pointer; }
.clock .admin-link { margin-bottom: 18px; }
.admin-link .sym { font-size: 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.map-full { margin-left: auto; height: 36px; font-size: 14px; }
.map-card { padding: 0; overflow: hidden; height: min(70vh, 620px); }
.map-card iframe { display: block; width: 100%; height: 100%; border: 0; background: var(--surface-container-lowest); }

/* login */
.login-wrap { display: grid; place-items: center; min-height: 60vh; }
.login { width: min(420px, 100%); display: grid; gap: 14px; justify-items: center; text-align: center; padding: 40px 32px; }
.login-art .shape { width: 88px; height: 88px; }
.login-art .sym { font-size: 40px; }
.login h1 { font-size: 36px; }
.login p { margin: 0; color: var(--on-surface-variant); }
.pin { width: 100%; }
.pin input {
  width: 100%; height: 64px; border: 0; border-radius: 20px; text-align: center; font: inherit; font-size: 28px;
  letter-spacing: .4em; background: var(--surface-container-highest); color: var(--on-surface); outline: none;
  transition: border-radius .3s var(--spring), box-shadow .2s var(--ease);
}
.pin input:focus { box-shadow: 0 0 0 2px var(--primary); border-radius: 28px; }
.login-error { color: var(--error) !important; min-height: 1.4em; font-weight: 560; }
.login .btn { width: 100%; justify-content: center; height: 52px; }
.btn:disabled { opacity: .6; cursor: progress; }

/* admin layout */
.admin-hero { align-items: flex-end; margin-bottom: 8px; }
.power { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-tonal { background: var(--secondary-container); color: var(--on-secondary-container); }
.btn.armed { background: var(--error); color: var(--on-error, #690006); border-radius: 12px; }
.btn-small { height: 40px; padding: 0 16px 0 12px; font-size: 14px; }
#admin { display: grid; gap: 40px; }
#admin[hidden] { display: none; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px 24px; }
.admin-grid .span-2 { grid-column: 1 / -1; }
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } }

.console { padding: 0; overflow: hidden; display: grid; }
.console-log {
  margin: 0; height: 420px; overflow: auto; padding: 16px 20px; font: 12.5px/1.55 ui-monospace, "JetBrains Mono", monospace;
  background: color-mix(in oklab, var(--surface-container-lowest) 85%, transparent); color: var(--on-surface-variant);
  white-space: pre-wrap; word-break: break-word;
}
.console-log .warn { color: var(--tertiary); }
.console-log .err { color: var(--error); }
.console-log .chatline { color: var(--on-surface); }
.console-input { display: flex; align-items: center; gap: 10px; padding: 12px; }
.console-input input {
  flex: 1; min-width: 0; height: 40px; border: 0; border-radius: 999px; padding: 0 16px; font: inherit; font-size: 14px;
  background: var(--surface-container-highest); color: var(--on-surface); outline: none;
}
.console-input input:focus { box-shadow: 0 0 0 2px var(--primary); }
#cmd { font-family: ui-monospace, monospace; }
.prompt { color: var(--primary); font: 600 18px ui-monospace, monospace; padding-left: 6px; }

.chat { padding: 0; display: grid; }
.chat-list { list-style: none; margin: 0; padding: 12px 20px; height: 340px; overflow: auto; display: grid; align-content: start; gap: 6px; font-size: 14px; }
.chat-list li { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; align-items: baseline; }
.chat-list time { color: var(--outline); font-size: 12px; font-feature-settings: "tnum" 1; }
.chat-list b { font-weight: 600; color: var(--primary); }
.chat-list .server b { color: var(--tertiary); }
.chat-list .empty { display: block; }

.people { display: grid; gap: 10px; align-content: start; }
.people h3 { margin: 6px 0 0; font-size: 15px; font-weight: 600; color: var(--on-surface-variant); }
.people .empty { margin: 0; }
.people-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.people-list li { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 8px; border-radius: 14px; background: color-mix(in oklab, var(--surface-container-high) 70%, transparent); }
.people-list li > span:not(.tag) { flex: 1; font-weight: 560; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--tertiary-container); color: var(--on-tertiary-container); }
.mini {
  border: 0; border-radius: 999px; height: 30px; padding: 0 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  background: var(--surface-container-highest); color: var(--on-surface);
}
.mini:hover { filter: brightness(1.15); }
.mini.danger { background: var(--error-container); color: var(--on-error-container); }
.wl-add { padding: 6px 0 0; }

.backups { padding: 8px 24px 16px; }
.mono { font-family: ui-monospace, monospace; font-size: 12px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20; max-width: min(640px, calc(100vw - 32px));
  padding: 14px 20px; border-radius: 16px; background: var(--inverse-surface, #dee3eb); color: var(--inverse-on-surface, #2d3137);
  box-shadow: 0 8px 30px rgb(0 0 0 / .4); font-weight: 560; white-space: pre-wrap;
}
.toast.bad { background: var(--error-container); color: var(--on-error-container); }

.svc-backup { display: inline-flex; align-items: center; gap: 8px; color: var(--on-surface-variant); font-size: 14px; }
.svc-backup .sym { font-size: 18px; }

/* ======================================================================
   Apps page (jaxserv.net/apps)
   ====================================================================== */
.apps-body { padding-bottom: 96px; }
.apps-hero h1 { font-size: clamp(56px, 9vw, 96px); }
.lede { margin: 16px 0 0; max-width: 62ch; color: var(--on-surface-variant); font-size: 18px; line-height: 1.5; }

.installer { display: grid; gap: 18px; padding: 28px; background: color-mix(in oklab, var(--primary-container) 30%, var(--surface-container) 70%); }
.installer-head { display: flex; align-items: center; gap: 18px; }
.installer-badge { width: 64px; height: 64px; }
.installer-badge .sym { font-size: 30px; }
.installer h2 { font-size: 28px; }
.installer .sub { margin: 4px 0 0; color: var(--on-surface-variant); }
.cmd-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 20px; border-radius: var(--radius-l);
  background: var(--surface-container-lowest); box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--outline-variant) 60%, transparent);
}
.cmd { font: 500 14.5px/1.5 ui-monospace, "Google Sans Code", monospace; color: var(--on-surface); overflow-wrap: anywhere; flex: 1; }
.cmd-row .cmd { padding: 6px 0; }
.cmd.small { display: block; font-size: 12.5px; padding: 10px 14px; border-radius: var(--radius-m); background: var(--surface-container-lowest); }
.picked-list { display: flex; flex-wrap: wrap; gap: 8px; }
.installer-notes { margin: 0; padding-left: 20px; color: var(--on-surface-variant); font-size: 14px; display: grid; gap: 4px; }
.installer-notes code, .muted code { font-family: ui-monospace, monospace; font-size: 13px; color: var(--on-surface); }

.app-group + .app-group { margin-top: 40px; }
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
@media (max-width: 520px) { .apps { grid-template-columns: 1fr; } }
.app { display: flex; flex-direction: column; gap: 18px; transition: box-shadow .3s var(--ease), background .3s var(--ease); }
.app.picked {
  background: color-mix(in oklab, var(--primary-container) 22%, var(--surface-container) 78%);
  box-shadow: inset 0 0 0 2px var(--primary);
}
.app-head { display: flex; gap: 18px; align-items: center; }
.app-badge { width: 72px; height: 72px; }
.app-badge .sym { font-size: 32px; }
.app.picked .app-badge > svg path { fill: var(--primary-container); }
.app.picked .app-badge > .sym { color: var(--on-primary-container); }
.app-title { min-width: 0; }
.app-title h3 { margin: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 28px; font-weight: 600; letter-spacing: -.015em; line-height: 1.1; }
.app-title .ver { font-size: 14px; font-weight: 520; color: var(--on-surface-variant); letter-spacing: 0; }
.app-title p { margin: 6px 0 0; color: var(--on-surface-variant); }
.features { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 14.5px; }
.features li { position: relative; padding-left: 20px; }
.features li::before {
  content: ""; position: absolute; left: 4px; top: .5em; width: 7px; height: 7px; border-radius: 3px;
  background: var(--primary); transform: rotate(45deg);
}
.app-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.app-meta .chip { height: 28px; font-size: 12.5px; }
.app-meta .chip .sym { font-size: 16px; }

.opts { display: grid; gap: 4px; padding: 14px 16px; border-radius: var(--radius-l); background: color-mix(in oklab, var(--surface-container-highest) 70%, transparent); }
.opts-title { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--primary); margin-bottom: 4px; }
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.opt input { appearance: none; flex: none; width: 20px; height: 20px; margin: 1px 0 0; border-radius: 6px; border: 2px solid var(--outline); display: grid; place-items: center; cursor: pointer; transition: background .2s var(--ease), border-color .2s var(--ease), border-radius .3s var(--spring); }
.opt input:checked { background: var(--primary); border-color: var(--primary); border-radius: 10px; }
.opt input:checked::after { content: ""; width: 5px; height: 10px; border: solid var(--on-primary); border-width: 0 2.5px 2.5px 0; transform: translate(0, -1px) rotate(45deg); }
.opt input:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.opt-text { display: grid; gap: 2px; font-size: 14px; }
.opt-text span { color: var(--on-surface-variant); font-size: 13px; }

.history summary, .manual summary {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; width: fit-content;
  color: var(--on-surface-variant); font-size: 13px; font-weight: 560; list-style: none;
}
.history summary::-webkit-details-marker, .manual summary::-webkit-details-marker { display: none; }
.history summary .sym { font-size: 18px; }
.history summary:hover, .manual summary:hover { color: var(--on-surface); }
.history summary:focus-visible, .manual summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.history ol { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 12px; }
.hist-head { display: flex; gap: 10px; align-items: baseline; font-size: 14px; }
.hist-head span { color: var(--on-surface-variant); font-size: 13px; }
.history ul { margin: 4px 0 0; padding-left: 18px; font-size: 14px; color: var(--on-surface-variant); }
.history p { margin: 2px 0 0; }
.muted { color: var(--on-surface-variant); font-size: 12.5px; overflow-wrap: anywhere; }
.manual { display: grid; gap: 8px; margin-top: -4px; }
.manual[open] summary { margin-bottom: 8px; }

.app-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: auto; }
.app-actions .btn small { font-weight: 500; opacity: .75; font-size: 13px; }
.spacer { flex: 1; }
.pick-note { color: var(--tertiary); font-size: 13px; }
.pick {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px 0 14px; border-radius: 999px;
  border: 0; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
  background: var(--secondary-container); color: var(--on-secondary-container);
  transition: background .2s var(--ease), color .2s var(--ease), border-radius .3s var(--spring);
}
.pick:active { border-radius: 12px; }
.pick:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.pick[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }

.tray {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 10;
  width: min(1176px, calc(100% - 32px)); display: flex; align-items: center; gap: 14px;
  padding: 10px 10px 10px 22px; border-radius: 999px;
  background: color-mix(in oklab, var(--surface-container-highest) 92%, transparent);
  backdrop-filter: blur(24px) saturate(1.2); box-shadow: 0 12px 40px rgb(0 0 0 / .45), inset 0 0 0 1px color-mix(in oklab, var(--outline-variant) 60%, transparent);
  animation: rise .4s var(--ease) both;
}
.tray-count { font-weight: 600; white-space: nowrap; color: var(--primary); }
.tray .cmd { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; color: var(--on-surface-variant); }
@media (max-width: 640px) { .tray { border-radius: var(--radius-l); } .tray .cmd { display: none; } .tray .btn { margin-left: auto; } }
.hero-links { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-bottom: 18px; }
.hero-links .admin-link { margin-bottom: 0; }
@media (max-width: 640px) { .hero-links { justify-content: flex-start; } }
/* A group with one card (Tonal): full width, features and options side by side */
.apps > .app:only-child { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .apps > .app:only-child .features { grid-template-columns: 1fr 1fr; column-gap: 32px; }
  .apps > .app:only-child .opts { grid-template-columns: repeat(3, 1fr); column-gap: 24px; }
  .apps > .app:only-child .opts-title { grid-column: 1 / -1; }
}
