/* Fonts are self-hosted in static/fonts (see @font-face block below).
   The old build pulled these from fonts.googleapis.com via @import, which
   is render-blocking: the browser can't finish parsing this stylesheet
   (and therefore can't paint the page) until that external CSS file has
   round-tripped to Google's servers, parsed, then round-tripped again for
   the actual woff2 files — on *every* navigation, since this is a classic
   server-rendered multi-page app with no client-side routing. That single
   dependency was very likely the single biggest cause of "slow to load"
   pages. Self-hosting removes the extra DNS lookup + TLS handshake + fetch
   entirely; the fonts now ship from the same origin as everything else. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/inter-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/inter-latin-800-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/space-grotesk-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/space-grotesk-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/space-grotesk-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/jetbrains-mono-latin-700-normal.woff2') format('woff2');
}

/* =========================================================
   OpsLab Server Panel — design tokens
   Signal palette: instrument-panel navy, sapphire/cyan accent.
   Display: Space Grotesk (headings/brand) · Body: Inter
   Data: JetBrains Mono (anything read like a readout)
   ========================================================= */
:root {
  --bg-void: #060a14;
  --bg-panel: #0a0f1e;
  --bg-panel-raised: #101a30;
  --bg-panel-hover: #16233f;
  --border-subtle: #182338;
  --border-strong: #263a5c;

  --accent-deep: #1d3fa8;
  --accent-bright: #3d7bff;
  --accent-ink: #1b2d6b;
  --accent-glow: #4fc7e8;
  --accent-gradient: linear-gradient(135deg, var(--accent-bright), var(--accent-glow));
  --accent-gradient-dim: linear-gradient(135deg, rgba(61,123,255,0.14), rgba(79,199,232,0.14));

  --text-primary: #eaf0fb;
  --text-secondary: #8fa1c4;
  --text-muted: #55648a;

  --ok: #35d19c;
  --ok-dim: rgba(53, 209, 156, 0.14);
  --warn: #e8a53d;
  --warn-dim: rgba(232, 165, 61, 0.14);
  --danger: #f0526e;
  --danger-dim: rgba(240, 82, 110, 0.14);

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --radius-pill: 999px;

  --shadow-card: 0 1px 2px rgba(0,0,0,0.35), 0 14px 32px -20px rgba(0,0,0,0.6);
  --shadow-pop: 0 20px 50px -22px rgba(0,0,0,0.65);
  --shadow-glow: 0 10px 30px -12px rgba(61, 123, 255, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(circle at 10% -10%, rgba(61, 123, 255, 0.10), transparent 42%),
    radial-gradient(circle at 94% 4%, rgba(79, 199, 232, 0.07), transparent 40%),
    linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
  background-size: auto, auto, 42px 42px, 42px 42px;
  background-attachment: fixed;
}

a { color: var(--accent-glow); text-decoration: none; }
a:hover { color: var(--accent-bright); }

*:focus-visible {
  outline: 2px solid var(--accent-glow);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--accent-glow); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-deep); }

.mono { font-family: var(--font-mono); }

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.01em; }

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-void);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 1px 5px;
}

/* =========================================================
   Shell / sidebar
   ========================================================= */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 252px;
  flex-shrink: 0;
  background:
    linear-gradient(180deg, rgba(61,123,255,0.06), transparent 160px),
    var(--bg-panel);
  border-right: 1px solid var(--border-subtle);
  padding: 20px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 20px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-mark {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  letter-spacing: -0.02em;
  box-shadow: 0 6px 16px -6px rgba(61, 123, 255, 0.45);
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  pointer-events: none;
}

.brand-text { line-height: 1.25; }
.brand-text .brand-name {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15.5px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.brand-text .brand-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.14em;
  margin-top: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 500;
  position: relative;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav-link svg { flex-shrink: 0; opacity: 0.75; }
.nav-link:hover { background: var(--bg-panel-hover); color: var(--text-primary); }
.nav-link:hover svg { opacity: 1; }
.nav-link.active {
  background: var(--bg-panel-raised);
  color: var(--text-primary);
  box-shadow: inset 2px 0 0 var(--accent-bright);
}
.nav-link.active svg { opacity: 1; color: var(--accent-bright); }

/* Pinned to the bottom of the sidebar column no matter how many nav
   links sit above it — margin-top:auto on a flex-column parent pushes
   this to the end instead of leaving it floating mid-list. */
.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 12px;
}
.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-gradient);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-user-name { font-size: 12.5px; color: var(--text-primary); font-weight: 600; line-height: 1.3; }
.sidebar-user-role { font-size: 10.5px; color: var(--text-muted); font-family: var(--font-mono); letter-spacing: 0.04em; }

/* =========================================================
   Main content / topbar
   ========================================================= */
.main {
  flex: 1;
  padding: 30px 40px 60px;
  max-width: 1440px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 26px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.page-eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-glow);
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-title { font-family: var(--font-display); font-size: 24px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.page-sub { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

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

/* =========================================================
   Cards / grid
   ========================================================= */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.grid-2 { grid-template-columns: 1fr 1fr; }

.card {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
  position: relative;
}

.card.stat {
  overflow: hidden;
}
.card.stat::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent-gradient);
  opacity: 0.55;
}

.card.danger-outline { border-color: rgba(240, 82, 110, 0.4); }
.card.flush { padding: 0; overflow: hidden; }
.card.tight { margin-bottom: 16px; }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.card-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-value {
  font-size: 27px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
}
.card-value.line { font-size: 18px; }
.card-value small { font-size: 13px; color: var(--text-muted); font-weight: 500; }

.card-meta { color: var(--text-muted); font-size: 12.5px; margin-top: 10px; font-family: var(--font-mono); line-height: 1.7; }

.card.stat .card-header { margin-bottom: 10px; }
.card.stat .card-value { margin-top: 2px; }

/* Trend chip used inline next to a stat card's label */
.trend-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
}
.trend-chip.up { color: var(--ok); background: var(--ok-dim); border-color: rgba(53, 209, 156, 0.3); }
.trend-chip.down { color: var(--danger); background: var(--danger-dim); border-color: rgba(240, 82, 110, 0.3); }
.trend-chip.flat { color: var(--text-muted); background: var(--bg-panel-raised); border-color: var(--border-subtle); }

/* =========================================================
   Chart cards (Dashboard traffic / per-core panels)
   ========================================================= */
.chart-card .card-header { margin-bottom: 2px; }
.chart-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--text-muted); font-family: var(--font-mono); }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend .dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.chart-svg-wrap { margin-top: 6px; }
.chart-svg-wrap svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-axis-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
}

.progress-track {
  height: 6px;
  border-radius: 4px;
  background: var(--border-subtle);
  overflow: hidden;
  margin-top: 12px;
}
.progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: 4px;
  transition: width 0.6s ease;
}
.progress-fill.ok { background: var(--ok); }
.progress-fill.warn { background: var(--warn); }
.progress-fill.danger { background: linear-gradient(135deg, var(--danger), #c93a56); }

/* =========================================================
   Buttons
   ========================================================= */
.btn, .btn-primary, .btn-secondary, .btn-danger, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: none;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.12s ease, border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}
.btn:active, .btn-primary:active, .btn-secondary:active, .btn-danger:active, .btn-ghost:active { transform: translateY(1px); }

.btn-primary, button.btn-primary, input.btn-primary, a.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  width: auto;
}
.btn-primary:hover { filter: brightness(1.1); color: #fff; }

.btn-secondary, button.btn-secondary, a.btn-secondary {
  background: var(--bg-panel-raised);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}
.btn-secondary:hover { color: var(--text-primary); border-color: var(--accent-glow); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}
.btn-ghost:hover { color: var(--text-primary); border-color: var(--border-strong); background: var(--bg-panel-hover); }

.btn-danger, button.btn-danger, a.btn-danger {
  background: var(--bg-panel-raised);
  border: 1px solid var(--border-strong);
  color: var(--danger);
}
.btn-danger:hover { border-color: var(--danger); background: var(--danger-dim); }

.btn-sm { padding: 5px 10px; font-size: 11.5px; border-radius: 6px; }
.btn-block { width: 100%; }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* legacy full-width primary button (auth forms) */
.auth-card .btn-primary { width: 100%; padding: 11px; }

/* =========================================================
   Badges / status
   ========================================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  background: var(--bg-panel-raised);
  white-space: nowrap;
}
.badge-ok { color: var(--ok); border-color: rgba(47, 209, 138, 0.35); background: var(--ok-dim); }
.badge-warn { color: var(--warn); border-color: rgba(240, 171, 30, 0.35); background: var(--warn-dim); }
.badge-danger { color: var(--danger); border-color: rgba(240, 82, 110, 0.35); background: var(--danger-dim); }
.badge-muted { color: var(--text-muted); }

.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--text-muted); flex-shrink: 0; }
.status-dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-dim); }
.status-dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-dim); }
.status-dot.danger { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-dim); }
.status-dot.live { animation: pulse-dot 2s ease-in-out infinite; }

@media (prefers-reduced-motion: no-preference) {
  @keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 0 var(--ok-dim); }
    50% { box-shadow: 0 0 0 4px var(--ok-dim); }
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-panel-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
}
.pill form { margin: 0; }

/* =========================================================
   Tables
   ========================================================= */
.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.data-table thead th {
  text-align: left;
  padding: 12px 18px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255,255,255,0.015);
  white-space: nowrap;
}
table.data-table tbody td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: middle;
}
table.data-table tbody tr:last-child td { border-bottom: none; }
table.data-table tbody tr:hover { background: rgba(255,255,255,0.015); }
table.data-table td.primary { color: var(--text-primary); }
table.data-table td.actions form { display: inline; }

.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13.5px;
}
.empty-state strong { color: var(--text-secondary); display: block; margin-bottom: 4px; font-size: 14px; }

/* =========================================================
   Forms (setup/login + module forms)
   ========================================================= */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-bottom: 22px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 34px 32px;
  box-shadow: var(--shadow-pop);
}

.auth-card h1 { font-family: var(--font-display); font-size: 20px; margin: 0 0 4px; text-align: center; }
.auth-card p.sub { color: var(--text-muted); font-size: 13px; margin: 0 0 24px; text-align: center; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; }
.field-inline { display: flex; align-items: center; gap: 8px; margin: 0; }
.field-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field input:not([type]),
.field select,
.field textarea {
  width: 100%;
  background: var(--bg-void);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-body);
}
.field textarea { font-family: var(--font-mono); font-size: 13px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent-glow);
  box-shadow: 0 0 0 3px rgba(79, 199, 232, 0.18);
}
.field input[type="checkbox"] { width: auto; accent-color: var(--accent-glow); }

.form-errors { color: var(--danger); font-size: 12.5px; margin-top: 4px; }

.flash {
  padding: 11px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 14px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-panel-raised);
}
.flash-error { border-color: var(--danger); color: var(--danger); background: var(--danger-dim); }
.flash-success { border-color: var(--ok); color: var(--ok); background: var(--ok-dim); }
.flash-info { border-color: var(--border-strong); color: var(--text-secondary); }

/* =========================================================
   Log / console panes
   ========================================================= */
.console-pane {
  margin: 0;
  padding: 16px 18px;
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-y: auto;
  color: var(--text-secondary);
}

/* =========================================================
   Log tabs (Logs page)
   ========================================================= */
.tab-row { display: flex; gap: 6px; flex-wrap: wrap; }
.tab-link {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 7px 13px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
}
.tab-link:hover { color: var(--text-primary); }
.tab-link.active { background: var(--bg-panel-raised); color: var(--text-primary); border-color: var(--accent-glow); }

/* =========================================================
   Modals (systemctl create — editor)
   ========================================================= */
.modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(5,2,8,0.72);
  z-index: 100; align-items: center; justify-content: center; padding: 24px;
  backdrop-filter: blur(2px);
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--bg-panel); border: 1px solid var(--border-subtle); border-radius: 12px;
  width: 100%; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--shadow-pop);
}
.modal-browse { max-width: 520px; max-height: 70vh; }
.modal-editor { max-width: 980px; height: 82vh; }
.modal-header {
  display:flex; justify-content:space-between; align-items:center;
  padding: 14px 18px; border-bottom: 1px solid var(--border-subtle);
}
.modal-header h3 { margin: 0; font-size: 14px; font-family: var(--font-mono); }
.modal-close { background:none; border:none; color: var(--text-muted); font-size: 18px; cursor:pointer; line-height:1; }
.modal-close:hover { color: var(--text-primary); }

.browse-list { overflow-y: auto; flex: 1; padding: 6px; }
.browse-item {
  display:flex; align-items:center; gap:8px; padding: 8px 10px; border-radius: 6px;
  cursor: pointer; font-size: 13px; color: var(--text-secondary);
}
.browse-item:hover { background: var(--bg-panel-hover); color: var(--text-primary); }
.browse-item .icon { width: 16px; text-align:center; color: var(--text-muted); }

#monaco-container { flex: 1; min-height: 0; }
.editor-footer { padding: 10px 18px; border-top: 1px solid var(--border-subtle); display:flex; justify-content:flex-end; gap:8px; align-items:center; }
.editor-save-status { font-size: 12px; color: var(--text-muted); margin-right: auto; }

.detect-row { display:flex; gap:8px; align-items:flex-end; margin-bottom: 16px; }
.detect-hint { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; }
.detect-hint.found { color: var(--ok); }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 880px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; flex-direction: row; flex-wrap: wrap; padding: 14px; }
  .brand { border-bottom: none; padding-bottom: 8px; margin-bottom: 0; width: 100%; }
  .sidebar-footer { margin-top: 0; padding-top: 8px; border-top: none; width: 100%; }
  .main { padding: 22px 18px 40px; }
  .grid-2 { grid-template-columns: 1fr; }
}
