:root {
  color-scheme: dark;
  font-family: "Tajawal";
  background: #0b1020;
  color: #f8fafc;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top, #172554 0, #0b1020 45%, #070b14 100%); }
button, input { font: inherit; }
.page-shell { min-height: 100vh; display: grid; place-items: center; padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom)); }
.auth-card, .session-card, .health-card, .decision-card, .agents-card { width: min(100%, 760px); border: 1px solid rgba(148,163,184,.22); background: rgba(15,23,42,.94); border-radius: 24px; padding: 28px; box-shadow: 0 28px 80px rgba(0,0,0,.35); }
.page-shell { gap: 18px; align-content: center; }
.brand-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; color: #93c5fd; font-size: 12px; font-weight: 800; letter-spacing: .18em; }
h1, h2 { margin: 0; font-size: clamp(26px, 6vw, 38px); line-height: 1.15; }
.subtitle, .help { color: #94a3b8; }
label { display: block; margin-bottom: 9px; font-weight: 700; }
input { width: 100%; border-radius: 14px; border: 1px solid #334155; background: #0f172a; color: #fff; padding: 14px 15px; outline: none; }
input:focus { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(96,165,250,.15); }
.help { font-size: 14px; line-height: 1.6; }
.error { min-height: 24px; color: #fca5a5; font-weight: 700; }
.primary-button, .secondary-button, .language-button { border: 0; border-radius: 14px; cursor: pointer; font-weight: 800; }
.primary-button { width: 100%; padding: 14px 18px; background: #f8fafc; color: #0f172a; }
.primary-button:disabled { opacity: .55; cursor: wait; }
.secondary-button { margin-top: 20px; padding: 12px 16px; background: #1e293b; color: #f8fafc; }
.language-button { min-width: 48px; padding: 10px 12px; background: #1e293b; color: #bfdbfe; }
.health-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.compact-button { margin-top: 0; white-space: nowrap; }
.health-meta { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; color: #cbd5e1; font-size: 14px; }
.health-meta span { background: #111827; border: 1px solid #334155; border-radius: 999px; padding: 8px 12px; }
.health-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.health-item { border: 1px solid #273449; background: #0b1220; border-radius: 16px; padding: 14px; }
.health-item strong { display: block; margin-bottom: 6px; }
.health-state { font-size: 13px; font-weight: 800; }
.health-state.ok { color: #86efac; }
.health-state.stale, .health-state.unknown { color: #fde68a; }
.health-state.failed { color: #fca5a5; }
.health-detail { margin-top: 6px; color: #94a3b8; font-size: 12px; }
.decision-hero { display: flex; align-items: baseline; gap: 14px; margin: 20px 0; }
.decision-action { font-size: clamp(32px, 8vw, 52px); font-weight: 900; letter-spacing: -.03em; }
.decision-state { color: #94a3b8; font-size: 13px; font-weight: 800; }
.decision-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.decision-metric { border: 1px solid #273449; background: #0b1220; border-radius: 14px; padding: 12px; }
.decision-metric span { display: block; color: #94a3b8; font-size: 12px; margin-bottom: 5px; }
.decision-metric strong { font-size: 15px; }
.decision-section { margin-top: 18px; }
.agents-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 18px; }
.agent-item { border: 1px solid #273449; background: #0b1220; border-radius: 16px; padding: 14px; }
.agent-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.agent-name { font-weight: 900; }
.agent-family { color: #93c5fd; font-size: 12px; font-weight: 800; }
.agent-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.agent-tag { border: 1px solid #334155; border-radius: 999px; padding: 4px 8px; color: #cbd5e1; font-size: 11px; }
.agent-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; color: #94a3b8; font-size: 12px; }
.agent-authority { margin-top: 10px; font-size: 12px; font-weight: 800; }
.agent-authority.safe { color: #86efac; }
.agent-authority.danger { color: #fca5a5; }
.hidden { display: none !important; }
@media (max-width: 560px) {
  .health-grid, .decision-grid, .agents-grid { grid-template-columns: 1fr; }
  .health-heading { align-items: stretch; flex-direction: column; }
}
@media (max-width: 420px) {
  .auth-card, .session-card, .health-card, .decision-card, .agents-card { border-radius: 20px; padding: 22px; }
}
