:root {
  --bg: #07100f;
  --bg-raised: #0b1715;
  --panel: rgba(15, 31, 28, 0.82);
  --panel-solid: #0f1f1c;
  --line: rgba(183, 227, 211, 0.14);
  --line-bright: rgba(112, 234, 187, 0.34);
  --ink: #f1faf6;
  --muted: #a9bdb6;
  --green: #70eabb;
  --green-dark: #174d3c;
  --amber: #ffc27f;
  --red: #ff9e87;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.28);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; overflow-x: hidden; background: radial-gradient(circle at 50% -20%, #18392f 0, var(--bg) 42%); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(112, 234, 187, 0.48); outline-offset: 3px; }
a { color: inherit; }
.skip-link { position: fixed; z-index: 20; top: 8px; left: 8px; padding: 10px 14px; color: #062117; background: var(--green); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.ambient { position: fixed; z-index: -1; border-radius: 50%; filter: blur(100px); opacity: .14; pointer-events: none; }
.ambient-one { width: 420px; height: 420px; top: 20%; right: -230px; background: var(--green); }
.ambient-two { width: 340px; height: 340px; bottom: 5%; left: -220px; background: #2e8b71; }

.topbar { display: flex; align-items: center; justify-content: space-between; width: min(1180px, calc(100% - 48px)); min-height: 86px; margin: 0 auto; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand > span:last-child { display: grid; gap: 1px; }
.brand strong { font-size: 16px; letter-spacing: -.01em; }
.brand small { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line-bright); border-radius: 50%; background: rgba(112, 234, 187, .08); }
.brand-mark span { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 18px var(--green); }
nav { display: flex; align-items: center; gap: 8px; }
nav a, .quiet-button, .connect-button { min-height: 44px; border: 0; border-radius: 999px; cursor: pointer; text-decoration: none; }
nav a, .quiet-button { padding: 12px 14px; color: var(--muted); background: transparent; }
nav a:hover, .quiet-button:hover { color: var(--ink); background: rgba(255, 255, 255, .04); }
.connect-button { padding: 12px 18px; color: #062117; background: var(--green); font-weight: 780; }
.connect-button:hover { background: #8df4cc; transform: translateY(-1px); }

.shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 24px 0 32px; }
.mode-banner { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 14px; border: 1px solid rgba(255, 194, 127, .26); border-radius: 12px; color: #e8d6c3; background: rgba(88, 56, 27, .18); font-size: 13px; }
.mode-banner #mode-copy { min-width: 0; flex: 1 1 260px; line-height: 1.45; }
.mode-banner strong { color: var(--amber); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }
.mode-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 12px var(--amber); }
.mode-banner.connected { border-color: var(--line-bright); background: rgba(19, 77, 59, .2); }
.mode-banner.connected strong { color: var(--green); }
.mode-banner.connected .mode-dot { background: var(--green); box-shadow: 0 0 12px var(--green); }
.text-button { min-height: 32px; margin-left: auto; padding: 5px 9px; border: 0; color: var(--muted); background: transparent; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.hero { display: grid; grid-template-columns: 1.2fr .8fr; gap: 60px; align-items: end; padding: 78px 0 58px; }
.eyebrow { margin: 0 0 12px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 680px; margin-bottom: 18px; font-size: clamp(48px, 7vw, 92px); line-height: .94; letter-spacing: -.065em; }
h2 { margin-bottom: 0; font-size: clamp(22px, 3vw, 31px); letter-spacing: -.035em; }
.hero-copy { max-width: 610px; margin-bottom: 24px; color: var(--muted); font-size: 17px; line-height: 1.65; }
.sync-line { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.sync-line time { color: var(--ink); }
.icon-button { display: grid; place-items: center; min-width: 38px; min-height: 38px; margin-left: 4px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: transparent; cursor: pointer; }
.icon-button:hover { border-color: var(--line-bright); color: var(--green); }
.icon-button.loading { animation: spin .8s linear infinite; }
.pulse-summary { display: flex; align-items: center; gap: 23px; justify-self: end; min-width: 360px; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(140deg, rgba(112, 234, 187, .08), rgba(7, 16, 15, .18)); box-shadow: var(--shadow); }
.pulse-orb { position: relative; display: grid; place-items: center; flex: 0 0 82px; height: 82px; border: 1px solid rgba(112, 234, 187, .3); border-radius: 50%; background: rgba(112, 234, 187, .06); }
.pulse-orb::before, .pulse-orb::after { position: absolute; content: ""; border: 1px solid rgba(112, 234, 187, .2); border-radius: inherit; inset: 10px; }
.pulse-orb::after { inset: -1px; animation: pulse 2.5s ease-out infinite; }
.pulse-orb span { width: 24px; height: 24px; border-radius: 50%; background: var(--green); box-shadow: 0 0 30px rgba(112, 234, 187, .75); }
.status-kicker { margin-bottom: 5px; color: var(--muted); font-size: 12px; }
.pulse-summary strong { display: block; font-size: 22px; letter-spacing: -.03em; }
.pulse-summary p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.pulse-summary.problem .pulse-orb span { background: var(--red); box-shadow: 0 0 30px rgba(255, 158, 135, .65); }
.pulse-summary.problem .pulse-orb, .pulse-summary.problem .pulse-orb::before, .pulse-summary.problem .pulse-orb::after { border-color: rgba(255, 158, 135, .3); }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.metric-card, .panel { border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(18px); box-shadow: var(--shadow); }
.metric-card { min-height: 178px; padding: 22px; border-radius: 17px; }
.metric-featured { background: linear-gradient(145deg, rgba(29, 72, 59, .9), rgba(15, 31, 28, .88)); }
.metric-heading { display: flex; align-items: center; gap: 8px; margin-bottom: 32px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.data-kind { margin-left: auto; padding: 4px 7px; border: 1px solid rgba(255, 194, 127, .3); border-radius: 999px; color: var(--amber); background: rgba(255, 194, 127, .07); font-size: 8px; font-style: normal; letter-spacing: .08em; white-space: nowrap; }
.data-kind.live { border-color: var(--line-bright); color: var(--green); background: rgba(112, 234, 187, .08); }
.metric-icon { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: var(--green); background: rgba(112, 234, 187, .09); }
.metric-value { display: block; margin-bottom: 8px; font-size: 28px; letter-spacing: -.04em; }
.metric-value.good { color: var(--green); }
.metric-card p { margin-bottom: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.battery-readout { display: flex; align-items: center; gap: 12px; }
.battery-readout strong { font-size: 35px; letter-spacing: -.05em; }
.battery-shell { position: relative; width: 52px; height: 23px; padding: 3px; border: 1px solid rgba(241, 250, 246, .55); border-radius: 5px; }
.battery-shell::after { position: absolute; content: ""; width: 3px; height: 9px; top: 6px; right: -5px; border-radius: 0 2px 2px 0; background: rgba(241, 250, 246, .55); }
.battery-shell span { display: block; width: 83%; height: 100%; border-radius: 2px; background: var(--green); transition: width .5s ease; }

.content-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 12px; margin-top: 12px; }
.lower-grid { grid-template-columns: .8fr 1.2fr; }
.panel { padding: 26px; border-radius: 19px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.panel-heading .eyebrow { margin-bottom: 6px; }
.panel-stat { color: var(--muted); font-size: 13px; }
.health-pill { display: inline-flex; align-items: center; min-height: 28px; padding: 5px 10px; border: 1px solid var(--line-bright); border-radius: 999px; color: var(--green); background: rgba(112, 234, 187, .08); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.chart-wrap { min-height: 230px; overflow: hidden; }
#battery-chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid line { stroke: rgba(169, 189, 182, .13); stroke-width: 1; }
.chart-line { fill: none; stroke: var(--green); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px rgba(112, 234, 187, .3)); }
.chart-area { fill: url(#none); fill: rgba(112, 234, 187, .07); }
.chart-labels text { fill: var(--muted); font-size: 10px; }
.chart-legend { display: flex; justify-content: space-between; gap: 14px; margin-top: 16px; color: var(--muted); font-size: 11px; }
.chart-legend span:first-child { display: flex; align-items: center; gap: 7px; }
.chart-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.legend-green { background: var(--green); }
.speed-primary { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 34px 0 30px; }
.speed-primary > div { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; }
.speed-primary span { grid-row: 1 / 3; color: var(--green); font-size: 19px; }
.speed-primary strong { font-size: clamp(42px, 5vw, 60px); line-height: .9; letter-spacing: -.065em; }
.speed-primary small { color: var(--muted); font-size: 10px; }
.speed-primary b { font-weight: 500; }
.speed-details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--line); }
.speed-details div { padding: 12px 10px; background: var(--panel-solid); }
.speed-details dt { margin-bottom: 4px; color: var(--muted); font-size: 10px; }
.speed-details dd { margin: 0; font-size: 14px; font-weight: 700; }
.exact-time { margin: 16px 0 0; color: var(--muted); font-size: 10px; }
.diagnostic-list, .timeline { margin: 0; padding: 0; list-style: none; }
.diagnostic-list { display: grid; gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.diagnostic-list li { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 49px; padding: 10px 14px; background: var(--panel-solid); }
.diagnostic-list span { display: flex; align-items: center; gap: 9px; }
.diagnostic-list i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px rgba(112, 234, 187, .55); }
.diagnostic-list b { color: var(--muted); font-size: 12px; font-weight: 600; }
.diagnostic-list strong { color: var(--green); font-size: 11px; }
.timeline { display: grid; gap: 0; }
.timeline li { position: relative; display: grid; grid-template-columns: 114px 1fr auto; align-items: center; min-height: 51px; border-bottom: 1px solid var(--line); font-size: 11px; }
.timeline li:last-child { border-bottom: 0; }
.timeline time { color: var(--muted); }
.timeline span { display: flex; align-items: center; gap: 8px; }
.timeline i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.timeline b { color: var(--muted); font-weight: 500; }
.timeline strong { font-size: 11px; }
.privacy-panel { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; margin-top: 12px; padding: 23px 26px; border: 1px solid var(--line); border-radius: 18px; background: rgba(9, 23, 20, .72); }
.privacy-icon { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 50%; color: var(--green); background: rgba(112, 234, 187, .09); font-size: 20px; }
.privacy-panel h2 { margin-bottom: 4px; font-size: 16px; }
.privacy-panel p { margin-bottom: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.privacy-panel a { min-height: 44px; padding: 13px 0; color: var(--green); font-size: 11px; font-weight: 800; text-decoration: none; }
footer { display: flex; justify-content: space-between; gap: 30px; width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 24px 0 36px; color: #71827c; font-size: 10px; }
footer span:last-child { text-align: right; }

dialog { width: min(590px, calc(100% - 28px)); max-height: calc(100vh - 28px); padding: 0; overflow: auto; border: 1px solid var(--line-bright); border-radius: 22px; color: var(--ink); background: #0b1715; box-shadow: 0 30px 120px rgba(0, 0, 0, .7); }
dialog::backdrop { background: rgba(1, 7, 6, .76); backdrop-filter: blur(7px); }
dialog form { position: relative; display: grid; gap: 18px; padding: clamp(25px, 6vw, 46px); }
dialog .eyebrow { margin-bottom: -8px; }
dialog h2 { font-size: 32px; }
dialog p { margin-bottom: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.dialog-close { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; color: var(--muted); background: transparent; cursor: pointer; font-size: 25px; }
dialog label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; }
dialog input { width: 100%; min-height: 49px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: rgba(0, 0, 0, .2); }
dialog input:focus { border-color: var(--green); }
dialog label small { color: #71827c; font-size: 10px; }
.dialog-warning { display: grid; gap: 4px; padding: 13px; border-left: 3px solid var(--amber); color: var(--muted); background: rgba(255, 194, 127, .06); font-size: 11px; }
.dialog-warning strong { color: var(--amber); }
.form-error { padding: 10px 12px; border: 1px solid rgba(255, 158, 135, .32); border-radius: 8px; color: #ffc7b9; background: rgba(255, 158, 135, .07); }
.dialog-submit { min-height: 50px; border: 0; border-radius: 9px; color: #062117; background: var(--green); cursor: pointer; font-weight: 800; }
noscript { display: block; padding: 20px; color: var(--red); text-align: center; }

@keyframes pulse { 0% { transform: scale(.9); opacity: .9; } 85%, 100% { transform: scale(1.35); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 940px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 56px; }
  .pulse-summary { justify-self: stretch; min-width: 0; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .content-grid, .lower-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .topbar, .shell, footer { width: min(100% - 24px, 1180px); }
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; min-height: 74px; }
  .brand { min-width: 0; }
  .brand strong { white-space: nowrap; }
  .brand small, nav > a { display: none; }
  nav { justify-self: end; gap: 2px; }
  .quiet-button { padding-inline: 10px; }
  .connect-button { display: grid; place-items: center; width: 44px; padding: 0; overflow: hidden; font-size: 0; }
  .connect-button::after { content: "+"; font-size: 22px; line-height: 1; }
  .mode-banner { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; }
  .mode-banner #mode-copy { grid-column: 1 / -1; padding-left: 17px; }
  .mode-banner .text-button { grid-column: 1 / -1; width: 100%; margin-left: 17px; padding: 0; text-align: left; }
  .hero { padding: 48px 0 38px; }
  h1 { font-size: clamp(47px, 13vw, 58px); }
  .pulse-summary { padding: 19px; }
  .pulse-orb { flex-basis: 64px; height: 64px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 154px; }
  .panel { padding: 20px; }
  .panel-heading { margin-bottom: 20px; }
  .speed-primary strong { font-size: 41px; }
  .speed-details { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 100px 1fr; padding: 8px 0; }
  .timeline li > strong { grid-column: 2; }
  .privacy-panel { grid-template-columns: auto 1fr; }
  .privacy-panel a { grid-column: 2; }
  footer { flex-direction: column; }
  footer span:last-child { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
