:root {
  --maroon: #8b1c1f;
  --maroon-dark: #5a0f11;
  --ink: #23191a;
  --muted: #716568;
  --paper: #f7f4ef;
  --panel: #fffdf9;
  --line: #ded5ce;
  --teal: #277b78;
  --gold: #b67c21;
  --shadow: 0 18px 50px rgba(57, 31, 28, 0.09);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(rgba(90, 15, 17, 0.035) 1px, transparent 1px) 0 0 / 100% 28px,
    var(--paper);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
}

button, input { font: inherit; }
a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(139, 28, 31, 0.3); outline-offset: 3px; }

.page-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 20px 0 64px; }
.masthead { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; padding: 10px 0 34px; }
.brand { display: inline-flex; align-items: center; gap: 12px; width: max-content; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 9px; color: white; background: var(--maroon); font: 800 0.8rem/1 Georgia, serif; letter-spacing: 0.06em; box-shadow: 0 7px 18px rgba(90, 15, 17, 0.22); }
.brand strong, .brand small { display: block; }
.brand strong { color: var(--maroon-dark); font: 800 1rem/1.15 Georgia, serif; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; }
.masthead nav { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255, 253, 249, 0.8); }
.masthead nav a { padding: 8px 13px; border-radius: 7px; text-decoration: none; font-size: 0.84rem; font-weight: 700; }
.masthead nav a.is-current { color: white; background: var(--maroon); }
.quiet-button { justify-self: end; border: 0; color: var(--maroon-dark); background: transparent; font-weight: 750; cursor: pointer; }

.login-panel { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(32px, 7vw, 88px); align-items: center; min-height: 66vh; padding: clamp(32px, 7vw, 80px); border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow); }
.login-panel h1, .dashboard-heading h1 { margin: 0; color: var(--maroon-dark); font: 800 clamp(2.4rem, 6vw, 5.6rem)/0.94 Georgia, serif; letter-spacing: -0.045em; }
.login-panel p { max-width: 42ch; color: var(--muted); line-height: 1.65; }
.eyebrow { margin: 0 0 13px !important; color: var(--maroon) !important; font-size: 0.72rem; font-weight: 850; letter-spacing: 0.15em; text-transform: uppercase; }
form { padding: 28px; border-top: 5px solid var(--maroon); background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
form label { display: block; margin: 16px 0 6px; color: var(--muted); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
form input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #cbbfba; border-radius: 7px; color: var(--ink); background: white; }
.primary-button { width: 100%; min-height: 46px; margin-top: 20px; border: 0; border-radius: 7px; color: white; background: var(--maroon); font-weight: 800; cursor: pointer; }
.form-status { min-height: 1.4em; margin: 12px 0 0; color: #a32024 !important; font-size: 0.85rem; }

.dashboard-heading { display: flex; align-items: end; justify-content: space-between; gap: 28px; padding: 42px 0 34px; border-bottom: 2px solid var(--maroon-dark); }
.dashboard-heading h1 { font-size: clamp(2.8rem, 7vw, 6.5rem); }
.lede { max-width: 58ch; margin: 15px 0 0; color: var(--muted); line-height: 1.55; }
.range-control { display: flex; flex: 0 0 auto; gap: 3px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.range-control button { padding: 8px 11px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 0.78rem; font-weight: 800; cursor: pointer; }
.range-control button.is-selected { color: white; background: var(--maroon-dark); }

.status-strip { display: flex; align-items: center; gap: 9px; min-height: 44px; color: var(--muted); font-size: 0.8rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(39, 123, 120, 0.12); }
.status-strip.is-error .status-dot { background: var(--maroon); box-shadow: 0 0 0 4px rgba(139, 28, 31, 0.12); }
.text-button { margin-left: auto; border: 0; color: var(--maroon); background: transparent; font-weight: 800; cursor: pointer; }

.register { padding: 42px 0 52px; border-top: 1px solid var(--line); }
.section-label { display: flex; align-items: baseline; gap: 12px; margin-bottom: 20px; }
.section-label span { color: var(--maroon); font: 700 0.75rem/1 "SFMono-Regular", Consolas, monospace; }
.section-label h2 { margin: 0; font: 800 1.45rem/1.2 Georgia, serif; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); }
.metric-card { position: relative; min-height: 174px; padding: 24px; overflow: hidden; }
.metric-card + .metric-card { border-left: 1px solid var(--line); }
.metric-card::after { content: ""; position: absolute; right: -20px; bottom: -35px; width: 110px; height: 110px; border: 15px solid rgba(139, 28, 31, 0.05); border-radius: 50%; }
.metric-card p { margin: 0; color: var(--muted); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.metric-card strong { display: block; margin: 20px 0 8px; color: var(--maroon-dark); font: 800 clamp(2.8rem, 5vw, 4.5rem)/0.8 Georgia, serif; letter-spacing: -0.06em; }
.metric-card small { color: var(--muted); }
.extension-card strong { color: var(--teal); }
.combined-card strong { color: var(--gold); }

.trend-card, .data-card, .uptime-card { margin-top: 18px; border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); }
.trend-card { padding: 24px; }
.card-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.card-heading h3, .data-card h3, .uptime-card h3 { margin: 0; font: 800 1rem/1.2 Georgia, serif; }
.card-heading p, .card-note { margin: 6px 0 0; color: var(--muted); font-size: 0.78rem; line-height: 1.45; }
.legend { display: flex; gap: 14px; color: var(--muted); font-size: 0.74rem; font-weight: 750; }
.legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--maroon); }
.legend .extension-key::before { background: var(--teal); }
.chart { display: flex; align-items: end; gap: clamp(4px, 1.4vw, 16px); min-height: 220px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); overflow-x: auto; }
.chart-day { display: grid; grid-template-rows: 1fr auto; flex: 1 0 28px; min-width: 28px; height: 185px; text-align: center; }
.bar-pair { display: flex; align-items: end; justify-content: center; gap: 3px; height: 155px; }
.bar { width: min(12px, 42%); min-height: 2px; border-radius: 3px 3px 0 0; background: var(--maroon); }
.bar.extension { background: var(--teal); }
.chart-day small { margin-top: 8px; color: var(--muted); font: 650 0.62rem/1 "SFMono-Regular", Consolas, monospace; }

.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.data-card { margin: 0; padding: 22px; }
.rank-list { display: grid; gap: 13px; margin-top: 24px; }
.rank-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.rank-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.82rem; font-weight: 700; }
.rank-row strong { color: var(--maroon-dark); font: 700 0.75rem/1 "SFMono-Regular", Consolas, monospace; }
.rank-track { grid-column: 1 / -1; height: 3px; background: #e9e1dc; }
.rank-track i { display: block; height: 100%; background: var(--maroon); }

.uptime-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.uptime-card { margin: 0; padding: 24px; border-top: 5px solid var(--teal); }
.uptime-line { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-top: 24px; }
.uptime-value { color: var(--teal); font: 800 clamp(2.5rem, 5vw, 4rem)/0.9 Georgia, serif; letter-spacing: -0.05em; }
.uptime-meta { color: var(--muted); font-size: 0.76rem; line-height: 1.55; text-align: right; }
.empty-state { padding: 26px 0; color: var(--muted); font-size: 0.84rem; }
.privacy-note { display: flex; gap: 18px; padding: 24px; border: 1px solid rgba(39, 123, 120, 0.28); background: rgba(39, 123, 120, 0.07); }
.privacy-note > span { color: var(--teal); font-size: 2rem; }
.privacy-note strong { font-family: Georgia, serif; }
.privacy-note p { margin: 6px 0 0; color: var(--muted); font-size: 0.83rem; line-height: 1.55; }

@media (max-width: 780px) {
  .page-shell { width: min(100% - 22px, 1180px); }
  .masthead { grid-template-columns: 1fr auto; }
  .masthead nav { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; }
  .masthead nav a { flex: 1; text-align: center; }
  .login-panel { grid-template-columns: 1fr; padding: 28px 20px; }
  .dashboard-heading { align-items: start; flex-direction: column; }
  .metric-grid, .detail-grid, .uptime-grid { grid-template-columns: 1fr; }
  .metric-card + .metric-card { border-top: 1px solid var(--line); border-left: 0; }
}

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