:root {
  color-scheme: dark;
  --bg:#10151c; --panel:#19212b; --input:#111820; --border:#526173;
  --line:#303d4c; --text:#edf2f7; --muted:#acbac9; --accent:#9ac1ff;
  --ok:#96e5bc; --warn:#f5ce85; --bad:#ffb4af; --focus:#f5ce85;
}
* { box-sizing:border-box; }
body { margin:0; background:var(--bg); color:var(--text); font:16px/1.55 system-ui,sans-serif; }
a { color:var(--accent); text-underline-offset:4px; }
a:hover { color:#d3e4ff; }
button,input,select,textarea { font:inherit; }
button,a,input,select,textarea,summary { -webkit-tap-highlight-color:transparent; }
:focus-visible { outline:3px solid var(--focus); outline-offset:4px; }
[tabindex="-1"]:focus { outline:2px solid var(--focus); outline-offset:4px; }
.skip-link { position:absolute; left:16px; top:-100px; background:var(--panel); padding:12px; z-index:10; }
.skip-link:focus { top:8px; }
.site-header { border-bottom:1px solid var(--line); display:flex; gap:32px; align-items:center; padding:16px max(24px,calc((100vw - 1120px)/2)); }
.brand { display:flex; align-items:center; gap:10px; font-weight:750; color:var(--text); text-decoration:none; white-space:nowrap; }
.brand-mark { display:grid; place-items:center; width:30px; height:30px; background:var(--accent); color:var(--bg); border-radius:8px; font-size:18px; }
nav { display:flex; gap:20px; flex-wrap:wrap; }
nav a { display:inline-flex; align-items:center; min-height:44px; color:var(--muted); text-decoration:none; }
nav a[aria-current] { color:var(--text); box-shadow:inset 0 -2px var(--accent); }
.logout { margin-left:auto; }
main { max-width:1168px; padding:36px 24px; margin:auto; min-height:70vh; }
footer { max-width:1168px; margin:auto; padding:24px; border-top:1px solid var(--line); color:var(--muted); font-size:13px; }
h1 { font-size:30px; letter-spacing:-.7px; line-height:1.25; margin:4px 0 10px; overflow-wrap:anywhere; }
h2 { font-size:20px; line-height:1.35; margin:0 0 12px; }
h3,legend { font-size:17px; font-weight:650; margin:0 0 16px; }
p { margin:0 0 16px; }
small,.hint,.eyebrow { color:var(--muted); font-size:13px; }
.eyebrow { font-weight:650; letter-spacing:.08em; text-transform:uppercase; }
.lead { color:var(--muted); max-width:760px; }
.page-heading { display:flex; justify-content:space-between; align-items:start; gap:20px; margin-bottom:28px; }
.panel,details.panel { background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:24px; margin-bottom:20px; }
.stack > * + * { margin-top:16px; }
.grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:22px 28px; }
.field { min-width:0; }
label { display:block; font-size:14px; font-weight:650; margin:0 0 7px; }
input:not([type="hidden"]):not([type="checkbox"]),select,textarea { display:block; width:100%; min-height:46px; border:1px solid var(--border); border-radius:7px; background:var(--input); color:var(--text); padding:10px 12px; }
input::placeholder,textarea::placeholder { color:#9baabd; opacity:1; }
textarea { resize:vertical; font-family:ui-monospace,monospace; font-size:14px; }
.hint { margin:7px 0 0; }
button,.button { display:inline-flex; justify-content:center; align-items:center; min-height:44px; border-radius:7px; padding:10px 18px; border:1px solid transparent; background:var(--accent); color:#112138; font-weight:650; cursor:pointer; text-decoration:none; }
button:hover,.button:hover { background:#c0d8ff; color:#112138; }
button.secondary,.button.secondary { background:transparent; color:var(--text); border-color:var(--border); }
button.quiet { background:transparent; color:var(--muted); padding:8px; }
button.danger { background:#f7aaa6; color:#381715; }
button:disabled { opacity:.65; cursor:wait; }
.actions { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-top:20px; }
.actions form { margin:0; }
.inline-form { display:flex; align-items:end; gap:12px; flex-wrap:wrap; }
.inline-form .field { flex:1; min-width:180px; }
.notice { border-left:3px solid var(--accent); padding:14px 18px; background:#1b2b3e; border-radius:4px; margin:0 0 20px; }
.notice p:last-child { margin-bottom:0; }
.notice.warning { background:#302b23; border-color:var(--warn); }
.notice.success { background:#18332a; border-color:var(--ok); }
.notice.error { background:#382527; border-color:var(--bad); }
.notice.error a { color:var(--bad); }
.notice ul { margin:10px 0 0; padding-left:22px; }
.field-error { color:var(--bad); font-size:14px; margin:6px 0 0; }
[aria-invalid="true"] { border-color:var(--bad) !important; }
.badge { display:inline-block; padding:4px 10px; background:#283543; color:var(--muted); border-radius:6px; font-size:13px; font-weight:650; }
.badge.ready { background:#1a362c; color:var(--ok); }
.badge.paused { background:#3a3122; color:var(--warn); }
.badge.quarantined,.badge.failed { background:#3b272a; color:var(--bad); }
.stat-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin:24px 0; }
.stat { border:1px solid var(--line); background:var(--panel); padding:18px 22px; border-radius:10px; }
.stat strong { display:block; font-size:28px; line-height:1.25; }
.stat span { color:var(--muted); font-size:14px; }
.account-list { list-style:none; padding:0; margin:20px 0 0; }
.account-row { display:flex; align-items:center; gap:24px; padding:20px 0; border-top:1px solid var(--line); }
.account-row:first-child { border-top:0; padding-top:0; }
.account-row:last-child { padding-bottom:0; }
.account-identity { flex:1; min-width:0; }
.account-identity a { color:var(--text); font-weight:650; overflow-wrap:anywhere; }
.account-identity .hint { margin-top:5px; }
.account-meta { display:flex; gap:24px; align-items:center; }
.account-meta small { display:block; }
summary { cursor:pointer; min-height:44px; font-weight:650; padding:8px 0; }
summary .hint { display:block; font-weight:400; margin-left:19px; }
details[open] > summary { margin-bottom:20px; }
details.advanced { border-top:1px solid var(--line); margin-top:24px; padding-top:12px; }
fieldset { min-width:0; border:0; padding:0; margin:24px 0 0; }
fieldset + fieldset { border-top:1px solid var(--line); padding-top:24px; }
.check { display:flex; align-items:start; gap:10px; font-weight:400; min-height:44px; margin:0; padding:9px 0; }
.check input { width:20px; height:20px; flex-shrink:0; }
.section-nav { display:flex; flex-wrap:wrap; gap:8px 24px; margin:0 0 24px; }
.section-nav a { min-height:44px; display:inline-flex; align-items:center; }
.empty { padding:24px 0; }
.state-line { display:flex; align-items:center; gap:16px; flex-wrap:wrap; }
.state-line h2 { margin:0; }
.table-scroll { overflow:auto; }
table { width:100%; border-collapse:collapse; font-size:14px; }
th,td { padding:12px; text-align:left; border-bottom:1px solid var(--line); vertical-align:top; }
th { color:var(--muted); font-weight:500; }
td { overflow-wrap:anywhere; }
dt { color:var(--muted); } dd { margin:0 0 12px; overflow-wrap:anywhere; }
code { overflow-wrap:anywhere; }
.login-panel { max-width:440px; margin:36px auto; }
.result:empty { display:none; }
.result:not(:empty) { margin-top:18px; }
.save-bar { border-top:1px solid var(--line); margin-top:24px; padding-top:20px; }
.dirty { font-size:14px; color:var(--warn); }
[hidden] { display:none !important; }
@media (max-width:760px) {
  .site-header { flex-wrap:wrap; gap:8px 16px; padding:12px 16px; }
  .site-header nav { order:3; width:100%; gap:22px; }
  main { padding:24px 16px; }
  h1 { font-size:26px; }
  .panel,details.panel { padding:20px; }
  .grid { grid-template-columns:1fr; gap:20px; }
  .stat { padding:14px; } .stat strong { font-size:24px; }
  .stat-grid { gap:8px; }
  .page-heading { display:block; }
  .account-row { flex-wrap:wrap; gap:12px; }
  .account-identity { flex-basis:100%; }
  .account-meta { flex:1; flex-wrap:wrap; gap:12px; }
  .account-row .button { padding:8px 12px; }
}
@media (max-width:380px) {
  .stat-grid { grid-template-columns:1fr; }
  .stat { display:flex; align-items:center; gap:14px; }
}
