:root {
  color-scheme: light;
  --ink: #0f172a;
  --muted: #64748b;
  --paper: #f8fafc;
  --card: #ffffff;
  --line: #e2e8f0;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-ink: #ffffff;
  --accent-soft: #eef2ff;
  --danger: #b91c1c;
  --danger-hover: #991b1b;
  --ok: #047857;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.05);
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::placeholder { color: #94a3b8; }
.icon { width: 1.05rem; height: 1.05rem; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1 { display: flex; align-items: center; gap: 0.45rem; font-size: 1.65rem; letter-spacing: -0.03em; margin: 0 0 0.35rem; }
.card ul, .card ol { margin: 0.2rem 0 0; padding-left: 1.1rem; }
h2 { font-size: 0.95rem; margin: 0 0 0.75rem; }
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; align-items: start; }
.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.25rem 0.9rem;
  background: #0b1220;
  color: #e8eefc;
  overflow: hidden;
}
.brand { display: flex; align-items: center; gap: 0.65rem; color: white; font-weight: 650; text-decoration: none; padding: 0.2rem 0.45rem; }
.brand:hover { text-decoration: none; }
.mark { width: 1.7rem; height: 1.7rem; border-radius: 8px; display: grid; place-items: center; background: var(--accent); color: white; font-size: 0.9rem; }
.nav { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; min-height: 0; overflow: auto; }
.nav a { color: #cbd5e1; text-decoration: none; display: flex; align-items: center; gap: 0.55rem; padding: 0.48rem 0.7rem; border-radius: 8px; }
.nav a:hover, .nav a.active { background: rgba(255, 255, 255, 0.08); color: white; text-decoration: none; }
.side-foot { margin-top: auto; padding: 0.4rem 0 0; flex: none; }
.side-foot form { width: 100%; }
.side button, .ghost {
  background: transparent;
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
}
.side button { display: flex; align-items: center; justify-content: center; gap: 0.4rem; width: 100%; }
.main button, .button {
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font: inherit;
}
.main button:hover, .button:hover { background: var(--accent-hover); text-decoration: none; }
.main button:disabled, .button:disabled { opacity: 0.5; cursor: not-allowed; }
.main .ghost { color: var(--ink); border: 1px solid var(--line); background: white; padding: 0.28rem 0.55rem; font-size: 0.78rem; }
.main .ghost:hover { background: var(--accent-soft); }
.main button.danger { background: var(--danger); }
.main button.danger:hover { background: var(--danger-hover); }
.main { padding: 1.6rem 1.8rem 2.5rem; }
.page-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-end; margin-bottom: 1.1rem; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.section-title { margin: 0.2rem 0 0.7rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1rem 1.1rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
label { display: block; margin: 0.7rem 0 0.25rem; color: var(--muted); font-size: 0.86rem; }
input, select { width: 100%; max-width: 32rem; padding: 0.55rem 0.7rem; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); }
.filters { display: flex; gap: 0.6rem; align-items: end; flex-wrap: wrap; }
.filters label { margin: 0; }
.filters input { width: 10.5rem; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.55rem 0.35rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 0.75rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; }
tr:hover td { background: #f8fafc; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
pre.snippet { white-space: pre-wrap; word-break: break-word; background: #f8fafc; padding: 0.8rem; border-radius: 10px; border: 1px solid var(--line); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.8rem; }
.sites { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 0.8rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.8rem; margin-bottom: 1rem; }
.kpis > .card, .sites > .card, .grid > .card, .board > .card, .stage > .card { margin-bottom: 0; }
.crumb { margin: 0 0 0.35rem; }
.table-wrap { overflow-x: auto; margin-bottom: 1rem; }
.card > .table-wrap, .card > .table-wrap:last-child { margin-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
code { font-size: 0.86em; background: #f1f5f9; padding: 0.12rem 0.35rem; border-radius: 6px; }
.button-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.form .button-row { margin: 1rem 0 0; }
.empty-note { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; gap: 0.15rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.checks { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.checks li { display: flex; align-items: center; gap: 0.45rem; padding: 0.28rem 0; }
.checks li .icon { color: var(--ok); }
.checks li.fail .icon { color: var(--danger); }
.stage > .card { display: flex; flex-direction: column; }
.form { max-width: 32rem; }
input[type="checkbox"], input[type="radio"] { width: auto; max-width: none; accent-color: var(--accent); }
fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 0.8rem 0; padding: 0.4rem 0.9rem 0.8rem; }
legend { color: var(--muted); font-size: 0.86rem; padding: 0 0.3rem; }
.stat strong { display: block; font-size: 1.7rem; letter-spacing: -0.04em; margin-top: 0.35rem; }
.stat span, .eyebrow { color: var(--muted); font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; }
.metrics { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.metrics .stat { display: flex; align-items: center; gap: 0.75rem; }
.metrics .mark {
  width: 2.4rem; height: 2.4rem; border-radius: 12px; display: grid; place-items: center; flex: none;
  text-transform: none; letter-spacing: 0;
}
.metrics .mark .icon { width: 1.15rem; height: 1.15rem; }
.metrics .mark.visits { background: #eef2ff; color: #4f46e5; }
.metrics .mark.visitors { background: #eff6ff; color: #1d4ed8; }
.metrics .mark.pages { background: #f5f3ff; color: #6d28d9; }
.metrics .mark.bounce { background: #fff7ed; color: #c2410c; }
.metrics .mark.time { background: #f1f5f9; color: #334155; }
.metrics .mark.live { background: #ecfdf5; color: #047857; }
.metrics .copy { display: flex; flex-direction: column; min-width: 0; text-transform: none; letter-spacing: 0; }
.metrics .copy strong { margin-top: 0.1rem; font-size: 1.45rem; }
.site-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.8rem; }
a.site-tile { display: flex; align-items: center; gap: 0.85rem; margin: 0; min-height: 4.6rem; color: inherit; text-decoration: none; }
a.site-tile:hover { border-color: #c7d2fe; background: #fafbff; text-decoration: none; }
a.site-tile .mark { width: 2.4rem; height: 2.4rem; border-radius: 12px; display: grid; place-items: center; flex: none; background: #eef2ff; color: #4f46e5; }
a.site-tile .mark .icon { width: 1.15rem; height: 1.15rem; }
a.site-tile strong { font-size: 1rem; letter-spacing: -0.02em; }
a.site-tile .go { margin-left: auto; color: #94a3b8; }
a.site-tile:hover .go { color: var(--accent); }
a.site-card { display: flex; flex-direction: column; gap: 0.7rem; color: inherit; text-decoration: none; }
a.site-card:hover { border-color: #c7d2fe; text-decoration: none; }
.site-card h2 { margin: 0; font-size: 1.05rem; display: flex; align-items: center; gap: 0.35rem; }
.quick { display: flex; flex-wrap: wrap; gap: 0.35rem 0.85rem; color: var(--muted); font-size: 0.82rem; }
.quick strong { color: var(--ink); }
.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 0.8rem; }
.board { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin-bottom: 1rem; }
.board > .card { margin-bottom: 0; }
.setup { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.setup > .card { margin-bottom: 0; }
.setup > .wide { grid-column: 1 / -1; }
.card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; }
.card-top h2 { margin: 0; }
.card-top a { font-size: 0.8rem; }
.rank { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.15rem 0.75rem; align-items: center; padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.rank:last-child { border-bottom: 0; }
.rank .name { display: flex; align-items: center; gap: 0.45rem; min-width: 0; overflow: hidden; }
.rank .name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .meter { grid-column: 1 / -1; }
.rank strong { font-variant-numeric: tabular-nums; }
canvas.chart.chart-lg { height: 260px; }
.stat.live strong { color: var(--ok); }
.stage { display: grid; grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.7fr); gap: 0.8rem; margin-bottom: 1rem; }
.stage > .card { margin-bottom: 0; }
.pulse { width: 0.5rem; height: 0.5rem; border-radius: 99px; background: var(--ok); display: inline-block; margin-right: 0.35rem; box-shadow: 0 0 0 0 rgba(4, 120, 87, 0.45); animation: pulse 1.8s ease-out infinite; vertical-align: 0.05rem; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(5, 150, 105, 0); } }
.live-list { max-height: 320px; overflow: auto; margin-top: 0.4rem; }
.live-row { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); gap: 0.15rem 0.7rem; align-items: center; padding: 0.55rem 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.live-row:last-child { border-bottom: 0; }
.live-row:hover { text-decoration: none; }
.live-row .when { color: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.live-row .where { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-row .meta { grid-column: 2; color: var(--muted); font-size: 0.78rem; display: flex; align-items: center; gap: 0.35rem; text-transform: none; letter-spacing: 0; }
.live-hero { display: flex; align-items: baseline; gap: 0.8rem; }
.live-hero strong { font-size: 2.4rem; letter-spacing: -0.04em; line-height: 1; }
.actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 0.6rem; margin-bottom: 1rem; }
.actions a { display: flex; align-items: center; gap: 0.55rem; min-height: 2.8rem; padding: 0.7rem 0.85rem; background: white; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04); }
.actions a .icon { color: #4f46e5; }
.flag { width: 1.35rem; height: 1rem; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.14); flex: none; }
.device-mark { width: 1.6rem; height: 1.6rem; border-radius: 8px; display: inline-grid; place-items: center; flex: none; background: #eef2ff; color: #4338ca; }
.device-mark .icon { width: 0.95rem; height: 0.95rem; }
.device-mark.mobile, .device-mark.phone { background: #ecfdf5; color: #047857; }
.device-mark.tablet { background: #fff7ed; color: #c2410c; }
td .flag, td .device-mark { margin-right: 0.45rem; vertical-align: middle; }
.card-top a, h2 { display: inline-flex; align-items: center; gap: 0.35rem; }
h2 { display: flex; }
.actions a:hover { border-color: #c7d2fe; background: #f8fafc; text-decoration: none; }
.meter { height: 6px; background: #eef2f7; border-radius: 99px; overflow: hidden; min-width: 4rem; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.row-label { display: flex; justify-content: space-between; gap: 0.8rem; }
canvas.chart { width: 100%; height: 210px; display: block; }
.chips { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0 0 1rem; }
.chip { background: white; border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.55rem; color: var(--muted); font-size: 0.8rem; }
.auth { max-width: 28rem; margin: 8vh auto; }
.auth.wide { max-width: 36rem; }
body:has(.auth) { background: var(--paper); }
.gate-main { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.gate-card { width: min(100%, 26rem); margin: 0; padding: 1.5rem 1.4rem 1.25rem; }
.gate-mark { display: flex; align-items: center; gap: 0.55rem; margin: 0 0 1rem; font-weight: 650; }
.gate-card h1 { margin-bottom: 0.35rem; }
.gate-card input { max-width: none; }
.gate-card .error { margin: 0.2rem 0 0.4rem; padding: 0.6rem 0.7rem; border-radius: 10px; background: #fef2f2; border: 1px solid #fecaca; }
.gate-card button { width: 100%; justify-content: center; margin-top: 0.35rem; }
.gate-main:has(.install-card) { place-items: start center; padding: 2.25rem 1.25rem 3rem; }
.install-card { width: min(100%, 42rem); }
.install-card h2 { margin-top: 0.8rem; }
.check-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.15rem 1.2rem; margin: 0.2rem 0 0.8rem; padding: 0.35rem 0.2rem; }
.env-line { margin: 0 0 0.4rem; }
.mode-set { display: grid; gap: 0.45rem; }
.mode-set label { display: flex; align-items: center; gap: 0.55rem; margin: 0; padding: 0.7rem 0.8rem; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); }
.mode-set label:has(input:checked) { border-color: #c7d2fe; background: var(--accent-soft); }
.install-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.8rem; }
.install-grid .span { grid-column: 1 / -1; }
.install-grid input { max-width: none; }
@media (max-width: 900px) {
  .split, .board, .stage, .setup { grid-template-columns: 1fr; }
  .setup > .wide { grid-column: auto; }
}
@media (max-width: 800px) {
  .check-grid, .install-grid { grid-template-columns: 1fr; }
  .install-grid .span { grid-column: auto; }
  .shell { grid-template-columns: 1fr; }
  .side {
    position: sticky;
    top: 0;
    height: auto;
    overflow: visible;
    z-index: 5;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "brand foot" "nav nav";
    align-items: center;
    gap: 0.45rem 0.7rem;
    padding: 0.7rem;
  }
  .brand { grid-area: brand; }
  .nav { grid-area: nav; flex-direction: row; width: 100%; overflow-x: auto; }
  .nav a { white-space: nowrap; }
  .side-foot { grid-area: foot; margin-top: 0; }
  .side-foot form, .side button { width: auto; }
  .main { padding: 1rem; }
  .filters { width: 100%; }
  .filters input { width: 100%; }
}
