@font-face {
    font-family: WTC Anton;
    src: url('./anton.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: WTC Oswald;
    src: url('./oswald-500.ttf') format('truetype');
    font-display: swap;
}

@font-face {
    font-family: WTC Inter;
    src: url('./inter-400.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: WTC Inter;
    src: url('./inter-600.ttf') format('truetype');
    font-weight: 600 900;
    font-display: swap;
}

:root {
    color-scheme: light;
    --ink: #14211d;
    --ink-soft: #20332d;
    --paper: #f1f4ef;
    --surface: #fbfcf8;
    --line: #d7dfd7;
    --muted: #6f7d75;
    --lime: #c7f36b;
    --lime-deep: #94c83d;
    --coral: #e66f57;
    --sky: #80b7c3;
    --display: WTC Anton, Impact, sans-serif;
    --numeric: WTC Oswald, Impact, sans-serif;
    --body: WTC Inter, sans-serif;
    --shadow: 0 14px 36px rgb(20 33 29 / 7%);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body {
    margin: 0;
    color: var(--ink);
    background-color: var(--paper);
    background-image: linear-gradient(rgb(32 51 45 / 2%) 1px, transparent 1px), linear-gradient(90deg, rgb(32 51 45 / 2%) 1px, transparent 1px);
    background-size: 34px 34px;
    font-family: var(--body);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.login-page { min-height: 100svh; overflow: hidden; color: #f1f4ef; background: var(--ink); }
.login-shell { display: grid; min-height: 100svh; padding: 22px; place-items: center; }
.login-content {
    position: relative;
    display: grid;
    width: min(100%, 390px);
    gap: 11px;
    padding: 32px;
    border: 1px solid rgb(199 243 107 / 28%);
    border-top: 4px solid var(--lime);
    background: #1b2b25;
    box-shadow: 0 28px 90px rgb(0 0 0 / 25%);
    animation: lift-in 500ms cubic-bezier(.2,.7,.2,1) both;
}
.rail-brand { display: block; width: 36px; height: 36px; }
.rail-brand img { display: block; width: 100%; height: 100%; border-radius: 8px; }
.login-mark, .site-entry__mark {
    display: grid;
    width: 43px;
    aspect-ratio: 1;
    place-items: center;
    color: var(--ink);
    background: var(--lime);
    font-family: var(--display);
    font-size: 27px;
}
.login-mark { overflow: hidden; border-radius: 3px; padding: 0; }
.login-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.login-content h1 { margin: 5px 0 13px; font-family: var(--display); font-size: 40px; font-weight: 400; line-height: 1; }
.login-content label { margin-top: 5px; color: #b7c3bc; font-size: 10px; font-weight: 600; text-transform: uppercase; }
.login-content input:not([type=hidden]) {
    width: 100%;
    min-height: 48px;
    padding: 0 13px;
    border: 1px solid #45584f;
    border-radius: 3px;
    outline: none;
    color: #f1f4ef;
    background: #14211d;
}
.login-content input:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgb(199 243 107 / 14%); }
.login-error { margin: 3px 0 0; color: #ff9a86; font-size: 12px; }

.button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 15px;
    border: 1px solid transparent;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.button:active { transform: translateY(1px); }
.button:focus-visible, .logout-button:focus-visible, .site-entry:focus-visible, .back-button:focus-visible { outline: 3px solid var(--lime-deep); outline-offset: 3px; }
.button-dark { color: var(--ink); background: var(--lime); }
.button-dark:hover { background: #d8fb91; }
.login-submit { min-height: 49px; margin-top: 11px; }

.app-shell { min-height: 100vh; }
.rail {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 3;
    display: flex;
    width: 66px;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    padding: 19px 0;
    color: #ecf2ed;
    background: var(--ink);
    box-shadow: 5px 0 20px rgb(20 33 29 / 8%);
}
.rail-brand { font-family: var(--display); font-size: 27px; line-height: 1; }
.rail-brand span { color: var(--lime); }
.rail-label { writing-mode: vertical-rl; color: #9aaba1; font-family: var(--numeric); font-size: 10px; letter-spacing: 1px; }
.rail-active { display: grid; width: 34px; aspect-ratio: 1; place-items: center; color: var(--ink); background: var(--lime); font-family: var(--numeric); font-size: 13px; }
.rail-spacer { flex: 1; }
.rail-live { width: 8px; height: 8px; margin-bottom: 5px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgb(199 243 107 / 15%); }

.main-content { width: min(calc(100% - 66px), 1540px); margin-left: 66px; padding: 0 clamp(20px, 4vw, 64px) 34px; }
.topbar { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.topbar-brand { font-family: var(--numeric); font-size: 13px; font-weight: 500; letter-spacing: .4px; }
.topbar-brand span { color: var(--muted); }
.topbar-actions { display: flex; align-items: center; gap: 22px; }
.topbar-date { color: var(--muted); font-size: 11px; }
.logout-button { padding: 8px 0 8px 10px; border: 0; background: transparent; font-size: 10px; font-weight: 600; cursor: pointer; }
.logout-button span { margin-left: 6px; color: var(--coral); font-size: 15px; }

.eyebrow { display: flex; align-items: center; gap: 9px; margin: 0; color: var(--muted); font-size: 9px; font-weight: 600; }
.status-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 3px rgb(230 111 87 / 14%); }
.sites-screen { max-width: 980px; padding: 54px 0 32px; animation: lift-in 480ms ease-out both; }
.sites-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding-bottom: 27px; }
.sites-heading h1 { margin: 12px 0 0; font-family: var(--display); font-size: clamp(38px, 6vw, 60px); font-weight: 400; line-height: .95; }
.sites-heading h1 span { color: #438069; }
.sites-heading > p { max-width: 260px; margin: 0 0 3px; color: var(--muted); font-size: 10px; text-align: right; }
.site-entry {
    display: grid;
    width: 100%;
    min-height: 94px;
    grid-template-columns: 46px minmax(0, 1fr) auto 20px;
    align-items: center;
    gap: 16px;
    padding: 17px 18px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--lime-deep);
    border-radius: 4px;
    background: var(--surface);
    box-shadow: var(--shadow);
    text-align: left;
    cursor: pointer;
    transition: transform 170ms ease, box-shadow 170ms ease;
}
.site-entry:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 20px 44px rgb(20 33 29 / 11%); }
.site-entry:disabled { color: var(--muted); cursor: not-allowed; }
.site-entry__mark { width: 46px; font-size: 29px; }
.site-entry__name { display: grid; min-width: 0; gap: 5px; }
.site-entry__name strong { overflow-wrap: anywhere; font-size: 14px; font-weight: 600; }
.site-entry__name small { color: var(--muted); font-size: 10px; }
.site-entry__status { color: #3f805b; font-family: var(--numeric); font-size: 11px; }
.site-entry:disabled .site-entry__status { color: var(--coral); }
.site-entry__arrow { color: var(--muted); font-size: 17px; }
.judo-subline { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }

.intro-row { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding: 43px 0 17px; animation: lift-in 420ms ease-out both; }
.intro-row h1 { margin: 12px 0 0; font-family: var(--display); font-size: clamp(38px, 5vw, 60px); font-weight: 400; line-height: .94; }
.intro-row h1 span { color: #438069; }
.eyebrow-divider { color: #a5b2a9; }
.button-outline { border-color: var(--line); background: var(--surface); }
.button-outline:hover { border-color: var(--ink); }
.refresh-button { min-height: 38px; flex: none; }
.refresh-icon { font-size: 17px; line-height: 1; }
.refresh-button.is-loading .refresh-icon { animation: spin 700ms linear infinite; }
.back-button { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 12px; padding: 4px 0; border: 0; background: none; color: var(--muted); font-size: 10px; font-weight: 600; cursor: pointer; }
.back-button:hover { color: var(--ink); }
.data-line { display: flex; min-height: 31px; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 12px; color: var(--muted); font-size: 10px; }
.report-controls { display: flex; align-items: center; gap: 12px; margin: 0 0 13px; }
.report-controls__note { color: var(--muted); font-size: 9px; }
.segmented-control { display: inline-flex; width: fit-content; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 3px; background: #e7ece6; }
.segmented-control button { min-width: 42px; min-height: 29px; padding: 0 9px; border: 0; border-radius: 2px; color: var(--muted); background: transparent; font-size: 9px; font-weight: 600; cursor: pointer; transition: color 140ms ease, background-color 140ms ease, box-shadow 140ms ease; }
.segmented-control button[aria-pressed="true"] { color: var(--ink); background: var(--surface); box-shadow: 0 1px 3px rgb(20 33 29 / 12%); }
.segmented-control button:focus-visible { outline: 2px solid var(--lime-deep); outline-offset: 1px; }
.chart-tools { display: flex; align-items: center; gap: 8px; }
.segmented-control--compact { padding: 2px; }
.segmented-control--compact button { min-width: 0; min-height: 27px; padding: 0 8px; }

.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; animation: lift-in 480ms 35ms ease-out both; }
.metric { position: relative; min-width: 0; min-height: 132px; padding: 15px; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.metric::after { position: absolute; inset: auto 0 0; height: 3px; background: var(--sky); content: ''; }
.metric:nth-child(3n + 2)::after { background: var(--lime-deep); }
.metric:nth-child(3n)::after { background: var(--coral); }
.metric-featured { border-color: var(--ink); color: var(--surface); background: var(--ink); }
.metric-featured::after { background: var(--lime); }
.metric-top { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 9px; font-weight: 600; }
.metric-featured .metric-top { color: #b9c7be; }
.metric-mark { color: #9ca9a1; font-family: var(--numeric); }
.metric-value { display: block; margin: 18px 0 5px; font-family: var(--numeric); font-size: clamp(32px, 4vw, 44px); font-weight: 500; line-height: .95; }
.metric-note { color: var(--muted); font-size: 9px; }
.metric-featured .metric-note { color: #c7d1cb; }

.analytics-grid, .breakdown-grid, .device-grid, .behavior-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 14px; }
.panel { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); box-shadow: 0 8px 22px rgb(20 33 29 / 3%); }
.panel-heading { display: flex; min-height: 44px; align-items: start; justify-content: space-between; gap: 12px; }
.panel-heading h2, .section-heading h2 { margin: 7px 0 0; font-family: var(--numeric); font-size: 22px; font-weight: 500; line-height: 1.08; }
.panel-heading .eyebrow, .section-heading .eyebrow { font-size: 8px; }
.period-label { flex: none; padding: 6px 8px; border-radius: 2px; color: #456359; background: #e5eee7; font-family: var(--numeric); font-size: 9px; }
.chart-wrap { position: relative; height: 205px; margin-top: 14px; }
.chart-wrap canvas { display: block; width: 100%; height: 100%; }
.empty-state { position: absolute; inset: 50% 0 auto; margin: 0; color: var(--muted); font-size: 11px; text-align: center; transform: translateY(-50%); }
.chart-legend { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 11px; color: var(--muted); font-size: 9px; }
.chart-legend span:first-child { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend i { width: 8px; height: 8px; border-radius: 50%; background: #438069; }
.table-wrap { overflow-x: auto; margin-top: 13px; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 8px; font-weight: 600; }
th:last-child, td:last-child { width: 74px; text-align: right; }
td { max-width: 1px; padding: 10px 0; border-bottom: 1px solid #e8ede7; font-size: 10px; }
td:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td:last-child { font-family: var(--numeric); font-size: 13px; }
.table-placeholder { color: var(--muted); text-align: left !important; }
.recent-activity-table { min-width: 680px; }
.recent-activity-table th:last-child, .recent-activity-table td:last-child { width: 142px; white-space: nowrap; }
.recent-activity-table td:first-child { width: 82px; }
.recent-activity-table td:nth-child(2) { width: 160px; }
.recent-activity-table td:nth-child(3) { font-family: var(--body); font-size: 10px; }
.activity-kind { font-weight: 600; }
.activity-kind--member { color: #438069; }
.activity-kind--visitor { color: #bd614d; }
.activity-privacy-note { margin: -4px 0 8px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.judo-recent-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 14px 0; }
.judo-recent-table { min-width: 540px; }
.judo-recent-table th:last-child, .judo-recent-table td:last-child { width: 126px; white-space: nowrap; }
.judo-recent-table td:first-child { width: 120px; }
.judo-recent-table td:nth-child(2) { font-family: var(--body); font-size: 10px; }
.judo-recent-table td:nth-child(3) { width: 126px; white-space: nowrap; }

.site-section { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); animation: lift-in 520ms 80ms ease-out both; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.section-heading h2 { font-size: 24px; }
.section-caption { color: var(--muted); font-family: var(--numeric); font-size: 9px; }
.club-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.club-stat { display: flex; min-width: 0; min-height: 108px; flex-direction: column; justify-content: space-between; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.club-stat > span { color: var(--muted); font-size: 8px; font-weight: 600; }
.club-stat strong { font-family: var(--numeric); font-size: 34px; font-weight: 500; line-height: .9; }
.club-stat small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.app-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 12px; padding: 19px 0 3px; color: var(--muted); font-family: var(--numeric); font-size: 9px; }

@keyframes lift-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 620px) {
    .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
    .metric { min-height: 145px; padding: 17px; }
    .analytics-grid { grid-template-columns: minmax(0, 1.45fr) minmax(250px, 1fr); gap: 14px; margin-top: 17px; }
    .breakdown-grid, .device-grid, .behavior-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
    .judo-recent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .panel { padding: 19px; }
    .chart-wrap { height: 230px; }
    .club-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
}

@media (min-width: 1040px) {
    .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .metric { min-height: 155px; }
    .metric-value { font-size: 43px; }
    .breakdown-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .device-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .behavior-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .club-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (min-width: 1500px) {
    .metric-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}

@media (max-width: 500px) {
    .main-content { width: calc(100% - 49px); margin-left: 49px; padding-right: 13px; padding-left: 13px; }
    .rail { width: 49px; gap: 20px; }
    .rail-active { width: 29px; }
    .rail-brand { font-size: 23px; }
    .topbar { min-height: 56px; }
    .topbar-brand { font-size: 11px; }
    .topbar-date { display: none; }
    .topbar-actions { gap: 4px; }
    .sites-screen { padding-top: 35px; }
    .sites-heading { align-items: start; flex-direction: column; gap: 11px; padding-bottom: 19px; }
    .sites-heading > p { text-align: left; }
    .site-entry { min-height: 80px; grid-template-columns: 38px minmax(0, 1fr) 16px; gap: 10px; padding: 12px; }
    .site-entry__mark { width: 38px; font-size: 24px; }
    .site-entry__status { grid-column: 2; grid-row: 2; }
    .site-entry__arrow { grid-column: 3; grid-row: 1 / span 2; }
    .intro-row { align-items: start; flex-direction: column; padding-top: 27px; }
    .intro-row h1 { font-size: 38px; }
    .refresh-button { align-self: end; margin-top: -4px; }
    .metric-grid { gap: 7px; }
    .metric { min-height: 118px; padding: 11px; }
    .metric-top { font-size: 8px; }
    .metric-value { margin-top: 15px; font-size: 33px; }
    .metric-note { font-size: 8px; }
    .data-line { align-items: start; flex-direction: column; gap: 3px; }
    .report-controls { align-items: start; flex-direction: column; gap: 7px; }
    .panel-heading { flex-wrap: wrap; }
    .chart-tools { flex-wrap: wrap; justify-content: end; }
    .section-heading { align-items: start; flex-direction: column; }
    .club-stat { min-height: 96px; padding: 10px; }
    .recent-activity-section .table-wrap { overflow: visible; }
    .recent-activity-table { min-width: 0; border-collapse: separate; border-spacing: 0 8px; }
    .recent-activity-table thead { display: none; }
    .recent-activity-table tbody tr { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 3px 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); }
    .recent-activity-table tbody td { width: auto; max-width: none; padding: 0; border: 0; font-size: 12px; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; }
    .recent-activity-table tbody td:first-child { grid-column: 1; grid-row: 1; overflow: visible; text-overflow: clip; }
    .recent-activity-table tbody td:nth-child(2) { grid-column: 2; grid-row: 1; text-align: right; font-weight: 600; }
    .recent-activity-table tbody td:nth-child(3) { grid-column: 1 / -1; grid-row: 2; font-size: 13px; }
    .recent-activity-table tbody td:last-child { grid-column: 1 / -1; grid-row: 3; padding-top: 6px; border-top: 1px solid var(--line); color: var(--muted); text-align: left; font-family: var(--body); font-size: 11px; }
    .recent-activity-table tbody td.table-placeholder { grid-column: 1 / -1; grid-row: auto; }
    .judo-recent-table { min-width: 0; }
    .judo-recent-table thead { display: none; }
    .judo-recent-table tbody { display: grid; gap: 8px; }
    .judo-recent-table tbody tr { display: grid; gap: 9px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); }
    .judo-recent-table tbody td { display: grid; width: auto; max-width: none; gap: 3px; padding: 0; border: 0; font-family: var(--body); font-size: 13px; line-height: 1.45; text-align: left; white-space: normal; overflow-wrap: anywhere; }
    .judo-recent-table tbody td:first-child { overflow: visible; text-overflow: clip; }
    .judo-recent-table tbody td::before { color: var(--muted); content: attr(data-label); font-size: 9px; font-weight: 600; text-transform: uppercase; }
    .judo-recent-table tbody td.table-placeholder { display: block; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* WTC dark-gold visual system */
:root {
    color-scheme: dark;
    --ink: #f4f0e6;
    --ink-soft: #d2cbbc;
    --paper: #0b0b0a;
    --surface: #141412;
    --line: #302e28;
    --muted: #938f84;
    --lime: #e7c56d;
    --lime-deep: #b9953f;
    --coral: #df896d;
    --sky: #d8b45c;
    --shadow: 0 18px 48px rgb(0 0 0 / 24%);
}

html { background: #0b0b0a; }
body {
    color: var(--ink);
    background-color: #0b0b0a;
    background-image: radial-gradient(ellipse at 82% 0%, rgb(151 117 43 / 10%), transparent 34%),
        linear-gradient(rgb(255 255 255 / 1.2%) 1px, transparent 1px),
        linear-gradient(90deg, rgb(255 255 255 / 1.2%) 1px, transparent 1px),
        radial-gradient(rgb(236 210 144 / 7%) .55px, transparent .8px);
    background-size: auto, 40px 40px, 40px 40px, 5px 5px;
}

.login-page { color: var(--ink); background: #0b0b0a; }
.login-shell { position: relative; isolation: isolate; }
.login-shell::before {
    position: absolute;
    z-index: -1;
    width: min(74vw, 620px);
    aspect-ratio: 1;
    border: 1px solid rgb(216 180 92 / 12%);
    border-radius: 50%;
    box-shadow: 0 0 0 34px rgb(216 180 92 / 2%), 0 0 0 68px rgb(216 180 92 / 2%);
    content: '';
    animation: orbit-in 1.2s ease-out both;
}
.login-content {
    border-color: #3c3525;
    border-top-color: var(--lime);
    background-color: #141412;
    background-image: linear-gradient(135deg, rgb(255 255 255 / 2%), transparent 38%),
        repeating-linear-gradient(135deg, rgb(255 255 255 / .7%) 0 1px, transparent 1px 8px);
    box-shadow: 0 30px 100px rgb(0 0 0 / 55%);
}
.login-mark, .site-entry__mark { color: #15130e; background: var(--lime); }
.login-content label { color: #b8b1a0; }
.login-content input:not([type=hidden]) { border-color: #3b3932; color: var(--ink); background: #0c0c0b; }
.login-content input:focus { border-color: var(--lime); box-shadow: 0 0 0 3px rgb(216 180 92 / 15%); }
.login-error { color: #ffad96; }
.button-dark { color: #17140d; background: var(--lime); }
.button-dark:hover { background: #f2d98c; }

.rail {
    border-right: 1px solid #27251f;
    background: #10100e;
    background-image: repeating-linear-gradient(135deg, rgb(255 255 255 / .8%) 0 1px, transparent 1px 9px);
    box-shadow: 8px 0 30px rgb(0 0 0 / 20%);
}
.rail-brand { color: var(--lime); }
.rail-label { color: #8c877a; }
.rail-active { color: #17140d; background: var(--lime); box-shadow: 0 5px 20px rgb(216 180 92 / 20%); }
.rail-live { background: #d8b45c; box-shadow: 0 0 0 4px rgb(216 180 92 / 13%); animation: live-pulse 2.4s ease-in-out infinite; }
.main-content { width: min(calc(100% - 66px), 1680px); padding-bottom: 50px; }
.topbar { border-bottom-color: #302e28; }
.topbar-brand { color: #f0eadb; }
.topbar-brand span { color: #a49d8e; }
.logout-button { color: #d2cbbc; }
.logout-button:hover { color: var(--lime); }
.logout-button span { color: var(--lime); }

.eyebrow { color: #a59e8e; letter-spacing: 1.3px; }
.status-dot { background: var(--lime); box-shadow: 0 0 0 3px rgb(216 180 92 / 15%); }
.sites-screen { max-width: 1050px; }
.sites-heading h1 { color: #f3eee2; }
.sites-heading h1 span, .intro-row h1 span { color: var(--lime); }
.sites-heading > p { color: var(--muted); }
.site-entry {
    border-color: #343127;
    border-left-color: var(--lime);
    background: linear-gradient(110deg, #191916, #111110 75%);
    box-shadow: 0 18px 50px rgb(0 0 0 / 22%);
}
.site-entry:hover:not(:disabled) { border-color: #756033; box-shadow: 0 22px 58px rgb(0 0 0 / 38%); }
.site-entry:disabled { color: #777368; }
.site-entry__name small, .site-entry__arrow { color: var(--muted); }
.site-entry__status { color: var(--lime); }
.site-entry:disabled .site-entry__status { color: var(--coral); }

.intro-row { padding-top: 45px; }
.intro-row h1 { color: #f4f0e6; }
.button:focus-visible, .logout-button:focus-visible, .site-entry:focus-visible, .back-button:focus-visible { outline-color: var(--lime); }
.button-outline { border-color: #454034; color: var(--ink); background: #171714; }
.button-outline:hover { border-color: var(--lime-deep); background: #201e18; }
.back-button { color: #aaa393; }
.back-button:hover { color: var(--lime); }
.eyebrow-divider { color: #696457; }
.data-line { color: #989284; }
.segmented-control { border-color: #343127; background: #111110; }
.segmented-control button { color: #a49d8e; }
.segmented-control button[aria-pressed="true"] { color: #19160e; background: var(--lime); box-shadow: 0 2px 12px rgb(216 180 92 / 18%); }
.segmented-control button:focus-visible { outline-color: var(--lime); }
.report-controls__note { color: #8e897e; }

.metric-grid { gap: 11px; }
.metric {
    min-height: 140px;
    border-color: #302e28;
    background-color: #151513;
    background-image: radial-gradient(ellipse at 100% 0%, rgb(216 180 92 / 5%), transparent 45%),
        repeating-linear-gradient(135deg, rgb(255 255 255 / .65%) 0 1px, transparent 1px 10px);
    box-shadow: 0 10px 30px rgb(0 0 0 / 13%);
    animation: metric-arrive 650ms cubic-bezier(.2,.75,.25,1) backwards;
    transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}
.metric:hover { transform: translateY(-4px); border-color: #766239; box-shadow: 0 18px 36px rgb(0 0 0 / 26%); }
.metric:nth-child(1) { animation-delay: 40ms; }
.metric:nth-child(2) { animation-delay: 80ms; }
.metric:nth-child(3) { animation-delay: 120ms; }
.metric:nth-child(4) { animation-delay: 160ms; }
.metric:nth-child(5) { animation-delay: 200ms; }
.metric:nth-child(6) { animation-delay: 240ms; }
.metric:nth-child(7) { animation-delay: 280ms; }
.metric:nth-child(8) { animation-delay: 320ms; }
.metric::after { height: 2px; background: #71603b; }
.metric:nth-child(3n + 2)::after { background: #c6a651; }
.metric:nth-child(3n)::after { background: #8c7541; }
.metric-featured { border-color: #766239; background: radial-gradient(ellipse at 100% 0%, rgb(216 180 92 / 16%), transparent 48%), #191812; }
.metric-featured::after { height: 3px; background: var(--lime); }
.metric-top { color: #a79f8e; letter-spacing: 1px; }
.metric-featured .metric-top { color: #c9bea4; }
.metric-mark { color: #777162; }
.metric-value { color: #f3eee2; }
.metric-featured .metric-value { color: var(--lime); }
.metric-note, .metric-featured .metric-note { color: #9c9687; }

.analytics-grid, .breakdown-grid, .device-grid, .behavior-grid { gap: 14px; margin-top: 16px; }
.panel {
    border-color: #302e28;
    background-color: #141412;
    background-image: linear-gradient(155deg, rgb(30 29 25 / 88%), rgb(17 17 16 / 92%)),
        repeating-linear-gradient(135deg, rgb(255 255 255 / .65%) 0 1px, transparent 1px 9px);
    box-shadow: 0 12px 32px rgb(0 0 0 / 18%);
    animation: panel-arrive 700ms cubic-bezier(.2,.75,.25,1) both;
    transition: border-color 220ms ease, box-shadow 220ms ease;
}
.panel:hover { border-color: #4f4734; box-shadow: 0 16px 38px rgb(0 0 0 / 24%); }
.panel-heading h2, .section-heading h2 { color: #eee8d9; }
.panel-heading .eyebrow, .section-heading .eyebrow { color: #a59b84; }
.period-label { color: #e3c775; background: #282317; }
.chart-wrap { overflow: hidden; }
.chart-legend { color: #aaa393; }
.chart-legend i { background: var(--lime); box-shadow: 0 0 12px rgb(216 180 92 / 38%); }
th { border-bottom-color: #3a372e; color: #a8a08f; letter-spacing: .8px; }
td { border-bottom-color: #292823; color: #ddd7c9; }
.table-placeholder { color: #938e82; }
.site-section { border-top-color: #343127; }
.section-caption { color: #a49b87; }
.club-stat {
    border-color: #302e28;
    background-color: #151513;
    background-image: linear-gradient(145deg, rgb(255 255 255 / 1.2%), transparent 56%),
        repeating-linear-gradient(135deg, rgb(255 255 255 / .55%) 0 1px, transparent 1px 10px);
    transition: transform 200ms ease, border-color 200ms ease;
}
.club-stat:hover { transform: translateY(-3px); border-color: #78643a; }
.club-stat > span { color: #aaa18e; letter-spacing: .7px; }
.club-stat strong { color: var(--lime); }
.club-stat small { color: #918b7e; }
.app-footer { color: #8d887c; }
.empty-state { color: #999386; }

.app-shell, .login-shell { animation: page-arrive 820ms cubic-bezier(.2,.75,.2,1) both; }
body::after {
    position: fixed;
    z-index: 10;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(112deg, transparent 0 42%, rgb(231 197 109 / 2%) 47%, rgb(255 248 224 / 8%) 50%, rgb(231 197 109 / 2%) 53%, transparent 61% 100%);
    content: '';
    animation: page-sweep 1150ms cubic-bezier(.65,0,.3,1) 80ms both;
}

@keyframes live-pulse {
    50% { box-shadow: 0 0 0 7px rgb(216 180 92 / 4%), 0 0 16px rgb(216 180 92 / 45%); }
}
@keyframes metric-arrive {
    from { opacity: 0; transform: translateY(15px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes panel-arrive {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes orbit-in {
    from { opacity: 0; transform: scale(.84) rotate(-12deg); }
    to { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes page-arrive {
    from { opacity: 0; transform: translateY(8px) scale(.994); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes page-sweep {
    from { transform: translateX(-110%); }
    to { transform: translateX(110%); }
}

@media (min-width: 620px) {
    .metric { min-height: 154px; }
}

@media (max-width: 700px) {
    .app-shell { min-height: 100svh; }
    .rail {
        inset: auto 0 0;
        width: 100%;
        height: calc(66px + env(safe-area-inset-bottom));
        flex-direction: row;
        justify-content: space-around;
        gap: 12px;
        padding: 9px 22px calc(9px + env(safe-area-inset-bottom));
        border-top: 1px solid #383328;
        border-right: 0;
        background: rgb(16 16 14 / 96%);
        box-shadow: 0 -12px 36px rgb(0 0 0 / 32%);
        backdrop-filter: blur(16px);
    }
    .rail-brand { font-size: 25px; }
    .rail-label { writing-mode: initial; font-size: 9px; letter-spacing: 1.5px; }
    .rail-active { width: 34px; height: 34px; }
    .rail-spacer { flex: 0 1 8%; }
    .rail-live { margin: 0 3px 0 0; }
    .main-content { width: 100%; margin: 0; padding: 0 20px calc(92px + env(safe-area-inset-bottom)); }
    .topbar { min-height: 62px; }
    .sites-screen { padding-top: 38px; }
    .intro-row { padding-top: 32px; }
    .site-section { margin-top: 25px; }
}

@media (max-width: 500px) {
    .rail { height: calc(62px + env(safe-area-inset-bottom)); padding-right: 28px; padding-left: 28px; }
    .main-content { width: 100%; margin: 0; padding-right: 16px; padding-left: 16px; }
    .topbar { min-height: 56px; }
    .topbar-brand { font-size: 12px; }
    .topbar-actions { gap: 9px; }
    .logout-button { font-size: 10px; }
    .sites-screen { padding-top: 31px; }
    .sites-heading { align-items: start; flex-direction: column; gap: 10px; padding-bottom: 19px; }
    .sites-heading h1 { font-size: 42px; }
    .sites-heading > p { text-align: left; }
    .site-entry { min-height: 82px; grid-template-columns: 40px minmax(0, 1fr) 16px; gap: 11px; padding: 12px; }
    .site-entry__mark { width: 40px; font-size: 25px; }
    .site-entry__status { grid-column: 2; grid-row: 2; }
    .site-entry__arrow { grid-column: 3; grid-row: 1 / span 2; }
    .intro-row { align-items: start; flex-direction: column; gap: 15px; padding-top: 28px; }
    .intro-row h1 { max-width: 350px; font-size: clamp(36px, 10vw, 43px); }
    .refresh-button { align-self: stretch; min-height: 44px; margin: 0; }
    .data-line { min-height: 42px; align-items: start; flex-direction: column; justify-content: center; gap: 4px; }
    .report-controls { align-items: center; flex-direction: row; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
    .segmented-control button { min-width: 45px; min-height: 33px; }
    .report-controls__note { font-size: 9px; text-align: right; }
    .metric-grid { gap: 8px; }
    .metric { min-height: 128px; padding: 13px 12px; }
    .metric-top { font-size: 8px; }
    .metric-value { margin-top: 17px; font-size: 35px; }
    .metric-note { font-size: 8px; }
    .analytics-grid, .breakdown-grid, .device-grid, .behavior-grid { gap: 10px; margin-top: 11px; }
    .panel { padding: 15px 13px; }
    .panel-heading { flex-wrap: wrap; gap: 9px; }
    .panel-heading h2 { font-size: 21px; }
    .chart-tools { flex-wrap: wrap; justify-content: end; gap: 6px; }
    .chart-wrap { height: 190px; margin-top: 10px; }
    .chart-legend { font-size: 8px; }
    .section-heading { align-items: start; flex-direction: column; gap: 6px; }
    .club-grid { gap: 7px; }
    .club-stat { min-height: 99px; padding: 11px 9px; }
    .club-stat strong { font-size: 31px; }
    .club-stat > span { font-size: 7px; }
    .club-stat small { font-size: 8px; }
    .app-footer { padding-top: 16px; font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    .app-shell, .login-shell { animation: none; }
    body::after { display: none; animation: none; }
    .rail-live { animation: none; }
    .metric, .panel, .club-stat { animation: none; }
}

:root {
    --radius-control: 14px;
    --radius-surface: 20px;
    --radius-floating: 24px;
    --radius-pill: 999px;
}

.login-content {
    padding: clamp(26px, 6vw, 36px);
    border-radius: var(--radius-floating);
    box-shadow: 0 28px 80px rgb(0 0 0 / 48%), inset 0 1px 0 rgb(255 255 255 / 5%);
}
.login-mark, .site-entry__mark { border-radius: var(--radius-control); }
.login-content input:not([type=hidden]) { min-height: 52px; border-radius: var(--radius-control); }
.button {
    min-height: 46px;
    padding-inline: 20px;
    border-radius: var(--radius-pill);
}
.login-submit { min-height: 50px; }
.logout-button {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid #38352d;
    border-radius: var(--radius-pill);
    background: rgb(255 255 255 / 3%);
    transition: color 180ms ease, border-color 180ms ease, background-color 180ms ease;
}
.logout-button:hover { border-color: #79663b; background: rgb(216 180 92 / 8%); }

.rail {
    inset: 12px auto 12px 12px;
    width: 64px;
    border: 1px solid #302c23;
    border-radius: var(--radius-floating);
}
.rail-active { border-radius: var(--radius-control); }
.main-content { width: min(calc(100% - 88px), 1680px); margin-left: 88px; }

.site-entry {
    border-left-width: 1px;
    border-radius: 22px;
    box-shadow: inset 3px 0 0 var(--lime), 0 18px 50px rgb(0 0 0 / 22%);
}
.site-entry:hover:not(:disabled) { box-shadow: inset 3px 0 0 var(--lime), 0 22px 58px rgb(0 0 0 / 38%); }
.site-entry__status {
    padding: 7px 11px;
    border: 1px solid rgb(223 137 109 / 20%);
    border-radius: var(--radius-pill);
    background: rgb(223 137 109 / 7%);
    font-size: 10px;
    letter-spacing: .35px;
}
.site-entry__status:where(:not(:empty)) { width: fit-content; }

.segmented-control {
    gap: 3px;
    padding: 4px;
    border-radius: var(--radius-pill);
    background: #111110;
}
.segmented-control button {
    min-height: 36px;
    padding-inline: 14px;
    border-radius: var(--radius-pill);
}
.segmented-control--compact button { min-height: 32px; padding-inline: 12px; }
.period-label { padding: 7px 11px; border-radius: var(--radius-pill); }

.metric {
    border-radius: 19px;
    box-shadow: 0 10px 30px rgb(0 0 0 / 13%), inset 0 1px 0 rgb(255 255 255 / 2%);
}
.metric::after { border-radius: 0 0 18px 18px; }
.metric-featured { border-radius: 19px; }
.panel {
    border-radius: 22px;
    box-shadow: 0 12px 32px rgb(0 0 0 / 18%), inset 0 1px 0 rgb(255 255 255 / 2%);
    backdrop-filter: blur(18px) saturate(115%);
}
.chart-wrap { border-radius: 14px; }
.club-stat { border-radius: 18px; }
.club-stat:hover { box-shadow: inset 0 1px 0 rgb(255 255 255 / 3%); }

@media (max-width: 700px) {
    .rail {
        inset: auto 12px max(12px, env(safe-area-inset-bottom)) 12px;
        width: auto;
        height: 68px;
        padding: 8px 18px;
        border: 1px solid #383328;
        border-radius: var(--radius-floating);
        box-shadow: 0 12px 40px rgb(0 0 0 / 42%), inset 0 1px 0 rgb(255 255 255 / 5%);
    }
    .main-content { width: 100%; margin: 0; padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
}

@media (max-width: 500px) {
    .rail { inset-inline: 10px; height: 66px; padding-inline: 15px; }
    .main-content { width: 100%; margin: 0; }
    .metric { border-radius: 18px; }
    .panel { border-radius: 20px; }
    .site-entry { border-radius: 19px; }
}
