/* ═══════════════════════════════════════════════════
   HERMES DASHBOARD — STYLES
   Dark · Minimal · Classy
═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Alfred's Study — Wayne Manor palette */
  --bg:           #0d0b09;
  --bg-card:      #181410;
  --bg-card-2:    #1e1a14;
  --bg-hover:     #252016;
  --border:       rgba(180,150,100,0.08);
  --border-md:    rgba(180,150,100,0.15);
  --border-accent:rgba(180,140,80,0.35);

  --accent:       #c9a84c;
  --accent-dim:   rgba(201,168,76,0.10);
  --accent-glow:  rgba(201,168,76,0.20);

  --green:        #8ba888;
  --green-dim:    rgba(139,168,136,0.12);
  --red:          #b85450;
  --red-dim:      rgba(184,84,80,0.12);
  --yellow:       #c9a84c;
  --yellow-dim:   rgba(201,168,76,0.12);
  --cyan:         #7a9a95;
  --cyan-dim:     rgba(122,154,149,0.12);
  --pink:         #b8847a;
  --pink-dim:     rgba(184,132,122,0.12);

  --text:         #e8e0d5;
  --text-dim:     #a09888;
  --text-muted:   #605850;

  --radius:       8px;
  --radius-sm:    5px;
  --radius-lg:    12px;
  --shadow:       0 4px 32px rgba(0,0,0,0.6);
  --shadow-sm:    0 2px 12px rgba(0,0,0,0.4);

  --font:         'Inter', -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ─── Scrollbar ──────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(139,92,246,0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ─── Header ─────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 28px;
  height: 56px;
  background: rgba(7,7,15,0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hermes-logo {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  font-size: 16px;
  color: var(--accent);
}

.brand-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text);
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-pill {
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  cursor: pointer;
  border: none;
  background: transparent;
  text-decoration: none;
  transition: all 0.15s;
  letter-spacing: 0.03em;
}
.nav-pill:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.nav-pill.active { color: var(--accent); background: var(--accent-dim); }

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
}
.status-badge.online { border-color: rgba(16,185,129,0.3); background: var(--green-dim); }
.status-badge.online .status-dot { background: var(--green); }
.status-badge.offline { border-color: rgba(239,68,68,0.3); }
.status-badge.offline .status-dot { background: var(--red); }

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}
.status-dot.pulse {
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 0 5px rgba(16,185,129,0); }
}

.sync-time {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.btn-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all 0.15s;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border-md); }
.btn-icon.spinning { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Layout ─────────────────────────────────────── */
.dashboard {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 28px 80px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.section {}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.section-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.section-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ─── Card ───────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.2s, background 0.2s;
}
.card:hover { border-color: var(--border-md); background: var(--bg-hover); }

/* ─── Stats Grid ─────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.15s;
  cursor: default;
}
.stat-card:hover { border-color: var(--border-md); transform: translateY(-1px); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent-color, var(--accent));
  opacity: 0;
  transition: opacity 0.2s;
}
.stat-card:hover::before { opacity: 1; }

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 16px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

.stat-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  font-family: var(--font-mono);
}

.stat-sparkline {
  margin-top: 14px;
}

/* ─── Model Breakdown ────────────────────────────── */
.model-breakdown {
  margin-top: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.model-breakdown:empty { display: none; }

.model-breakdown-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.model-table-wrap {
  overflow-x: auto;
}

.model-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.model-table th,
.model-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.model-table th {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.model-table td {
  font-size: 12px;
  color: var(--text);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-table tr:last-child td { border-bottom: 0; }
.model-table th:nth-child(1), .model-table td:nth-child(1) { width: 32%; }
.model-table th:nth-child(2), .model-table td:nth-child(2) { width: 16%; }
.model-table th:nth-child(3), .model-table td:nth-child(3) { width: 14%; }
.model-table th:nth-child(4), .model-table td:nth-child(4) { width: 12%; }
.model-table th:nth-child(5), .model-table td:nth-child(5) { width: 10%; }
.model-table th:nth-child(6), .model-table td:nth-child(6) { width: 16%; }

/* ─── Sparkline SVG ──────────────────────────────── */
.sparkline { display: block; }

/* ─── Gateway Row ────────────────────────────────── */
.gateways-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.gateway-card {
  flex: 1;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: border-color 0.2s;
}
.gateway-card.online { border-left: 3px solid var(--green); }
.gateway-card.degraded { border-left: 3px solid var(--yellow); }
.gateway-card.offline { border-left: 3px solid var(--red); }

.gateway-info { display: flex; align-items: center; gap: 12px; }
.gateway-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.gateway-name { font-size: 14px; font-weight: 600; color: var(--text); }
.gateway-id   { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }

.gateway-stats { text-align: right; }
.gateway-latency { font-size: 18px; font-weight: 700; color: var(--text); font-family: var(--font-mono); }
.gateway-msgs    { font-size: 11px; color: var(--text-muted); }
.gateway-status-badge {
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em;
  padding: 3px 8px; border-radius: 20px; text-transform: uppercase;
}
.gateway-status-badge.online  { background: var(--green-dim); color: var(--green); }
.gateway-status-badge.degraded{ background: var(--yellow-dim); color: var(--yellow); }
.gateway-status-badge.offline { background: var(--red-dim); color: var(--red); }

/* ─── Table ──────────────────────────────────────── */
.table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  padding: 12px 16px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-dim);
  font-size: 13px;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: rgba(255,255,255,0.02); }

.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--border-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--accent);
  flex-shrink: 0;
}

.user-cell { display: flex; align-items: center; gap: 10px; }
.user-name { font-weight: 600; color: var(--text); font-size: 13px; }
.user-handle { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }

.tier-badge {
  padding: 2px 8px; border-radius: 20px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tier-owner { background: var(--accent-dim); color: var(--accent); border: 1px solid var(--border-accent); }
.tier-admin { background: var(--cyan-dim); color: var(--cyan); }
.tier-user  { background: var(--bg-card-2); color: var(--text-muted); }

.ctx-bar-wrap { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.ctx-bar {
  flex: 1; height: 4px; background: rgba(255,255,255,0.06);
  border-radius: 2px; overflow: hidden;
}
.ctx-bar-fill { height: 100%; border-radius: 2px; background: var(--accent); transition: width 0.5s; }
.ctx-bar-fill.warn  { background: var(--yellow); }
.ctx-bar-fill.crit  { background: var(--red); }
.ctx-pct { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); min-width: 34px; }

.action-btns { display: flex; gap: 6px; }
.btn-action {
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-action:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border-md); }
.btn-action.reset:hover { border-color: rgba(239,68,68,0.4); color: var(--red); background: var(--red-dim); }
.btn-action.compact:hover { border-color: rgba(139,92,246,0.4); color: var(--accent); background: var(--accent-dim); }

/* ─── Sessions Grid ──────────────────────────────── */
.sessions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.session-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: border-color 0.2s;
}
.session-card.active { border-color: rgba(16,185,129,0.25); }
.session-card:hover { border-color: var(--border-md); }

.session-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.session-id { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.session-status {
  font-size: 10px; font-weight: 600; letter-spacing: 0.06em;
  padding: 2px 8px; border-radius: 20px; text-transform: uppercase;
}
.session-status.active  { background: var(--green-dim); color: var(--green); }
.session-status.idle    { background: var(--yellow-dim); color: var(--yellow); }
.session-status.closed  { background: rgba(255,255,255,0.05); color: var(--text-muted); }

.session-user { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 12px; }

.session-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.session-metric { }
.sm-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 2px; }
.sm-value { font-size: 14px; font-weight: 600; color: var(--text); font-family: var(--font-mono); }

.session-ctx {
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.session-ctx-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 6px; display: flex; justify-content: space-between; }
.session-ctx-bar { height: 3px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; }
.session-ctx-fill { height: 100%; border-radius: 2px; background: var(--accent); transition: width 0.5s; }

/* ─── Canvas Section ─────────────────────────────── */
.canvas-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
  align-items: start;
}

.canvas-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.canvas-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.tool-group { display: flex; align-items: center; gap: 4px; }
.tool-sep { width: 1px; height: 20px; background: var(--border-md); margin: 0 4px; }

.tool-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: all 0.15s;
}
.tool-btn:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border); }
.tool-btn.active { background: var(--accent-dim); color: var(--accent); border-color: var(--border-accent); }

.color-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s;
}
.color-dot:hover { transform: scale(1.2); }
.color-dot.active { border-color: var(--text); }

.size-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.size-btn:hover, .size-btn.active { background: var(--accent-dim); color: var(--accent); border-color: var(--border-accent); }

#mainCanvas {
  display: block;
  cursor: crosshair;
  background: #0a0a18;
  width: 100%;
  touch-action: none;
}

.canvas-actions {
  display: flex; gap: 6px; margin-left: auto;
}
.canvas-actions .btn-action { font-size: 11px; }

/* ─── Notes Panel ────────────────────────────────── */
.notes-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 500px;
}

.notes-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.notes-list {
  overflow-y: auto;
  flex: 1;
}

.note-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.note-item:last-child { border-bottom: none; }
.note-item.pinned { background: rgba(139,92,246,0.04); }

.note-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.note-time { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); }
.note-type-badge {
  font-size: 9px; font-weight: 600; letter-spacing: 0.08em;
  padding: 2px 6px; border-radius: 10px; text-transform: uppercase;
}
.note-type-badge.system { background: var(--cyan-dim); color: var(--cyan); }
.note-type-badge.info   { background: var(--accent-dim); color: var(--accent); }
.note-type-badge.alert  { background: var(--yellow-dim); color: var(--yellow); }

.note-content { font-size: 12px; color: var(--text-dim); line-height: 1.5; }
.note-pin { font-size: 10px; color: var(--accent); }

/* ─── Health Section ─────────────────────────────── */
.health-grid {
  display: grid;
  grid-template-columns: auto auto auto 1fr 1fr 1fr 1fr;
  gap: 12px;
  align-items: start;
}

.health-ring-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.ring-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.ring-svg { transform: rotate(-90deg); }
.ring-track { fill: none; stroke: rgba(255,255,255,0.06); }
.ring-fill  { fill: none; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }

.ring-label {
  position: absolute;
  text-align: center;
}
.ring-val { font-size: 18px; font-weight: 700; line-height: 1; color: var(--text); display: block; }
.ring-unit { font-size: 9px; color: var(--text-muted); letter-spacing: 0.05em; }

.ring-name { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.ring-goal { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); }

.health-metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hm-icon  { font-size: 18px; }
.hm-value { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1; font-variant-numeric: tabular-nums; }
.hm-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.hm-sub   { font-size: 11px; color: var(--text-muted); }

.health-sparkline-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}

.sparkline-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.sparkline-card-title { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 12px; }

/* ─── Entertainment ──────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.tab-btn {
  padding: 6px 16px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all 0.15s;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: var(--bg-card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.4); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.media-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s;
}
.media-card:hover { transform: translateY(-2px); border-color: var(--border-md); }

.media-cover {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  position: relative;
}

.media-body { padding: 12px; }
.media-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; line-height: 1.3; }
.media-meta  { font-size: 11px; color: var(--text-muted); }

.progress-mini { height: 3px; background: rgba(255,255,255,0.06); border-radius: 2px; overflow: hidden; margin-top: 8px; }
.progress-mini-fill { height: 100%; background: var(--accent); border-radius: 2px; }

.ep-badge {
  position: absolute;
  bottom: 6px; right: 6px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text);
}

.rating-stars {
  display: flex; align-items: center; gap: 4px; margin-top: 6px;
}
.star-val { font-size: 12px; font-weight: 700; color: var(--yellow); }
.star-icon { font-size: 11px; color: var(--yellow); }

.priority-badge {
  display: inline-block;
  padding: 2px 7px; border-radius: 10px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  margin-top: 6px;
}
.priority-high   { background: var(--red-dim); color: var(--red); }
.priority-medium { background: var(--yellow-dim); color: var(--yellow); }
.priority-low    { background: var(--bg-card-2); color: var(--text-muted); }

/* ─── Badge / Pill ───────────────────────────────── */
.badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
}

/* ─── Empty State ────────────────────────────────── */
.empty-state {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ─── Mono Number ────────────────────────────────── */
.mono { font-family: var(--font-mono); }
.green { color: var(--green); }
.red   { color: var(--red); }
.yellow{ color: var(--yellow); }
.cyan  { color: var(--cyan); }
.accent{ color: var(--accent); }

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 900px) {
  .canvas-layout { grid-template-columns: 1fr; }
  .notes-panel { max-height: 300px; }
  .health-grid { grid-template-columns: 1fr 1fr 1fr; }
  .health-sparkline-row { grid-column: 1 / -1; grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .dashboard { padding: 16px 16px 60px; }
  .header { padding: 0 16px; }
  .header-nav { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .health-grid { grid-template-columns: 1fr 1fr; }
}

/* ═══════════════════════════════════════════════════
   EXTENDED STYLES — Multi-page additions
═══════════════════════════════════════════════════ */

/* ─── Modal ──────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 15px; font-weight: 600; color: var(--text); }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); }

/* ─── Saved Canvas Cards ─────────────────────────── */
.cards-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.saved-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.saved-card:hover { transform: translateY(-2px); border-color: var(--border-accent); }
.saved-card-preview {
  height: 130px;
  background: #0a0a18;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.saved-card-body { padding: 12px; }
.saved-card-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.saved-card-meta { display: flex; align-items: center; justify-content: space-between; }

/* ─── Health Profile Banner ──────────────────────── */
.health-profile-banner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 0;
}
.health-banner-inner { display: flex; align-items: center; gap: 20px; }
.health-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 2px solid var(--border-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
}
.health-banner-name { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.health-banner-stats { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.banner-dot { color: var(--border-md); }
.health-banner-changes { display: flex; gap: 24px; margin-left: auto; flex-wrap: wrap; }
.banner-change { text-align: center; }
.bc-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); display: block; margin-bottom: 3px; }
.bc-val { font-size: 16px; font-weight: 700; color: var(--text); }

/* ─── Health Tabs ────────────────────────────────── */
.health-tabs {
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  padding: 3px;
  display: inline-flex;
  gap: 2px;
}

/* ─── Activity Rings Row ─────────────────────────── */
.health-rings-row {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ─── Health Overview Grid ───────────────────────── */
.health-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

/* ─── Body Snapshot ──────────────────────────────── */
.body-snapshot {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}
.body-snap-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
  transition: border-color 0.15s;
}
.body-snap-card:hover { border-color: var(--border-md); }
.body-snap-icon { font-size: 20px; margin-bottom: 8px; }
.body-snap-val  { font-size: 18px; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.body-snap-label{ font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 4px; }
.body-snap-chg  { font-size: 12px; font-family: var(--font-mono); }

/* ─── Charts ─────────────────────────────────────── */
.body-charts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.chart-card-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 14px; }

/* ─── Vitals Grid ────────────────────────────────── */
.vitals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.vital-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color 0.15s;
}
.vital-card:hover { border-color: var(--border-md); }
.vital-icon { font-size: 24px; flex-shrink: 0; }
.vital-val   { font-size: 18px; font-weight: 700; color: var(--text); line-height: 1.1; }
.vital-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; margin-top: 2px; }
.vital-sub   { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* ─── Insights Grid ──────────────────────────────── */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.insight-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  transition: border-color 0.15s, transform 0.15s;
}
.insight-card:hover { border-color: var(--border-md); transform: translateY(-1px); }
.insight-val   { font-size: 18px; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.insight-label { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.insight-sub   { font-size: 11px; color: var(--text-muted); }

/* ─── Streaming Sites Grid ───────────────────────── */
.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.site-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.site-card:hover { border-color: var(--border-accent); transform: translateY(-1px); }
.site-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.site-name { font-size: 15px; font-weight: 700; color: var(--text); }
.site-desc { font-size: 12px; color: var(--text-dim); line-height: 1.5; margin-bottom: 12px; }
.site-footer { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.site-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.site-tag { font-size: 10px; color: var(--text-muted); background: rgba(255,255,255,0.04); padding: 2px 7px; border-radius: 10px; }

/* ─── Radius / border fixes ──────────────────────── */
.login-input[style*="cursor:pointer"] { -webkit-appearance: none; appearance: none; }
textarea.login-input { line-height: 1.5; }

/* ─── Responsive extras ──────────────────────────── */
@media (max-width: 640px) {
  .health-banner-inner { flex-wrap: wrap; }
  .health-banner-changes { margin-left: 0; width: 100%; justify-content: space-between; }
  .body-charts { grid-template-columns: 1fr; }
}

/* Chart canvas explicit min-height so Chart.js works in hidden tabs */
.chart-card canvas { display: block; min-height: 180px; }

/* ═══════════════════════════════════════════════════
   OBSIDIAN / SECOND BRAIN
═══════════════════════════════════════════════════ */

/* Vault stats strip */
.vault-stats { display:flex; gap:12px; flex-wrap:wrap; margin-bottom:4px; }
.vault-stat-card { background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius-sm); padding:12px 18px; display:flex; align-items:center; gap:10px; flex:1; min-width:120px; }
.vault-stat-icon { font-size:18px; }
.vault-stat-val  { font-size:22px; font-weight:700; color:var(--text); }
.vault-stat-label{ font-size:11px; color:var(--text-muted); text-transform:uppercase; letter-spacing:.08em; }

/* Graph layout */
.vault-layout { display:grid; grid-template-columns:1fr 280px; gap:14px; align-items:start; }

/* Graph container */
.graph-container { background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.graph-toolbar   { display:flex; align-items:center; gap:10px; padding:10px 14px; border-bottom:1px solid var(--border); flex-wrap:wrap; }
.graph-search    { background:var(--bg); border:1px solid var(--border-md); border-radius:var(--radius-sm); padding:6px 12px; font-size:12px; color:var(--text); font-family:var(--font); outline:none; width:180px; transition:border-color .15s; }
.graph-search:focus { border-color:var(--accent); }
.graph-legend    { display:flex; gap:8px; flex-wrap:wrap; }
.legend-item     { display:flex; align-items:center; gap:5px; font-size:11px; color:var(--text-muted); cursor:pointer; padding:2px 6px; border-radius:4px; transition:background .15s; }
.legend-item:hover { background:rgba(255,255,255,0.05); color:var(--text); }
.legend-dot      { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
#graphSvg        { width:100%; display:block; background:#080813; cursor:grab; }
#graphSvg:active { cursor:grabbing; }

/* D3 elements */
.graph-link { stroke:rgba(139,92,246,0.25); stroke-width:1; }
.node-circle { cursor:pointer; transition:r .2s; }
.node-circle:hover { opacity:1 !important; }
.graph-node:hover .node-label { opacity:1 !important; }
.node-label { transition:opacity .2s; }

/* Note panel */
.note-panel { background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); padding:20px; min-height:340px; display:flex; flex-direction:column; }
.note-panel-empty { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; color:var(--text-muted); }
.note-title { font-size:16px; font-weight:700; color:var(--text); margin-bottom:10px; line-height:1.3; }
.note-meta-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-bottom:12px; }
.note-folder-badge { padding:2px 8px; border-radius:10px; font-size:10px; font-weight:600; letter-spacing:.06em; }
.note-excerpt { font-size:13px; color:var(--text-dim); line-height:1.6; margin-bottom:14px; padding-bottom:14px; border-bottom:1px solid var(--border); }
.note-connections { margin-bottom:12px; }
.conn-item { display:flex; align-items:center; gap:8px; padding:5px 8px; border-radius:6px; cursor:pointer; font-size:12px; color:var(--text-dim); transition:background .15s; }
.conn-item:hover { background:var(--bg-hover); color:var(--text); }
.conn-dot { width:6px; height:6px; border-radius:50%; flex-shrink:0; }
.note-tags { display:flex; flex-wrap:wrap; gap:5px; }

/* Query Chat */
.query-area { background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
.query-history { max-height:340px; overflow-y:auto; padding:16px; display:flex; flex-direction:column; gap:12px; }
.query-msg  { display:flex; align-items:flex-end; gap:8px; }
.query-msg.user { flex-direction:row-reverse; }
.query-bubble { max-width:85%; padding:10px 14px; border-radius:12px; font-size:13px; line-height:1.55; }
.user-bubble  { background:var(--accent); color:#fff; border-radius:12px 12px 2px 12px; }
.bot-bubble   { background:var(--bg-card-2); border:1px solid var(--border); color:var(--text-dim); border-radius:12px 12px 12px 2px; }
.query-bot-icon { width:28px; height:28px; border-radius:50%; background:var(--accent-dim); border:1px solid var(--border-accent); display:flex; align-items:center; justify-content:center; font-size:13px; color:var(--accent); flex-shrink:0; }
.query-input-row { display:flex; gap:0; border-top:1px solid var(--border); }
.query-input { flex:1; background:transparent; border:none; padding:14px 16px; font-size:13px; color:var(--text); font-family:var(--font); outline:none; }
.query-input::placeholder { color:var(--text-muted); }
.query-send  { padding:12px 20px; background:var(--accent); border:none; color:#fff; font-size:13px; font-weight:600; cursor:pointer; font-family:var(--font); transition:opacity .15s; white-space:nowrap; }
.query-send:hover { opacity:.88; }
.query-chips { display:flex; gap:6px; flex-wrap:wrap; padding:10px 16px; border-top:1px solid var(--border); background:rgba(0,0,0,0.1); }
.query-chip  { padding:5px 12px; border-radius:20px; border:1px solid var(--border); background:transparent; color:var(--text-dim); font-size:11px; cursor:pointer; font-family:var(--font); transition:all .15s; }
.query-chip:hover { background:var(--accent-dim); color:var(--accent); border-color:var(--border-accent); }
.query-result-item { display:flex; align-items:center; gap:6px; padding:4px 6px; border-radius:5px; cursor:pointer; transition:background .15s; }
.query-result-item:hover { background:rgba(255,255,255,0.06); }
.query-sources { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; padding-top:8px; border-top:1px solid var(--border); }
.query-source-pill { max-width:100%; padding:4px 8px; border:1px solid var(--border); border-radius:6px; color:var(--text-muted); font-size:11px; line-height:1.35; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* ═══════════════════════════════════════════════════
   HEALTH REDESIGN
═══════════════════════════════════════════════════ */

/* Activity rings */
.rings-wrap { display:flex; gap:20px; flex-wrap:wrap; }
.ring-card  { display:flex; flex-direction:column; align-items:center; gap:0; }

/* Mini charts row — 3 col */
.mini-charts-row { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }

/* Body metric picker tabs */
.body-metric-tabs { display:flex; gap:6px; flex-wrap:wrap; padding-bottom:12px; border-bottom:1px solid var(--border); margin-bottom:4px; }
.metric-tab { padding:5px 12px; border-radius:6px; border:1px solid var(--border); background:transparent; color:var(--text-muted); font-size:11px; font-weight:600; cursor:pointer; font-family:var(--font); transition:all .15s; }
.metric-tab:hover { color:var(--text); border-color:var(--border-md); }
.metric-tab.active { font-weight:700; }

/* Body chart annotation */
.body-chart-annotation { display:flex; align-items:center; gap:12px; flex-wrap:wrap; font-size:12px; padding:8px 0 0; color:var(--text-dim); }

/* ═══════════════════════════════════════════════════
   MOBILE — Bottom nav + responsive overrides
═══════════════════════════════════════════════════ */

.mobile-nav { display:none; }

@media (max-width:768px) {
  /* Vault graph stacks */
  .vault-layout { grid-template-columns:1fr; }
  .note-panel   { min-height:200px; }

  /* Mini charts single col */
  .mini-charts-row { grid-template-columns:1fr; }

  /* Rings wrap scrollable */
  .rings-wrap { flex-wrap:nowrap; overflow-x:auto; padding-bottom:6px; -webkit-overflow-scrolling:touch; }
  .rings-wrap::-webkit-scrollbar { height:3px; }

  /* Body snapshot 2-col */
  .body-snapshot { grid-template-columns:repeat(2,1fr); }

  /* Insights 2-col */
  .insights-grid { grid-template-columns:repeat(2,1fr); }

  /* Overview grid 2-col */
  .health-overview-grid { grid-template-columns:repeat(2,1fr); }

  /* Query chat */
  .query-chips { gap:4px; }
  .query-chip  { font-size:10px; padding:4px 9px; }

  /* Stats grid */
  .stats-grid { grid-template-columns:repeat(2,1fr); }

  /* Body metric tabs wrap nicely */
  .body-metric-tabs { gap:4px; }
  .metric-tab { font-size:10px; padding:4px 9px; }
}

@media (max-width:640px) {
  /* Show mobile bottom nav, hide top nav */
  .header-nav { display:none; }
  .header-right .sync-time { display:none; }
  .mobile-nav {
    display:flex;
    position:fixed;
    bottom:0; left:0; right:0;
    background:rgba(7,7,15,0.95);
    backdrop-filter:blur(16px);
    -webkit-backdrop-filter:blur(16px);
    border-top:1px solid var(--border);
    z-index:90;
    padding:6px 0 env(safe-area-inset-bottom,0);
  }
  .mobile-nav-item {
    flex:1; display:flex; flex-direction:column; align-items:center; gap:3px;
    padding:8px 4px; text-decoration:none; color:var(--text-muted);
    font-size:9px; letter-spacing:.04em; text-transform:uppercase;
    transition:color .15s;
  }
  .mobile-nav-item.active { color:var(--accent); }
  .mobile-nav-icon { font-size:17px; line-height:1; }
  .mobile-nav-label { font-size:9px; }

  /* Push content above bottom nav */
  .dashboard { padding-bottom:80px !important; }

  /* Header compact */
  .header { padding:0 14px; }
  .brand-sub { display:none; }

  /* Full-width tables scroll */
  .table-wrapper { overflow-x:auto; }
  .data-table { min-width:560px; }

  /* Health banner compact */
  .health-banner-changes { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; width:100%; }
  .banner-change { text-align:left; }

  /* Graph search full width */
  .graph-search { width:100% !important; }

  /* Sessions single col */
  .sessions-grid { grid-template-columns:1fr; }

  /* Gateways single col */
  .gateways-row { flex-direction:column; }
}

/* ═══════════════════════════════════════════════════
   UPGRADE — Toast · Modal · Insight Cards · Timeline
   Skeleton · Skills · Cron
═══════════════════════════════════════════════════ */

/* ─── Toast ─────────────────────────────────────── */
.toast-container {
  position:fixed; top:20px; right:20px; z-index:9999;
  display:flex; flex-direction:column; gap:8px; pointer-events:none;
}
.toast {
  padding:11px 18px; border-radius:var(--radius-sm); font-size:13px;
  font-family:var(--font); pointer-events:all;
  animation:slideIn .28s ease;
  max-width:380px; border:1px solid transparent;
}
.toast-info    { background:var(--cyan-dim);   border-color:rgba(6,182,212,.3);  color:var(--cyan);  }
.toast-success { background:var(--green-dim);  border-color:rgba(16,185,129,.3); color:var(--green); }
.toast-warning { background:var(--yellow-dim); border-color:rgba(245,158,11,.3); color:var(--yellow);}
.toast-error   { background:var(--red-dim);    border-color:rgba(239,68,68,.3);  color:var(--red);   }
@keyframes slideIn  { from { transform:translateX(110%); opacity:0; } to { transform:translateX(0); opacity:1; } }
@keyframes slideOut { from { transform:translateX(0);    opacity:1; } to { transform:translateX(110%); opacity:0; } }

/* ─── Skeleton ───────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { 0% {background-position:200% 0;} 100% {background-position:-200% 0;} }

/* ─── Alfred Insight Card ────────────────────────── */
.alfred-insight-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  border-left: 3px solid var(--accent);
  margin-bottom: 10px;
  transition: transform .15s;
}
.alfred-insight-card:hover { transform: translateX(2px); }
.alfred-insight-card.severity-critical { border-left-color: var(--red); }
.alfred-insight-card.severity-warning  { border-left-color: var(--yellow); }
.alfred-insight-card.severity-info     { border-left-color: var(--cyan); }
.alfred-insight-card.severity-positive { border-left-color: var(--green); }
.alfred-insight-card.severity-milestone{ border-left-color: var(--yellow); }
.alfred-insight-card.severity-gap      { border-left-color: var(--text-muted); }
.alfred-insight-card.severity-observation { border-left-color: var(--accent); }

.insight-card-header {
  display:flex; align-items:center; gap:10px; margin-bottom:8px;
}
.insight-icon      { font-size:15px; flex-shrink:0; }
.insight-title-text{ font-size:13px; font-weight:600; color:var(--text); flex:1; }
.insight-time      { font-size:11px; color:var(--text-muted); white-space:nowrap; font-family:var(--font-mono); }
.insight-body-text { font-size:12px; color:var(--text-dim); line-height:1.6; margin-bottom:8px; }
.insight-suggestion {
  margin-top:6px; border-radius:var(--radius-sm);
  background:rgba(255,255,255,0.03); border:1px solid var(--border);
}
.insight-suggestion summary {
  padding:6px 10px; font-size:11px; color:var(--accent); cursor:pointer;
  list-style:none; font-weight:600; letter-spacing:.04em;
}
.insight-suggestion-body {
  padding:10px; font-size:12px; color:var(--text-dim); line-height:1.6;
  border-top:1px solid var(--border);
}
.insight-source {
  font-size:10px; color:var(--text-muted); text-transform:uppercase;
  letter-spacing:.07em; margin-top:6px;
}
.insights-list { display:flex; flex-direction:column; gap:0; }
.agent-insight-shell {
  display:grid; grid-template-columns:32px minmax(0,1fr) 32px; align-items:stretch; gap:10px;
}
.agent-insight-rail {
  display:flex; gap:12px; overflow-x:auto; scroll-snap-type:x mandatory;
  scrollbar-width:thin; padding:2px 0 8px;
}
.agent-insight-card {
  min-width:min(430px, 86vw); scroll-snap-align:start;
  background:var(--bg-card); border:1px solid var(--border); border-left:3px solid var(--accent);
  border-radius:8px; padding:14px; display:flex; flex-direction:column; gap:9px;
}
.agent-insight-card.severity-critical { border-left-color:var(--red); }
.agent-insight-card.severity-warning { border-left-color:var(--yellow); }
.agent-insight-card.severity-info { border-left-color:var(--cyan); }
.agent-insight-card.severity-positive { border-left-color:var(--green); }
.agent-insight-top,
.agent-insight-meta {
  display:flex; justify-content:space-between; gap:10px; color:var(--text-muted);
  font-size:10px; text-transform:uppercase; letter-spacing:.07em;
}
.agent-insight-card h3 { margin:0; font-size:15px; line-height:1.35; color:var(--text); }
.agent-insight-card p { margin:0; font-size:12px; line-height:1.55; color:var(--text-dim); }
.agent-insight-action {
  font-size:12px; color:var(--text); background:rgba(255,255,255,.035);
  border:1px solid var(--border); border-radius:6px; padding:8px 10px; line-height:1.45;
}
.agent-insight-caveats summary,
.agent-insight-evidence-btn {
  color:var(--accent); font-size:11px; font-weight:600; cursor:pointer;
}
.agent-insight-evidence-btn {
  border:0; background:transparent; padding:0; text-align:left; font-family:var(--font);
}
.agent-insight-evidence {
  border-top:1px solid var(--border); padding-top:8px; display:grid; gap:6px;
}
.agent-evidence-row {
  display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px 10px;
  font-size:11px; color:var(--text-dim);
}
.agent-evidence-row strong { color:var(--text); font-family:var(--font-mono); }
.agent-evidence-row em {
  grid-column:1/-1; color:var(--text-muted); font-style:normal; font-size:10px;
}
.agent-insight-nav {
  width:32px; border:1px solid var(--border); border-radius:8px; background:var(--bg-card);
  color:var(--text-dim); display:flex; align-items:center; justify-content:center;
}
.agent-insight-nav:hover { color:var(--text); border-color:var(--border-md); }

/* ─── Timeline ───────────────────────────────────── */
.timeline-feed {
  display:flex; flex-direction:column; gap:0;
  border-left:2px solid var(--border);
  margin-left:18px; padding-left:0;
}
.timeline-event {
  display:flex; gap:16px; padding:14px 0 14px 22px;
  border-bottom:1px solid var(--border);
  position:relative;
}
.timeline-event:last-child { border-bottom:none; }
.tl-dot {
  position:absolute; left:-11px; top:16px;
  width:20px; height:20px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:10px; font-weight:700; border:2px solid;
  flex-shrink:0; background:var(--bg-card);
}
.tl-content { flex:1; min-width:0; }
.tl-header  { display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin-bottom:4px; }
.tl-title   { font-size:13px; font-weight:600; color:var(--text); }
.tl-time    { font-size:11px; color:var(--text-muted); white-space:nowrap; font-family:var(--font-mono); }
.tl-body    { font-size:12px; color:var(--text-dim); line-height:1.5; margin-bottom:4px; }
.tl-meta    { display:flex; gap:8px; align-items:center; }
.tl-type-badge {
  font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:.07em;
}

/* ─── Skills ─────────────────────────────────────── */
.skills-grid {
  display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:12px;
}
.skill-card {
  background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius);
  padding:16px; cursor:pointer; transition:border-color .15s, transform .15s;
}
.skill-card:hover { border-color:var(--border-accent); transform:translateY(-1px); }
.skill-disabled   { opacity:.5; }
.skill-card-header { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.skill-icon { font-size:16px; color:var(--accent); flex-shrink:0; }
.skill-name { font-size:14px; font-weight:600; color:var(--text); flex:1; }
.skill-toggle { flex-shrink:0; cursor:pointer; }
.skill-desc { font-size:12px; color:var(--text-dim); line-height:1.5; margin-bottom:10px; }
.skill-meta { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }

/* ─── Cron Jobs ──────────────────────────────────── */
.cron-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:12px; }
.cron-card {
  background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius); padding:16px;
}
.cron-card-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.cron-name     { font-size:13px; font-weight:600; color:var(--text); }
.cron-status   { font-size:11px; font-weight:600; }
.cron-schedule { font-size:12px; color:var(--text-muted); margin-bottom:10px; }
.cron-meta     { display:flex; align-items:center; justify-content:space-between; font-size:11px; color:var(--text-muted); }

/* ─── Responsive extras for new pages ────────────── */
@media (max-width:768px) {
  .skills-grid { grid-template-columns:1fr; }
  .cron-grid   { grid-template-columns:1fr; }
  .timeline-feed { margin-left:12px; }
}

/* ─── Health Expansion: Nutrition, Training, Score ───────────────────── */
.health-feature-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.login-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-md);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
  font-family: var(--font);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.login-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.login-input::placeholder { color: var(--text-muted); }

.btn-primary,
.btn-secondary {
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  color: var(--text);
  font: 600 12px var(--font);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--accent-dim); color: var(--accent); }
.btn-primary:hover { background: var(--accent-glow); border-color: var(--accent); }
.btn-secondary { background: var(--bg-card); color: var(--text-dim); }
.btn-secondary:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border-md); }
.btn-primary:disabled,
.btn-secondary:disabled { opacity: .55; cursor: wait; }

.quick-add-form { display: flex; flex-direction: column; gap: 12px; }
.quick-add-form label { display: flex; flex-direction: column; gap: 6px; }
.quick-add-form label span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.form-row.compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.nutrition-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 10px;
}
.nutrition-summary-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.nutrition-summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.nutrition-summary-top span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.nutrition-summary-top strong {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
}
.nutrition-target-bar,
.score-category-bar {
  height: 6px;
  background: rgba(255,255,255,.06);
  border-radius: 4px;
  overflow: hidden;
}
.nutrition-target-bar span,
.score-category-bar span {
  display: block;
  height: 100%;
  max-width: 100%;
  background: var(--accent);
  border-radius: inherit;
}
.nutrition-target-label {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 10px;
  font-family: var(--font-mono);
}

.meal-group { margin-bottom: 14px; }
.meal-group:last-child { margin-bottom: 0; }
.meal-group-title {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.meal-entry {
  background: rgba(255,255,255,.025);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
}
.meal-entry-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.meal-entry strong { color: var(--text); text-transform: capitalize; }
.meal-entry p {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
}
.meal-macros {
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: right;
  white-space: nowrap;
}
.meal-items { display: grid; gap: 4px; }
.meal-food-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-dim);
  font-size: 12px;
}
.meal-food-item em {
  color: var(--text-muted);
  font-style: normal;
  font-size: 11px;
}

.workout-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}
.workout-card.push { border-left: 3px solid #ef4444; }
.workout-card.pull { border-left: 3px solid #3b82f6; }
.workout-card.legs { border-left: 3px solid #10b981; }
.workout-card.rest { border-left: 3px solid #6b7280; }
.workout-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.workout-card h3 {
  margin-top: 4px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.1;
}
.workout-status {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}
.exercise-list { display: grid; gap: 8px; }
.exercise-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center;
  background: rgba(255,255,255,.025);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
}
.exercise-main strong { color: var(--text); font-size: 13px; }
.exercise-main p { color: var(--text-muted); font-size: 11px; margin-top: 2px; }
.exercise-check { position: relative; width: 22px; height: 22px; cursor: pointer; }
.exercise-check input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.exercise-check span {
  display: block;
  width: 22px;
  height: 22px;
  border: 1px solid var(--border-md);
  border-radius: 5px;
  background: var(--bg);
}
.exercise-check input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
}
.exercise-check input:checked + span::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 3px;
  width: 6px;
  height: 12px;
  border: solid var(--bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(78px, 1fr));
  gap: 8px;
  overflow-x: auto;
}
.week-day {
  min-height: 74px;
  border: 1px solid var(--border);
  border-top: 3px solid #6b7280;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  padding: 10px;
}
.week-day span {
  display: block;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.week-day strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 13px;
}
.week-day.complete { background: var(--green-dim); }
.push { border-color: #ef4444; }
.pull { border-color: #3b82f6; }
.legs { border-color: #10b981; }
.rest { border-color: #6b7280; }
.week-day.push { border-top-color: #ef4444; }
.week-day.pull { border-top-color: #3b82f6; }
.week-day.legs { border-top-color: #10b981; }
.week-day.rest { border-top-color: #6b7280; }

.score-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
  align-items: stretch;
}
.score-gauge {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.score-gauge-svg { width: 220px; height: 220px; }
.score-gauge-track {
  fill: none;
  stroke: rgba(255,255,255,.06);
  stroke-width: 15;
}
.score-gauge-ring {
  fill: none;
  stroke: url(#scoreGradient);
  stroke-width: 15;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 95px 95px;
  transition: stroke-dashoffset .8s ease;
}
.score-gauge-value {
  font-size: 42px;
  font-weight: 800;
  font-family: var(--font-mono);
}
.score-gauge-label {
  fill: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.score-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.score-category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.score-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.score-category-head span {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.score-category-head strong {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 18px;
}

.recommendations-list { display: grid; gap: 10px; }
.recommendation-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-md);
  border-radius: var(--radius);
  padding: 16px;
}
.recommendation-card.priority-high { border-left-color: #ef4444; }
.recommendation-card.priority-medium { border-left-color: #c9a84c; }
.recommendation-card.priority-low { border-left-color: #6b7280; }
.recommendation-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.recommendation-category {
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.recommendation-card h3 {
  color: var(--text);
  font-size: 15px;
  margin-top: 3px;
}
.recommendation-card p {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 8px;
}
.recommendation-card ul {
  margin: 0 0 8px 18px;
  color: var(--text-dim);
  font-size: 12px;
}
.recommendation-based {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

@media (max-width: 900px) {
  .health-feature-grid,
  .score-layout { grid-template-columns: 1fr; }
  .nutrition-summary,
  .score-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .week-strip { grid-template-columns: repeat(7, minmax(96px, 1fr)); }
}

@media (max-width: 560px) {
  .nutrition-summary,
  .score-category-grid,
  .form-row,
  .form-row.compact { grid-template-columns: 1fr; }
  .meal-entry-head,
  .workout-card-head,
  .recommendation-head { flex-direction: column; align-items: flex-start; }
  .meal-macros { text-align: left; white-space: normal; }
}
