:root {
  --bg: #090c11;
  --panel: #11161e;
  --panel-2: #171d27;
  --line: #27303d;
  --text: #f5f7fb;
  --muted: #96a0ae;
  --cyan: #5ce1e6;
  --cyan-strong: #24bdc5;
  --green: #72e2a2;
  --amber: #ffbe5c;
  --red: #ff7d88;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 72% -20%, rgba(64, 193, 203, .13), transparent 35%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 20px;
  border-right: 1px solid var(--line);
  background: rgba(8, 11, 16, .85);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 12px; margin: 0 6px 38px; }
.brand-mark {
  display: grid; place-items: center; width: 42px; height: 42px;
  overflow: hidden;
}
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); margin-top: 2px; }
.beta-badge { display: inline-block; margin-left: 5px; padding: 3px 6px; border: 1px solid rgba(255,190,92,.45); border-radius: 999px; color: var(--amber); background: rgba(255,190,92,.1); font-size: 9px; line-height: 1; letter-spacing: .08em; text-transform: uppercase; vertical-align: 2px; }
.beta-notice { margin: 8px 0 10px; color: var(--amber); }
nav { display: grid; gap: 7px; }
.nav-item {
  padding: 12px 14px; border: 0; border-radius: 11px;
  background: transparent; color: var(--muted); text-align: left; cursor: pointer;
}
.nav-item:hover, .nav-item.active { color: var(--text); background: var(--panel-2); }
.nav-item.active { box-shadow: inset 3px 0 var(--cyan); }
.sidebar-meta {
  position: absolute; bottom: 28px; left: 28px;
  display: grid; gap: 7px; color: var(--muted); font-size: 13px;
}
.privacy-note {
  display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px;
}
.sidebar-meta small { color: #6f7987; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 14px var(--green); }

main { width: min(1240px, 100%); padding: 34px 46px 64px; }
.topbar, .section-intro, .panel-heading, .split-detail, .top-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.topbar { margin-bottom: 30px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.04em; }
h2 { margin-bottom: 0; font-size: 22px; letter-spacing: -.02em; }
.eyebrow {
  margin-bottom: 7px; color: var(--cyan); font-size: 11px;
  font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
}
.muted, .field-note { color: var(--muted); }
.button {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 15px;
  background: var(--panel-2); cursor: pointer; font-weight: 700;
}
.button:hover { transform: translateY(-1px); border-color: #3c4859; }
.button.primary { color: #041114; border-color: var(--cyan); background: var(--cyan); }
.button.ghost { background: transparent; }
.view { display: none; }
.view.active { display: block; animation: reveal .2s ease; }
#view-dashboard.view.active { display: grid; gap: 16px; }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } }

.hero-grid { display: grid; grid-template-columns: 1.7fr 1fr 1fr; gap: 16px; }
.contributor-note { margin: 0; border-color: rgba(92,225,230,.32); background: linear-gradient(120deg, rgba(92,225,230,.1), rgba(14,18,25,.92)); }
.contributor-note p:last-child { max-width: 940px; margin-bottom: 0; color: var(--muted); line-height: 1.65; }
.hero-card, .metric-card, .panel {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(23,29,39,.9), rgba(14,18,25,.9));
  box-shadow: 0 24px 70px rgba(0,0,0,.18);
}
.hero-card { min-height: 190px; padding: 26px; display: flex; justify-content: space-between; overflow: hidden; }
.hero-card h2 { margin-bottom: 10px; font-size: 34px; }
.pulse-orbit {
  align-self: center; width: 108px; height: 108px; display: grid; place-items: center;
  border: 1px solid rgba(92,225,230,.2); border-radius: 50%;
  box-shadow: 0 0 70px rgba(92,225,230,.12);
}
.pulse-orbit::before { content: ""; position: absolute; width: 70px; height: 70px; border: 1px solid rgba(92,225,230,.35); border-radius: 50%; }
.pulse-orbit span { width: 22px; height: 22px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 30px var(--cyan); }
.metric-card { min-height: 190px; padding: 24px; display: flex; flex-direction: column; justify-content: space-between; }
.metric-card span, .metric-card small { color: var(--muted); }
.metric-card strong { font-size: 31px; }
.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 0; }
.panel { padding: 24px; }
.panel-heading { margin-bottom: 22px; }
.badge { padding: 6px 10px; border-radius: 999px; color: var(--green); background: rgba(114,226,162,.1); font-size: 12px; }
.schedule-summary { display: grid; gap: 10px; color: var(--muted); }
.summary-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.meter { height: 10px; margin: 32px 0 15px; border-radius: 999px; background: #090d13; overflow: hidden; }
.meter span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan-strong), var(--cyan)); transition: width .35s; }
.split-detail { color: var(--muted); font-size: 13px; }
.split-detail strong { color: var(--text); }
.activity-panel { margin-top: 0; }
.activity-chart-panel { margin-top: 0; overflow: hidden; }
.activity-chart-heading { align-items: flex-start; }
.chart-legend { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 18px; color: var(--muted); font-size: 12px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px rgba(92,225,230,.65); }
.legend-dot.completed { width: 9px; height: 9px; background: var(--green); box-shadow: 0 0 12px rgba(114,226,162,.75); }
.activity-chart-frame { position: relative; min-height: 220px; padding: 4px 0 24px; border-radius: 14px; background: linear-gradient(180deg, rgba(92,225,230,.035), rgba(9,12,17,.28)); overflow: hidden; }
.activity-chart { display: block; width: 100%; height: 220px; overflow: visible; }
.activity-chart-grid line { stroke: rgba(150,160,174,.14); stroke-width: 1; stroke-dasharray: 3 7; }
.activity-area { fill: url("#activity-gradient"); fill: rgba(92,225,230,.08); }
.activity-line { fill: none; stroke: var(--cyan); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 7px rgba(92,225,230,.5)); }
.activity-marker-heartbeat { fill: var(--cyan); stroke: #0d131a; stroke-width: 3; }
.activity-marker-completed { fill: var(--green); stroke: #0d131a; stroke-width: 4; filter: drop-shadow(0 0 8px rgba(114,226,162,.7)); }
.activity-chart-axis { position: absolute; right: 16px; bottom: 8px; left: 32px; display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }
.activity-chart-summary { margin: 13px 0 0; color: var(--muted); font-size: 13px; }
.activity-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line); }
.activity-row strong, .activity-row small { display: block; }
.activity-row small { margin-top: 3px; color: var(--muted); }
.activity-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--panel-2); color: var(--cyan); }
.activity-icon.error { color: var(--red); }

.section-intro { margin-bottom: 22px; align-items: end; }
.section-intro > p { width: min(480px, 50%); margin-bottom: 0; color: var(--muted); }
.form-panel { max-width: 820px; }
label { display: grid; gap: 8px; margin-bottom: 16px; font-weight: 700; }
input, select, textarea {
  width: 100%; min-width: 0; padding: 11px 12px; color: var(--text);
  border: 1px solid var(--line); border-radius: 10px; outline: 0; background: #0c1118;
}
textarea { resize: vertical; line-height: 1.55; }
input:focus, select:focus { border-color: var(--cyan-strong); box-shadow: 0 0 0 3px rgba(92,225,230,.08); }
.inline-field { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.field-note { margin: 10px 0 22px; font-size: 13px; line-height: 1.55; }
.account-state { display: flex; align-items: center; gap: 14px; padding-top: 20px; border-top: 1px solid var(--line); }
.account-state strong, .account-state small { display: block; }
.account-state small { color: var(--muted); margin-top: 4px; }
.account-avatar { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--cyan); background: rgba(92,225,230,.1); }
.model-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.hardware-summary { margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.hardware-summary p, .hardware-summary small { margin: 0; color: var(--muted); }
.hardware-summary small { max-width: 320px; line-height: 1.45; }
.comfyui-assistant { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 16px; border-color: rgba(92,225,230,.35); }
.comfyui-assistant.recommended { border-color: rgba(114,226,162,.5); background: linear-gradient(135deg, rgba(114,226,162,.08), rgba(92,225,230,.04)); }
.comfyui-assistant.limited { border-color: rgba(255,190,92,.5); background: rgba(255,190,92,.06); }
.comfyui-assistant.ineligible { border-color: rgba(255,125,136,.35); }
.comfyui-assistant h2 { margin: 3px 0 8px; }
.comfyui-assistant p { margin: 0 0 6px; }
.comfyui-assistant small { color: var(--muted); }
.comfyui-assistant .button { flex: 0 0 auto; text-align: center; text-decoration: none; }
.runtime-panel { margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.runtime-list { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.runtime-actions { display: grid; justify-items: end; gap: 10px; }
.runtime-chip { padding: 7px 10px; border-radius: 999px; color: var(--cyan); background: rgba(92,225,230,.09); font-size: 12px; font-weight: 700; }
.model-download-panel { margin-bottom: 22px; }
.update-panel {
  display: flex; align-items: center; justify-content: space-between;
  gap: 22px; margin: 0;
  border-color: rgba(92, 225, 230, .32);
}
.update-panel h2 { margin: 3px 0 7px; }
.update-panel p, .update-panel small { margin: 0; }
.update-panel .eyebrow { margin-bottom: 7px; }
.model-download-controls { display: grid; grid-template-columns: minmax(240px, 1fr) auto; gap: 10px; margin-top: 18px; }
.model-download-panel .field-note { margin-bottom: 0; }
.download-status { margin: 14px 0 0; padding: 11px 12px; border-radius: 10px; color: var(--green); background: rgba(114,226,162,.09); font-size: 13px; }
.download-status.working { color: var(--cyan); background: rgba(92,225,230,.09); }
.download-status.error { color: var(--red); background: rgba(255,125,136,.09); }
.section-heading { margin: 26px 0 14px; }
.model-card { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.model-card.compatibility-recommended { border-color: rgba(114,226,162,.45); }
.model-card.compatibility-ineligible { opacity: .72; border-color: rgba(255,125,136,.4); }
.model-card header { display: flex; justify-content: space-between; gap: 10px; }
.model-card h3 { margin: 0; }
.model-card p { margin: 14px 0 0; color: var(--muted); font-size: 13px; }
.model-check { width: 20px; height: 20px; accent-color: var(--cyan); }
.compatibility-badge { display: inline-block; margin-top: 14px; padding: 5px 9px; border-radius: 999px; color: var(--cyan); background: rgba(92,225,230,.09); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.compatibility-recommended .compatibility-badge { color: var(--green); background: rgba(114,226,162,.1); }
.compatibility-ineligible .compatibility-badge { color: var(--red); background: rgba(255,125,136,.1); }
.unmanaged-badge { height: fit-content; padding: 5px 8px; border-radius: 8px; color: var(--muted); background: var(--panel-2); font-size: 10px; font-weight: 800; text-transform: uppercase; white-space: nowrap; }
.test-panel { margin-bottom: 16px; }
.queued-test-intro { margin-top: 40px; }
.remote-result-panel { margin-bottom: 16px; border-color: rgba(114,226,162,.4); }
.test-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; }
.test-result-panel pre { margin: 0; color: var(--text); font: inherit; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.image-test-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.audio-test-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.generated-images { display: grid; gap: 16px; }
.generated-images img { display: block; width: min(100%, 900px); height: auto; border: 1px solid var(--line); border-radius: 14px; background: #080b10; }
.generated-audio { display: grid; gap: 14px; }
.generated-audio-item { display: grid; grid-template-columns: minmax(240px, 1fr) auto; align-items: center; gap: 14px; }
.generated-audio-item audio { width: 100%; }
.terms-panel { max-width: 940px; }
.terms-panel h3 { margin: 30px 0 10px; }
.terms-panel > h3:first-child { margin-top: 0; }
.terms-panel > p { color: var(--muted); line-height: 1.7; }
.terms-important { margin: 24px 0; padding: 18px; border: 2px solid rgba(255,190,92,.6); border-radius: 14px; background: rgba(255,190,92,.08); }
.terms-important p:last-child { margin-bottom: 0; line-height: 1.7; }
.terms-important.indemnity { border-color: rgba(255,125,136,.65); background: rgba(255,125,136,.08); }
.terms-important.beta-terms { border-color: rgba(255,190,92,.7); background: linear-gradient(135deg, rgba(255,190,92,.12), rgba(92,225,230,.05)); }
.terms-acceptance { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.terms-acceptance label { display: flex; grid-template-columns: none; align-items: flex-start; gap: 10px; margin: 0; line-height: 1.5; }
.terms-acceptance input { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 2px; accent-color: var(--cyan); }

.schedule-editor { display: grid; gap: 10px; }
.schedule-row { display: grid; grid-template-columns: 1.1fr 1fr auto 1fr 1.5fr auto; gap: 10px; align-items: center; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: transparent; cursor: pointer; color: var(--muted); }
.icon-button:hover { color: var(--red); border-color: var(--red); }
.exception-panel { margin-top: 16px; }
.exception-form { display: grid; grid-template-columns: 1fr 1.2fr .8fr .8fr 1.5fr auto; gap: 10px; }
.exception-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.exception-list { margin-top: 18px; }
.exception-item small { color: var(--muted); }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.unit-input { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: #0c1118; }
.unit-input input { border: 0; }
.unit-input span { padding-right: 12px; white-space: nowrap; color: var(--muted); font-size: 13px; }
.toggle-row { display: flex; align-items: center; gap: 11px; margin-top: 10px; }
.toggle-row input { width: 18px; height: 18px; accent-color: var(--cyan); }
.notice { margin: -12px 0 20px; padding: 12px 14px; border: 1px solid rgba(92,225,230,.35); border-radius: 10px; color: var(--cyan); background: rgba(92,225,230,.07); }
.notice.error { color: var(--red); border-color: rgba(255,125,136,.35); background: rgba(255,125,136,.07); }
.hidden { display: none !important; }

@media (max-width: 980px) {
  .shell { grid-template-columns: 78px 1fr; }
  .sidebar { padding: 24px 12px; }
  .brand > div, .nav-item { font-size: 0; }
  .brand { margin-left: 5px; }
  .nav-item::first-letter { font-size: 15px; }
  .sidebar-meta { display: none; }
  main { padding: 28px 24px 50px; }
  .hero-grid { grid-template-columns: 1fr 1fr; }
  .hero-card { grid-column: 1 / -1; }
  .model-grid { grid-template-columns: 1fr 1fr; }
  .schedule-row, .exception-form { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 650px) {
  .shell { display: block; }
  .sidebar { position: static; width: 100%; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { margin-bottom: 18px; }
  .brand > div { display: block; }
  nav { display: flex; overflow-x: auto; }
  .nav-item { font-size: 13px; white-space: nowrap; }
  main { padding: 24px 16px 42px; }
  .topbar, .section-intro { align-items: flex-start; flex-direction: column; }
  .hardware-summary, .comfyui-assistant { align-items: flex-start; flex-direction: column; }
  .model-download-controls { grid-template-columns: 1fr; }
  .top-actions { flex-wrap: wrap; }
  .hero-grid, .content-grid, .model-grid, .two-columns, .image-test-options, .audio-test-options, .generated-audio-item { grid-template-columns: 1fr; }
  .metric-card { min-height: 145px; }
  .section-intro > p { width: 100%; }
  .inline-field { grid-template-columns: 1fr; }
  .schedule-row, .exception-form { grid-template-columns: 1fr; }
  .activity-chart-heading { align-items: flex-start; flex-direction: column; }
  .chart-legend { justify-content: flex-start; }
  .activity-chart-frame { min-height: 180px; }
  .activity-chart { height: 180px; }
}
