/* Appie Hub design system, from appie.ooo and theoutlap.app: a warm pit-black
   ground, cream type, Bricolage Grotesque with an Instrument Serif accent and
   Appie orange. Set --app on any container to tint what is inside. */

:root {
  color-scheme: dark;
  --bg: #0e0d0c;
  --bg-2: #121110;
  --panel: #141312;
  --panel-2: #1a1917;
  --panel-3: #211f1c;
  --line: #262421;
  --line-2: #34312d;
  --text: #f3efe7;
  --text-2: #a9a49a;
  --text-3: #8c877d;
  --text-4: #5e5a53;
  --ink: #0e0d0c;
  --cream: #f3efe7;
  --paper: #fffcf6;
  --sand: #cfc8ba;
  --red: #e8481c;
  --good: #5fd38d;
  --bad: #ff6b5e;
  --warn: #f2b84b;
  --app: #cfc8ba;
  --radius: 14px;
  --radius-sm: 10px;
  --sans: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --shadow: none;
}

* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; overflow-x: clip; overscroll-behavior-x: none; }
body { overflow-x: clip; overscroll-behavior-x: none; }   /* no sideways swipe or wobble on a phone */
body {
  margin: 0;
  min-height: 100vh;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: color-mix(in srgb, var(--red) 40%, transparent); }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid color-mix(in srgb, var(--app) 70%, white); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Type ─────────────────────────────────────────────────────────────── */
h1, h2, h3 { margin: 0; font-family: var(--display); color: var(--text); letter-spacing: -0.025em; }
h1 { font-size: clamp(2rem, 4.6vw, 2.9rem); font-weight: 750; line-height: 0.98; letter-spacing: -0.055em; }
h2 { font-size: 1.14rem; font-weight: 650; }
h3 { font-size: 0.98rem; font-weight: 650; }
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
h1 .serif { font-size: 1.08em; padding-right: 0.04em; }
.red { color: var(--red); }
p { margin: 0; }
.label {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
}
.eyebrow { display: inline-flex !important; align-items: center; gap: 10px; letter-spacing: 0.2em; }
.eyebrow::before { content: ""; width: 22px; height: 1px; background: currentColor; opacity: 0.8; flex: none; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 0.84rem; }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }

/* ── Shell ────────────────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 60px;
  padding: 0 max(16px, calc((100vw - 1220px) / 2));
  background: rgba(14, 13, 12, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.brand { align-items: baseline; }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 1.5rem; line-height: 1; letter-spacing: -0.04em; white-space: nowrap; }
.dots { display: inline-flex; gap: 3px; margin-left: -9px; flex: none; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.brand-tag {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-3); white-space: nowrap;
}
.brand-tag::before { content: ""; width: 1px; height: 14px; background: var(--line-2); align-self: center; }
.brand-tag { align-self: center; }
.nav { display: flex; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 7px 12px; border-radius: 999px; color: var(--text-2); text-decoration: none; font-size: 0.9rem;
  white-space: nowrap; transition: background 0.15s, color 0.15s;
}
.nav a:hover { color: var(--text); background: rgba(243, 239, 231, 0.05); }
.nav a.on { color: var(--text); background: rgba(243, 239, 231, 0.09); }
.topbar .right { display: flex; align-items: center; gap: 10px; flex: none; }

.page { position: relative; z-index: 1; width: min(1220px, 100% - 32px); margin: 0 auto; padding: 28px 0 80px; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head .eyebrow { margin-bottom: 8px; display: block; }
.page-head p { margin-top: 6px; color: var(--text-2); }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); text-decoration: none; font-size: 0.86rem; margin-bottom: 14px; }
.back:hover { color: var(--text); }
.back svg { width: 16px; height: 16px; flex: none; }
.stack { display: grid; gap: 16px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.spread { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px; }

/* ── Panels ───────────────────────────────────────────────────────────── */
.panel {
  position: relative;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.panel.flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.panel.flush .panel-head { padding: 18px 20px 0; }
.panel .hint { color: var(--text-3); font-size: 0.84rem; }
.tinted { border-top: 2px solid var(--app); }
.divider { height: 1px; background: var(--line); margin: 18px 0; border: 0; }

/* ── Stat tiles ───────────────────────────────────────────────────────── */
.tiles { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 12px; }
.tile {
  container-type: inline-size;
  min-width: 0; text-align: left; display: block; width: 100%;
  background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 13px;
}
button.tile { cursor: pointer; transition: border-color 0.15s, transform 0.15s; }
button.tile:hover { border-color: var(--line-2); transform: translateY(-1px); }
button.tile.on { border-color: color-mix(in srgb, var(--app) 60%, transparent); }
.tile .label { display: block; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .value {
  display: block; font-family: var(--display); font-weight: 700; letter-spacing: -0.04em;
  font-size: clamp(1.05rem, 15cqi, 1.65rem); line-height: 1.1; font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile .delta { display: block; margin-top: 6px; font-size: 0.76rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .delta.up { color: var(--good); }
.tile .delta.down { color: var(--bad); }
.tile.accent { background: color-mix(in srgb, var(--app) 12%, var(--panel)); border-color: color-mix(in srgb, var(--app) 40%, transparent); }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 0 15px; border-radius: 999px; border: 1px solid transparent;
  background: var(--cream); color: var(--ink); font-weight: 650; font-size: 0.88rem;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 0.12s, background 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn:hover { transform: translateY(-1px); background: var(--paper); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: wait; transform: none; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn.ghost:hover { background: rgba(243, 239, 231, 0.06); border-color: var(--text-4); }
.btn.tint, .btn.tint:hover { background: var(--app); color: #fff; }
.btn.danger, .btn.danger:hover { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.danger:hover { background: color-mix(in srgb, var(--bad) 12%, transparent); }
.btn.small { min-height: 30px; padding: 0 11px; font-size: 0.8rem; }
.btn.icon { width: 34px; min-height: 34px; padding: 0; }
.btn svg { width: 15px; height: 15px; flex: none; }
.link-btn { background: none; border: 0; padding: 0; color: var(--text-2); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: inherit; }
.link-btn:hover { color: var(--text); }

/* ── Segmented range control ──────────────────────────────────────────── */
.segmented { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 999px; background: transparent; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.segmented button { border: 0; background: none; padding: 6px 12px; border-radius: 999px; color: var(--text-2); font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.06em; cursor: pointer; white-space: nowrap; }
.segmented button:hover { color: var(--text); }
.segmented button.on { background: var(--cream); color: var(--ink); }

/* ── Chips ────────────────────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line-2); font-size: 0.74rem; color: var(--text-2); white-space: nowrap; line-height: 1.4;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--app); flex: none; }
.chip.app { border-color: color-mix(in srgb, var(--app) 40%, transparent); background: color-mix(in srgb, var(--app) 10%, transparent); color: var(--text); text-decoration: none; }
.chip.status-active, .chip.status-ok, .chip.status-paid { color: var(--good); border-color: color-mix(in srgb, var(--good) 35%, transparent); }
.chip.status-paused, .chip.status-approved, .chip.status-no_key, .chip.status-running { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.chip.status-archived, .chip.status-draft { color: var(--text-3); }
.chip.status-fetch_failed, .chip.status-error { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.chip.sample { color: var(--sand); border-color: rgba(207, 200, 186, 0.35); background: rgba(207, 200, 186, 0.07); font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.1em; text-transform: uppercase; }

/* ── App identity ─────────────────────────────────────────────────────── */
.app-icon {
  width: var(--size, 36px); height: var(--size, 36px); flex: none; border-radius: 24%;
  display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(150deg, color-mix(in srgb, var(--app) 85%, white), color-mix(in srgb, var(--app) 70%, black));
  color: #fff; font-family: var(--display); font-weight: 700; font-size: calc(var(--size, 36px) * 0.42);
  box-shadow: 0 0 0 1px rgba(243, 239, 231, 0.08);
}
.app-icon img { width: 100%; height: 100%; object-fit: cover; }
.app-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.app-title .name { font-family: var(--display); font-weight: 650; letter-spacing: -0.01em; }
.avatar {
  width: var(--size, 38px); height: var(--size, 38px); border-radius: 50%; flex: none; display: grid; place-items: center;
  background: linear-gradient(150deg, #3a3631, #221f1c); color: var(--text); font-weight: 650;
  font-size: calc(var(--size, 38px) * 0.38); box-shadow: 0 0 0 1px var(--line-2);
}

/* ── App cards ────────────────────────────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card-link { text-decoration: none; display: block; transition: transform 0.15s, border-color 0.15s; }
.card-link:hover { transform: translateY(-2px); border-color: var(--line-2); }
.mini-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin-top: 16px; }
.mini-stats .v { display: block; font-family: var(--display); font-weight: 650; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.archived { opacity: 0.55; }

/* ── Tables ───────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; max-width: 100%; }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; font-variant-numeric: tabular-nums; }
th {
  text-align: left; font-family: var(--mono); font-size: 0.64rem; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-3); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 11px 12px; border-bottom: 1px solid var(--line); color: var(--text-2); white-space: nowrap; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th.r, td.r { text-align: right; }
td.strong, td .strong { color: var(--text); font-weight: 550; }
tr.clickable { cursor: pointer; transition: background 0.12s; }
tr.clickable:hover td { background: rgba(255, 255, 255, 0.025); }
.panel.flush table th:first-child, .panel.flush table td:first-child { padding-left: 20px; }
.panel.flush table th:last-child, .panel.flush table td:last-child { padding-right: 20px; }
.empty { padding: 28px 16px; text-align: center; color: var(--text-3); font-size: 0.88rem; }
td.wrap { white-space: normal; min-width: 220px; }

/* ── Forms ────────────────────────────────────────────────────────────── */
.form { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 0.8rem; color: var(--text-2); }
.field small { color: var(--text-3); font-size: 0.76rem; line-height: 1.45; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"],
input[type="date"], input[type="search"], select, textarea {
  width: 100%; min-height: 40px; padding: 9px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { min-height: 76px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: color-mix(in srgb, var(--app) 70%, white); box-shadow: 0 0 0 3px color-mix(in srgb, var(--app) 18%, transparent); }
input[type="color"] { width: 44px; height: 40px; padding: 3px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--bg-2); cursor: pointer; }
.input-row { display: flex; gap: 8px; align-items: center; }
.input-row > input { flex: 1; min-width: 0; }
.field.error input, .field.error select, .field.error textarea { border-color: var(--bad); }
.field .error-text { color: var(--bad); font-size: 0.78rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.form-error { color: var(--bad); font-size: 0.84rem; }
.suffix-input { position: relative; }
.suffix-input input { padding-right: 34px; }
.suffix-input em { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--text-3); font-size: 0.86rem; pointer-events: none; }
details.disclosure > summary { cursor: pointer; list-style: none; color: var(--text-2); font-size: 0.88rem; display: inline-flex; align-items: center; gap: 8px; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::before { content: "+"; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-2); font-family: var(--mono); font-size: 0.8rem; }
details.disclosure[open] > summary::before { content: "\2212"; }
details.disclosure[open] > summary { margin-bottom: 14px; color: var(--text); }

/* ── Links ────────────────────────────────────────────────────────────── */
.linkbox { display: grid; gap: 6px; min-width: 0; }
.linkbox .url-row { display: flex; gap: 6px; align-items: center; min-width: 0; }
.linkbox .url {
  flex: 1; min-width: 0; padding: 9px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--bg-2); font-family: var(--mono); font-size: 0.8rem; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.linkbox.primary .url { border-color: color-mix(in srgb, var(--app) 45%, transparent); }
.copied { color: var(--good) !important; }

/* ── Banners ──────────────────────────────────────────────────────────── */
.banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line-2); background: transparent;
  font-size: 0.88rem; color: var(--text-2);
}
.banner.sample { border-color: rgba(207, 200, 186, 0.28); background: rgba(207, 200, 186, 0.05); }
.banner.warn { border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: color-mix(in srgb, var(--warn) 7%, transparent); }
.banner.bad { border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: color-mix(in srgb, var(--bad) 7%, transparent); }
.note { font-size: 0.8rem; color: var(--text-3); line-height: 1.55; }
.note b { color: var(--text-2); font-weight: 550; }

/* ── Chart ────────────────────────────────────────────────────────────── */
.metric-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 14px; padding-bottom: 2px; }
.metric-tabs::-webkit-scrollbar { display: none; }
.metric-tabs button {
  flex: none; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); border-radius: 999px;
  padding: 5px 11px; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer;
}
.metric-tabs button:hover { color: var(--text); }
.metric-tabs button.on { color: var(--text); border-color: color-mix(in srgb, var(--app) 65%, transparent); background: color-mix(in srgb, var(--app) 16%, transparent); }
.chart-box { position: relative; height: 240px; }
.chart-box svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.chart-box text { font-family: var(--mono); font-size: 10px; fill: var(--text-3); }
.chart-tip {
  position: absolute; z-index: 3; transform: translate(-50%, calc(-100% - 12px)); pointer-events: none;
  padding: 7px 10px; border-radius: 9px; background: var(--cream); color: var(--ink); font-size: 0.76rem; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.chart-tip b { font-weight: 650; }
.chart-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.chart-meta .v { display: block; margin-top: 4px; font-family: var(--display); font-weight: 650; font-size: 1.05rem; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-meta .v small { color: var(--text-3); font-family: var(--sans); font-weight: 400; font-size: 0.72rem; margin-left: 4px; }
.chart-empty { display: grid; place-items: center; height: 100%; color: var(--text-3); font-size: 0.88rem; }

/* ── Funnel ───────────────────────────────────────────────────────────── */
.funnel { display: grid; gap: 12px; }
.funnel .step .top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; font-size: 0.86rem; }
.funnel .step .top b { font-family: var(--display); font-weight: 650; font-variant-numeric: tabular-nums; }
.funnel .bar { height: 8px; border-radius: 999px; background: rgba(243, 239, 231, 0.06); overflow: hidden; }
.funnel .bar i { display: block; height: 100%; border-radius: inherit; background: var(--app); transition: width 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
.funnel .conv { margin-top: 4px; font-size: 0.72rem; color: var(--text-3); }

/* ── Overview pieces ──────────────────────────────────────────────────── */
.tabs { display: flex; width: max-content; max-width: 100%; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; margin-bottom: 18px; }
.tabs a { padding: 6px 14px; border-radius: 999px; color: var(--text-2); text-decoration: none; font-size: 0.86rem; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.on { background: var(--cream); color: var(--ink); font-weight: 600; }
.app-switch { margin-bottom: 16px; }
.app-switch .chip { cursor: pointer; background: transparent; font: inherit; font-size: 0.8rem; padding: 5px 11px; }
.app-switch .chip.on { background: color-mix(in srgb, var(--app) 18%, transparent); border-color: var(--app); }
.answers { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.answer { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.answer h3 { font-size: 1rem; }
.answer-rows { display: grid; gap: 7px; margin-top: 12px; }
.answer-row { display: grid; grid-template-columns: minmax(0, 9fr) minmax(0, 10fr) 34px 42px; align-items: center; gap: 10px; font-size: 0.84rem; }
.answer-row > .num { text-align: right; }
.answer-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.answer-bar { height: 6px; border-radius: 999px; background: rgba(243, 239, 231, 0.06); overflow: hidden; }
.answer-bar i { display: block; height: 100%; border-radius: inherit; background: var(--app); }

/* ── Top videos ──────────────────────────────────────────────────────── */
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.video { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; transition: border-color 0.15s; }
.video:hover { border-color: var(--line-2); }
.video-thumb { position: relative; width: 92px; aspect-ratio: 9 / 16; border-radius: 10px; overflow: hidden; background: var(--panel-3); }
.video-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-rank { position: absolute; top: 6px; left: 6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; background: var(--cream); color: var(--ink); font-size: 0.75rem; }
.video-platform { position: absolute; bottom: 6px; left: 6px; padding: 2px 6px; border-radius: 6px; background: rgba(14, 13, 12, 0.75); font-family: var(--mono); font-size: 0.58rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text); }
.video-body { display: grid; align-content: start; gap: 6px; min-width: 0; }
.video-views { font-family: var(--display); font-weight: 750; font-size: 1.45rem; letter-spacing: -0.04em; line-height: 1; }
.video-views small { font-family: var(--sans); font-weight: 400; font-size: 0.78rem; letter-spacing: 0; color: var(--text-3); }
.video-caption { font-size: 0.84rem; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-meta { font-size: 0.74rem; color: var(--text-3); }

/* ── Key-value lists ──────────────────────────────────────────────────── */
.kv { display: grid; gap: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.88rem; }
.kv > div:last-child { border-bottom: 0; }
.kv dt, .kv .k { color: var(--text-3); }
.kv dd, .kv .v { margin: 0; color: var(--text); text-align: right; min-width: 0; overflow-wrap: anywhere; }
.big-money { font-family: var(--display); font-weight: 750; font-size: clamp(1.9rem, 5vw, 2.7rem); letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }

/* ── Auth screens ─────────────────────────────────────────────────────── */
.center { position: relative; z-index: 1; min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; }
.auth {
  width: min(420px, 100%); padding: 32px 28px 28px; border-radius: 20px; border: 1px solid var(--line);
  background: var(--panel);
}
.auth .brand { margin-bottom: 30px; }
.auth h1 { font-size: 2.2rem; margin-bottom: 10px; }
.auth > p { color: var(--text-2); margin-bottom: 22px; font-size: 0.92rem; }
.auth .btn { width: 100%; min-height: 44px; }
.auth .foot { margin-top: 18px; font-size: 0.8rem; color: var(--text-3); text-align: center; }
.auth .code-input { font-family: var(--mono); font-size: 1.5rem; letter-spacing: 0.4em; text-align: center; min-height: 54px; }
.loader { width: 26px; height: 26px; border: 2px solid var(--line-2); border-top-color: var(--text); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Dialog and toast ─────────────────────────────────────────────────── */
dialog {
  width: min(460px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line-2); border-radius: 18px;
  background: var(--panel-2); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
dialog::backdrop { background: rgba(8, 7, 6, 0.72); backdrop-filter: blur(3px); }
dialog .dialog-body { padding: 22px; display: grid; gap: 14px; }
dialog .dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.qr-frame { background: #fff; border-radius: 14px; padding: 10px; width: min(260px, 100%); justify-self: center; }
.qr-frame img { display: block; width: 100%; height: auto; }
.toast-zone { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { padding: 11px 15px; border-radius: 12px; background: var(--cream); color: var(--ink); font-size: 0.88rem; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45); animation: rise 0.25s ease both; }
.toast.error { background: #ffd9d3; color: #4a0d08; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.fade-in { animation: rise 0.35s ease both; }
.foot-note { margin-top: 36px; text-align: center; color: var(--text-4); font-size: 0.78rem; }
.foot-note a { color: var(--text-3); }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .tiles.t7 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tiles.t7 > :last-child { grid-column: span 2; }
  .tiles.t6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .tiles, .tiles.t6, .tiles.t7 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles > :last-child:nth-child(odd), .tiles.t7 > :last-child { grid-column: 1 / -1; }
  .grid-2, .grid-3, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .chart-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .topbar { height: auto; flex-wrap: wrap; gap: 8px 12px; padding-top: 10px; padding-bottom: 8px; }
  .topbar .nav { order: 3; flex-basis: 100%; }
  .topbar .right { margin-left: auto; }
  .brand-tag { display: none; }

  .page { padding-top: 20px; }
  .panel { padding: 16px; }
  .panel.flush .panel-head { padding: 14px 16px 0; }
  .panel.flush table th:first-child, .panel.flush table td:first-child { padding-left: 16px; }
  .panel.flush table th:last-child, .panel.flush table td:last-child { padding-right: 16px; }
  .chart-box { height: 200px; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; padding: 6px 6px; }
  .hide-phone { display: none; }
  /* Every section fits across the bar, so it never slides sideways. */
  .topbar .nav { overflow: visible; gap: 0; justify-content: space-between; }
  .nav a { padding: 6px 7px; font-size: 0.86rem; }
  /* Tables read as short lists: the first cell as the title, the rest beside their column names. */
  .table-wrap { overflow: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table-wrap tbody tr:last-child { border-bottom: 0; }
  .panel.flush .table-wrap td, .table-wrap td {
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 3px 0 !important;
    border: 0; white-space: normal; text-align: right; overflow-wrap: anywhere; min-width: 0;
  }
  .table-wrap td::before { content: attr(data-label); flex: none; color: var(--text-3); text-align: left; }
  .table-wrap td:first-child { display: block; text-align: left; color: var(--text); font-weight: 550; padding-bottom: 6px !important; }
  .table-wrap td:first-child::before, .table-wrap td[data-label=""]::before, .table-wrap td.empty::before { content: none; }
  .table-wrap td[data-label=""] { justify-content: flex-start; }
  .table-wrap td.empty { display: block; text-align: center; }
  td.wrap { min-width: 0; }
  /* The chart's metrics wrap onto a second line instead of sliding. */
  .metric-tabs { flex-wrap: wrap; overflow: visible; }
  .input-row { flex-wrap: wrap; }
  .input-row > input { flex: 1 1 100%; }
  .page-head .app-title { align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── Overview ─────────────────────────────────────────────────────────── */
.ov-hero {
  position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; padding: 26px 28px 26px;
  background:
    radial-gradient(90% 160% at 0% 0%, color-mix(in srgb, var(--app) 22%, transparent), transparent 55%),
    radial-gradient(60% 120% at 100% 100%, color-mix(in srgb, var(--app) 9%, transparent), transparent 60%),
    var(--panel);
}
.ov-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.ov-id { display: flex; align-items: center; gap: 20px; min-width: 0; }
.ov-id .eyebrow { margin-bottom: 8px; }
.ov-id h1 { font-size: clamp(2.3rem, 5vw, 3.5rem); }
.ov-icon {
  width: 84px; height: 84px; flex: none; border-radius: 24%; overflow: hidden; display: grid; place-items: center;
  background: var(--panel-3); font-family: var(--display); font-weight: 750; font-size: 1.6rem;
  box-shadow: 0 0 0 1px rgba(243, 239, 231, 0.1), 0 18px 46px -10px color-mix(in srgb, var(--app) 70%, transparent);
  transform: rotate(-4deg);
}
.ov-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ov-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ov-numbers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.ov-num { min-width: 0; padding: 0 24px; border-left: 1px solid var(--line); }
.ov-num:first-child { padding-left: 0; border-left: 0; }
.ov-num .label { display: block; margin-bottom: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-num b {
  display: block; font-family: var(--display); font-weight: 750; letter-spacing: -0.055em; line-height: 1;
  font-size: clamp(2rem, 3.8vw, 3.1rem); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ov-num .delta { display: block; margin-top: 10px; font-size: 0.82rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov-num .delta.up { color: var(--good); }
.ov-num .delta.down { color: var(--bad); }

/* Install to purchase, one row of steps */
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--steps, 5), minmax(0, 1fr)); gap: 12px; }
.flow-step { position: relative; min-width: 0; padding: 16px 16px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); }
.flow-step.goal { background: color-mix(in srgb, var(--app) 13%, var(--panel)); border-color: color-mix(in srgb, var(--app) 45%, transparent); }
.flow-step .label { display: block; margin-bottom: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-num { display: block; font-family: var(--display); font-weight: 750; font-size: clamp(1.5rem, 2.5vw, 2.1rem); letter-spacing: -0.045em; line-height: 1; font-variant-numeric: tabular-nums; }
.flow-bar { display: block; height: 5px; margin-top: 16px; border-radius: 999px; background: rgba(243, 239, 231, 0.07); overflow: hidden; }
.flow-bar i { display: block; height: 100%; border-radius: inherit; background: var(--app); }
.flow-of { display: block; margin-top: 8px; font-size: 0.76rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Content: the top three as ranked posters, the next best as a list */
.content-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 32px; margin-top: 22px; align-items: start; }
.top .label, .runners .label { display: block; margin-bottom: 12px; }
.top-three { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.top-card { display: grid; gap: 14px; min-width: 0; text-decoration: none; }
.top-art {
  position: relative; aspect-ratio: 9 / 16; border-radius: 16px; overflow: hidden; background: var(--panel-3);
  box-shadow: 0 0 0 1px var(--line-2), 0 22px 44px -24px rgba(0, 0, 0, 0.9); transition: transform 0.2s ease;
}
.top-card.first .top-art { box-shadow: 0 0 0 2px var(--app), 0 26px 60px -24px color-mix(in srgb, var(--app) 70%, transparent); }
.top-card:hover .top-art { transform: translateY(-4px); }
.top-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.top-meta { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; min-width: 0; }
.top-rank { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 3.2rem; line-height: 0.8; letter-spacing: -0.02em; color: var(--text); }
.top-card.first .top-rank { color: var(--app); }
.top-text { display: grid; gap: 4px; min-width: 0; }
.top-views { font-family: var(--display); font-weight: 750; font-size: 1.3rem; letter-spacing: -0.04em; line-height: 1; white-space: nowrap; }
.top-views small { font-family: var(--sans); font-weight: 400; font-size: 0.74rem; letter-spacing: 0; color: var(--text-3); }
.top-caption { font-size: 0.78rem; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.runners { align-self: start; min-width: 0; }
.runners ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.runner { display: grid; grid-template-columns: 18px 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 10px; margin: 0 -10px; border-radius: 10px; text-decoration: none; }
.runner:hover { background: var(--panel-2); }
.runner-rank { font-family: var(--mono); font-size: 0.74rem; color: var(--text-3); }
.runner-thumb { position: relative; width: 38px; aspect-ratio: 9 / 16; border-radius: 7px; overflow: hidden; background: var(--panel-3); }
.runner-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.runner-text { display: grid; gap: 2px; min-width: 0; }
.runner-text span { font-size: 0.84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.runner-text small { font-size: 0.72rem; color: var(--text-3); }
.runner-views { font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; }

/* More detail */
details.more > summary {
  list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px;
  padding: 16px 20px; border: 1px dashed var(--line-2); border-radius: var(--radius); font-size: 0.88rem;
}
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary > span:first-child { font-family: var(--display); font-weight: 650; font-size: 1rem; }
details.more > summary > span:first-child::before { content: "+"; display: inline-block; width: 1.2em; font-family: var(--mono); color: var(--text-3); }
details.more[open] > summary > span:first-child::before { content: "\2212"; }
details.more[open] > summary { margin-bottom: 16px; }
details.more > summary:hover { border-color: var(--text-4); }

/* Sale sound and sale note */
.btn.icon-only { padding-left: 9px; padding-right: 9px; }
.btn.icon-only.on { color: var(--good); }
.toast.sale { background: var(--good); color: #062a14; font-weight: 600; }

@media (max-width: 1100px) {
  .content-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-step.goal { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .ov-hero { padding: 20px 18px; border-radius: 18px; }
  .ov-icon { width: 64px; height: 64px; }
  .ov-id { gap: 14px; }
  .ov-numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 22px; margin-top: 22px; padding-top: 20px; }
  .ov-num { padding: 0 14px; }
  .ov-num:nth-child(3) { padding-left: 0; border-left: 0; }
  .ov-num b { font-size: 2rem; }
  .ov-num .delta { white-space: normal; }
  .top-three { gap: 8px; }
  .top-meta { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .top-rank { font-size: 2.2rem; }
  .top-views { font-size: 1rem; }
}

/* ── Team ─────────────────────────────────────────────────────────────── */
.team-avatar { background: var(--who, var(--panel-3)) !important; color: #0e0d0c; font-family: var(--display); font-weight: 750; box-shadow: none; }
.me { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-size: 0.86rem; color: var(--text-2); padding: 3px 10px 3px 3px; border-radius: 999px; border: 1px solid var(--line-2); }
.me:hover { color: var(--text); border-color: var(--text-4); }
.nav a { position: relative; }
.badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px;
  background: var(--red); color: #fff; font-style: normal; font-size: 0.66rem; font-weight: 700; vertical-align: 1px;
}
.team-head { align-items: center; }
.team-head .tabs { margin-bottom: 0; }

/* Chat */
.chat { display: grid; gap: 14px; }
.chat-list { display: grid; gap: 4px; min-height: 40vh; align-content: end; }
.chat-list.inner { min-height: 0; overflow-y: auto; overscroll-behavior: contain; align-content: start; padding: 4px 2px; }
/* Team page: the chat takes the rest of the screen, newest messages on the bottom */
.chat.full { grid-template-rows: minmax(0, 1fr) auto; min-height: 0; }
.chat.full .chat-list.inner { display: flex; flex-direction: column; gap: 4px; }
.chat.full .chat-list.inner > :first-child { margin-top: auto; }   /* sit on the bottom, still scroll to the top */
.page:has(.chat.full) { padding-bottom: 0; }
.chat.full .chat-compose { position: static; }
.chat-empty { text-align: center; padding: 40px 0; }
.chat-day { display: flex; justify-content: center; margin: 14px 0 8px; }
.chat-day span { font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }
.msg { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; align-items: start; margin-top: 10px; }
.msg.joined { margin-top: 0; }
.msg-gap { width: 32px; }
.msg-body { display: grid; justify-items: start; gap: 4px; min-width: 0; }
.msg-who { display: flex; align-items: baseline; gap: 8px; font-size: 0.82rem; }
.msg-who span { color: var(--text-3); font-size: 0.74rem; }
.msg-who time { color: var(--text-4); font-size: 0.72rem; }
.bubble {
  max-width: min(560px, 100%); padding: 9px 13px; border-radius: 4px 16px 16px 16px; background: var(--panel-2);
  line-height: 1.45; overflow-wrap: anywhere;
}
.msg.joined .bubble { border-radius: 16px; }
.bubble a { color: inherit; text-underline-offset: 3px; }
.msg.mine { grid-template-columns: minmax(0, 1fr) 32px; }
.msg.mine > :first-child { order: 2; }
.msg.mine .msg-body { justify-items: end; }
.msg.mine .msg-who { flex-direction: row-reverse; }
.msg.mine .bubble { background: var(--cream); color: var(--ink); border-radius: 16px 4px 16px 16px; }
.msg.mine.joined .bubble { border-radius: 16px; }
.msg-delete { font-size: 0.72rem; color: var(--text-4); opacity: 0; transition: opacity 0.15s; }
.msg:hover .msg-delete, .msg-delete:focus-visible { opacity: 1; }
.chat-compose {
  position: sticky; bottom: 12px; display: flex; align-items: flex-end; gap: 10px; padding: 10px;
  border: 1px solid var(--line-2); border-radius: 20px; background: rgba(20, 19, 18, 0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.chat-compose textarea { flex: 1; min-height: 40px; max-height: 160px; resize: none; border: 0; background: transparent; padding: 9px 8px; box-shadow: none !important; }
.chat-compose .btn { flex: none; }

/* Bottom-left chat button and its window */
.chat-fab {
  position: fixed; left: 20px; bottom: 20px; z-index: 60; display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 16px 0 14px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--cream); color: var(--ink); font-weight: 650; font-size: 0.88rem; cursor: pointer;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5); transition: transform 0.15s;
}
.chat-fab:hover { transform: translateY(-1px); }
.chat-fab svg { width: 18px; height: 18px; }
.chat-fab .badge { margin-left: 0; }
.chat-pop {
  position: fixed; left: 20px; bottom: 76px; z-index: 60; width: min(380px, calc(100vw - 40px)); height: min(520px, calc(100vh - 120px));
  display: grid; grid-template-rows: auto minmax(0, 1fr); border: 1px solid var(--line-2); border-radius: 22px;
  background: var(--panel); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); overflow: hidden; animation: rise 0.2s ease both;
}
.chat-pop[hidden] { display: none; }
.chat-pop-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); }
.chat-pop-head b { flex: 1; font-family: var(--display); }
.chat-pop-body { grid-template-rows: minmax(0, 1fr) auto; min-height: 0; padding: 0 12px 12px; gap: 10px; }
.chat-pop-body .chat-compose { position: static; }
.chat-pop .msg-who span { display: none; }

/* Tasks */
.task-new { margin-bottom: 18px; }
.task-new-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.task-new-row .grow { flex: 1 1 260px; }
.task-new-row .field:not(.grow) { flex: 0 1 170px; }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.board-col { display: grid; gap: 10px; min-width: 0; }
.board-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 4px; }
.board-empty { padding: 16px 4px; }
.task { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); min-width: 0; }
.board-col[data-col="doing"] .task { border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.task.done h3 { color: var(--text-3); text-decoration: line-through; text-decoration-color: var(--text-4); }
.task h3 { font-size: 0.98rem; overflow-wrap: anywhere; }
.task-notes { color: var(--text-2); font-size: 0.84rem; overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 0.82rem; }
.chip.late { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.task-actions { display: flex; gap: 8px; align-items: center; }
.task-actions select { flex: 1; min-height: 32px; padding: 4px 8px; font-size: 0.8rem; min-width: 0; }

/* Ideas */
.ideas { display: grid; gap: 12px; }
.idea { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px; align-items: start; }
.idea.parked { opacity: 0.6; }
.vote {
  display: grid; justify-items: center; gap: 2px; padding: 10px 0; border-radius: 14px; border: 1px solid var(--line-2);
  background: transparent; color: var(--text-2); cursor: pointer; font: inherit;
}
.vote b { font-family: var(--display); font-size: 1.15rem; color: var(--text); }
.vote.on { border-color: var(--red); color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); }
.idea-body { display: grid; gap: 8px; min-width: 0; }
.idea-body h3 { font-size: 1.05rem; overflow-wrap: anywhere; }
.idea-notes { color: var(--text-2); font-size: 0.88rem; overflow-wrap: anywhere; }
.idea-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--text-3); }
.idea-backers { display: inline-flex; margin-left: auto; }
.idea-backers .avatar + .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--panel); }
.idea-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.idea-actions select { width: auto; min-height: 32px; padding: 4px 8px; font-size: 0.8rem; }

/* People */
.people { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.person-top { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.person-top h2 { display: flex; align-items: center; gap: 8px; font-size: 1.3rem; }
.person-title { font-family: var(--serif); font-style: italic; font-size: 1.2rem; color: var(--who, var(--text-2)); }

@media (max-width: 900px) {
  .board, .people { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .nav a { padding: 6px 5px; font-size: 0.8rem; }
  .badge { margin-left: 3px; }

  .me { padding: 3px; }
  .chat-fab { left: 16px; bottom: 16px; padding: 0 14px; }
  .chat-fab span { display: none; }
  .chat-pop { left: 16px; right: 16px; width: auto; bottom: 72px; height: min(70vh, 560px); }
  .team-head { gap: 12px; }
  .msg-delete { opacity: 1; }
  .task-new-row .field:not(.grow) { flex: 1 1 140px; }
  .idea { grid-template-columns: 48px minmax(0, 1fr); gap: 12px; }
}

/* Team overview: everyone's tasks at a glance */
.ov-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 16px; }
.ov-person { display: grid; gap: 14px; align-content: start; }
.ov-head { display: flex; align-items: center; gap: 12px; }
.ov-head > div { display: grid; }
.ov-none { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--line-2); color: var(--text-3); font-weight: 700; }
.ov-counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ov-counts span { display: grid; gap: 2px; font-size: 0.7rem; color: var(--text-3); }
.ov-counts b { font-family: var(--display); font-size: 1.5rem; color: var(--text); line-height: 1; }
.ov-counts .bad b { color: var(--accent, #E8481C); }
.ov-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ov-task { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; }
.ov-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--text-4); }
.ov-dot.doing { background: #F5A623; }
.task-locked { margin: 4px 0 0; }

/* The bell */
.bell-wrap { position: relative; }
#bell { position: relative; }
#bell .badge { position: absolute; top: -4px; right: -4px; margin: 0; }
.bell-pop { position: absolute; right: 0; top: calc(100% + 8px); width: min(360px, calc(100vw - 32px)); max-height: min(70vh, 520px); overflow-y: auto;
  background: var(--panel, #161513); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); z-index: 60; padding: 8px; }
.bell-pop[hidden] { display: none; }
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 10px; }
.bell-head b { font-family: var(--display); }
.bell-ask { width: 100%; margin: 0 0 8px; justify-content: center; }
.bell-list { display: grid; gap: 2px; }
.bell-item { display: flex; gap: 10px; padding: 10px 8px; border-radius: 12px; color: var(--text); text-decoration: none; align-items: flex-start; }
.bell-item:hover { background: rgba(255, 255, 255, 0.04); }
.bell-item.unread { background: rgba(232, 72, 28, 0.08); }
.bell-text { display: grid; gap: 3px; font-size: 0.86rem; min-width: 0; }
.bell-text small { color: var(--text-3); font-size: 0.72rem; }
.bell-quote { color: var(--text-2); overflow-wrap: anywhere; }
.bell-empty { padding: 8px; }
@media (max-width: 640px) { .bell-pop { position: fixed; left: 16px; right: 16px; top: 64px; width: auto; } }

/* Room for the menu next to the bell: drop the name beside your avatar before the menu gets cut */
@media (max-width: 1100px) { .topbar .me > .hide-phone { display: none; } .topbar .right { gap: 6px; } }
/* Menu on its own row as soon as it would not fit beside the buttons */
@media (max-width: 900px) {
  .topbar { height: auto; flex-wrap: wrap; gap: 8px 12px; padding-top: 10px; padding-bottom: 8px; }
  .topbar .nav { order: 3; flex-basis: 100%; }
  .topbar .right { margin-left: auto; }
}
/* Five team tabs: on a phone they scroll inside their bar instead of running off the edge */
.team-head .tabs { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.team-head .tabs::-webkit-scrollbar { display: none; }
@media (max-width: 640px) { .team-head .tabs a { padding-left: 12px; padding-right: 12px; } }
