/* Layout : rail blanc à pilules rouges (la barre du site), bandeau-build crépuscule
   en tête de la vue d'ensemble, cartes à filet sans ombre, accents rouge/vert du site. */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f4f3;
  --surface-3: #ecebea;
  --ink: #323131;
  --text: #3b3838;
  --body: #6b6b6b;
  --muted: #8a8a8a;
  --line: rgba(0,0,0,.1);
  --line-2: rgba(0,0,0,.06);
  --red: #db3535;
  --red-ink: #c22b2b;
  --red-soft: #fff0f0;
  --green: #86d629;
  --green-ink: #4f7d18;
  --green-soft: #f1fae6;
  --amber: #e39b16;
  --amber-ink: #9a6406;
  --amber-soft: #fff6e5;
  --blue: #4a78c2;
  --chart-2: #3b3838;
  --shadow: 0 6px 24px rgba(0,0,0,.07);
  --f-display: 'Poppins', ui-sans-serif, system-ui, sans-serif;
  --f-body: 'Open Sans', ui-sans-serif, system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --r-pill: 36px; --r-lg: 22px; --r-md: 14px; --r-sm: 8px;
  --side: 264px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #141416; --surface: #1c1c1f; --surface-2: #222226; --surface-3: #2b2b30;
  --ink: #f2f1ef; --text: #dcdbd9; --body: #a9a8a5; --muted: #8f8f94;
  --line: rgba(255,255,255,.12); --line-2: rgba(255,255,255,.07);
  --red: #e04646; --red-ink: #ff7a7a; --red-soft: #2a1f20;
  --green: #86d629; --green-ink: #a6e85a; --green-soft: #1d2614;
  --amber: #eaa62a; --amber-ink: #f4c46b; --amber-soft: #2a2316;
  --blue: #6b97de; --chart-2: #dcdbd9; --shadow: 0 6px 24px rgba(0,0,0,.45);
  color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #141416; --surface: #1c1c1f; --surface-2: #222226; --surface-3: #2b2b30;
  --ink: #f2f1ef; --text: #dcdbd9; --body: #a9a8a5; --muted: #8f8f94;
  --line: rgba(255,255,255,.12); --line-2: rgba(255,255,255,.07);
  --red: #e04646; --red-ink: #ff7a7a; --red-soft: #2a1f20;
  --green: #86d629; --green-ink: #a6e85a; --green-soft: #1d2614;
  --amber: #eaa62a; --amber-ink: #f4c46b; --amber-soft: #2a2316;
  --blue: #6b97de; --chart-2: #dcdbd9; --shadow: 0 6px 24px rgba(0,0,0,.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--f-body); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: clip; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--bg); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--f-mono); }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: var(--side) minmax(0,1fr); min-height: 100%; }
.side { position: sticky; top: env(safe-area-inset-top, 0px); height: calc(100vh - env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; gap: 18px; padding: 22px 16px 18px max(16px, env(safe-area-inset-left, 0px)); border-right: 1px solid var(--line); background: var(--surface); overflow-y: auto; z-index: 40; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 4px 6px; }
.brand img { width: 40px; height: 40px; }
.brand b { display: block; font-family: var(--f-display); font-weight: 600; font-size: 15px; color: var(--ink); letter-spacing: -.01em; line-height: 1.15; }
.brand span { font-family: var(--f-display); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav h6 { margin: 12px 12px 6px; font-family: var(--f-display); font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 12px; border: 1.5px solid transparent; border-radius: var(--r-pill); font-family: var(--f-display); font-size: 13.5px; font-weight: 500; color: var(--text); transition: color .2s, background .2s, border-color .2s; }
.nav a:hover { color: var(--green-ink); background: var(--surface-2); }
.nav a[aria-current="page"] { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.nav a .badge { margin-left: auto; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.ip-pill { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 8px 14px; border: 2px solid var(--red); border-radius: var(--r-pill); background: var(--surface); color: var(--red); font-family: var(--f-display); font-weight: 600; font-size: 12px; letter-spacing: .05em; cursor: pointer; transition: background .2s; }
.ip-pill:hover { background: var(--red-soft); }
.me { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-md); }
.me .av { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2) url(img/skins/Nicolas_vinc.webp) center 6% / 190% no-repeat; flex: none; }
.me b { display: block; font-family: var(--f-display); font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.2; }
.me small { color: var(--muted); font-size: 11.5px; }
.me .theme { margin-left: auto; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: none; cursor: pointer; color: var(--text); transition: color .2s, border-color .2s; flex: none; }
.icon-btn:hover { color: var(--red); border-color: var(--red); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px max(16px, env(safe-area-inset-right, 0px)) 14px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .burger { display: none; }
.crumbs { min-width: 0; }
.crumbs small { display: block; font-family: var(--f-display); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.crumbs h1 { margin: 0; font-family: var(--f-display); font-size: 20px; font-weight: 500; letter-spacing: -.02em; color: var(--ink); line-height: 1.25; }
.top-live { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid var(--line); border-radius: var(--r-pill); font-family: var(--f-display); font-size: 12px; font-weight: 500; color: var(--text); background: var(--surface); white-space: nowrap; }
.chip b { font-weight: 600; color: var(--ink); }
.chip .i { width: 14px; height: 14px; color: var(--muted); }
.state { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 10px; border-radius: var(--r-pill); font-family: var(--f-display); font-size: 12.5px; font-weight: 600; border: 1.5px solid; white-space: nowrap; }
.state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.state.online { color: var(--green-ink); border-color: var(--green); background: var(--green-soft); }
.state.online::before { background: var(--green); box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 60%, transparent); animation: pulse 2s infinite; }
.state.sleeping { color: var(--blue); border-color: color-mix(in srgb, var(--blue) 60%, transparent); background: color-mix(in srgb, var(--blue) 8%, var(--surface)); }
.state.starting, .state.stopping { color: var(--amber-ink); border-color: var(--amber); background: var(--amber-soft); }
.state.stopped { color: var(--body); border-color: var(--line); background: var(--surface-2); }
.state.error { color: var(--red); border-color: var(--red); background: var(--red-soft); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--green) 55%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

.content { padding: 24px max(16px, env(safe-area-inset-right, 0px)) 64px 28px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.preview-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 14px; border: 1px dashed color-mix(in srgb, var(--red) 45%, transparent); border-radius: var(--r-md); background: var(--red-soft); color: var(--text); font-size: 12.5px; }
.preview-note b { font-family: var(--f-display); color: var(--red); font-weight: 600; }
.preview-note .x { margin-left: auto; }

/* ---------- Building blocks ---------- */
.grid { display: grid; gap: 16px; min-width: 0; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-7-5 { grid-template-columns: minmax(0,7fr) minmax(0,5fr); }
.g-8-4 { grid-template-columns: minmax(0,8fr) minmax(0,4fr); }
.span-2 { grid-column: span 2; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; min-width: 0; }
.card.flat { background: var(--surface-2); border-color: transparent; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-h h2, .card-h h3 { margin: 0; font-family: var(--f-display); font-weight: 500; font-size: 15.5px; letter-spacing: -.01em; color: var(--ink); }
.card-h p { margin: 0; color: var(--muted); font-size: 12.5px; flex-basis: 100%; }
.card-h .end { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.eyebrow { font-family: var(--f-display); font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.body { color: var(--body); }
.sep { height: 1px; background: var(--line); border: 0; margin: 14px 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 16px; border-radius: var(--r-pill); border: 1.5px solid var(--line); background: var(--surface); font-family: var(--f-display); font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; white-space: nowrap; transition: border-color .2s, color .2s, background .2s, transform .1s; }
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn .i { width: 16px; height: 16px; }
.btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.btn.red:hover { background: var(--red-ink); border-color: var(--red-ink); color: #fff; }
.btn.outline-red { border-color: var(--red); color: var(--red); }
.btn.outline-red:hover { background: var(--red-soft); }
.btn.green { border-color: var(--green); color: var(--green-ink); }
.btn.green:hover { background: var(--green); color: #1d2b0a; }
.btn.sm { padding: 5px 12px; font-size: 12px; }
.btn.ghost { border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: var(--r-pill); font-family: var(--f-display); font-size: 11px; font-weight: 600; background: var(--surface-2); color: var(--body); white-space: nowrap; }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.green { background: var(--green-soft); color: var(--green-ink); }
.badge.amber { background: var(--amber-soft); color: var(--amber-ink); }
.badge.blue { background: color-mix(in srgb, var(--blue) 12%, var(--surface)); color: var(--blue); }
.badge.line { background: none; border: 1px solid var(--line); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--muted); }
.dot.green { background: var(--green); } .dot.red { background: var(--red); } .dot.amber { background: var(--amber); } .dot.blue { background: var(--blue); }

.seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: var(--r-pill); font-family: var(--f-display); font-size: 12px; font-weight: 500; cursor: pointer; color: var(--body); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

.field { display: flex; align-items: center; gap: 8px; padding: 7px 14px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); min-width: 0; }
.field input, .field select { border: 0; background: none; outline: none; min-width: 0; width: 100%; font-size: 13px; }
.field .i { width: 16px; height: 16px; color: var(--muted); }
input.text, select.text { padding: 9px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); width: 100%; font-size: 13.5px; }
input.text:focus, select.text:focus { outline: 2px solid var(--green); outline-offset: 0; border-color: transparent; }
label.lbl { display: block; font-family: var(--f-display); font-size: 12px; font-weight: 500; color: var(--ink); margin-bottom: 6px; }

.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 22px; background: var(--surface-3); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 3px solid var(--green); outline-offset: 2px; }

table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
.t th { text-align: left; font-family: var(--f-display); font-weight: 600; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 11px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t td.r, .t th.r { text-align: right; }
.t tbody tr { transition: background .15s; }
.t tbody tr:hover { background: var(--surface-2); }
.tw { overflow-x: auto; margin: 0 -8px; padding: 0 8px; }

.bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: var(--ink); }
.bar.red > i { background: var(--red); } .bar.green > i { background: var(--green); } .bar.amber > i { background: var(--amber); }

.kv { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 9px 16px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }

.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); min-width: 0; }
.li:last-child { border-bottom: 0; }
.li .grow { flex: 1; min-width: 0; }
.li b { font-family: var(--f-display); font-weight: 500; color: var(--ink); font-size: 13.5px; }
.li small { color: var(--muted); font-size: 12px; display: block; }
.ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--text); }
.ico.red { background: var(--red-soft); color: var(--red); }
.ico.green { background: var(--green-soft); color: var(--green-ink); }
.ico.amber { background: var(--amber-soft); color: var(--amber-ink); }
.ico.blue { background: color-mix(in srgb, var(--blue) 12%, var(--surface)); color: var(--blue); }
.ico .i { width: 17px; height: 17px; }

.head { width: 30px; height: 30px; border-radius: 8px; flex: none; background-color: var(--surface-2); background-repeat: no-repeat; background-size: 200%; background-position: center 5%; image-rendering: pixelated; }
.head.lg { width: 52px; height: 52px; border-radius: 12px; }

/* ---------- KPI ---------- */
.kpi { display: flex; flex-direction: column; gap: 8px; }
.kpi .top-row { display: flex; align-items: center; gap: 8px; }
.kpi .val { font-family: var(--f-display); font-size: 28px; font-weight: 500; letter-spacing: -.03em; color: var(--ink); line-height: 1.1; }
.kpi .val small { font-size: 14px; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-left: 3px; }
.kpi .sub { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spark { height: 38px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; border-radius: var(--r-lg); min-height: 260px; display: flex; color: #fff; isolation: isolate; }
.hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(100deg, rgba(14,10,14,.92) 0%, rgba(20,14,18,.72) 46%, rgba(20,14,18,.15) 100%); }
.hero .gridov { position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(rgba(219,53,53,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(134,214,41,.07) 1px, transparent 1px); background-size: 40px 40px; mask-image: linear-gradient(90deg, #000 0%, transparent 70%); }
.hero-in { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: 24px; padding: 28px 30px; width: 100%; align-items: end; }
.hero .tag { display: inline-flex; align-items: center; gap: 8px; padding: 5px 13px; border-radius: var(--r-pill); background: rgba(219,53,53,.16); border: 1px solid rgba(219,53,53,.45); font-family: var(--f-display); font-size: 10.5px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #ff8c8c; }
.hero h2 { margin: 14px 0 8px; font-family: var(--f-display); font-weight: 500; font-size: clamp(1.8rem, 1.2rem + 2vw, 2.7rem); line-height: 1.05; letter-spacing: -.03em; text-wrap: balance; color: #fff; }
.hero h2 b { color: var(--green); font-weight: 500; }
.hero h2 b.off { color: #9fb3d9; }
.hero p { margin: 0 0 18px; color: rgba(255,255,255,.72); max-width: 520px; }
.hero .acts { display: flex; gap: 8px; flex-wrap: wrap; }
.hero .btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.25); color: #fff; }
.hero .btn:hover { background: rgba(255,255,255,.16); border-color: #fff; color: #fff; }
.hero .btn.red { background: var(--red); border-color: var(--red); }
.hero-side { display: flex; flex-direction: column; gap: 10px; justify-self: end; width: min(100%, 320px); }
.glass { background: rgba(20,16,20,.55); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(8px); border-radius: var(--r-md); padding: 12px 14px; }
.glass .eyebrow { color: rgba(255,255,255,.55); }
.glass .row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.glass .heads { display: flex; }
.glass .heads .head { width: 28px; height: 28px; border: 2px solid rgba(20,16,20,.9); margin-left: -6px; border-radius: 8px; }
.glass .heads .head:first-child { margin-left: 0; }
.glass .big { font-family: var(--f-display); font-size: 22px; font-weight: 500; letter-spacing: -.02em; }
.glass .stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 8px; }
.glass .stats div { font-size: 11px; color: rgba(255,255,255,.6); }
.glass .stats b { display: block; font-family: var(--f-display); font-size: 16px; color: #fff; font-weight: 500; }

/* ---------- Charts ---------- */
.chart { position: relative; width: 100%; min-width: 0; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .axis { font-family: var(--f-display); font-size: 10.5px; fill: var(--muted); }
.chart .gridl { stroke: var(--line-2); stroke-width: 1; }
.chart .sleep { fill: color-mix(in srgb, var(--blue) 9%, transparent); }
.chart .xline { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; }
.chart .tip { position: absolute; pointer-events: none; opacity: 0; transform: translate(-50%, -110%); background: var(--ink); color: var(--bg); border-radius: 10px; padding: 7px 10px; font-size: 11.5px; white-space: nowrap; z-index: 5; transition: opacity .1s; font-variant-numeric: tabular-nums; }
.chart .tip b { font-family: var(--f-display); font-weight: 600; display: block; margin-bottom: 2px; }
.chart .tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--body); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }

.uptime { display: grid; grid-template-columns: repeat(32, minmax(0,1fr)); gap: 3px; }
.uptime i { height: 30px; border-radius: 4px; background: var(--green); opacity: .9; position: relative; cursor: default; }
.uptime i.warn { background: var(--amber); }
.uptime i.bad { background: var(--red); }
.uptime i.none { background: var(--surface-3); }
.uptime i:hover { opacity: 1; outline: 2px solid var(--ink); outline-offset: 1px; }

/* ---------- Console ---------- */
.term { background: #121214; color: #d9d7d3; border-radius: var(--r-md); font-family: var(--f-mono); font-size: 12.3px; line-height: 1.65; height: 460px; overflow: auto; padding: 14px 16px; border: 1px solid rgba(255,255,255,.06); }
.term .ln { white-space: pre-wrap; word-break: break-word; }
.term .ts { color: #6f6d6a; }
.term .lv-INFO { color: #86d629; } .term .lv-WARN { color: #eaa62a; } .term .lv-ERROR { color: #ff6b6b; }
.term .src { color: #8fa7d6; }
.term .cmd { color: #ff8c8c; }
.term .chat { color: #f2f1ef; }
.term mark { background: rgba(219,53,53,.35); color: #fff; border-radius: 2px; }
.cmdline { display: flex; gap: 8px; align-items: center; margin-top: 10px; padding: 6px 6px 6px 16px; border: 1.5px solid var(--line); border-radius: var(--r-pill); background: var(--surface); }
.cmdline:focus-within { border-color: var(--red); }
.cmdline span { font-family: var(--f-mono); color: var(--red); font-weight: 500; }
.cmdline input { flex: 1; border: 0; outline: 0; background: none; font-family: var(--f-mono); font-size: 13px; min-width: 0; }
.suggest { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.suggest button { font-family: var(--f-mono); font-size: 11.5px; }

/* ---------- Map ---------- */
.mapwrap { position: relative; border-radius: var(--r-lg); overflow: hidden; background: #2f5a9e; height: 560px; cursor: grab; touch-action: none; border: 1px solid var(--line); }
.mapwrap.dragging { cursor: grabbing; }
.mapwrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.mk { position: absolute; transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; gap: 3px; pointer-events: auto; cursor: pointer; }
.mk .pin { background: #fff; color: #323131; border: 2px solid var(--red); border-radius: var(--r-pill); padding: 3px 9px; font-family: var(--f-display); font-size: 11px; font-weight: 600; white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.mk .stem { width: 2px; height: 10px; background: var(--red); }
.mk.player .pin { border-color: var(--green); display: flex; align-items: center; gap: 6px; padding: 2px 9px 2px 3px; }
.mk.player .stem { background: var(--green); }
.mk.player .head { width: 20px; height: 20px; border-radius: 50%; }
.map-ui { position: absolute; display: flex; gap: 6px; z-index: 3; flex-wrap: wrap; }
.map-ui.tl { top: 14px; left: 14px; right: 80px; }
.map-ui.tr { top: 14px; right: 14px; flex-direction: column; }
.map-ui.bl { bottom: 14px; left: 14px; }
.map-ui.br { bottom: 14px; right: 14px; }
.mpill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-pill); background: rgba(255,255,255,.94); color: #323131; font-family: var(--f-display); font-size: 12px; font-weight: 500; border: 0; box-shadow: 0 4px 14px rgba(0,0,0,.18); cursor: pointer; }
.mpill[aria-pressed="true"] { background: #323131; color: #fff; }
.mpill.sq { width: 34px; height: 34px; padding: 0; justify-content: center; font-size: 18px; }
.coords { font-family: var(--f-mono); font-size: 11.5px; background: rgba(18,18,20,.78); color: #fff; padding: 6px 10px; border-radius: 10px; }
.minimap { border-radius: var(--r-md); overflow: hidden; position: relative; height: 210px; background: #2f5a9e; }
.minimap canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }

/* ---------- Files ---------- */
.client-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.client { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--surface); cursor: pointer; text-align: left; transition: border-color .2s, transform .15s, background .2s; }
.client:hover { border-color: var(--red); transform: translateY(-2px); }
.client .logo { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; font-size: 13px; color: #fff; }
.client b { font-family: var(--f-display); font-weight: 600; color: var(--ink); font-size: 14px; }
.client small { color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.client .go { font-family: var(--f-display); font-size: 12px; font-weight: 600; color: var(--red); display: inline-flex; gap: 6px; align-items: center; margin-top: auto; }
.cred { display: grid; grid-template-columns: 120px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.cred:last-child { border-bottom: 0; }
.cred dt { color: var(--muted); font-size: 12.5px; }
.cred dd { margin: 0; font-family: var(--f-mono); font-size: 13px; color: var(--ink); overflow-wrap: anywhere; min-width: 0; }
.tree { font-family: var(--f-mono); font-size: 12.5px; }
.tree .row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; }
.tree .row:hover { background: var(--surface-2); }
.tree .row .i { width: 15px; height: 15px; color: var(--muted); }
.tree .row .sz { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.tree .row.lock { color: var(--body); }
.tree .ind { padding-left: 24px; }

/* ---------- Backups ---------- */
.ret { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.slots { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.slots i { width: 22px; height: 22px; border-radius: 6px; background: var(--surface-3); display: grid; place-items: center; font-style: normal; font-size: 9.5px; font-family: var(--f-display); color: var(--muted); }
.slots i.on { background: var(--ink); color: var(--bg); }
.snaps { position: relative; display: flex; flex-direction: column; }
.snap { display: grid; grid-template-columns: 16px 140px minmax(0,1fr) auto; gap: 14px; align-items: center; padding: 10px 6px; border-radius: 10px; }
.snap:hover { background: var(--surface-2); }
.snap .node { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); background: var(--surface); justify-self: center; position: relative; }
.snap.first .node { background: var(--green); border-color: var(--green); }
.snap.site .node { border-color: var(--muted); border-style: dashed; }
.snap .when b { font-family: var(--f-display); font-weight: 500; color: var(--ink); font-size: 13.5px; display: block; }
.snap .when small { color: var(--muted); font-size: 11.5px; }
.snap .what { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.addbar { width: 120px; max-width: 30vw; }
.steps { display: flex; flex-direction: column; gap: 8px; }
.step { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }
.step .st { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); flex: none; }
.step.running .st { border-color: var(--amber); border-top-color: transparent; animation: spin .8s linear infinite; }
.step.done .st { border-color: var(--green); background: var(--green); color: #1d2b0a; }
.step.done .st::after { content: "✓"; font-size: 11px; font-weight: 700; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Activity ---------- */
.feed { display: flex; flex-direction: column; }
.day { font-family: var(--f-display); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 16px 0 6px; }
.day:first-child { padding-top: 0; }
.ev { display: grid; grid-template-columns: 52px 34px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 9px 8px; border-radius: 10px; }
.ev:hover { background: var(--surface-2); }
.feed.compact .ev { grid-template-columns: 40px 30px minmax(0,1fr); padding: 8px 4px; }
.feed.compact .ev > .badge { display: none; }
.ev time { font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.ev .txt { min-width: 0; }
.ev .txt b { font-family: var(--f-display); font-weight: 500; color: var(--ink); }
.ev .txt small { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--r-pill); padding: 5px 12px; font-family: var(--f-display); font-size: 12px; font-weight: 500; cursor: pointer; color: var(--body); display: inline-flex; gap: 6px; align-items: center; }
.chips button[aria-pressed="true"] { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.chips button .n { font-size: 10.5px; color: var(--muted); }

/* ---------- Players ---------- */
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.member { position: relative; border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 10px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; background: var(--surface); cursor: pointer; transition: border-color .2s, transform .15s; }
.member:hover { border-color: var(--red); transform: translateY(-2px); }
.member .skin { width: 100%; aspect-ratio: 3 / 3.4; max-width: 100%; background: var(--surface-2) center bottom / contain no-repeat; border-radius: 10px; }
.member b { font-family: var(--f-display); font-weight: 500; color: var(--ink); font-size: 13px; text-align: center; overflow-wrap: anywhere; }
.member .on { position: absolute; top: 14px; right: 14px; }

/* ---------- Modal / drawer / toast ---------- */
.scrim { position: fixed; inset: 0; background: rgba(10,8,10,.45); z-index: 80; display: grid; place-items: center; padding: 16px; backdrop-filter: blur(2px); }
.modal { background: var(--surface); border-radius: var(--r-lg); width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 22px 24px; border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.modal.wide { width: min(720px, 100%); }
.modal h3 { margin: 0; font-family: var(--f-display); font-weight: 500; font-size: 18px; color: var(--ink); letter-spacing: -.01em; }
.modal pre { margin: 0; background: var(--surface-2); border-radius: var(--r-md); padding: 12px 14px; font-family: var(--f-mono); font-size: 11.5px; line-height: 1.55; overflow: auto; max-height: 280px; color: var(--text); }
.modal .acts { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.notice { display: flex; gap: 10px; padding: 11px 14px; border-radius: var(--r-md); font-size: 12.5px; background: var(--surface-2); align-items: flex-start; }
.notice .i { margin-top: 1px; width: 16px; height: 16px; flex: none; }
.notice.amber { background: var(--amber-soft); color: var(--amber-ink); }
.notice.red { background: var(--red-soft); color: var(--red); }
.notice.green { background: var(--green-soft); color: var(--green-ink); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: var(--surface); border-left: 1px solid var(--line); z-index: 85; padding: calc(22px + env(safe-area-inset-top, 0px)) max(22px, env(safe-area-inset-right, 0px)) 22px 22px; overflow: auto; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; animation: slidein .22s ease; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: var(--r-pill); font-family: var(--f-display); font-size: 13px; font-weight: 500; z-index: 99; display: flex; gap: 8px; align-items: center; box-shadow: var(--shadow); animation: up .25s ease; }
@keyframes up { from { transform: translate(-50%, 10px); opacity: 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .client-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 1100px) { .g-7-5, .g-8-4, .g3 { grid-template-columns: minmax(0,1fr); } .span-2 { grid-column: auto; } .hero-in { grid-template-columns: minmax(0,1fr); } .hero-side { justify-self: stretch; width: 100%; } }
@media (max-width: 1024px) {
  .app { grid-template-columns: minmax(0,1fr); }
  .side { position: fixed; top: 0; left: 0; bottom: 0; height: 100%; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .25s ease; box-shadow: var(--shadow); padding-top: calc(22px + env(safe-area-inset-top, 0px)); }
  .side.open { transform: none; }
  .top { padding-left: max(16px, env(safe-area-inset-left, 0px)); }
  .top .burger { display: inline-grid; }
  .content { padding-left: max(16px, env(safe-area-inset-left, 0px)); }
}
@media (max-width: 720px) {
  .g2, .g4, .ret { grid-template-columns: minmax(0,1fr); }
  .client-grid { grid-template-columns: minmax(0,1fr); }
  .top-live .chip.hide-sm { display: none; }
  .hero-in { padding: 22px 20px; }
  .snap { grid-template-columns: 16px minmax(0,1fr); }
  .snap .what, .snap .end { grid-column: 2; }
  .ev { grid-template-columns: 44px 30px minmax(0,1fr); }
  .ev > :last-child { grid-column: 3; justify-self: start; }
  .cred { grid-template-columns: minmax(0,1fr) auto; }
  .cred dt { grid-column: 1 / -1; }
  .mapwrap { height: 440px; }
  .term { height: 380px; }
  .uptime { gap: 2px; } .uptime i { height: 24px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
