:root {
  --bg: #0b0f14; --surface: rgba(30, 41, 59, .45); --surface-2: rgba(51, 65, 85, .35);
  --line: rgba(148, 163, 184, .16); --line-2: rgba(148, 163, 184, .3);
  --text: #e2e8f0; --muted: #8493a8; --accent: #5aa9ff;
  --ok: #34d399; --warn: #fbbf24; --bad: #f87171;
  --r: 12px; --r-sm: 8px; --tap: 36px;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; color: var(--text);
  background: radial-gradient(1200px 600px at 80% -10%, rgba(90, 169, 255, .08), transparent 60%), var(--bg);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
body.frame-mode { height: 100dvh; overflow: hidden; }
h1 { font-size: 1.05rem; margin: 0; font-weight: 600; letter-spacing: .01em; }
h2 { font-size: .8rem; margin: 0 0 .6rem; color: var(--muted); font-weight: 600; text-transform: uppercase;
  letter-spacing: .08em; display: flex; align-items: center; gap: .45rem; }
.muted { color: var(--muted); font-size: .8rem; margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { flex: none; }
.top { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .6rem 1rem;
  border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); }
.brand, .top-r, .upd { display: flex; align-items: center; gap: .5rem; }
.logo { color: var(--accent); }
.upd { gap: .3rem; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: .35rem; overflow-x: auto; padding: .5rem 1rem; border-bottom: 1px solid var(--line);
  scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; display: inline-flex; align-items: center; gap: .4rem; min-height: var(--tap); padding: 0 .8rem;
  background: transparent; color: var(--muted); border: 1px solid transparent; border-radius: var(--r-sm);
  cursor: pointer; font: inherit; transition: background .15s, color .15s; }
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active { color: var(--text); background: var(--surface); border-color: var(--line-2); }
.tab.active .ico { color: var(--accent); }
main { flex: 1; min-height: 0; width: 100%; padding: 1rem; display: flex; flex-direction: column; }
body.frame-mode main { padding: 0; }
.panel[hidden] { display: none !important; }
.panel.frame-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.block { margin-bottom: 1.25rem; }
.grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .85rem;
  backdrop-filter: blur(12px); }
.card h3 { margin: 0 0 .6rem; font-size: .92rem; font-weight: 600; display: flex; justify-content: space-between;
  align-items: center; gap: .5rem; }
.ttl { display: inline-flex; align-items: center; gap: .45rem; min-width: 0; flex-wrap: wrap; }
.ttl .ico { color: var(--accent); }
.kv, .stat { display: grid; grid-template-columns: 22px 1fr; align-items: center; gap: .1rem .5rem; font-size: .85rem;
  padding: .2rem 0; font-variant-numeric: tabular-nums; }
.stat .k { color: var(--muted); display: inline-flex; }
.stat .v { text-align: right; }
.stat .bar { grid-column: 2; }
.bar { height: 4px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bar i.warn { background: var(--warn); }
.bar i.bad { background: var(--bad); }
.row { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .7rem; }
.badge { display: inline-flex; align-items: center; gap: .25rem; font-size: .72rem; padding: .08rem .5rem;
  border-radius: 999px; border: 1px solid var(--line-2); flex-shrink: 0; white-space: nowrap; }
.badge.ok { color: var(--ok); border-color: rgba(52, 211, 153, .4); background: rgba(52, 211, 153, .08); }
.badge.bad { color: var(--bad); border-color: rgba(248, 113, 113, .4); background: rgba(248, 113, 113, .08); }
.badge.warn { color: var(--warn); border-color: rgba(251, 191, 36, .4); background: rgba(251, 191, 36, .08); }
.badge.info { color: var(--accent); border-color: rgba(90, 169, 255, .4); background: rgba(90, 169, 255, .08); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: var(--tap);
  padding: 0 .85rem; background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2);
  border-radius: var(--r-sm); cursor: pointer; font: inherit; text-decoration: none; transition: background .15s, border-color .15s; }
.btn:hover:not(:disabled) { border-color: var(--accent); background: rgba(90, 169, 255, .12); }
.btn:focus-visible, .tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-btn { width: var(--tap); height: var(--tap); min-height: var(--tap); padding: 0; }
.btn.ok { color: var(--ok); }
.btn.warn { color: var(--warn); }
.btn.bad { color: var(--bad); }
.btn.primary { background: var(--accent); color: #06121f; border-color: var(--accent); }
.btn.primary:hover:not(:disabled) { background: #7dbcff; }
.btn.danger { background: var(--bad); color: #1b0606; border-color: var(--bad); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.err { color: var(--bad); margin: 0; }
.actions { display: flex; justify-content: flex-end; gap: .4rem; padding: .35rem .75rem;
  border-bottom: 1px solid var(--line); flex-shrink: 0; }
iframe { flex: 1; width: 100%; min-height: 0; border: 0; background: #fff; display: block; }
.modal { position: fixed; inset: 0; background: rgba(2, 6, 12, .7); backdrop-filter: blur(4px); display: flex;
  align-items: center; justify-content: center; padding: 1rem; z-index: 10; }
.modal[hidden], .toast[hidden] { display: none; }
.dialog { background: #131a24; border: 1px solid var(--line-2); border-radius: var(--r); padding: 1.1rem;
  max-width: 400px; width: 100%; }
.dialog p { margin: 0; }
.dialog .row { justify-content: flex-end; }
.toast { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); z-index: 11; max-width: 92vw;
  background: #131a24; border: 1px solid var(--accent); border-radius: var(--r-sm); padding: .55rem 1rem; }
.console-out { margin: 0; padding: .75rem; background: rgba(2, 6, 12, .6); border: 1px solid var(--line);
  border-radius: var(--r); min-height: 5rem; max-height: 50vh; overflow: auto; white-space: pre-wrap;
  word-break: break-word; font: .78rem/1.4 ui-monospace, Menlo, Consolas, monospace; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; min-width: 0; }
.proj-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.proj-table th { text-align: left; color: var(--muted); font-size: .72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; padding: .55rem .75rem; border-bottom: 1px solid var(--line); }
.proj-table td { padding: .65rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.proj-table tr:last-child td { border-bottom: 0; }
.proj-table th.c, .proj-table td.c { text-align: center; width: 64px; }
.proj-table th.c .ico { vertical-align: middle; }
.proj-table td { vertical-align: middle; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle;
  background: var(--muted); box-shadow: 0 0 0 3px rgba(148, 163, 184, .12); }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(52, 211, 153, .18), 0 0 8px rgba(52, 211, 153, .5); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(251, 191, 36, .18); }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px rgba(248, 113, 113, .18), 0 0 8px rgba(248, 113, 113, .5); }
.dot.info { background: var(--accent); box-shadow: 0 0 0 3px rgba(90, 169, 255, .18); }
.dot.off { background: transparent; border: 2px solid var(--muted); box-shadow: none; }
.proj-desc { margin: .2rem 0 0; }
.dash-link { color: var(--accent); text-decoration: none; overflow-wrap: anywhere; font-size: .85rem; }
.dash-link:hover { text-decoration: underline; }
.toggle.on { color: var(--ok); border-color: rgba(52, 211, 153, .5); background: rgba(52, 211, 153, .1); }
.toggle.off { color: var(--muted); }
@media (max-width: 639px) {
  body { font-size: 14px; }
  .proj-table thead { display: none; }
  .proj-table, .proj-table tbody, .proj-table tr, .proj-table td { display: block; width: 100%; }
  .proj-table { background: none; border: 0; }
  .proj-table tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: .5rem .7rem; margin-bottom: .6rem; }
  .proj-table td, .proj-table td.c { border: 0; padding: .3rem 0; width: 100%; text-align: left; }
  .proj-table td.c { display: flex; align-items: center; justify-content: space-between; }
  .proj-table td[data-label]:not(:first-child)::before { content: attr(data-label); display: block; color: var(--muted); font-size: .68rem;
    text-transform: uppercase; letter-spacing: .06em; }
  .top { padding: .45rem .75rem; }
  .tabs { padding: .4rem .6rem; }
  .tab-l { display: none; }
  .tab { padding: 0; width: var(--tap); justify-content: center; }
  main { padding: .6rem; }
  .grid { grid-template-columns: 1fr; }
  .row .btn:not(.icon-btn) { flex: 1 1 auto; }
}
