:root {
  color-scheme: dark;
  --bg: #0b1220;
  --panel: #111827;
  --panel2: #172033;
  --text: #eef4ff;
  --muted: #9aa7bd;
  --line: #29354c;
  --accent: #38bdf8;
  --green: #22c55e;
  --red: #ef4444;
  --amber: #f59e0b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #09111f 0%, var(--bg) 45%, #060a12 100%);
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, textarea, select { font: inherit; }
button {
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  padding: 10px 13px;
  color: #06101d;
  background: var(--accent);
  font-weight: 700;
}
button.secondary { background: #273449; color: var(--text); }
button.danger { background: var(--red); color: white; }
button.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #07101d;
  color: var(--text);
}
textarea { min-height: 92px; resize: vertical; }
label { display: grid; gap: 6px; color: var(--muted); }
.login { min-height: 100vh; display: grid; place-content: center; padding: 20px; }
.login h1 { font-size: 44px; margin: 0 0 20px; }
.panel {
  width: min(440px, calc(100vw - 32px));
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 24, 39, .94);
}
.shell { min-height: 100vh; padding-bottom: 76px; }
.top {
  position: sticky;
  top: 0;
  z-index: 4;
  padding: 12px 12px 10px;
  background: rgba(8, 14, 26, .94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.titlebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.titlebar h1 { margin: 0; font-size: 22px; }
.status-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(70px, 1fr));
  gap: 7px;
  overflow-x: auto;
}
.pill {
  min-width: 70px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d1728;
}
.pill b { display: block; font-size: 12px; }
.pill span { color: var(--muted); font-size: 12px; }
.ok { color: var(--green); }
.bad { color: var(--red); }
.content { width: min(1180px, 100%); margin: 0 auto; padding: 14px 12px; }
.grid { display: grid; gap: 12px; }
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 24, 39, .86);
  padding: 14px;
}
.card h2, .card h3 { margin: 0 0 12px; }
.actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.stack { display: grid; gap: 10px; }
.row { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.muted { color: var(--muted); }
.list { display: grid; gap: 8px; }
.item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel2);
}
.item-title { font-weight: 700; overflow-wrap: anywhere; }
.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--line);
  background: rgba(8, 14, 26, .97);
}
.tabs button {
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  min-height: 62px;
  padding: 8px 4px;
}
.tabs button.active { color: var(--accent); background: #0d1728; }
.toast {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 80px;
  z-index: 9;
  padding: 12px;
  border-radius: 8px;
  background: #18243a;
  border: 1px solid var(--line);
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  align-items: end;
  background: rgba(0,0,0,.56);
}
.sheet {
  background: var(--panel);
  border-radius: 8px 8px 0 0;
  padding: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
}
pre { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--muted); }
@media (min-width: 760px) {
  .shell { padding-bottom: 0; }
  .tabs { left: 50%; transform: translateX(-50%); bottom: 18px; width: min(760px, calc(100vw - 32px)); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wide { grid-column: 1 / -1; }
}
@media (min-width: 1040px) {
  .grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
