:root {
    color-scheme: light;
    font-family: Aptos, "Trebuchet MS", sans-serif;
    background: #f3f2ed;
    color: #161a17;
    --ink: #161a17;
    --muted: #69716b;
    --line: #d9dbd5;
    --paper: #fbfbf8;
    --green: #146c52;
    --green-light: #8ed0b6;
    --coral: #de654c;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.app-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--ink); color: #f7f5ef; display: flex; flex-direction: column; padding: 26px 18px; position: sticky; top: 0; height: 100vh; }
.brand { align-items: center; display: flex; gap: 12px; font-weight: 700; text-decoration: none; }
.brand-mark { align-items: center; background: var(--coral); color: #fff; display: inline-flex; font-family: Georgia, serif; font-size: 14px; font-weight: 700; height: 34px; justify-content: center; width: 34px; }
.brand-mark.large { height: 48px; width: 48px; }
.public-page { align-items: center; background: var(--paper); display: flex; flex-direction: column; justify-content: center; min-height: 100vh; padding: 32px; text-align: center; }
.public-brand { align-items: center; display: flex; font-family: Georgia, "Times New Roman", serif; font-size: 24px; gap: 14px; }
.public-brand-mark { height: 46px; width: 46px; }
.public-page p { color: var(--muted); font-size: 14px; margin: 18px 0 0; }
.sidebar nav { display: grid; gap: 5px; margin-top: 48px; }
.sidebar nav a { border-left: 3px solid transparent; color: #aeb6af; padding: 11px 14px; text-decoration: none; }
.sidebar nav a.active { background: #252b27; border-color: var(--green-light); color: #fff; }
.sidebar-foot { display: grid; gap: 10px; margin-top: auto; }
.privacy-note { color: #89918b; font-size: 12px; }
.account-name { font-weight: 650; }
.content-shell { min-width: 0; }
.workspace { margin: 0 auto; max-width: 1500px; padding: 38px clamp(22px, 4vw, 64px) 64px; }
.workspace-header { align-items: flex-end; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; padding-bottom: 26px; }
.eyebrow { color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: 0; margin: 0 0 8px; text-transform: uppercase; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
h1 { font-size: clamp(34px, 5vw, 58px); line-height: 1; margin: 0; }
h2 { font-size: 23px; margin: 0; }
.header-meta { color: var(--muted); margin: 10px 0 0; }
.header-controls { align-items: center; display: flex; gap: 12px; }
select, input { background: #fff; border: 1px solid #c9ccc6; border-radius: 4px; min-height: 42px; padding: 8px 11px; }
.segmented { border: 1px solid #c9ccc6; display: flex; }
.segmented button { background: transparent; border: 0; border-right: 1px solid #c9ccc6; min-height: 40px; padding: 0 13px; }
.segmented button:last-child { border-right: 0; }
.segmented button.active { background: var(--ink); color: #fff; }
.dashboard-filters { align-items: end; border-bottom: 1px solid var(--line); display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(120px, 1fr)) repeat(3, minmax(140px, 1fr)) auto; padding: 22px 0; }
.dashboard-filters label { display: grid; gap: 6px; min-width: 0; }
.dashboard-filters label span { color: var(--muted); font-size: 12px; font-weight: 650; }
.dashboard-filters input { min-width: 0; width: 100%; }
.filter-actions { display: flex; gap: 8px; }
.metrics { border-bottom: 1px solid var(--line); display: grid; grid-template-columns: repeat(6, 1fr); margin-top: 26px; }
.metrics article { border-right: 1px solid var(--line); padding: 18px 18px 24px; }
.metrics article:first-child { padding-left: 0; }
.metrics article:last-child { border-right: 0; }
.metrics span { color: var(--muted); display: block; font-size: 13px; }
.metrics strong { display: block; font-family: Georgia, serif; font-size: clamp(25px, 3vw, 38px); font-weight: 500; margin-top: 10px; }
.trend-section { border-bottom: 1px solid var(--line); padding: 34px 0 30px; }
.section-title { align-items: flex-end; display: flex; justify-content: space-between; }
.legend { color: var(--muted); display: flex; font-size: 12px; gap: 16px; }
.legend i { display: inline-block; height: 9px; margin-right: 6px; width: 9px; }
.legend .views, .bars .views { background: var(--green); }
.legend .visitors, .bars .visitors { background: var(--coral); }
.trend-chart { align-items: stretch; display: flex; gap: clamp(4px, 1vw, 14px); height: 230px; margin-top: 28px; overflow: hidden; }
.trend-column { display: grid; flex: 1 1 0; grid-template-rows: 1fr 24px; min-width: 10px; }
.bars { align-items: flex-end; display: flex; gap: 2px; }
.bars span { min-height: 2px; transition: height 240ms ease-out; width: 50%; }
.trend-column small { color: var(--muted); font-size: 10px; overflow: hidden; padding-top: 8px; text-align: center; white-space: nowrap; }
.breakdown-grid { display: grid; grid-template-columns: repeat(2, 1fr); }
.breakdown { border-bottom: 1px solid var(--line); min-width: 0; padding: 30px 34px 30px 0; }
.breakdown:nth-child(even) { border-left: 1px solid var(--line); padding-left: 34px; }
.breakdown ol { list-style: none; margin: 20px 0 0; padding: 0; }
.breakdown li { align-items: center; border-top: 1px solid #e3e4df; display: flex; gap: 16px; justify-content: space-between; min-height: 42px; }
.breakdown li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breakdown li strong { color: var(--green); }
.muted, .loading-state { color: var(--muted); }
.loading-state, .empty-state { padding: 80px 0; }
.empty-state p { color: var(--muted); margin-bottom: 26px; }
.primary-button, .quiet-button { align-items: center; border: 0; border-radius: 3px; cursor: pointer; display: inline-flex; justify-content: center; min-height: 40px; padding: 0 16px; text-decoration: none; }
.primary-button { background: var(--green); color: #fff; font-weight: 700; }
.quiet-button { background: #e2e3de; color: var(--ink); }
.sidebar .quiet-button { background: #2b322d; color: #fff; width: 100%; }
.login-page { display: grid; grid-template-columns: 1.2fr minmax(360px, .8fr); min-height: 100vh; }
.login-intro { background: var(--ink); color: #f7f5ef; display: flex; flex-direction: column; justify-content: center; padding: clamp(40px, 8vw, 130px); }
.login-intro .eyebrow { color: var(--green-light); margin-top: 42px; }
.login-intro h1 { font-size: clamp(48px, 7vw, 96px); line-height: .98; }
.login-intro > p:last-child { color: #aeb6af; line-height: 1.7; max-width: 540px; }
.login-panel { align-self: center; padding: clamp(30px, 8vw, 110px); }
.login-panel h2 { font-size: 42px; }
.login-panel small { color: var(--muted); display: block; margin-top: 20px; }
.stack-form { display: grid; gap: 18px; margin-top: 34px; }
.stack-form label, .form-grid label { display: grid; gap: 7px; }
.stack-form label span, .form-grid label span { color: var(--muted); font-size: 13px; font-weight: 650; }
.input-with-actions { color: inherit !important; display: block !important; font-size: inherit !important; font-weight: inherit !important; position: relative; }
.input-with-actions input { padding-right: 42px; width: 100%; }
.input-action { align-items: center; background: transparent; border: 0; color: #7b847d; cursor: pointer; display: inline-flex; height: 34px; justify-content: center; padding: 0; position: absolute; top: 4px; width: 34px; }
.input-action:hover { color: var(--ink); }
.input-action:focus-visible { outline: 2px solid var(--green); outline-offset: -3px; }
.input-action svg { height: 17px; width: 17px; }
.input-clear { right: 4px; }
.input-clear[hidden] { display: none; }
.password-toggle { right: 4px; }
.password-eye-closed { display: none; }
.password-toggle.is-password-visible .password-eye-open { display: none; }
.password-toggle.is-password-visible .password-eye-closed { display: block; }
.form-error { background: #f8dfd9; border-left: 3px solid var(--coral); color: #792c1e; margin-top: 20px; padding: 12px 14px; }
.create-panel { border-bottom: 1px solid var(--line); padding: 30px 0; }
.form-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, 1fr); margin-top: 24px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.website-list { display: grid; }
.website-item { border-bottom: 1px solid var(--line); padding: 30px 0; }
.website-heading, .website-heading > div { align-items: center; display: flex; justify-content: space-between; }
.website-heading > div { gap: 12px; }
.website-heading h2, .website-heading p { margin: 0; }
.website-heading p { color: var(--muted); margin-top: 4px; }
.status { background: var(--green); border-radius: 50%; height: 9px; width: 9px; }
.status.off { background: #999; }
.switch { align-items: center; display: flex; gap: 8px; }
.switch input { height: 1px; opacity: 0; position: absolute; width: 1px; }
.switch > span { background: #aeb3ae; border-radius: 20px; height: 22px; padding: 3px; width: 40px; }
.switch > span::after { background: #fff; border-radius: 50%; content: ""; display: block; height: 16px; transition: transform 150ms; width: 16px; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch b { font-size: 12px; }
.website-item dl { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.website-item dl div { min-width: 0; }
.website-item dt { color: var(--muted); font-size: 12px; }
.website-item dd { margin: 5px 0 0; overflow-wrap: anywhere; }
.snippet { align-items: center; background: var(--ink); color: #dce4de; display: flex; gap: 20px; justify-content: space-between; margin-top: 20px; padding: 14px; }
.snippet code { font-size: 12px; overflow: auto; white-space: nowrap; }

@media (max-width: 980px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { align-items: center; flex-direction: row; height: auto; padding: 12px 18px; position: static; }
    .sidebar nav { display: flex; margin: 0 0 0 24px; }
    .sidebar-foot { margin: 0 0 0 auto; }
    .privacy-note, .account-name { display: none; }
    .sidebar .quiet-button { min-height: 36px; width: auto; }
    .metrics { grid-template-columns: repeat(3, 1fr); }
    .metrics article:nth-child(3) { border-right: 0; }
    .metrics article:nth-child(n+4) { border-top: 1px solid var(--line); }
    .dashboard-filters { grid-template-columns: repeat(3, 1fr); }
    .filter-actions { justify-content: flex-end; }
    .login-page { grid-template-columns: 1fr; }
    .login-intro { min-height: 44vh; padding: 40px; }
}

@media (max-width: 680px) {
    .brand > span:last-child { display: none; }
    .sidebar nav { margin-left: 10px; }
    .sidebar nav a { padding: 9px 10px; }
    .workspace { padding: 26px 18px 50px; }
    .workspace-header { align-items: stretch; flex-direction: column; gap: 22px; }
    .header-controls { align-items: stretch; flex-direction: column; }
    .dashboard-filters { grid-template-columns: 1fr; }
    .filter-actions .primary-button, .filter-actions .quiet-button { flex: 1; }
    .metrics { grid-template-columns: repeat(2, 1fr); }
    .metrics article:nth-child(2n) { border-right: 0; }
    .metrics article:nth-child(3) { border-right: 1px solid var(--line); }
    .metrics article:nth-child(n+3) { border-top: 1px solid var(--line); }
    .breakdown-grid { grid-template-columns: 1fr; }
    .breakdown, .breakdown:nth-child(even) { border-left: 0; padding-left: 0; padding-right: 0; }
    .trend-chart { gap: 3px; }
    .trend-column small { display: none; }
    .login-intro { min-height: 42vh; }
    .login-intro h1 { font-size: 48px; }
    .login-panel { padding: 40px 24px; }
    .form-grid, .website-item dl { grid-template-columns: 1fr; }
    .snippet { align-items: stretch; flex-direction: column; }
}