/* ============================================================================
   Minecraft Winter - cloud panel
   A cold, dark operations interface. No external assets of any kind:
   system font stacks only, every icon is inline SVG or a unicode glyph.
   ========================================================================= */

/* ---- 1. design tokens --------------------------------------------------- */

:root {
  color-scheme: dark;

  /* Surfaces, deepest first. */
  --ink-900: #05080f;
  --ink-800: #080d18;
  --ink-700: #0b1220;
  --ink-600: #0e1626;
  --ink-500: #121c2e;
  --ink-400: #172338;

  --line: #1d2a42;
  --line-soft: #162236;
  --line-strong: #2b3d5e;

  --text: #e7eefb;
  --text-dim: #a2b5d3;
  --text-faint: #6d82a4;

  /* Ice-blue accent. */
  --frost: #7cc4fb;
  --frost-deep: #3f83c4;
  --frost-veil: rgba(124, 196, 251, 0.14);
  --frost-edge: rgba(124, 196, 251, 0.38);

  /* Service states. */
  --running: #4fd8cf;
  --starting: #f2b25c;
  --stopping: #9bb6e2;
  --stopped: #74889f;
  --crashed: #f4707f;

  --ok: #4fd8cf;
  --warn: #f2b25c;
  --bad: #f4707f;

  --radius-xs: 5px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow: 0 14px 30px -18px rgba(0, 0, 0, 0.9), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 40px 80px -34px rgba(0, 0, 0, 0.95), 0 6px 18px rgba(0, 0, 0, 0.4);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", "Courier New", monospace;

  --nav-width: 246px;
  --ease: cubic-bezier(0.4, 0.14, 0.3, 1);
  --fast: 130ms var(--ease);
  --slow: 250ms var(--ease);
}

/* ---- 2. reset and base -------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--ink-900);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* A single cold aurora behind everything; fixed so scrolling stays calm. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px 640px at 8% -14%, rgba(62, 122, 196, 0.20), transparent 62%),
    radial-gradient(940px 520px at 102% -6%, rgba(70, 190, 208, 0.10), transparent 58%),
    linear-gradient(180deg, #060a13 0%, #05080f 55%);
}

.app { position: relative; z-index: 1; }

h1, h2, h3, h4, p, figure { margin: 0; }

a { color: var(--frost); text-decoration: none; }
a:hover { color: #a9d9ff; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--frost);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

::selection { background: rgba(124, 196, 251, 0.28); }

/* Scrollbars kept in the palette instead of the browser default. */
* { scrollbar-color: #24344f transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #22314a;
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: #2e4265; background-clip: padding-box; }

.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.mono { font-family: var(--mono); font-variant-ligatures: none; }
/* A literal command, quoted inside running text. */
.code {
  font-family: var(--mono);
  font-size: 12px;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  color: #cfe6ff;
  background: rgba(148, 178, 220, 0.09);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.nowrap { white-space: nowrap; }
.numeric { font-variant-numeric: tabular-nums; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ---- 3. first paint and noscript ---------------------------------------- */

.boot, .noscript {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 24px;
}

.boot-mark { color: var(--frost); opacity: 0.9; }
.boot-title { font-size: 17px; font-weight: 600; letter-spacing: 0.02em; }
.boot-note { color: var(--text-faint); font-size: 13px; }
.noscript { color: var(--text-dim); }

/* ---- 4. brand mark ------------------------------------------------------ */

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 11px;
  color: var(--frost);
  background: linear-gradient(160deg, rgba(124, 196, 251, 0.20), rgba(124, 196, 251, 0.04));
  border: 1px solid var(--frost-edge);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 6px 18px -10px rgba(124, 196, 251, 0.7);
}
.brand-mark svg { display: block; }

.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-name {
  font-size: 15px; font-weight: 650; letter-spacing: 0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-sub {
  font-size: 11px; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--text-faint);
}

/* ---- 5. login ----------------------------------------------------------- */

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}

.login-card {
  width: 100%;
  max-width: 396px;
  padding: 32px 30px 28px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(19, 29, 47, 0.94), rgba(11, 18, 32, 0.94));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}

.login-head { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.login-head .brand-mark { width: 52px; height: 52px; border-radius: 15px; }
.login-title { font-size: 21px; font-weight: 650; letter-spacing: 0.01em; }
.login-note { color: var(--text-faint); font-size: 12.5px; }
.login-form { margin-top: 26px; display: flex; flex-direction: column; gap: 15px; }
.login-form .btn { margin-top: 4px; height: 42px; }
.login-foot {
  margin-top: 22px; padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  text-align: center; font-size: 12px; color: var(--text-faint);
}

/* ---- 6. shell: sidebar, top bar, content -------------------------------- */

.shell {
  display: grid;
  grid-template-columns: var(--nav-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 14px;
  background: linear-gradient(180deg, rgba(10, 16, 28, 0.86), rgba(7, 11, 20, 0.92));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.sidebar > .brand { padding: 4px 8px 0; }

.nav { display: flex; flex-direction: column; gap: 3px; overflow: auto; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 500;
  transition: background var(--fast), color var(--fast), border-color var(--fast);
}
.nav-item:hover { background: rgba(124, 196, 251, 0.07); color: var(--text); }
.nav-item.is-active {
  background: linear-gradient(90deg, var(--frost-veil), rgba(124, 196, 251, 0.03));
  border-color: rgba(124, 196, 251, 0.24);
  color: #dbeeff;
}
.nav-item .icon { flex: none; display: grid; place-items: center; color: var(--frost-deep); }
.nav-item.is-active .icon { color: var(--frost); }
.nav-item .icon svg { display: block; }
.nav-label { flex: 1 1 auto; min-width: 0; }

.nav-count {
  flex: none;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  padding: 1px 7px;
  border-radius: 999px;
  color: var(--text-dim);
  background: rgba(148, 178, 220, 0.12);
  border: 1px solid var(--line);
}

.sidebar-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 10px 2px;
  border-top: 1px solid var(--line-soft);
  font-size: 11.5px;
  color: var(--text-faint);
}

.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 30px;
  background: rgba(8, 13, 24, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.topbar-title { display: flex; flex-direction: column; min-width: 0; }
.topbar-title h1 {
  font-size: 17px; font-weight: 620; letter-spacing: 0.005em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-title p { font-size: 12px; color: var(--text-faint); }
.topbar-tools { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.stream-state {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--text-faint);
  padding: 5px 11px 5px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(17, 26, 43, 0.7);
  white-space: nowrap;
}
.stream-state .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--running); flex: none; }
.stream-state.is-live .dot { animation: pulse 2.4s var(--ease) infinite; }
.stream-state.is-lost { color: var(--warn); border-color: rgba(242, 178, 92, 0.34); }
.stream-state.is-lost .dot { background: var(--warn); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(79, 216, 207, 0.5); }
  60%      { box-shadow: 0 0 0 6px rgba(79, 216, 207, 0); }
}

.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 6px 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(17, 26, 43, 0.7);
}
.user-chip .who { display: flex; flex-direction: column; line-height: 1.2; }
.user-chip .who b { font-size: 12.5px; font-weight: 600; }
.user-chip .who span { font-size: 10.5px; color: var(--text-faint); letter-spacing: 0.04em; }

.content { flex: 1 1 auto; padding: 24px 30px 72px; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 22px; }
/* The class sets a display, so the attribute needs saying again to win. */
.stack[hidden] { display: none; }
.stack-sm { display: flex; flex-direction: column; gap: 14px; }

.section-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.section-head h2 { font-size: 13px; font-weight: 620; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-dim); }
.section-head p { font-size: 12.5px; color: var(--text-faint); }
.section-head .spacer { margin-left: auto; }

/* ---- 7. banners --------------------------------------------------------- */

.banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  margin-bottom: 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  border: 1px solid rgba(242, 178, 92, 0.32);
  background: rgba(242, 178, 92, 0.09);
  color: #f6cf9a;
}
.banner[hidden] { display: none; }
.banner .spin {
  width: 12px; height: 12px; flex: none;
  border-radius: 50%;
  border: 2px solid rgba(242, 178, 92, 0.35);
  border-top-color: var(--warn);
  animation: spin 900ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.notice {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  border: 1px solid var(--line);
  background: rgba(124, 196, 251, 0.06);
  color: var(--text-dim);
}
.notice strong { color: #cfe6ff; font-weight: 600; }
.notice[hidden] { display: none; }
/* Something is unavailable rather than merely worth knowing: the database is down. */
.notice.is-bad {
  border-color: rgba(244, 112, 127, 0.32);
  background: rgba(244, 112, 127, 0.08);
  color: #f2a1ab;
}
.notice.is-bad strong { color: #ffc3ca; }

/* ---- 8. panels and cards ------------------------------------------------ */

.panel {
  background: linear-gradient(180deg, rgba(18, 28, 46, 0.72), rgba(11, 18, 32, 0.72));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.panel-head h3 { font-size: 13.5px; font-weight: 620; }
.panel-head .spacer { margin-left: auto; }
.panel-body { padding: 18px; }
.panel-foot {
  padding: 13px 18px;
  border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}

/* ---- 9. stat tiles ------------------------------------------------------ */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  gap: 14px;
}
/* Two tiles must not stretch across a wide screen the way six of them may. */
.tiles.is-pair { grid-template-columns: repeat(auto-fit, minmax(196px, 272px)); }

.tile {
  position: relative;
  overflow: hidden;
  padding: 15px 16px 14px;
  border-radius: var(--radius);
  background: linear-gradient(165deg, rgba(21, 32, 52, 0.86), rgba(11, 18, 31, 0.86));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: border-color var(--fast), transform var(--fast);
}
.tile:hover { border-color: var(--line-strong); }
.tile-label {
  font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-faint);
}
.tile-value {
  margin-top: 8px;
  font-size: 26px; font-weight: 620; letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
  color: #f2f7ff;
}
.tile-meta { margin-top: 3px; font-size: 12px; color: var(--text-faint); }
.tile-bar {
  margin-top: 12px;
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 178, 220, 0.13);
  overflow: hidden;
}
.tile-bar > i {
  display: block; height: 100%; width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--frost-deep), var(--frost));
  transition: width var(--slow);
}
.tile-bar.is-warm > i { background: linear-gradient(90deg, #c98a3c, var(--starting)); }
.tile-bar.is-hot > i { background: linear-gradient(90deg, #c8505f, var(--crashed)); }

/* ---- 10. badges --------------------------------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.015em;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

.badge.state-RUNNING  { color: var(--running);  background: rgba(79, 216, 207, 0.11); border-color: rgba(79, 216, 207, 0.30); }
.badge.state-STARTING { color: var(--starting); background: rgba(242, 178, 92, 0.11); border-color: rgba(242, 178, 92, 0.30); }
.badge.state-STOPPING { color: var(--stopping); background: rgba(155, 182, 226, 0.10); border-color: rgba(155, 182, 226, 0.28); }
.badge.state-STOPPED  { color: var(--stopped);  background: rgba(116, 136, 159, 0.11); border-color: rgba(116, 136, 159, 0.28); }
.badge.state-CRASHED  { color: var(--crashed);  background: rgba(244, 112, 127, 0.11); border-color: rgba(244, 112, 127, 0.32); }

.badge.state-RUNNING .dot { animation: pulse 2.6s var(--ease) infinite; }
.badge.state-STARTING .dot { animation: blink 1.1s steps(2, jump-none) infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

/* Kind of punishment: a Bann is the harder of the two, a Chatsperre the milder. */
.badge.kind-BAN  { color: var(--crashed);  background: rgba(244, 112, 127, 0.11); border-color: rgba(244, 112, 127, 0.32); }
.badge.kind-MUTE { color: var(--starting); background: rgba(242, 178, 92, 0.11); border-color: rgba(242, 178, 92, 0.30); }

/* Where a punishment stands: in force, run out, or lifted by hand. */
.badge.life-active  { color: var(--running);  background: rgba(79, 216, 207, 0.11); border-color: rgba(79, 216, 207, 0.30); }
.badge.life-expired { color: var(--stopped);  background: rgba(116, 136, 159, 0.11); border-color: rgba(116, 136, 159, 0.28); }
.badge.life-revoked { color: var(--stopping); background: rgba(155, 182, 226, 0.10); border-color: rgba(155, 182, 226, 0.28); }
.badge.life-active .dot { animation: pulse 2.6s var(--ease) infinite; }

/* "dauerhaft" is a state, not a countdown, and must not read like one. */
.perm {
  display: inline-flex; align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px; font-weight: 620; letter-spacing: 0.05em;
  color: #f2a1ab;
  background: rgba(244, 112, 127, 0.10);
  border: 1px solid rgba(244, 112, 127, 0.28);
  white-space: nowrap;
}
.perm[hidden] { display: none; }

.tag {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-size: 10.5px; font-weight: 620; letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: rgba(148, 178, 220, 0.09);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.tag.soft-PAPER    { color: #a9cff5; border-color: rgba(124, 196, 251, 0.26); background: rgba(124, 196, 251, 0.08); }
.tag.soft-FOLIA    { color: #9fe4dd; border-color: rgba(79, 216, 207, 0.26); background: rgba(79, 216, 207, 0.08); }
.tag.soft-VELOCITY { color: #c8b6f2; border-color: rgba(170, 146, 240, 0.28); background: rgba(170, 146, 240, 0.09); }

.role-pill {
  display: inline-flex; align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 10.5px; font-weight: 620; letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid var(--line);
  color: var(--text-dim);
  background: rgba(148, 178, 220, 0.09);
}
.role-pill.role-ADMIN    { color: #f5cf9c; border-color: rgba(242, 178, 92, 0.30); background: rgba(242, 178, 92, 0.08); }
.role-pill.role-OPERATOR { color: #a9d9ff; border-color: rgba(124, 196, 251, 0.28); background: rgba(124, 196, 251, 0.08); }

/* ---- 11. buttons and form controls -------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 32px;
  padding: 0 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(31, 45, 70, 0.9), rgba(20, 30, 48, 0.9));
  color: var(--text);
  font-size: 12.5px; font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--fast), border-color var(--fast), color var(--fast),
              box-shadow var(--fast), transform var(--fast);
}
.btn:hover:not(:disabled) { border-color: var(--frost-edge); background: linear-gradient(180deg, rgba(40, 58, 89, 0.95), rgba(24, 36, 57, 0.95)); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.38; cursor: not-allowed; }

.btn-primary {
  border-color: rgba(124, 196, 251, 0.46);
  background: linear-gradient(180deg, rgba(90, 163, 226, 0.95), rgba(56, 118, 180, 0.95));
  color: #f2faff;
  box-shadow: 0 8px 20px -12px rgba(124, 196, 251, 0.9);
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, rgba(108, 182, 244, 1), rgba(66, 133, 198, 1)); }

.btn-ghost { background: transparent; border-color: var(--line); color: var(--text-dim); }
.btn-ghost:hover:not(:disabled) { color: var(--text); background: rgba(124, 196, 251, 0.07); }

.btn-danger { border-color: rgba(244, 112, 127, 0.42); color: #ffb9c1; background: rgba(244, 112, 127, 0.10); }
.btn-danger:hover:not(:disabled) { background: rgba(244, 112, 127, 0.19); border-color: rgba(244, 112, 127, 0.6); }

.btn-sm { height: 27px; padding: 0 10px; font-size: 11.5px; }
.btn-block { width: 100%; }
.btn .icon svg { display: block; }

.actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

/* Two mutually exclusive choices, side by side instead of folded into a menu.
   Sized to end up exactly as tall as a neighbouring .input. */
.segmented {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: rgba(6, 11, 20, 0.78);
}
.segmented .seg {
  flex: 1 1 auto;
  height: 32px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-dim);
  font-size: 12.5px; font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--fast), color var(--fast), border-color var(--fast);
}
.segmented .seg:hover { color: var(--text); background: rgba(124, 196, 251, 0.07); }
.segmented .seg.is-on {
  color: #dbeeff;
  background: linear-gradient(180deg, rgba(124, 196, 251, 0.20), rgba(124, 196, 251, 0.06));
  border-color: rgba(124, 196, 251, 0.34);
}

/* Fills the field next to them; that field stays typable for anything else. */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(148, 178, 220, 0.07);
  color: var(--text-dim);
  font-size: 11.5px; font-weight: 550;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--fast), border-color var(--fast), color var(--fast);
}
.chip:hover { color: var(--text); border-color: var(--frost-edge); background: rgba(124, 196, 251, 0.10); }
.chip:active { transform: translateY(1px); }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); }
.field .hint { font-size: 11.5px; color: var(--text-faint); }

.input, .select, .textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: rgba(6, 11, 20, 0.78);
  color: var(--text);
  font-size: 13.5px;
  transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
}
.input::placeholder, .textarea::placeholder { color: #55698a; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--frost-edge);
  box-shadow: 0 0 0 3px rgba(124, 196, 251, 0.13);
  background: rgba(8, 14, 25, 0.9);
}
.input:disabled, .select:disabled { opacity: 0.5; cursor: not-allowed; }

.select {
  appearance: none;
  padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-faint) 50%),
                    linear-gradient(135deg, var(--text-faint) 50%, transparent 50%);
  background-position: calc(100% - 16px) 51%, calc(100% - 11px) 51%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.select option { background: var(--ink-600); color: var(--text); }

.search {
  position: relative;
  display: flex; align-items: center;
  min-width: 220px;
}
.search .icon { position: absolute; left: 11px; color: var(--text-faint); display: grid; place-items: center; }
.search .icon svg { display: block; }
.search .input { padding-left: 34px; height: 34px; padding-top: 0; padding-bottom: 0; }
.search kbd {
  position: absolute; right: 9px;
  font-family: var(--mono); font-size: 10.5px;
  padding: 1px 6px;
  color: var(--text-faint);
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(148, 178, 220, 0.06);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  align-items: end;
}

.status-line { font-size: 12.5px; color: var(--text-dim); min-height: 18px; }
.status-line.is-ok { color: var(--ok); }
.status-line.is-bad { color: var(--bad); }

/* ---- 12. service cards -------------------------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(298px, 1fr));
  gap: 15px;
}

.service-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(168deg, rgba(20, 31, 50, 0.82), rgba(10, 17, 30, 0.86));
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color var(--fast), transform var(--fast), box-shadow var(--fast);
}
.service-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: 0 20px 38px -22px rgba(0, 0, 0, 0.95), 0 2px 6px rgba(0, 0, 0, 0.3);
}
/* A thin state rail down the left edge; the fastest read on a wall display. */
.service-card { border-left: 3px solid var(--stopped); }
.service-card.is-RUNNING  { border-left-color: var(--running); }
.service-card.is-STARTING { border-left-color: var(--starting); }
.service-card.is-STOPPING { border-left-color: var(--stopping); }
.service-card.is-STOPPED  { border-left-color: var(--stopped); }
.service-card.is-CRASHED  { border-left-color: var(--crashed); }

.service-card-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px 12px;
}
.service-card-head .who { min-width: 0; flex: 1 1 auto; }
.service-card-head .name {
  display: block;
  font-size: 15px; font-weight: 620; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.service-card-head .name:hover { color: #b9dfff; }
.service-card-head .sub {
  margin-top: 5px;
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--text-faint);
  font-family: var(--mono);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.metric {
  display: flex; flex-direction: column; gap: 2px;
  padding: 9px 16px;
  background: rgba(9, 15, 26, 0.6);
}
.metric[hidden] { display: none; }
.metric dt { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }
.metric dd {
  margin: 0;
  font-size: 13.5px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #dfeaf9;
}

.service-card-foot {
  margin-top: auto;
  padding: 12px 16px 14px;
  display: flex; flex-direction: column; gap: 10px;
}

.idle-line {
  display: flex; align-items: center; gap: 7px;
  font-size: 11.5px; color: var(--starting);
}
.idle-line[hidden] { display: none; }
.idle-line .icon { display: grid; place-items: center; }
.idle-line .icon svg { display: block; }
.idle-line .clock { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.error-line {
  font-size: 11.5px;
  color: #f2a1ab;
  background: rgba(244, 112, 127, 0.08);
  border: 1px solid rgba(244, 112, 127, 0.22);
  border-radius: var(--radius-xs);
  padding: 6px 9px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.error-line[hidden] { display: none; }

/* ---- 13. tables --------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(16, 25, 41, 0.7), rgba(10, 17, 29, 0.7));
  box-shadow: var(--shadow);
}

table.grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  /* Wide enough that no column is squeezed; the wrapper scrolls instead. */
  min-width: 1180px;
}
table.grid.narrow { min-width: 560px; }
table.grid thead th {
  position: sticky; top: 0; z-index: 2;
  text-align: left;
  padding: 11px 14px;
  font-size: 10.5px; font-weight: 620; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--text-faint);
  background: rgba(11, 18, 31, 0.96);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  backdrop-filter: blur(6px);
}
table.grid tbody td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  color: var(--text-dim);
}
/* Action buttons must never wrap: a wrapped cell drives the whole row's height. */
table.grid td .actions { flex-wrap: nowrap; }
/* A full-width control would collapse inside a shrink-to-fit cell. */
table.grid td .select { width: auto; min-width: 154px; padding-top: 6px; padding-bottom: 6px; }
table.grid tbody tr:last-child td { border-bottom: none; }
table.grid tbody tr { transition: background var(--fast); }
table.grid tbody tr:hover { background: rgba(124, 196, 251, 0.055); }
table.grid tbody tr.is-clickable { cursor: pointer; }
table.grid td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.grid td.primary { color: var(--text); font-weight: 550; }
table.grid td.tight { width: 1%; white-space: nowrap; }
/* A row that no longer stands is still evidence, but it must not shout. */
table.grid tbody tr.is-dim td { opacity: 0.58; }
table.grid tbody tr.is-dim:hover td { opacity: 0.85; }

.cell-service { display: flex; flex-direction: column; line-height: 1.3; }
.cell-service b { font-weight: 600; color: var(--text); white-space: nowrap; }
.cell-service span {
  font-size: 11px; color: var(--text-faint); font-family: var(--mono); white-space: nowrap;
}

.flag { font-size: 12px; color: var(--text-faint); }
.flag.on { color: var(--frost); }

.empty {
  padding: 34px 20px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(11, 18, 31, 0.4);
}
.empty[hidden] { display: none; }
/* An empty state that has to explain a command needs room to breathe. */
.empty p + p { margin-top: 9px; line-height: 1.85; }

/* ---- 14. service detail ------------------------------------------------- */

.detail-head {
  display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(21, 33, 54, 0.82), rgba(10, 17, 30, 0.86));
  box-shadow: var(--shadow);
}
.detail-head .titles { min-width: 0; flex: 1 1 260px; }
.detail-head h2 { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; }
.detail-head .sub {
  margin-top: 7px;
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-faint);
}
.detail-head .actions { margin-left: auto; }

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.meta {
  display: flex; flex-direction: column; gap: 3px;
  padding: 11px 14px;
  background: rgba(11, 18, 31, 0.82);
  min-width: 0;
}
.meta dt { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }
.meta dd {
  margin: 0;
  font-size: 13px; font-weight: 550; color: #dfeaf9;
  font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---- 15. console -------------------------------------------------------- */

.console {
  position: relative;
  display: flex; flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(4, 7, 13, 0.86);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.console-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(11, 18, 31, 0.86);
}
.console-head h3 { font-size: 12.5px; font-weight: 620; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); }
.console-head .spacer { margin-left: auto; }
.console-head .meta-note { font-size: 11.5px; color: var(--text-faint); font-variant-numeric: tabular-nums; }

.console-log {
  height: 500px;
  overflow-y: auto;
  overflow-x: auto;
  padding: 10px 0;
  font-family: var(--mono);
  font-size: 12.25px;
  line-height: 1.62;
  scroll-behavior: auto;
}

.log-line {
  display: flex;
  gap: 12px;
  padding: 0 16px;
  white-space: pre-wrap;
  word-break: break-word;
  border-left: 2px solid transparent;
}
.log-line:hover { background: rgba(124, 196, 251, 0.045); }
.log-line .at { flex: none; color: #3f5375; user-select: none; font-variant-numeric: tabular-nums; }
.log-line .text { color: #b9c9e0; min-width: 0; }

.log-line.is-warn { border-left-color: rgba(242, 178, 92, 0.6); background: rgba(242, 178, 92, 0.045); }
.log-line.is-warn .text { color: #f0c48a; }
.log-line.is-error { border-left-color: rgba(244, 112, 127, 0.65); background: rgba(244, 112, 127, 0.055); }
.log-line.is-error .text { color: #f5a1aa; }
.log-line.is-cloud { border-left-color: rgba(124, 196, 251, 0.55); }
.log-line.is-cloud .text { color: #96cdf7; }

.jump-down {
  position: absolute;
  right: 20px;
  bottom: 74px;
  z-index: 5;
  box-shadow: var(--shadow-lg);
}
.jump-down[hidden] { display: none; }

.console-form {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: rgba(11, 18, 31, 0.86);
}
.console-form .prompt { color: var(--frost); font-family: var(--mono); font-size: 15px; padding-left: 4px; }
.console-form .input {
  font-family: var(--mono);
  font-size: 12.75px;
  border-color: var(--line);
  background: rgba(4, 8, 15, 0.8);
}
.console-note { font-size: 11.5px; color: var(--text-faint); padding: 0 16px 12px; }

/* ---- 16. configuration editor ------------------------------------------- */

.config-editor {
  width: 100%;
  min-height: 480px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 12.75px;
  line-height: 1.62;
  tab-size: 2;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
}

/* ---- 17. modal ---------------------------------------------------------- */

.modal-root {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 6, 12, 0.66);
  backdrop-filter: blur(3px);
  animation: fade var(--fast) both;
}
.modal-root[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }

.modal {
  width: 100%;
  max-width: 428px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(22, 33, 53, 0.98), rgba(12, 19, 33, 0.98));
  box-shadow: var(--shadow-lg);
  animation: rise var(--slow) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(0.985); } }

.modal h3 { padding: 20px 22px 0; font-size: 16px; font-weight: 620; }
.modal .modal-body { padding: 10px 22px 4px; display: flex; flex-direction: column; gap: 14px; }
.modal .modal-body p { font-size: 13px; color: var(--text-dim); }
.modal .modal-foot {
  display: flex; justify-content: flex-end; gap: 9px;
  padding: 18px 22px 20px;
}

/* ---- 18. toasts --------------------------------------------------------- */

.toast-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 300;
  display: flex;
  flex-direction: column-reverse;
  gap: 9px;
  max-width: min(370px, calc(100vw - 40px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.75px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(24, 36, 57, 0.98), rgba(14, 22, 37, 0.98));
  box-shadow: var(--shadow-lg);
  animation: toast-in var(--slow) both;
}
.toast.is-ok { border-color: rgba(79, 216, 207, 0.42); }
.toast.is-bad { border-color: rgba(244, 112, 127, 0.45); }
.toast .mark { flex: none; margin-top: 1px; color: var(--frost); }
.toast.is-ok .mark { color: var(--ok); }
.toast.is-bad .mark { color: var(--bad); }
.toast.is-leaving { animation: toast-out var(--fast) both; }

@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ---- 19. responsive ----------------------------------------------------- */

@media (max-width: 1180px) {
  .content { padding: 22px 22px 64px; }
  .topbar { padding: 13px 22px; }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    border-right: none;
    border-bottom: 1px solid var(--line);
    background: rgba(8, 13, 24, 0.94);
  }
  .sidebar > .brand { padding: 0; }
  .brand-text { display: none; }

  .nav {
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    margin-left: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item { padding: 7px 11px; }

  .sidebar-foot { display: none; }

  .topbar { top: 58px; padding: 12px 18px; gap: 12px; }
  .content { padding: 20px 18px 60px; }
}

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; }
  .topbar-tools { width: 100%; margin-left: 0; justify-content: space-between; }
  .nav-label { display: none; }
  .nav-item { padding: 8px 10px; }
  .nav-count { display: none; }

  /* .is-pair caps the width on a wide screen; on a narrow one it must give that up again. */
  .tiles,
  .tiles.is-pair { grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 11px; }
  .tile-value { font-size: 22px; }

  .card-grid { grid-template-columns: minmax(0, 1fr); }
  .console-log { height: 62vh; min-height: 320px; }
  .detail-head .actions { margin-left: 0; width: 100%; }
  .content { padding: 16px 13px 56px; }
  .toast-root { left: 13px; right: 13px; bottom: 13px; max-width: none; }
}

@media (max-width: 480px) {
  .search { min-width: 0; width: 100%; }
  .search kbd { display: none; }
  .user-chip .who { display: none; }
  .stream-state span:not(.dot) { display: none; }
  .stream-state { padding: 6px; }
}

/* ---- 20. motion preferences --------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
