:root {
  --bg: #07110e;
  --surface: #0d1a16;
  --surface-2: #12231d;
  --line: #23372f;
  --text: #eef8f3;
  --muted: #8fa79c;
  --green: #41e18c;
  --green-deep: #157749;
  --amber: #f4c65d;
  --red: #ff6d6d;
  --blue: #78a9ff;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 80% 0%, #133126 0, transparent 34rem), var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .42; }
.shell { width: min(1440px, calc(100% - 40px)); margin: 0 auto; padding: 34px 0 56px; }
.topbar, .section-heading, .panel-title { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.75rem, 3vw, 2.7rem); letter-spacing: -.04em; }
h2 { margin-bottom: 0; font-size: 1.25rem; }
.eyebrow { margin-bottom: 7px; color: var(--green); font-size: .75rem; font-weight: 800; letter-spacing: .14em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.button { min-height: 42px; padding: 0 16px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: var(--surface-2); font-weight: 750; }
.button:hover:not(:disabled) { border-color: #46685a; transform: translateY(-1px); }
.button-primary { border-color: var(--green-deep); background: var(--green); color: #032215; }
.button-secondary { background: transparent; }
.button-danger { border-color: #7e3434; background: var(--red); color: #2d0808; }
.data-age { color: var(--muted); font-size: .85rem; }
.banner { display: none; margin-top: 22px; padding: 13px 16px; border: 1px solid #705b28; border-radius: 10px; background: #2a2312; color: #ffe3a1; }
.banner.visible { display: block; }
.overview { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 14px; margin-top: 28px; }
.hero-card, .stat-card, .panel, .node-card { border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(145deg, rgba(20, 42, 33, .9), rgba(9, 23, 18, .96)); box-shadow: 0 16px 44px rgba(0,0,0,.13); }
.hero-card { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; padding: 25px; }
.stat-card { padding: 22px; }
.card-label { margin-bottom: 10px; color: var(--muted); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.active-line { display: flex; align-items: center; gap: 12px; }
.active-node { font-size: 2.35rem; font-weight: 850; letter-spacing: -.05em; }
.status-pill, .lock { display: inline-flex; align-items: center; min-height: 27px; padding: 0 10px; border-radius: 999px; font-size: .76rem; font-weight: 800; }
.status-pill.good { background: #123c29; color: var(--green); }
.status-pill.warn { background: #413716; color: var(--amber); }
.status-pill.bad, .lock { background: #442121; color: #ffaaaa; }
.status-pill.neutral { background: #203028; color: var(--muted); }
.muted { margin: 8px 0 0; color: var(--muted); line-height: 1.55; }
.metric-value { display: block; min-height: 2.6rem; font-size: 2rem; }
.metric-value.compact { font-size: 1.05rem; line-height: 2.6rem; }
.tip-visual { align-self: center; }
.tip-numbers { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 10px; color: var(--muted); font-size: .82rem; }
.tip-numbers strong { color: var(--text); }
.progress { height: 8px; overflow: hidden; border-radius: 999px; background: #21322b; }
.progress span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green-deep), var(--green)); transition: width .45s ease; }
.section-heading { margin: 38px 0 15px; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: .8rem; }
.legend span { display: flex; align-items: center; gap: 6px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 4px rgba(255,255,255,.03); }
.dot.good { background: var(--green); }.dot.warn { background: var(--amber); }.dot.bad { background: var(--red); }
.node-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.node-card { padding: 22px; }
.node-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.node-title { display: flex; align-items: center; gap: 10px; }
.node-title h3 { margin: 0; font-size: 1.35rem; }
.node-height { text-align: right; }
.node-height strong { display: block; font-size: 1.45rem; }
.metric-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 26px; padding-top: 20px; }
.metric-group h4 { margin: 0 0 10px; color: var(--muted); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.metric-row { display: flex; justify-content: space-between; gap: 14px; min-height: 31px; font-size: .86rem; }
.metric-row span:first-child { color: var(--muted); }
.metric-row strong { text-align: right; font-variant-numeric: tabular-nums; }
.value-good { color: var(--green); }.value-warn { color: var(--amber); }.value-bad { color: var(--red); }
.lower-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 14px; margin-top: 30px; }
.panel { padding: 22px; }
.timeline { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0; margin: 28px 0; padding: 0; list-style: none; counter-reset: step; }
.timeline li { position: relative; padding: 30px 9px 0; color: var(--muted); font-size: .78rem; text-align: center; }
.timeline li::before { content: counter(step); counter-increment: step; position: absolute; z-index: 2; top: 0; left: 50%; display: grid; place-items: center; width: 22px; height: 22px; transform: translateX(-50%); border: 2px solid #3b5348; border-radius: 50%; background: var(--surface); color: var(--muted); font-size: .7rem; font-weight: 800; }
.timeline li::after { content: ""; position: absolute; top: 10px; left: 0; width: 100%; height: 2px; background: #263c33; }
.timeline li:first-child::after { left: 50%; width: 50%; }.timeline li:last-child::after { width: 50%; }
.timeline li.current { color: var(--text); }.timeline li.current::before { border-color: var(--green); color: #061c12; background: var(--green); box-shadow: 0 0 18px rgba(65,225,140,.3); }
.callout, .blocker-list { padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; background: rgba(4,12,9,.45); color: var(--muted); line-height: 1.55; }
.blocker-list { min-height: 76px; margin-top: 18px; }
.blocker-list ul { margin: 0; padding-left: 20px; }
.switch-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.danger-copy { margin: 14px 0 0; color: #d29797; font-size: .78rem; line-height: 1.5; }
dialog { width: min(500px, calc(100% - 28px)); padding: 0; border: 1px solid #365245; border-radius: 16px; color: var(--text); background: var(--surface); box-shadow: 0 24px 80px #000; }
dialog::backdrop { background: rgba(0, 5, 3, .78); backdrop-filter: blur(5px); }
dialog form { padding: 23px; }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; }
.icon-button { border: 0; color: var(--muted); background: transparent; font-size: 1.8rem; }
dialog label { display: grid; gap: 7px; margin-top: 16px; color: var(--muted); font-size: .86rem; font-weight: 700; }
dialog input, dialog select { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; outline: none; color: var(--text); background: #08130f; }
dialog input:focus, dialog select:focus { border-color: var(--green); }
.dialog-help { margin: 14px 0 0; color: var(--amber); font-size: .78rem; line-height: 1.55; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 20; max-width: 420px; padding: 13px 16px; transform: translateY(30px); border: 1px solid var(--line); border-radius: 10px; opacity: 0; background: #14271f; box-shadow: 0 16px 44px #0008; transition: .2s ease; pointer-events: none; }
.toast.visible { transform: translateY(0); opacity: 1; }

@media (max-width: 1050px) {
  .overview { grid-template-columns: repeat(3, 1fr); }.hero-card { grid-column: 1 / -1; }
  .lower-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .shell { width: min(100% - 24px, 1440px); padding-top: 22px; }
  .topbar { align-items: flex-start; }.topbar-actions { flex-wrap: wrap; justify-content: flex-end; }.data-age { width: 100%; text-align: right; }
  .overview, .node-grid { grid-template-columns: 1fr; }.hero-card { grid-template-columns: 1fr; gap: 20px; }.stat-card { padding: 18px; }
  .metric-groups { grid-template-columns: 1fr; }.timeline { grid-template-columns: 1fr; gap: 9px; }
  .timeline li { padding: 4px 0 4px 42px; text-align: left; }.timeline li::before { top: 0; left: 12px; }.timeline li::after { top: -9px; left: 11px !important; width: 2px !important; height: 30px; }.timeline li:first-child::after { display: none; }
  .legend { display: none; }
}
@media (max-width: 520px) {
  .topbar { display: block; }.topbar-actions { justify-content: flex-start; margin-top: 18px; }.data-age { text-align: left; }
  .node-head { display: block; }.node-height { margin-top: 15px; text-align: left; }.switch-actions { grid-template-columns: 1fr; }
}
