:root {
  color-scheme: light;
  --ink: #17233d;
  --muted: #667089;
  --line: #dfe4ee;
  --soft: #f4f6fa;
  --panel: #ffffff;
  --navy: #101a33;
  --blue: #2458e6;
  --aqua: #56d8d3;
  --green: #18784f;
  --amber: #a45c06;
  --danger: #b42318;
  --shadow: 0 20px 60px rgba(23, 35, 61, .10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--soft); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue); }
.topbar { height: 76px; padding: 0 clamp(20px, 4vw, 64px); background: var(--navy); color: white; display: flex; align-items: center; gap: 18px; }
.brand { color: white; text-decoration: none; font-size: 24px; letter-spacing: -.06em; padding-right: 18px; border-right: 1px solid rgba(255,255,255,.22); }
.brand b { display: inline-grid; place-items: center; width: 29px; height: 29px; margin-left: 2px; border-radius: 50%; color: var(--navy); background: var(--aqua); }
.topbar-copy { display: grid; gap: 2px; }
.topbar-copy small { color: #aeb9d2; }
.account { margin-left: auto; display: flex; gap: 16px; align-items: center; color: #d8def0; font-size: 14px; }
main { max-width: 1420px; margin: 0 auto; padding: 54px clamp(20px, 4vw, 64px) 80px; }
.hero-grid { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 34px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(36px, 5vw, 65px); line-height: .98; letter-spacing: -.055em; }
h2 { margin-bottom: 20px; font-size: 20px; letter-spacing: -.02em; }
.eyebrow { margin-bottom: 10px; color: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.lede { max-width: 670px; margin-bottom: 0; color: var(--muted); font-size: 18px; }
.button, button.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border: 1px solid var(--blue); border-radius: 9px; background: var(--blue); color: white; font-weight: 750; text-decoration: none; cursor: pointer; box-shadow: 0 8px 20px rgba(36,88,230,.20); }
.quiet { min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: inherit; cursor: pointer; }
.topbar .quiet { border-color: rgba(255,255,255,.28); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin-bottom: 16px; }
.metrics article, .panel { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 5px 20px rgba(23,35,61,.035); }
.metrics article { padding: 22px; }
.metrics span { display: block; margin-bottom: 10px; color: var(--muted); font-size: 13px; }
.metrics strong { font-size: 32px; letter-spacing: -.04em; }
.analytics-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.panel { padding: 24px; min-width: 0; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.panel-heading h2 { margin-bottom: 0; }
.chart { height: 190px; display: flex; align-items: end; gap: 5px; padding-top: 20px; }
.bar-column { flex: 1; min-width: 3px; height: 100%; display: flex; align-items: end; position: relative; }
.bar-column i { width: 100%; min-height: 2px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, var(--aqua), var(--blue)); }
.bar-column span { display: none; position: absolute; z-index: 2; bottom: calc(100% + 5px); left: 50%; transform: translateX(-50%); padding: 4px 6px; border-radius: 5px; background: var(--navy); color: white; white-space: nowrap; font-size: 11px; }
.bar-column:hover span { display: block; }
.ranking { display: grid; gap: 15px; }
.rank-row { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; font-size: 13px; }
.rank-row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row i { grid-column: 1 / -1; height: 5px; border-radius: 10px; background: var(--soft); overflow: hidden; }
.rank-row i::after { content: ""; display: block; width: var(--width); height: 100%; background: var(--blue); }
.links-panel { padding: 0; overflow: hidden; }
.links-panel > .panel-heading { padding: 24px; }
.search input { width: min(330px, 35vw); padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 18px; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: 13px; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; background: #fafbfc; }
td strong, td small { display: block; }
td small { max-width: 420px; margin-top: 4px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.short-link { color: var(--blue); font-weight: 800; text-decoration: none; }
.pill { display: inline-flex; padding: 4px 8px; border-radius: 100px; background: #eaf8f2; color: var(--green); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.pill.disabled { background: #fff2e2; color: var(--amber); }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.row-actions button, .row-actions a { padding: 6px 8px; border: 0; background: transparent; color: var(--blue); cursor: pointer; font-weight: 700; text-decoration: none; }
.message { min-height: 0; padding: 0 24px; color: var(--green); }
.message:not(:empty) { padding-bottom: 15px; }
.message.error { color: var(--danger); }
.empty { padding: 30px; color: var(--muted); text-align: center; }
dialog { width: min(670px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 16px; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(16,26,51,.66); backdrop-filter: blur(3px); }
dialog form { padding: 28px; }
.dialog-heading, .dialog-actions { display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.icon-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: transparent; font-size: 24px; cursor: pointer; }
label { display: grid; gap: 7px; margin-bottom: 17px; color: var(--ink); font-size: 13px; font-weight: 700; }
label small { color: var(--muted); font-weight: 500; }
input, select { min-width: 0; padding: 12px 13px; border: 1px solid #cbd2df; border-radius: 8px; color: var(--ink); background: white; }
input:focus, select:focus { border-color: var(--blue); outline: 3px solid rgba(36,88,230,.12); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dialog-actions { justify-content: flex-end; align-items: center; margin-top: 8px; }
.form-error { min-height: 22px; color: var(--danger); font-size: 13px; }
.signed-out { display: grid; min-height: calc(100vh - 76px); place-items: center; }
.login-card, .public-card { max-width: 610px; padding: clamp(32px,7vw,70px); border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: var(--shadow); }
.login-card h1, .public-card h1 { font-size: clamp(38px,6vw,62px); }
.login-card p:not(.eyebrow), .public-card p:not(.eyebrow) { margin-bottom: 28px; color: var(--muted); font-size: 18px; line-height: 1.6; }
.login-card .quiet { margin-left: 10px; }
.public { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 15% 10%, #dffbf9, transparent 32%), var(--navy); }
.public main { padding: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
@media (max-width: 900px) { .analytics-grid { grid-template-columns: 1fr 1fr; } .analytics-grid .panel:first-child { grid-column: 1 / -1; } .metrics { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .topbar-copy { display: none; } .hero-grid { align-items: start; flex-direction: column; } .metrics, .analytics-grid, .field-grid { grid-template-columns: 1fr; } .analytics-grid .panel:first-child { grid-column: auto; } .search input { width: 100%; } .links-panel > .panel-heading { align-items: stretch; flex-direction: column; } }
