:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #16181d;
  --text-2: #3d4350;
  --muted: #5b6270;
  --border: #e3e6eb;
  --line: #eef0f3;
  --primary: #2459d6;
  --primary-2: #7fa0ea;
  --primary-3: #c9d6f6;
  --link: #1f4fbf;
  --bot: #f0a65e;
  --flag: #a4520e;
  --note-bg: #fbf3ea;
  --note-text: #3d2a14;
  --good: #1b7f3b;
  --good-bg: #e7f3ea;
  --good-text: #17602d;
  --bad: #b3261e;
  --error-bg: #fcebeb;
  --error-text: #791f1f;
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
  color-scheme: light;
}
/* Light is the default for everyone; dark only when chosen with the theme switch (theme.js sets data-theme). */
:root[data-theme="dark"] {
  --bg: #121316;
  --surface: #1b1d22;
  --text: #eceef2;
  --text-2: #c5c9d2;
  --muted: #9aa1ad;
  --border: #2c2f36;
  --line: #262930;
  --primary: #5b8af0;
  --primary-2: #3d63b8;
  --primary-3: #2a3d66;
  --link: #8db0ff;
  --bot: #c9813f;
  --flag: #f0a65e;
  --note-bg: #2e2418;
  --note-text: #f3dcc0;
  --good: #5cc983;
  --good-bg: #183424;
  --good-text: #8fe0aa;
  --bad: #ff8a80;
  --error-bg: #3a1c1c;
  --error-text: #f7c1c1;
  color-scheme: dark;
}
.theme-toggle { display: inline-flex; align-items: center; gap: 6px; background: none; border: 1px solid var(--border); color: var(--text-2); border-radius: 8px; min-height: 32px; padding: 0 10px; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.theme-toggle:hover { color: var(--text); background: var(--bg); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-float { position: fixed; top: 12px; right: 12px; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; }
a { color: var(--link); }
h1 { margin: 0; font-size: 24px; font-weight: 700; overflow-wrap: anywhere; }
h2 { margin: 0; font-size: 17px; font-weight: 600; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Login */
.login { max-width: 520px; margin: 8vh auto 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 28px; }
@media (max-width: 560px) { .login { margin: 16px; padding: 22px; } }
.login form { display: grid; gap: 6px; margin-top: 16px; }
.login label { font-size: 14px; color: var(--muted); margin-top: 8px; }
.login .muted { color: var(--muted); margin: 6px 0 0; }
.login .small { font-size: 13px; }
input { font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); width: 100%; }
input:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
button { font: inherit; cursor: pointer; border-radius: 8px; }
.login button { margin-top: 16px; min-height: 44px; border: 0; background: var(--primary); color: #fff; font-weight: 600; }
.error { background: var(--error-bg); color: var(--error-text); padding: 10px 12px; border-radius: 8px; font-size: 14px; }

/* Page frame */
.bar { background: var(--surface); border-bottom: 1px solid var(--border); }
.bar-inner, .wrap { max-width: 1280px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.bar-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 16px; padding-bottom: 16px; }
.eyebrow { font-size: 13px; color: var(--muted); }
.ghost { min-height: 40px; padding: 0 14px; border: 1px solid var(--border); background: transparent; color: var(--text); }
.wrap { padding-bottom: 48px; }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 0 16px; }
.period { margin: 0; color: var(--text-2); }
.period.gathering { display: flex; align-items: flex-start; gap: 10px; max-width: 760px; background: var(--note-bg); color: var(--note-text); padding: 12px 14px; border-radius: 10px; }
.period.gathering::before { content: ""; display: inline-block; width: 16px; height: 16px; margin-top: 2px; border: 2px solid var(--primary-3); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; flex: none; }
.ranges { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.ranges a, .ranges summary { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); text-decoration: none; font-size: 14px; cursor: pointer; list-style: none; }
.ranges summary::-webkit-details-marker { display: none; }
.ranges a.active, .ranges summary.active { background: var(--text); color: var(--surface); border-color: var(--text); }
.custom-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 8px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.custom-form label { font-size: 13px; color: var(--muted); display: grid; gap: 4px; }
.custom-form input { width: auto; padding: 6px 8px; }
.custom-form button { min-height: 36px; padding: 0 14px; border: 0; background: var(--primary); color: #fff; }

/* Sections */
main { display: flex; flex-direction: column; gap: 20px; }
.panel, .summary, .card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.panel { padding: 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 16px; }
.hint { font-size: 12px; color: var(--muted); }
.summary { padding: 20px 24px; }
.summary ul { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 6px; color: var(--text-2); }
.summary li::marker { color: var(--primary); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.card { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.card .label { font-size: 13px; color: var(--muted); }
.card .value { font-size: 32px; font-weight: 700; font-family: var(--mono); line-height: 1.2; }
.card .sub { font-size: 13px; color: var(--muted); }
.card .value.warn { color: var(--flag); }
.up { color: var(--good); }
.down { color: var(--bad); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 20px; }

/* Charts */
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.swatch.people { background: var(--primary); }
.swatch.bots { background: var(--bot); }
.swatch.flag { width: 8px; height: 8px; border-radius: 50%; background: var(--flag); }
.swatch.ly { height: 0; border-top: 2px dashed var(--muted); border-radius: 0; }
.chart { overflow-x: auto; }
.chart svg { display: block; width: 100%; min-width: 560px; height: 260px; }
.chart .people { fill: var(--primary); }
.chart .bots { fill: var(--bot); }
.chart .ly { fill: none; stroke: var(--muted); stroke-width: 2; stroke-dasharray: 5 4; }
.chart .flag { fill: var(--flag); }
.chart .partial { opacity: 0.45; }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--mono); }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .base { stroke: var(--border); stroke-width: 1; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.switch input { width: 18px; height: 18px; }
.notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.note { background: var(--note-bg); color: var(--note-text); border-radius: 8px; padding: 10px 14px; font-size: 14px; }

/* Lists with bars */
.rows { display: flex; flex-direction: column; }
.row { display: flex; flex-direction: column; gap: 6px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row-top { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row-name.path { font-family: var(--mono); font-size: 13px; }
.row-val { font-family: var(--mono); font-size: 13px; color: var(--text-2); white-space: nowrap; }
.row-sub { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.track { height: 6px; background: var(--line); border-radius: 3px; }
.fill { height: 6px; border-radius: 3px; background: var(--primary); }
.fill.light { background: var(--primary-2); }
.sub-head { font-size: 13px; font-weight: 600; margin-top: 6px; }
.sub-head.up { color: var(--link); }
.sub-head.down { color: var(--flag); }
.empty { color: var(--muted); font-size: 14px; margin: 0; }
.stats3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.stat .num { font-size: 20px; font-weight: 600; }
.stat .lbl { font-size: 12px; color: var(--muted); }
.callout { background: var(--note-bg); color: var(--note-text); border-radius: 8px; padding: 12px 14px; font-size: 14px; display: grid; gap: 6px; }
.callout .mono { font-size: 12px; overflow-wrap: anywhere; }
.box { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 14px; display: grid; gap: 4px; }
.stack { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--line); }
.stack .s1 { background: var(--primary); }
.stack .s2 { background: var(--primary-2); }
.stack .s3 { background: var(--primary-3); }
.swatch.s1 { background: var(--primary); }
.swatch.s2 { background: var(--primary-2); }
.swatch.s3 { background: var(--primary-3); }
.bar-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 52px; gap: 12px; align-items: center; font-size: 13px; }
.bar-row .row-val { text-align: right; }
.footnote { font-size: 12px; color: var(--muted); max-width: 900px; margin: 0; }

/* Admin */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; font-size: 13px; color: var(--muted); padding: 8px 0; }
td { padding: 8px 0; border-top: 1px solid var(--line); vertical-align: top; }
th.n, td.n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; padding-left: 12px; white-space: nowrap; }
td.name { overflow-wrap: anywhere; padding-right: 8px; }
td .sub { display: block; font-size: 12px; color: var(--muted); }
.table-scroll { overflow-x: auto; }
header.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; max-width: 1280px; margin: 0 auto; padding: 16px; }
.admin-main { max-width: 1280px; margin: 0 auto; padding: 0 16px 48px; }
.admin-main .panel { margin-bottom: 20px; }
.muted { color: var(--muted); }
button.link { background: none; border: 1px solid var(--border); color: var(--text); padding: 6px 12px; }

@media (max-width: 600px) {
  .card .value { font-size: 26px; }
  .bar-row { grid-template-columns: 90px minmax(0, 1fr) 48px; }
}

/* Side menu layout */
.layout { max-width: 1280px; margin: 0 auto; padding: 0 16px 48px; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; }
.side { position: sticky; top: 16px; align-self: start; display: flex; flex-direction: column; gap: 2px; padding-top: 20px; }
.nav-link { display: block; padding: 9px 12px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: 14px; }
.nav-link:hover { background: var(--surface); color: var(--text); }
.nav-link.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: inset 3px 0 0 var(--primary); }
.content { min-width: 0; }
.more { font-size: 13px; text-decoration: none; }
h3 { margin: 0; font-size: 16px; font-weight: 600; }

/* Reports */
.report-head { display: grid; gap: 6px; }
.intro { margin: 0; color: var(--text-2); max-width: 820px; }
#charts, .stack-v { display: flex; flex-direction: column; gap: 20px; }
#charts:empty { display: none; }
#tables.grid { display: grid; }
.table-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search { width: 200px; padding: 6px 10px; font-size: 14px; }
.small-btn { min-height: 34px; font-size: 13px; padding: 0 12px; }
.more-bar { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-start; }
.more-bar[hidden] { display: none; }
table.data td { padding: 7px 0; }
table.data td.path { font-family: var(--mono); font-size: 13px; }
table.data th { padding: 0; }
.sort { background: none; border: 0; padding: 8px 0; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; text-align: inherit; width: 100%; }
th[aria-sort="ascending"] .sort::after { content: " \2191"; }
th[aria-sort="descending"] .sort::after { content: " \2193"; }
td.up { color: var(--good); }
td.down { color: var(--bad); }
.heat-host svg { min-width: 640px; height: auto; }
.heat .cell { fill: var(--primary); }

@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .side { position: static; flex-direction: row; overflow-x: auto; padding: 12px 0 0; gap: 6px; }
  .nav-link { white-space: nowrap; border: 1px solid var(--border); background: var(--surface); }
  .nav-link.active { box-shadow: none; background: var(--text); color: var(--surface); }
}


/* ---- Admin area: shared bar, cards, forms, buttons, chips ---- */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.admin-bar { background: var(--surface); border-bottom: 1px solid var(--border); }
.admin-bar-inner { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 8px 20px; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; margin-right: 4px; white-space: nowrap; }
.brand span { color: var(--muted); font-weight: 500; }
.admin-nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.admin-nav a { color: var(--text-2); text-decoration: none; padding: 7px 12px; border-radius: 8px; font-size: 14px; white-space: nowrap; }
.admin-nav a:hover { background: var(--bg); color: var(--text); }
.admin-nav a[aria-current="page"] { background: var(--bg); color: var(--text); font-weight: 600; }
.admin-user { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.admin-user form { margin: 0; }
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px 64px; display: flex; flex-direction: column; gap: 20px; }
.admin-wrap.narrow { max-width: 860px; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 20px; }
.page-head p { margin: 4px 0 0; }
.page-head .crumb { font-size: 14px; margin: 0 0 6px; }
.crumb a { text-decoration: none; }
.card-section { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.section-head { display: flex; flex-direction: column; gap: 4px; }
.section-head p { margin: 0; font-size: 14px; color: var(--muted); }
.admin-wrap code { font-family: var(--mono); font-size: 13px; background: var(--bg); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }

.form-stack { display: flex; flex-direction: column; gap: 18px; max-width: 620px; margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; color: var(--text); }
.field label .optional { font-weight: 400; color: var(--muted); }
.field-help { margin: 0; font-size: 13px; color: var(--muted); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 16px; }
textarea { font: 14px/1.6 var(--mono); padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); width: 100%; resize: vertical; min-height: 84px; }
textarea:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent; font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-quiet { background: none; color: var(--text-2); border-color: var(--border); min-height: 32px; padding: 0 12px; font-weight: 500; }
.btn-quiet:hover { color: var(--text); background: var(--bg); }
.btn-danger { background: none; color: var(--bad); border-color: var(--border); font-weight: 500; }
.btn-danger:hover { border-color: var(--bad); }
.btn-small { min-height: 32px; padding: 0 12px; font-size: 13px; }

.notice-ok { background: color-mix(in srgb, var(--good) 12%, var(--surface)); color: var(--text); border: 1px solid color-mix(in srgb, var(--good) 35%, transparent); padding: 12px 16px; border-radius: 10px; font-size: 14px; margin: 0; }
.notice-error { background: var(--error-bg); color: var(--error-text); padding: 12px 16px; border-radius: 10px; font-size: 14px; margin: 0; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--bg); color: var(--text-2); border: 1px solid var(--border); }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }
.chip.ok { color: var(--good); border-color: color-mix(in srgb, var(--good) 35%, transparent); background: color-mix(in srgb, var(--good) 10%, var(--surface)); }
.chip.warn { color: var(--flag); border-color: color-mix(in srgb, var(--flag) 35%, transparent); background: color-mix(in srgb, var(--flag) 10%, var(--surface)); }
.chip.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: color-mix(in srgb, var(--bad) 8%, var(--surface)); }
.chip.plain::before { display: none; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: 0 12px 10px 0; white-space: nowrap; }
.admin-table td { padding: 12px 12px 12px 0; border-top: 1px solid var(--line); vertical-align: middle; }
.admin-table th:last-child, .admin-table td:last-child { padding-right: 0; }
.admin-table .n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.admin-table .end { text-align: right; white-space: nowrap; }
.admin-table .site a { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.admin-table .site a:hover { text-decoration: underline; }
.admin-table .sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; font-weight: 400; }
.admin-table tbody tr:hover { background: color-mix(in srgb, var(--bg) 60%, transparent); }
.admin-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.admin-tools input[type="search"] { width: 280px; max-width: 100%; padding: 8px 12px; }
.admin-tools .count { font-size: 14px; color: var(--muted); }
.mono-cell { font-family: var(--mono); font-size: 13px; white-space: nowrap; }

.login-row { display: grid; grid-template-columns: minmax(140px, 1fr) auto minmax(240px, 1.4fr) auto; gap: 12px 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.login-row:first-child { border-top: 0; padding-top: 0; }
.login-name { font-weight: 600; overflow-wrap: anywhere; }
.login-name .sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.pw-form, .remove { display: flex; gap: 8px; margin: 0; }
.pw-form input { padding: 6px 10px; min-width: 0; flex: 1; }
.subform { border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.subform h3 { font-size: 15px; }
.subform form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin: 0; }
.subform .field { flex: 1; min-width: 180px; }

.activity { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.activity li { display: grid; grid-template-columns: 120px 80px 1fr; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.activity li:first-child { border-top: 0; padding-top: 0; }
.activity .when { color: var(--muted); font-family: var(--mono); font-size: 13px; }
.activity .who { font-weight: 600; overflow-wrap: anywhere; }
.activity .what { overflow-wrap: anywhere; }
.activity .ip { color: var(--muted); font-size: 12px; margin-left: 6px; }

@media (max-width: 760px) {
  .admin-table .hide-sm { display: none; }
  .field-row { grid-template-columns: 1fr; }
  .login-row { grid-template-columns: 1fr auto; }
  .login-row .pw-form { grid-column: 1 / -1; }
  .activity li { grid-template-columns: 1fr; gap: 2px; }
  .card-section { padding: 16px; }
  .admin-user .who-am-i { display: none; }
  .admin-tools input[type="search"] { width: 100%; }
  .admin-bar-inner { justify-content: space-between; }
  .admin-nav { order: 3; flex-basis: 100%; margin: 0 -12px; }
  .admin-table .site a { overflow-wrap: break-word; word-break: normal; }
  .admin-wrap { padding-top: 16px; }
  .page-head .btn { width: 100%; }
}
.bar-actions { display: flex; align-items: center; gap: 8px; }
.bar-actions form { margin: 0; }
.bar-actions .theme-toggle { min-height: 40px; padding: 0 12px; font-size: 14px; }
@media (max-width: 600px) { .theme-toggle span { display: none; } }
/* Report tables: a gap between every column so numbers never run into the next path */
table.data th + th, table.data td + td { padding-left: 16px; }
table.data td.path { min-width: 14ch; }
/* Overview: how people use the site */
.eng-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 8px; }
.eng-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.eng-label { font-size: 13px; color: var(--muted); }
.eng-value { font-family: var(--mono); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.eng-stat .up { color: var(--good); }
.eng-stat .down { color: var(--bad); }
@media (max-width: 600px) { .eng-stats { grid-template-columns: 1fr; } }
select { font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); }
select:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* ---- Overview: verdict, findings, chart tabs, report links ---- */
.verdict { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px 28px; display: flex; flex-direction: column; gap: 12px; }
.verdict h2 { font-size: 26px; line-height: 1.3; font-weight: 700; max-width: 860px; }
.verdict p { margin: 0; font-size: 17px; color: var(--text-2); max-width: 860px; }
.badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--line); color: var(--text-2); }
.badge.up { background: var(--good-bg); color: var(--good-text); }
.badge.down { background: var(--note-bg); color: var(--note-text); }
.card .sub.strong { font-size: 14px; font-weight: 600; color: var(--text-2); }
.card .sub.strong.up { color: var(--good); }
.card .sub.strong.down { color: var(--bad); }
.findings { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 20px; }
.finding-head { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.finding-icon { display: inline-flex; width: 32px; height: 32px; border-radius: 50%; align-items: center; justify-content: center; flex: none; }
.finding-icon.good { background: var(--good-bg); color: var(--good-text); }
.finding-icon.warn { background: var(--note-bg); color: var(--flag); }
.finding { display: flex; flex-direction: column; gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.finding:first-child { padding-top: 4px; }
.finding:last-child { border-bottom: 0; padding-bottom: 0; }
.finding p { margin: 0; color: var(--text-2); overflow-wrap: anywhere; }
.finding h3 { overflow-wrap: anywhere; }
.finding a { font-size: 14px; align-self: flex-start; }
.finding-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.chip.warn { padding: 2px 8px; border-radius: 999px; background: var(--note-bg); color: var(--note-text); font-size: 12px; font-weight: 600; }
.tabs { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.tab { min-height: 34px; padding: 0 12px; border: 0; border-radius: 0; background: transparent; color: var(--text-2); font-size: 13px; }
.tab + .tab { border-left: 1px solid var(--border); }
.tab[aria-pressed="true"] { background: var(--text); color: var(--surface); font-weight: 600; }
.chart .ly-bar, .swatch.ly-bar { fill: var(--primary-3); background: var(--primary-3); }
.details-block { display: flex; flex-direction: column; gap: 12px; }
.details { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 12px; }
.detail-link { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: var(--text); }
.detail-link:hover { border-color: var(--primary-2); }
.detail-name { font-weight: 600; color: var(--link); }
.detail-sub { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .verdict { padding: 20px; }
  .verdict h2 { font-size: 22px; }
}
/* ---- Overview: this week in brief (AI summary) ---- */
.brief { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px 24px; display: flex; flex-direction: column; gap: 10px; }
.brief[hidden] { display: none; }
.brief-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.brief-top .badge { background: var(--primary-3); color: var(--text); }
.brief h2 { font-size: 20px; line-height: 1.35; max-width: 860px; }
.brief p { margin: 0; color: var(--text-2); max-width: 860px; }
.brief .hint { font-size: 12px; }
.brief-alerts { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; max-width: 860px; }
.brief-alerts[hidden] { display: none; }
.brief-alerts li { background: var(--note-bg); color: var(--note-text); border-radius: 8px; padding: 10px 14px; display: grid; gap: 2px; font-size: 14px; }
/* Report rows that open to show more beneath (Top 10 other websites) */
td.has-expand { white-space: nowrap; }
.expand { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin: -4px 6px -4px -4px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--muted); vertical-align: middle; }
.expand:hover { background: var(--bg); color: var(--text); }
.expand svg { transition: transform 0.15s; }
.expand[aria-expanded="true"] svg { transform: rotate(90deg); }
tr.detail > td { padding: 4px 0 12px 34px; border-top: 0; }
table.data.sub { font-size: 13px; width: 100%; max-width: 720px; }
table.data.sub th { padding: 4px 0; font-size: 12px; color: var(--muted); font-weight: 600; text-align: left; }
table.data.sub th.n { text-align: right; }
table.data.sub td { padding: 5px 0; }
table.data.sub td.path a { overflow-wrap: anywhere; }
table.data.sub th.n, table.data.sub td.n { padding-left: 16px; white-space: nowrap; }
/* ---- Insights ---- */
.ins-block { display: flex; flex-direction: column; gap: 12px; }
.moments { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; }
.moment { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.moment strong { font-size: 16px; overflow-wrap: anywhere; }
.moment span:last-child { color: var(--text-2); }
.chip.good { align-self: flex-start; padding: 2px 10px; border-radius: 999px; background: var(--good-bg); color: var(--good-text); font-size: 12px; font-weight: 600; }
.chip.info { align-self: flex-start; padding: 2px 10px; border-radius: 999px; background: var(--primary-3); color: var(--text); font-size: 12px; font-weight: 600; }
.ins-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 80px; gap: 12px; align-items: center; padding: 8px 0; }
.ins-row .n { text-align: right; font-family: var(--mono); font-size: 13px; }
.ins-head { font-size: 13px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); }
.ins-head .n { font-family: inherit; }
.ins-item { border-bottom: 1px solid var(--line); }
.ins-item:last-child { border-bottom: 0; }
.ins-page { display: flex; align-items: center; min-width: 0; }
.ins-page a { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; text-decoration: none; }
.ins-detail { margin: 0 0 12px 30px; padding: 12px 14px; background: var(--bg); border-radius: 8px; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; font-size: 14px; }
.ins-detail[hidden] { display: none; }
.ins-detail > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.ins-detail strong { font-size: 13px; }
.ins-channels { display: flex; flex-direction: column; gap: 8px; }
.ins-channel { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto 56px; gap: 10px; align-items: center; font-size: 14px; }
.ins-channel .n { text-align: right; font-family: var(--mono); font-size: 13px; }
.ins-site { overflow-wrap: anywhere; }
#sites { display: flex; flex-direction: column; gap: 8px; }
.stack .c0, .swatch.c0 { background: var(--primary); }
.stack .c1, .swatch.c1 { background: var(--primary-2); }
.stack .c2, .swatch.c2 { background: var(--primary-3); }
.stack .c3, .swatch.c3 { background: var(--flag); }
.stack .c4, .swatch.c4 { background: var(--muted); }
.ins-who { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; font-size: 14px; }
.ins-who > div { display: flex; flex-direction: column; gap: 4px; }
.ins-who strong { font-size: 13px; color: var(--muted); }
.ai-vis > div { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ai-big { margin: 0; font-size: 15px; }
.ai-big strong { font-size: 20px; }
label.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
label.check input { width: 18px; height: 18px; flex: none; }
/* ---- Email reports ---- */
.sub-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: center; }
.sub-row:last-of-type { border-bottom: 0; }
.sub-who { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.sub-form { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.sub-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.often { display: flex; flex-wrap: wrap; gap: 6px 16px; border: 0; padding: 0; margin: 0; }
.sub-form select { min-height: 34px; }
@media (max-width: 700px) { .sub-row { grid-template-columns: minmax(0, 1fr); } }
/* ---- Site check ---- */
.check-running { display: flex; align-items: center; gap: 10px; color: var(--text-2); margin: 0; }
.check-ok { margin: 0; font-weight: 600; color: var(--good); }
.check-issue { border: 1px solid var(--border); border-radius: 10px; padding: 0 14px; }
.check-issue + .check-issue { margin-top: 10px; }
.check-issue > summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; cursor: pointer; list-style: none; }
.check-issue > summary::-webkit-details-marker { display: none; }
.check-issue > summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform 0.15s; flex: none; margin-right: 4px; }
.check-issue[open] > summary::before { transform: rotate(45deg); }
.check-title { flex: 1; font-weight: 600; }
.check-count { font-size: 13px; color: var(--muted); white-space: nowrap; }
.check-issue.sev1 { border-left: 4px solid var(--bad); }
.check-issue.sev2 { border-left: 4px solid var(--flag); }
.check-issue > .hint { margin: 0 0 8px; }
.check-issue .table-scroll { margin-bottom: 12px; }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--primary-3); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.open-page { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-left: 6px; vertical-align: middle; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); }
.open-page:hover, .open-page:focus-visible { color: var(--primary); border-color: var(--primary); }
.login .login-notice { margin-top: 14px; }
.login .login-notice a { color: inherit; font-weight: 600; }
