:root {
  color-scheme: light;
  --paper: #f5f5ef;
  --surface: #fffefa;
  --ink: #20362e;
  --muted: #6b766e;
  --line: #dfe3d9;
  --teal: #215d4c;
  --teal-hover: #164535;
  --page: #215d4c;
  --secure: #69877a;
  --watch: #c2a564;
  --redirect: #ab725b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
a { color: inherit; }
button, input, select, a { outline-offset: 4px; }
:focus-visible { outline: 2px solid var(--teal); }
button { transition: background .18s, border-color .18s; }
h1, h2, p { margin: 0; }
button span[aria-hidden] { display: inline-block; }
.shell { max-width: 1440px; padding: 0 56px; margin: auto; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 110px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-size: 17px; font-weight: 650; letter-spacing: -.35px; }
.brand-caption { display: block; padding-top: 5px; font-size: 10px; font-weight: 500; letter-spacing: 1.2px; color: var(--muted); text-transform: uppercase; }
.brand-mark { height: 35px; width: 35px; display: flex; align-items: flex-end; gap: 4px; padding: 5px; background: var(--teal); border-radius: 8px; }
.brand-mark i { display: block; background: #e8ede0; border-radius: 1px; width: 5px; }
.brand-mark i:nth-child(1) { height: 10px; }
.brand-mark i:nth-child(2) { height: 17px; }
.brand-mark i:nth-child(3) { height: 24px; }
.header-actions { display: flex; align-items: center; gap: 24px; }
.private-badge { font-size: 12px; color: var(--muted); }
.private-badge span { color: var(--teal); font-size: 9px; padding-right: 6px; }
.text-button { background: none; border: none; color: var(--ink); padding: 10px 0; font-weight: 600; white-space: nowrap; }
.text-button:hover { color: var(--teal); text-decoration: underline; text-underline-offset: 4px; }
.text-button span { margin-left: 8px; }
main { min-height: calc(100svh - 194px); }
.site-footer { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-top: 40px; padding: 24px 0; min-height: 84px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.site-footer > :first-child { font-weight: 650; color: var(--ink); }
.eyebrow { text-transform: uppercase; letter-spacing: 1.8px; font-size: 10px; font-weight: 650; color: var(--muted); }
h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; letter-spacing: -1.7px; line-height: 1.12; }
.intro-copy { color: var(--muted); line-height: 1.7; }
.button { min-height: 42px; border-radius: 7px; border: 1px solid transparent; padding: 10px 16px; font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 16px; white-space: nowrap; }
.primary { color: #fffefa; background: var(--teal); border-color: var(--teal); }
.primary:hover:not(:disabled) { background: var(--teal-hover); border-color: var(--teal-hover); }
.secondary { color: var(--ink); background: var(--surface); border-color: var(--line); }
.secondary:hover:not(:disabled) { background: #edf0e7; border-color: #c3cdbf; }
label, legend { font-weight: 600; color: #536258; font-size: 11px; }
input, select { border: 1px solid var(--line); border-radius: 6px; min-height: 42px; background: var(--surface); padding: 9px 12px; color: var(--ink); }
input:focus, select:focus { border-color: var(--teal); }
.field-error { font-size: 12px; color: #963f30; line-height: 1.6; }
.initializing { min-height: 60svh; display: flex; flex-direction: column; gap: 15px; align-items: center; justify-content: center; color: var(--muted); }
.loader { width: 24px; height: 24px; border: 2px solid var(--line); border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-view { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(40px, 7vw, 110px); align-items: center; max-width: 1000px; margin: auto; padding: 85px 0 55px; }
.login-intro h1 { font-size: clamp(42px, 4.4vw, 64px); margin: 20px 0; }
.login-intro .intro-copy { max-width: 360px; font-size: 15px; }
.login-illustration { margin-top: 36px; max-width: 350px; }
.illustration-line { display: flex; align-items: center; gap: 14px; margin-top: 10px; font-size: 10px; color: #8a938a; }
.illustration-line span { width: 15px; font-variant-numeric: tabular-nums; }
.illustration-line i { display: block; height: 14px; background: var(--page); border-radius: 3px; width: 90%; }
.illustration-line:nth-child(2) i { width: 72%; background: var(--secure); }
.illustration-line:nth-child(3) i { width: 51%; background: var(--watch); }
.illustration-line:nth-child(4) i { width: 35%; background: var(--redirect); }
.illustration-note { display: block; margin: 18px 0 0 29px; color: var(--muted); font-size: 11px; }
.login-card { padding: 36px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 38px #253c2c05; }
.section-marker { display: flex; justify-content: center; align-items: center; width: 39px; height: 39px; border-radius: 50%; background: #ecf0e6; font-size: 20px; color: var(--teal); margin-bottom: 23px; }
.login-card h2 { font: 400 30px/1.25 Georgia, "Times New Roman", serif; letter-spacing: -.6px; }
.login-card > p { color: var(--muted); font-size: 13px; line-height: 1.75; margin-top: 10px; }
#login-form { margin-top: 28px; display: flex; flex-direction: column; gap: 10px; }
#login-form input { min-height: 48px; }
#login-submit { margin-top: 8px; min-height: 48px; justify-content: space-between; }
.login-card > .login-note { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 26px; font-size: 11px; }
.page-intro { padding: 44px 0 30px; display: flex; gap: 24px; justify-content: space-between; align-items: flex-end; }
.page-intro h1 { font-size: clamp(34px, 3.5vw, 48px); margin: 12px 0; }
.page-intro .intro-copy { font-size: 13px; }
.update-controls { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; padding-bottom: 3px; }
.update-controls p { color: var(--muted); font-size: 10px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; padding: 18px; background: #eeefe7; border-radius: 10px; border: 1px solid var(--line); }
.filter-field { display: flex; flex-direction: column; gap: 8px; }
.funnel-field { flex: 1; min-width: 180px; }
.filter-field input { max-width: 160px; font-size: 12px; }
.filter-field select { min-width: 175px; font-size: 12px; }
.preset-field { padding: 0; margin: 0; border: 0; min-width: 196px; }
.preset-field legend { margin-bottom: 8px; }
.preset-field legend span { font-weight: 400; }
.presets { display: flex; border-radius: 6px; padding: 3px; min-height: 42px; border: 1px solid var(--line); background: #e6e9df; }
.preset { flex: 1; border: 0; border-radius: 4px; background: transparent; padding: 7px 10px; color: #6b766e; font-size: 11px; white-space: nowrap; }
.preset:hover { background: #f5f5ef; }
.preset[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px #20362e0d; font-weight: 600; }
#filter-error { flex-basis: 100%; }
.data-status { min-height: 28px; padding-top: 7px; color: var(--muted); font-size: 11px; }
.error-banner { display: flex; justify-content: space-between; align-items: center; gap: 20px; background: #fff1ec; border: 1px solid #ebcebf; padding: 10px 18px; margin-top: 18px; border-radius: 8px; font-size: 12px; color: #873f2f; }
.error-banner .text-button { color: #873f2f; font-size: 12px; }
.empty-state { display: flex; gap: 16px; align-items: center; padding: 22px 24px; border: 1px dashed #bbc9b9; border-radius: 10px; background: #edf1e8; margin-bottom: 22px; }
.empty-icon { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex-shrink: 0; border: 1px solid #cdd7c7; border-radius: 50%; font-size: 20px; color: var(--teal); }
.empty-state h2 { font-size: 15px; font-weight: 600; margin-bottom: 5px; }
.empty-state p { color: var(--muted); font-size: 12px; line-height: 1.6; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metric-card { position: relative; border: 1px solid var(--line); padding: 20px 22px 23px; border-radius: 10px; background: var(--surface); overflow: hidden; }
.metric-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.metric-heading h2 { font-size: 12px; font-weight: 600; }
.step { font-size: 10px; color: #9aa397; font-variant-numeric: tabular-nums; }
.metric-value { font-size: clamp(30px, 3vw, 43px); line-height: 1.2; font-weight: 450; letter-spacing: -1.7px; font-variant-numeric: tabular-nums; margin: 19px 0 9px; overflow-wrap: anywhere; }
.metric-caption { color: var(--muted); font-size: 10px; line-height: 1.6; }
.metric-rule { height: 3px; position: absolute; bottom: 0; left: 22px; width: 32px; border-radius: 3px 3px 0 0; }
.event-page { background: var(--page); }
.event-secure { background: var(--secure); }
.event-watch { background: var(--watch); }
.event-redirect { background: var(--redirect); }
.analysis-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 20px; margin-top: 22px; }
.panel { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 26px; min-width: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.panel-heading .eyebrow { font-size: 9px; letter-spacing: 1.3px; margin-bottom: 8px; }
.panel-heading h2 { font-size: 23px; font-family: Georgia, "Times New Roman", serif; font-weight: 400; letter-spacing: -.5px; }
.panel-tag { font-size: 9px; letter-spacing: .2px; color: var(--muted); padding: 5px 8px; border: 1px solid var(--line); border-radius: 4px; white-space: nowrap; }
.stage-row { margin-bottom: 20px; }
.stage-labels { display: flex; gap: 15px; justify-content: space-between; align-items: center; font-size: 11px; margin-bottom: 8px; }
.stage-labels strong { font-weight: 600; font-variant-numeric: tabular-nums; }
.stage-labels .stage-number { color: #8d998c; font-size: 9px; margin-right: 10px; }
.stage-track { height: 10px; background: #f0f1ea; border-radius: 3px; overflow: hidden; }
.stage-bar { height: 100%; border-radius: 3px; }
.stage-ratio { color: var(--muted); font-size: 10px; padding-top: 6px; line-height: 1.5; text-align: right; }
.ratio-summary { border-top: 1px solid var(--line); padding-top: 17px; margin-top: 3px; display: flex; gap: 20px; justify-content: space-between; align-items: center; font-size: 10px; color: var(--muted); }
.ratio-summary strong { color: var(--teal); font-size: 22px; font-weight: 500; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.panel-note { font-size: 10px; line-height: 1.65; color: var(--muted); margin-top: 15px; }
.panel-note a { text-underline-offset: 4px; }
.chart-legend { list-style: none; padding: 0; margin: -2px 0 16px; display: flex; flex-wrap: wrap; column-gap: 16px; row-gap: 9px; color: var(--muted); font-size: 9px; }
.chart-legend li { display: flex; gap: 6px; align-items: center; }
.chart-legend span { display: block; width: 7px; height: 7px; border-radius: 2px; }
.chart { min-height: 265px; display: flex; align-items: center; justify-content: center; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 75px 20px; }
.trend-panel .panel-note { margin-top: 12px; }
.table-panel { padding-bottom: 0; margin-top: 22px; overflow: hidden; }
.table-panel .panel-heading { margin-bottom: 20px; }
.table-scroll { overflow-x: auto; margin: 0 -26px; padding: 0 26px; }
table { border-collapse: collapse; text-align: right; width: 100%; white-space: nowrap; font-size: 11px; }
th, td { border-top: 1px solid var(--line); padding: 15px 12px; font-variant-numeric: tabular-nums; }
th { color: var(--muted); font-weight: 500; font-size: 10px; }
th:first-child, td:first-child { text-align: left; padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
thead th { padding-top: 15px; padding-bottom: 15px; }
thead th span { font-size: 8px; color: #9aa397; margin-left: 5px; }
tbody tr:hover { background: #f6f7f0; }
tbody td:first-child { font-weight: 500; }
tfoot th, tfoot td { font-weight: 650; color: var(--ink); padding-top: 18px; padding-bottom: 18px; }
td.table-empty { text-align: center; color: var(--muted); padding: 30px 12px; font-weight: 400; }
.measurement-note { display: flex; gap: 10px; max-width: 970px; margin-top: 22px; color: var(--muted); }
.measurement-note > span { margin-top: 2px; font-size: 13px; }
.measurement-note p { font-size: 10px; line-height: 1.8; }
.measurement-note strong { font-weight: 600; color: #55665a; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 100; background: var(--surface); color: var(--ink); padding: 12px 18px; border: 1px solid var(--teal); border-radius: 4px; }

@media (min-width: 1450px) { .page-intro { padding-top: 52px; } }
@media (max-width: 1100px) {
  .shell { padding-inline: 32px; }
  .filter-bar { gap: 12px; }
  .funnel-field { flex-basis: 34%; }
  .preset-field { flex: 1; }
  .filter-field:has(input) { flex: 1; }
  .filter-field input { max-width: none; width: 100%; }
  .metrics { gap: 12px; }
  .metric-card { padding: 18px 16px 22px; }
  .metric-rule { left: 16px; }
  .metric-heading { align-items: flex-start; }
  .analysis-grid { grid-template-columns: 1fr 1.2fr; gap: 16px; }
  .panel { padding: 22px; }
  .table-panel { padding-bottom: 0; }
  .table-scroll { margin-inline: -22px; padding-inline: 22px; }
  .panel-tag { display: none; }
  .chart { min-height: 280px; }
}
@media (max-width: 800px) {
  .shell { padding-inline: 24px; }
  .site-header { min-height: 90px; }
  .private-badge { display: none; }
  .page-intro { padding-top: 32px; }
  .page-intro h1 { font-size: 37px; }
  .update-controls { min-width: 125px; }
  .update-controls p { max-width: 150px; text-align: right; line-height: 1.5; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-value { font-size: 38px; }
  .metric-heading h2 { font-size: 13px; }
  .metric-caption { font-size: 11px; }
  .analysis-grid { grid-template-columns: 1fr; }
  .panel-tag { display: block; }
  .chart { min-height: 235px; }
  .chart svg { max-height: 300px; }
  .login-view { gap: 40px; padding-top: 60px; }
  .login-intro h1 { font-size: 41px; }
  .login-intro .intro-copy { font-size: 13px; }
  .login-card { padding: 26px; }
}
@media (max-width: 580px) {
  .shell { padding-inline: 18px; }
  .site-header { min-height: 80px; }
  .brand { font-size: 15px; gap: 10px; }
  .brand-caption { font-size: 8px; }
  .brand-mark { width: 31px; height: 32px; }
  .brand-mark i:nth-child(3) { height: 22px; }
  .text-button { font-size: 12px; }
  .header-actions { gap: 8px; }
  .page-intro { display: block; padding: 28px 0 23px; }
  .page-intro h1 { font-size: 34px; letter-spacing: -1.2px; }
  .page-intro .eyebrow { font-size: 9px; }
  .update-controls { margin-top: 20px; flex-direction: row-reverse; align-items: center; justify-content: space-between; gap: 12px; }
  .update-controls p { max-width: none; font-size: 9px; }
  .update-controls .button { min-height: 37px; padding: 8px 12px; }
  .filter-bar { padding: 14px; gap: 13px 10px; }
  .funnel-field { flex-basis: 100%; }
  .preset-field { flex-basis: 100%; }
  .filter-field:has(input) { flex-basis: calc(50% - 5px); min-width: 0; }
  .filter-field input { min-width: 0; padding: 8px; font-size: 16px; }
  .filter-field select, #password { font-size: 16px; }
  #apply-filter { width: 100%; }
  .presets { min-height: 40px; }
  .preset { padding: 8px 14px; }
  .metrics { gap: 10px; }
  .metric-card { padding: 17px 14px 20px; }
  .metric-heading h2 { font-size: 11px; }
  .metric-heading .step { font-size: 8px; }
  .metric-value { font-size: 35px; margin-top: 16px; }
  .metric-caption { font-size: 10px; line-height: 1.7; }
  .metric-rule { left: 14px; }
  .panel { padding: 20px; }
  .panel-heading { margin-bottom: 22px; }
  .panel-heading h2 { font-size: 23px; }
  .panel-tag { font-size: 8px; }
  .analysis-grid { margin-top: 16px; gap: 16px; }
  .stage-labels { font-size: 12px; }
  .stage-row { margin-bottom: 20px; }
  .stage-ratio { font-size: 10px; }
  .ratio-summary { font-size: 10px; }
  .panel-note { font-size: 10px; }
  .chart { min-height: 185px; }
  .chart-legend { column-gap: 13px; row-gap: 11px; font-size: 10px; }
  .table-panel { margin-top: 16px; padding-bottom: 0; }
  .table-panel .button { gap: 8px; font-size: 10px; min-height: 36px; padding: 8px 10px; }
  .table-scroll { margin-inline: -20px; padding-inline: 20px; }
  th, td { padding-inline: 14px; }
  .measurement-note { margin-top: 18px; }
  .site-footer { margin-top: 28px; font-size: 9px; padding-block: 20px; }
  .login-view { display: block; padding: 35px 0 15px; }
  .login-intro h1 { margin: 15px 0; font-size: 42px; }
  .login-intro .intro-copy { max-width: 370px; }
  .login-illustration { display: none; }
  .login-card { margin-top: 30px; padding: 25px; }
  .login-card h2 { font-size: 27px; }
  .section-marker { margin-bottom: 18px; }
  .empty-state { padding: 18px; align-items: flex-start; }
  .empty-icon { display: none; }
  .error-banner { align-items: flex-start; flex-direction: column; gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition: none !important; }
}
