:root {
    color-scheme: dark;
    --bg: #141516;
    --card: #1d1f21;
    --line: #343638;
    --ink: #f4f2ed;
    --muted: #b1b2af;
    --accent: #ffd233;
    --red: #ff9b92;
    font: 16px/1.5 system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: var(--accent); text-underline-offset: .2em; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2.15rem, 6vw, 4.3rem); letter-spacing: -.065em; line-height: 1.05; }
h2 { font-size: clamp(1.25rem, 2.5vw, 1.65rem); letter-spacing: -.035em; }
h3 { font-size: 1.15rem; }
.shell { max-width: 1450px; margin: 0 auto; padding-inline: clamp(1rem, 4vw, 3.5rem); }
.topbar { border-bottom: 1px solid var(--line); background: #191a1b; }
.masthead, .intro, .section-heading, .dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.masthead { min-height: 67px; }
.wordmark { display: flex; align-items: center; gap: .55rem; color: var(--ink); text-decoration: none; font-weight: 780; }
.wordmark > span:last-child { color: var(--muted); font-weight: 530; }
.brand-mark { display: grid; place-items: center; width: 2rem; height: 2rem; background: var(--accent); color: #141414; border-radius: .35rem; }
button, .button, input, select { min-height: 42px; border: 1px solid var(--line); border-radius: .45rem; font: inherit; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .45rem .8rem; color: #141414; background: var(--accent); border-color: var(--accent); cursor: pointer; font-weight: 680; text-decoration: none; }
.secondary { background: var(--card); border-color: var(--line); color: var(--ink); }
button:hover, .button:hover { filter: brightness(1.14); }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.intro { padding-block: 2.4rem 1.5rem; align-items: end; }
.intro h1 { margin-block: .28rem .55rem; }
.intro p:not(.eyebrow), .muted, .note { color: var(--muted); }
.eyebrow { color: var(--accent); font-size: .76rem; font-weight: 760; text-transform: uppercase; letter-spacing: .12em; }
label { display: grid; gap: .3rem; font-size: .83rem; color: var(--muted); }
input, select { width: 100%; padding: .45rem .65rem; background: var(--card); color: var(--ink); }
input[type=checkbox] { width: 1.2rem; min-height: 1.2rem; accent-color: var(--accent); }
.status { display: flex; flex-wrap: wrap; gap: .4rem .65rem; color: var(--muted); font-size: .82rem; }
.status > span { background: var(--card); padding: .25rem .55rem; border: 1px solid var(--line); border-radius: .4rem; }
.status .warning, .warning { color: var(--red); }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-top: 1.35rem; overflow-x: auto; }
.tabs button { flex: 0 0 auto; background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--muted); border-radius: 0; }
.tabs [aria-current] { color: var(--accent); border-bottom-color: var(--accent); }
.section { padding-block: 1.25rem 2rem; }
.section-heading { margin-bottom: .9rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: .75rem; }
.card, .empty, .chart { padding: 1rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--card); }
.card h3 { margin-block: .2rem .7rem; overflow-wrap: anywhere; }
.card dl { margin: .65rem 0 0; }
.card dl > div { display: flex; justify-content: space-between; gap: .75rem; padding-block: .34rem; border-top: 1px solid var(--line); }
.card dt { color: var(--muted); font-size: .85rem; }
.card dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.card .headline { font-size: 2rem; font-weight: 740; line-height: 1.1; letter-spacing: -.04em; }
.note { font-size: .83rem; margin-block: .65rem; }
.filters, .actions, .editor { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; margin-block: .8rem; }
.filters > label:first-child { flex: 1 1 16rem; }
.table-scroll { max-width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: .6rem; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; font-variant-numeric: tabular-nums; }
th, td { padding: .55rem .65rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { background: var(--card); color: var(--muted); }
th button, .link-button { background: transparent; color: inherit; border: 0; padding: 0; min-height: 1.8rem; }
.link-button { display: inline-block; text-align: left; white-space: normal; color: var(--ink); text-decoration: underline; text-decoration-color: #777; text-underline-offset: .18em; }
.video-title { min-width: 14rem; max-width: 25rem; white-space: normal; overflow-wrap: anywhere; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #242527; }
.pill { display: inline-block; min-width: 2rem; padding: .08rem .3rem; text-align: center; border: 1px solid var(--line); border-radius: .35rem; font-weight: 730; font-size: .75rem; }
.pill.youtube { color: #ff9b92; }.pill.instagram { color: #ffacd6; }.pill.tiktok { color: #a4ede5; }
.footer { display: flex; flex-wrap: wrap; gap: .8rem; padding-block: 1rem 2rem; color: var(--muted); font-size: .83rem; }
.footer a { color: inherit; }
dialog { width: min(100% - 1rem, 1040px); max-height: 92dvh; margin: auto; padding: 1rem; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: .65rem; }
dialog::backdrop { background: #000b; }
.dialog-header { align-items: start; margin-bottom: .8rem; }
.dialog-header h2 { overflow-wrap: anywhere; }
.chart { padding: .4rem; margin-block: .8rem; }
.chart svg { display: block; width: 100%; height: auto; min-height: 160px; }
.chart text { fill: var(--muted); font-size: 13px; }
.legend { display: flex; flex-wrap: wrap; gap: .5rem .85rem; margin: .55rem .65rem; font-size: .78rem; color: var(--muted); }
.legend span::before { content: '● '; }
.detail-list { margin-block: .8rem; }
.detail-list summary { cursor: pointer; padding-block: .4rem; }
.connect { padding-block: 2rem; max-width: 1000px; }
.connect h1 { margin-block: .65rem; }
.connect p, .connect form { margin-top: .55rem; }
.connect form button { margin-top: .55rem; }
.back { display: inline-block; margin-bottom: .55rem; }
@media (max-width: 570px) {
    .masthead { gap: .5rem; }
    .masthead .button { font-size: .78rem; }
    .wordmark { gap: .3rem; font-size: .87rem; }
    .wordmark > span:last-child { display: none; }
    .intro { padding-block: 1.55rem 1rem; align-items: stretch; flex-direction: column; }
    .intro .brand-picker { align-self: start; min-width: 10rem; }
    .tabs button { padding-inline: .6rem; font-size: .87rem; }
    .section-heading { align-items: start; }
}

/* login */
.login { max-width: 380px; margin: 12vh auto 0; }
.login form { display: grid; gap: 14px; }
.login label { display: grid; gap: 6px; }
.login input { padding: 10px 12px; font-size: 16px; border-radius: 8px; border: 1px solid #444; background: #111; color: inherit; }
.login button { padding: 11px; font-size: 16px; border: 0; border-radius: 8px; background: #FFD233; color: #111; font-weight: 700; cursor: pointer; }
.login .error { color: #ff6b6b; }
