/* Look and feel: bright, bubbly, easy to read. Colours live here as tokens; dark mode swaps them. */

:root {
  --bg: #fbf7ff;
  --surface: #ffffff;
  --surface-2: #f5efff;
  --border: #ebe2fb;
  --text: #1c1036;
  --muted: #6c5f8a;
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-text: #ffffff;
  --accent-soft: #f1e8ff;
  --pink: #ff3fa4;
  --cyan: #13c8e8;
  --yellow: #ffc83d;
  --lime: #7ed957;
  --grad: linear-gradient(120deg, #ff3fa4 0%, #8b5cf6 52%, #13c8e8 100%);
  --grad-soft: linear-gradient(120deg, rgba(255, 63, 164, 0.12), rgba(139, 92, 246, 0.12) 52%, rgba(19, 200, 232, 0.12));
  --danger: #e11d48;
  --danger-soft: #ffe4ec;
  --success: #058a5e;
  --success-soft: #dcfbec;
  --warn: #a55300;
  --warn-soft: #fff1d1;
  --demo-soft: #fff3c4;
  --demo: #7a5600;
  /* Graph lines (Premium stats). Checked for colour-blind readers on the card colour, light and dark. */
  --viz-total: #7c3aed;
  --viz-1: #2a78d6;
  --viz-2: #eb6834;
  --viz-3: #1baf7a;
  --premium-grad: linear-gradient(120deg, #f7b733 0%, #ff6a3d 50%, #ff3fa4 100%);
  --tiktok: #111111;
  --instagram: #e1306c;
  --youtube: #ff0033;
  --ig-grad: linear-gradient(45deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5);
  --tt-grad: linear-gradient(90deg, #25f4ee, #111111 50%, #fe2c55);
  --yt-grad: linear-gradient(90deg, #ff0033, #ff5c5c);
  --radius: 20px;
  --shadow: 0 2px 4px rgba(76, 29, 149, 0.04), 0 10px 30px rgba(124, 58, 237, 0.08);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --tabbar-height: 64px;
  color-scheme: light;
}

/* Dark colours. Settings > Appearance sets data-theme on <html> (static/js/theme.js): "dark" always
   uses them, "light" never does, and without it they follow the device. Keep the two blocks the same. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #120a24;
    --surface: #1c1236;
    --surface-2: #271a4a;
    --border: #372866;
    --text: #f7f2ff;
    --muted: #b6a9d9;
    --accent: #b197ff;
    --accent-hover: #c4b0ff;
    --accent-text: #160d2c;
    --accent-soft: #2f2265;
    --danger: #ff6b8b;
    --danger-soft: #3d1426;
    --success: #4fe3a5;
    --success-soft: #0f3326;
    --warn: #ffc76b;
    --warn-soft: #3a2a0d;
    --demo-soft: #3a3110;
    --demo: #ffd76a;
    --viz-total: #8b5cf6;
    --viz-1: #3987e5;
    --viz-2: #d95926;
    --viz-3: #199e70;
    --tiktok: #f4f4f4;
    --instagram: #ff5c9b;
    --youtube: #ff4d6a;
    --tt-grad: linear-gradient(90deg, #25f4ee, #ffffff 50%, #fe2c55);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #120a24;
  --surface: #1c1236;
  --surface-2: #271a4a;
  --border: #372866;
  --text: #f7f2ff;
  --muted: #b6a9d9;
  --accent: #b197ff;
  --accent-hover: #c4b0ff;
  --accent-text: #160d2c;
  --accent-soft: #2f2265;
  --danger: #ff6b8b;
  --danger-soft: #3d1426;
  --success: #4fe3a5;
  --success-soft: #0f3326;
  --warn: #ffc76b;
  --warn-soft: #3a2a0d;
  --demo-soft: #3a3110;
  --demo: #ffd76a;
  --viz-total: #8b5cf6;
  --viz-1: #3987e5;
  --viz-2: #d95926;
  --viz-3: #199e70;
  --tiktok: #f4f4f4;
  --instagram: #ff5c9b;
  --youtube: #ff4d6a;
  --tt-grad: linear-gradient(90deg, #25f4ee, #ffffff 50%, #fe2c55);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background:
    radial-gradient(900px 500px at 100% -10%, rgba(19, 200, 232, 0.14), transparent 60%),
    radial-gradient(800px 500px at -10% 0%, rgba(255, 63, 164, 0.14), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.9rem; font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 750; }
p { margin: 0; }

.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.stack > * + * { margin-top: 12px; }
.stack-lg > * + * { margin-top: 20px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
[hidden] { display: none !important; }

/* Layout ----------------------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  /* Room for the phone's status bar when installed to the home screen */
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
}

.brand img { width: 32px; height: 32px; }

.nav { display: flex; gap: 6px; flex: 1; justify-content: center; }

.nav a {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 650;
  white-space: nowrap;
}

.nav a svg { width: 18px; height: 18px; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(139, 92, 246, 0.3); }

.who-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; text-decoration: none; }
.who { color: var(--muted); font-size: 0.86rem; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Smaller windows: make room for every section in the top bar. */
@media (max-width: 1100px) {
  .app-shell .who { display: none; }
  .app-shell .nav { gap: 4px; }
  .app-shell .nav a { padding: 8px 11px; }
}

@media (max-width: 940px) {
  .app-shell .nav a svg { display: none; }
  .app-shell .nav a { padding: 8px 10px; }
}

@media (max-width: 800px) {
  .app-shell .brand-name { display: none; }
}

/* Bottom tab bar: phones only */
.tabbar { display: none; }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 16px 72px;
}

.narrow { max-width: 720px; margin: 0 auto; }

.page-head { margin-bottom: 22px; }
.page-head p { margin-top: 6px; font-size: 1.02rem; }

/* Cards ------------------------------------------------------------------------------------ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.card + .card { margin-top: 16px; }
.card-title { margin-bottom: 16px; display: flex; gap: 12px; align-items: flex-start; }
.card-title p { margin-top: 3px; }

.step-num {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--grad);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
}

/* Buttons ---------------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  line-height: 1.2;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s;
}

.btn:hover { background: var(--surface-2); color: var(--text); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--pink);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.32);
}

.btn-primary:hover { background: var(--grad); color: #fff; box-shadow: 0 10px 26px rgba(255, 63, 164, 0.35); }
.btn-primary:disabled { box-shadow: none; }
.btn-danger { color: var(--danger); border-color: var(--danger-soft); }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-small { min-height: 34px; padding: 5px 13px; font-size: 0.88rem; }
.btn-large { min-height: 56px; padding: 14px 24px; font-size: 1.12rem; width: 100%; font-family: var(--font-display); font-weight: 800; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }

/* Forms ------------------------------------------------------------------------------------ */

.field { display: block; }
.field + .field { margin-top: 16px; }
.field-label { display: block; font-weight: 700; margin-bottom: 7px; }
.field-hint { margin-top: 5px; font-size: 0.86rem; color: var(--muted); }
.field-error { margin-top: 5px; font-size: 0.88rem; color: var(--danger); font-weight: 600; }

input[type="text"], input[type="email"], input[type="password"], input[type="datetime-local"], textarea, select {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  transition: border-color 0.12s;
}

input:hover, textarea:hover, select:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 96px; }
select { cursor: pointer; }
select:invalid { color: var(--muted); }

.counter { font-size: 0.8rem; color: var(--muted); text-align: right; margin-top: 5px; }
.counter.over { color: var(--danger); font-weight: 700; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  padding: 4px 0;
}

.check input { margin: 3px 0 0; width: 19px; height: 19px; accent-color: var(--accent); flex: none; }
.check.disabled { color: var(--muted); cursor: not-allowed; }
.check-desc { display: block; font-size: 0.86rem; color: var(--muted); }

.checks-inline { display: flex; gap: 8px; flex-wrap: wrap; }
.checks-inline .check { padding: 7px 14px 7px 10px; border: 2px solid var(--border); border-radius: 999px; }
.checks-inline .check input { margin-top: 2px; }

.switch-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }

.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--border); transition: background 0.15s; }
.switch span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s;
}
.switch input:checked + span { background: var(--grad); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--pink); outline-offset: 2px; }

.subsection { margin-top: 14px; padding: 16px; border-radius: 16px; background: var(--surface-2); }

details.tips { margin-top: 12px; }
details.tips summary { cursor: pointer; color: var(--accent); font-weight: 700; font-size: 0.92rem; list-style: none; }
details.tips summary::-webkit-details-marker { display: none; }
details.tips summary::before { content: "💡 "; }
details.tips ul { margin: 8px 0 0; padding-left: 20px; color: var(--muted); font-size: 0.9rem; }
details.tips li + li { margin-top: 4px; }

/* Banners, pills, chips -------------------------------------------------------------------- */

.banner { padding: 12px 16px; border-radius: 14px; background: var(--accent-soft); font-size: 0.95rem; }
.banner + .banner { margin-top: 10px; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.error { background: var(--danger-soft); color: var(--danger); }
.banner.success { background: var(--success-soft); color: var(--success); }
.banner a { color: inherit; font-weight: 700; }

.banner.party {
  background: var(--grad);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  text-align: center;
  padding: 18px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--text);
}

.pill::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.pill.tiktok::before { background: var(--tt-grad); }
.pill.instagram::before { background: var(--ig-grad); }
.pill.youtube::before { background: var(--youtube); }

.chip {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}

.chip.published { background: var(--success-soft); color: var(--success); }
.chip.failed { background: var(--danger-soft); color: var(--danger); }
.chip.uploading, .chip.processing, .chip.scheduled { background: var(--accent-soft); color: var(--accent); }
.chip.reconnect { background: var(--warn-soft); color: var(--warn); }
.chip.demo { background: var(--demo-soft); color: var(--demo); }

/* Avatars ---------------------------------------------------------------------------------- */

.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex: none;
  object-fit: cover;
  background: var(--grad);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  color: #fff;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 2px var(--border);
}

.avatar.small { width: 32px; height: 32px; font-size: 0.85rem; }

/* Accounts --------------------------------------------------------------------------------- */

.platform-card { position: relative; overflow: hidden; padding-top: 28px; }
.platform-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; }
.platform-card.tiktok::before { background: var(--tt-grad); }
.platform-card.instagram::before { background: var(--ig-grad); }
.platform-card.youtube::before { background: var(--yt-grad); }

.account-limit { margin-bottom: 16px; }

.platform-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.platform-emoji { font-size: 1.6rem; line-height: 1; }
.account-list { margin-top: 16px; display: grid; gap: 8px; }

.account-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--surface-2);
}

.account-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Composer --------------------------------------------------------------------------------- */

.dropzone {
  display: block;
  border: 3px dashed color-mix(in srgb, var(--accent) 40%, var(--border));
  border-radius: var(--radius);
  padding: 40px 16px;
  text-align: center;
  cursor: pointer;
  background: var(--grad-soft);
  transition: transform 0.12s, border-color 0.12s;
}

.dropzone:hover, .dropzone.dragging { border-color: var(--pink); transform: scale(1.01); }
.dropzone input { display: none; }
.dropzone-emoji { font-size: 2.6rem; line-height: 1; margin-bottom: 8px; }
.dropzone-title { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; }

/* Phones and tablets: Camera roll / Record / Files instead of (phones) or under (tablets) the drop area. */
.phone-picker { display: none; }

.pick-source {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.12s, border-color 0.12s;
}

.pick-source:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.pick-source:active { transform: scale(0.98); }
.pick-source:focus-within { outline: 3px solid var(--pink); outline-offset: 2px; }
/* Hidden but still there, so tapping the label opens the picker on every phone. */
.pick-source input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pick-source-emoji { font-size: 1.6rem; line-height: 1; }
.pick-source-text { display: flex; flex-direction: column; text-align: left; }
.pick-source-text strong { font-family: var(--font-display); font-size: 1.05rem; }

.pick-source.primary {
  min-height: 76px;
  padding: 16px 18px;
  border-color: transparent;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.32);
}

.pick-source.primary .pick-source-emoji { font-size: 2rem; }
.pick-source.primary .pick-source-text strong { font-size: 1.2rem; }
.pick-source.primary .small { color: rgba(255, 255, 255, 0.88); }
.phone-picker-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.phone-picker-row .pick-source { justify-content: center; }
.phone-picker-note { text-align: center; }

@media (max-width: 699px), (pointer: coarse) {
  .phone-picker { display: grid; gap: 10px; }
}

@media (pointer: coarse) and (min-width: 700px) {
  .phone-picker { margin-top: 14px; }
}

@media (max-width: 699px) {
  .dropzone { display: none; }
}

.video-layout { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }

.preview {
  width: 210px;
  max-width: 100%;
  aspect-ratio: 9 / 16;
  background: #000;
  border-radius: 18px;
  object-fit: contain;
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.25);
}

.facts { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; font-size: 0.92rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }

.progress { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress div { height: 100%; background: var(--grad); width: 0; transition: width 0.25s; border-radius: 999px; }

.pick-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, transform 0.12s;
}

.pick-row + .pick-row { margin-top: 8px; }
.pick-row:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.pick-row.selected { border-color: var(--accent); background: var(--accent-soft); }
.pick-row.disabled { opacity: 0.55; cursor: not-allowed; }
.pick-row input { width: 22px; height: 22px; accent-color: var(--accent); margin: 0; flex: none; }

.panel { position: relative; overflow: hidden; padding-top: 28px; }
.panel::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; }
.panel.tiktok::before { background: var(--tt-grad); }
.panel.instagram::before { background: var(--ig-grad); }
.panel.youtube::before { background: var(--yt-grad); }
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }

.issues { margin: 0; padding-left: 20px; color: var(--muted); font-size: 0.92rem; }
.issues li + li { margin-top: 4px; }
.declaration { font-size: 0.92rem; color: var(--muted); text-align: center; }

/* Posts ------------------------------------------------------------------------------------ */

.post-card { display: block; text-decoration: none; color: inherit; transition: transform 0.12s, border-color 0.12s; }
.post-card:hover { border-color: var(--accent); color: inherit; transform: translateY(-2px); }
.post-caption { font-weight: 750; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.target-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.target-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 4px; border-radius: 999px; background: var(--surface-2); }

.list-head { margin: 28px 0 12px; }
.list-head:first-child { margin-top: 0; }
.list-head + .card { margin-top: 0; }
.schedule-banner p { margin-top: 4px; }
.schedule-banner input[type="datetime-local"] { width: auto; flex: 1; min-width: 200px; }
.usage-line { text-align: center; }

.target-row { display: flex; gap: 12px; align-items: flex-start; padding: 16px 0; border-bottom: 1px solid var(--border); }
.target-row:first-child { padding-top: 0; }
.target-row:last-child { border-bottom: 0; padding-bottom: 0; }
.target-row .progress { margin-top: 8px; max-width: 320px; }

.empty { text-align: center; padding: 44px 16px; }
.empty-emoji { font-size: 3rem; line-height: 1; margin-bottom: 10px; }
.empty p { margin: 8px 0 18px; }

/* Settings: Appearance --------------------------------------------------------------------- */

.theme-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

.theme-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 12px;
  border: 2px solid var(--border);
  border-radius: 16px;
  font-weight: 700;
  font-size: 0.92rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.theme-option:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.theme-option.selected { border-color: var(--accent); background: var(--accent-soft); }
.theme-option input { position: absolute; opacity: 0; pointer-events: none; }
.theme-option:has(input:focus-visible) { outline: 3px solid var(--pink); outline-offset: 2px; }

/* A tiny picture of the app in each look: a card and a gradient button on the page colour. */
.theme-swatch {
  position: relative;
  width: 100%;
  height: 58px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.theme-swatch::before, .theme-swatch::after { content: ""; position: absolute; left: 10px; border-radius: 6px; }
.theme-swatch::before { right: 10px; top: 10px; height: 14px; }
.theme-swatch::after { top: 31px; width: 46%; height: 14px; border-radius: 999px; background: linear-gradient(120deg, #ff3fa4, #8b5cf6 52%, #13c8e8); }
.theme-swatch.light { background: #fbf7ff; }
.theme-swatch.light::before { background: #ffffff; box-shadow: 0 0 0 1px #ebe2fb; }
.theme-swatch.dark { background: #120a24; }
.theme-swatch.dark::before { background: #271a4a; }
.theme-swatch.system { background: linear-gradient(135deg, #fbf7ff 50%, #120a24 50%); }
.theme-swatch.system::before { background: linear-gradient(135deg, #ffffff 50%, #271a4a 50%); }

/* Plans ------------------------------------------------------------------------------------ */

.plan-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.6;
  white-space: nowrap;
}

.plan-badge.pro { background: var(--grad); color: #fff; }
.plan-badge.premium { background: var(--premium-grad); color: #fff; }

/* Plan cards: in the plan picker, Settings, and on locked screens. */
.plan-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; text-align: left; }
.plan-option {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}
.plan-option .perks { flex: 1; font-size: 0.92rem; }
.plan-option .price { font-size: 1.25rem; }
.plan-option .btn { width: 100%; }
.plan-option.pro { border-color: color-mix(in srgb, #8b5cf6 45%, var(--border)); }
.plan-option.premium { border-color: color-mix(in srgb, #ff6a3d 50%, var(--border)); }
.plan-option.premium .btn-primary { background: var(--premium-grad); }
.plan-option.current { background: var(--surface-2); }
.plan-option.dim { opacity: 0.6; }
.plan-option.dim .perks li::before { color: var(--muted); }
.modal.plan-dialog { width: min(680px, calc(100% - 32px)); }
.plan-dialog .plan-options { margin-top: 4px; }

/* A locked feature: which plan unlocks it, and a button for the plan picker. */
.locked-note {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface-2);
}

/* Segmented buttons: Stats tabs, periods, which number to graph. */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); }
.segmented button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(28, 16, 54, 0.12); }
.segmented.small-seg { border-radius: 14px; }
.segmented.small-seg button { min-height: 32px; padding: 4px 11px; font-size: 0.88rem; }
.stats-tabs { margin-bottom: 18px; }

.perks { list-style: none; margin: 0; padding: 0; text-align: left; }
.perks li { position: relative; padding-left: 28px; }
.perks li + li { margin-top: 8px; }
.perks li::before { content: "✓"; position: absolute; left: 4px; color: var(--success); font-weight: 800; }

.price { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; }

/* Stats (Pro) ------------------------------------------------------------------------------ */

.stats-updated { margin: -12px 0 16px; }
.stats-body { transition: opacity 0.15s; }
.stats-body.is-loading { opacity: 0.55; }
.stats-body > * + *, .locked-preview > * + * { margin-top: 16px; }
.section-head { margin-bottom: 16px; }

.stats-hero { position: relative; overflow: hidden; padding-top: 28px; }
.stats-hero::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: var(--grad); }

.stat-label { color: var(--muted); font-size: 0.92rem; font-weight: 700; }
.hero-value { font-size: clamp(3rem, 10vw, 4.4rem); font-weight: 800; line-height: 1.05; letter-spacing: -0.02em; margin: 4px 0 8px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }

.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.stat-value { font-size: 1.7rem; font-weight: 800; line-height: 1.15; margin-top: 4px; }
.stat-hint { color: var(--muted); font-size: 0.8rem; margin-top: 4px; }

.stats-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.stats-columns .card + .card { margin-top: 0; }

/* Views by platform: one horizontal bar each, square at the baseline, rounded at the value end. */
.bars { display: grid; gap: 16px; }
.bar-row { display: grid; grid-template-columns: 116px 1fr; gap: 4px 12px; align-items: center; }
.bar-track { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 24px; border-left: 1px solid var(--border); }
.bar-fill { height: 14px; background: var(--accent); border-radius: 0 4px 4px 0; flex: none; }
.bar-value { font-size: 0.92rem; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-detail { grid-column: 2; }

.top-videos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
.top-video { display: flex; align-items: center; gap: 12px; padding: 8px; margin: 0 -8px; border-radius: 14px; color: inherit; text-decoration: none; }
a.top-video:hover { background: var(--surface-2); color: inherit; }
.video-thumb {
  width: 46px;
  height: 62px;
  flex: none;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}
.video-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-meta { gap: 6px; margin-top: 2px; }
.video-numbers, .stats-account-numbers { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 4px; }

.stats-account { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.stats-account:first-of-type { padding-top: 0; }
.stats-account:last-child { border-bottom: 0; padding-bottom: 0; }
.stats-account p { margin-top: 4px; }

/* Premium: in-depth stats. Filters sit in one row above everything they change. */
.insight-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.insight-filters select { width: auto; min-width: 180px; padding: 8px 12px; border-radius: 999px; }
.filter-chips { gap: 6px; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 6px 13px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
.filter-chip:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.filter-chip.active { border-color: var(--accent); background: var(--accent-soft); }
.split-toggle { gap: 8px; cursor: pointer; font-weight: 700; }
.insight-chart .segmented { margin-bottom: 8px; }
.video-sort select { width: auto; padding: 7px 12px; border-radius: 999px; }

.insight-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.insight-table th { text-align: right; color: var(--muted); font-weight: 700; font-size: 0.82rem; padding: 0 8px 8px; white-space: nowrap; }
.insight-table td { text-align: right; padding: 9px 8px; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; white-space: nowrap; }
.insight-table th:first-child, .insight-table td:first-child { text-align: left; padding-left: 0; }

/* The line chart (static/js/chart.js) */
.viz-chart { position: relative; border-radius: 12px; }
.viz-chart:focus-visible { outline: 3px solid var(--pink); outline-offset: 4px; }
.viz-frame { position: relative; margin-top: 8px; }
.viz-svg { display: block; width: 100%; height: auto; overflow: visible; }
.viz-grid { stroke: var(--border); stroke-width: 1; }
.viz-base { stroke: var(--muted); stroke-opacity: 0.5; stroke-width: 1; }
.viz-axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-area { opacity: 0.1; }
.viz-dot { stroke: var(--surface); stroke-width: 2; }
.viz-end-label { fill: var(--text); font-size: 12px; font-weight: 700; }
.viz-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.viz-hit { cursor: crosshair; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 0.88rem; font-weight: 700; color: var(--muted); }
.viz-legend-item { display: inline-flex; align-items: center; gap: 7px; }
.viz-key { display: inline-block; width: 14px; height: 3px; border-radius: 2px; flex: none; }
.viz-tooltip {
  position: absolute;
  top: 6px;
  transform: translateX(12px);
  z-index: 2;
  min-width: 130px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  pointer-events: none;
  font-size: 0.86rem;
}
.viz-tooltip.flip { transform: translateX(calc(-100% - 12px)); }
.viz-tooltip-day { color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.viz-tooltip-row { display: flex; align-items: center; gap: 7px; }
.viz-tooltip-row strong { font-variant-numeric: tabular-nums; }
.viz-table { margin-top: 10px; }
.viz-table summary { cursor: pointer; color: var(--accent); font-weight: 700; font-size: 0.9rem; }
.viz-table-scroll { overflow-x: auto; max-height: 320px; }
.viz-table table { width: 100%; border-collapse: collapse; font-size: 0.86rem; margin-top: 8px; }
.viz-table th, .viz-table td { padding: 5px 8px; text-align: right; border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; white-space: nowrap; }
.viz-table th:first-child, .viz-table td:first-child { text-align: left; padding-left: 0; }

/* Free: a blurred example of the dashboard behind the upgrade card. */
.locked { display: grid; }
.locked > * { grid-area: 1 / 1; min-width: 0; }
.locked-preview { filter: blur(5px); opacity: 0.55; pointer-events: none; user-select: none; }
.upsell { position: relative; align-self: start; justify-self: center; width: min(620px, 100%); margin-top: 40px; text-align: center; }
.upsell .plan-badge { align-self: center; }
.upsell h2 { font-size: 1.5rem; }

/* Onelink editor (the page itself is styled in onelink.css) -------------------------------- */

.ol-head-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.ol-save-status { max-width: 280px; }
.ol-preview-jump { display: none; }

.ol-editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 22px; align-items: start; }
.ol-editor-side { position: sticky; top: 84px; }
.ol-preview-head { margin: 2px 8px 10px; }

.ol-phone {
  padding: 9px;
  border-radius: 44px;
  background: #0d0a16;
  box-shadow: 0 0 0 2px #2b2340, 0 24px 50px rgba(28, 16, 54, 0.28);
}

.ol-phone-screen {
  height: min(640px, calc(100vh - 150px));
  min-height: 460px;
  border-radius: 36px;
  overflow: hidden auto;
  background: var(--bg);
  scrollbar-width: none;
}

.ol-phone-screen::-webkit-scrollbar { display: none; }
.ol-phone-screen .ol-page { min-height: 100%; padding: 24px 12px 18px; }
.ol-phone-screen .ol-backdrop-wrap { position: absolute; }
.ol-phone-screen .ol-card { border-radius: 24px; padding-bottom: 20px; }
.ol-phone-screen .ol-cover { height: 112px; }
.ol-phone-screen .ol-avatar { width: 92px; height: 92px; margin-top: -46px; border-width: 4px; }
.ol-phone-screen .ol-initials { font-size: 2.2rem; }
.ol-phone-screen .ol-name { margin-top: 10px; font-size: 1.28rem; }
.ol-phone-screen .ol-bio { margin-left: 16px; margin-right: 16px; font-size: 0.92rem; }
.ol-phone-screen .ol-links { margin: 18px 12px 0; gap: 8px; }
.ol-phone-screen .ol-link { padding: 8px 10px 8px 8px; border-radius: 16px; }
.ol-phone-screen .ol-link-icon { width: 38px; height: 38px; border-radius: 12px; }
.ol-phone-screen .ol-link-icon svg { width: 21px; height: 21px; }
.ol-phone-screen .ol-footer { margin-top: 16px; font-size: 0.78rem; }

/* Your link: the address with the editable name at the end. */
.ol-handle {
  display: flex;
  align-items: center;
  padding-left: 14px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  cursor: text;
  transition: border-color 0.12s;
}

.ol-handle:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.ol-handle:focus-within { border-color: var(--accent); }
.ol-handle-host { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.ol-handle-at { flex: none; color: var(--muted); font-weight: 700; }
.ol-handle input[type="text"] { flex: 1 0 110px; min-width: 0; border: 0; padding-left: 2px; background: transparent; font-weight: 700; }
.ol-handle input[type="text"]:focus-visible { outline: none; }
.ol-ok { color: var(--success); font-weight: 600; }

.ol-live-url {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--success-soft);
  font-weight: 700;
}

.ol-live-url a { color: var(--success); }
.ol-live-dot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 25%, transparent); }
.ol-url-text { overflow-wrap: anywhere; }
.plan-badge.pro-on-grad { background: rgba(255, 255, 255, 0.25); color: #fff; }

/* Profile */
.ol-avatar-edit { display: flex; align-items: center; gap: 16px; }

.ol-avatar-thumb {
  width: 84px;
  height: 84px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 2px var(--border);
}

.ol-avatar-thumb.ol-initials { font-size: 2rem; }

/* Background swatches (their colours are in onelink.css) */
.ol-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 12px; }

.ol-swatch {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 54px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  font: inherit;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  transition: transform 0.12s, box-shadow 0.12s;
}

.ol-swatch:hover { transform: translateY(-2px); }
.ol-swatch.selected { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--accent); }
.ol-swatch:focus-within { outline: 3px solid var(--pink); outline-offset: 2px; }
.ol-swatch:disabled { cursor: progress; opacity: 0.7; transform: none; }
.ol-swatch-tool span { position: relative; pointer-events: none; font-size: 0.78rem; font-weight: 800; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); }
.ol-swatch-tool input[type="color"] { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.ol-swatch-tool.empty { background: var(--surface-2); box-shadow: inset 0 0 0 2px var(--border); }
.ol-swatch-tool.empty span { color: var(--muted); text-shadow: none; }
.ol-swatch-tool.empty.selected { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--accent); }

/* Links */
.ol-link-rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.ol-link-row { display: flex; align-items: center; gap: 12px; padding: 10px 8px 10px 12px; border-radius: 16px; background: var(--surface-2); }
.ol-link-row .ol-link-icon { width: 38px; height: 38px; border-radius: 12px; }
.ol-link-row .ol-link-icon svg { width: 21px; height: 21px; }
.ol-link-row.off .ol-link-icon, .ol-link-row.off .ol-link-row-info { opacity: 0.5; }
.ol-link-row-name { flex-wrap: nowrap; gap: 6px; }
.ol-link-row-name .account-name { min-width: 0; }
.ol-link-row-info p { margin-top: 4px; }
input.ol-label-input[type="text"] { margin-top: 6px; padding: 6px 10px; border-width: 1.5px; border-radius: 10px; font-size: 0.88rem; }
.ol-move { display: flex; flex-direction: column; gap: 2px; }
.btn.icon-btn { width: 36px; min-height: 30px; padding: 0; }
.icon-btn svg { width: 18px; height: 18px; }
.ol-links-empty { padding: 20px 8px 6px; }

/* Links you added and headings */
input.ol-emoji-input[type="text"] { width: 46px; height: 46px; flex: none; padding: 0; border-radius: 12px; font-size: 1.3rem; text-align: center; }
.ol-custom-row .ol-link-row-info input + input { margin-top: 6px; }
.ol-custom-row .ol-link-row-info .field-error { margin-top: 4px; }
.ol-row-tools { display: flex; align-items: center; gap: 2px; flex: none; }
.ol-heading-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 800;
}
input.ol-heading-input[type="text"] { margin-top: 0; font-weight: 800; }
.ol-add-row { margin-top: 12px; }
.ol-connect-note { margin-bottom: 10px; }

/* "Or use the picture from: TikTok / Instagram / YouTube" */
.ol-use-picture { margin-top: 8px; gap: 6px; }
.ol-picture-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 3px;
  border: 2px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}
.ol-picture-pick:hover { border-color: var(--accent); }
.ol-picture-pick:disabled { opacity: 0.5; cursor: progress; }
.ol-picture-pick img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }

/* Look */
.ol-look { display: grid; gap: 16px; }
.ol-look-row { display: grid; gap: 7px; justify-items: start; }
.ol-look-row.switch-row { display: flex; justify-items: initial; cursor: pointer; }
.ol-look-label { font-weight: 700; font-size: 0.92rem; }
.segmented button.ol-font-rounded { font-family: var(--font-display); }
.segmented button.ol-font-classic { font-family: var(--font); }
.segmented button.ol-font-serif, .segmented button.ol-font-mono { font-family: var(--ol-title-font); }
.ol-accents { gap: 8px; }
.ol-accent {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.ol-accent.selected { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent); }
.ol-accent-own { background: var(--surface-2); }
.ol-accent-own input[type="color"] { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.ol-accent:focus-within, .ol-accent:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
.btn-premium, .btn-premium:hover { background: var(--premium-grad); }

/* Pop-up (the Pro offer when publishing on Free) */
.modal {
  width: min(460px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 26px 24px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.modal::backdrop { background: rgba(18, 10, 36, 0.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal h2 { font-size: 1.45rem; }
.modal .btn-ghost { width: 100%; }

@media (max-width: 899px) {
  .ol-editor { grid-template-columns: minmax(0, 1fr); }
  .ol-editor-side { position: static; width: 100%; max-width: 380px; margin: 6px auto 0; }
  .ol-phone-screen { height: 600px; }
  .ol-preview-jump { display: inline-flex; }
}

/* Auth ------------------------------------------------------------------------------------- */

.auth { max-width: 440px; margin: calc(40px + env(safe-area-inset-top)) auto 0; }
.auth h1 { margin-bottom: 6px; }
.auth form { margin-top: 22px; }
.auth .switch-link { margin-top: 18px; text-align: center; }

/* Toasts and confetti ---------------------------------------------------------------------- */

.toasts {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(440px, calc(100% - 32px));
}

.toast {
  padding: 13px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 650;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  animation: toast-in 0.2s ease-out;
}

.toast.error { background: var(--danger); color: #fff; }
.toast.success { background: var(--grad); color: #fff; }

@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti span { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px; animation: confetti-fall linear forwards; }

@keyframes confetti-fall {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0.9; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .confetti { display: none; }
}

/* Marketing and legal pages ---------------------------------------------------------------- */

.hero { text-align: center; padding: 64px 16px 44px; max-width: 800px; margin: 0 auto; }
.hero h1 { font-size: clamp(2.3rem, 7vw, 3.8rem); letter-spacing: -0.03em; line-height: 1.05; }
.hero p { font-size: 1.2rem; margin: 18px auto 30px; color: var(--muted); max-width: 580px; }
.hero .row { justify-content: center; }
.hero-badges { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.btn-hero { min-height: 54px; padding: 14px 26px; font-size: 1.08rem; }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

.features .card + .card { margin-top: 0; }
.pricing { max-width: 760px; }
.pricing.three { max-width: 1060px; }
.pricing .card { display: flex; flex-direction: column; }
.pricing .perks { flex: 1; }
.pricing .btn { align-self: stretch; }
.features h3 { margin-bottom: 6px; }
.feature-emoji { font-size: 2rem; line-height: 1; margin-bottom: 12px; }
.section-title { text-align: center; padding: 8px 16px 20px; }

.footer { border-top: 1px solid var(--border); padding: 26px 16px; text-align: center; font-size: 0.9rem; color: var(--muted); }
.footer a { color: var(--muted); margin: 0 8px; }
.footer p { margin-top: 10px; }

.legal { max-width: 760px; margin: 0 auto; padding: 32px 16px 64px; }
.legal h1 { margin-bottom: 6px; }
.legal h2 { margin: 28px 0 8px; }
.legal p + p { margin-top: 10px; }
.legal ul { padding-left: 20px; }
.legal li + li { margin-top: 6px; }

/* Inside the phone demo frame, hide the desktop scrollbar like a real phone would. */
html.in-frame { scrollbar-width: none; }
html.in-frame::-webkit-scrollbar { display: none; }

/* Phones ----------------------------------------------------------------------------------- */

@media (max-width: 699px) {
  body { font-size: 16px; }
  .topbar-inner { padding: 10px 16px; justify-content: space-between; }
  .app-shell .nav, .app-shell .who { display: none; }
  h1 { font-size: 1.6rem; }
  .container { padding: 18px 14px calc(var(--tabbar-height) + 36px + env(safe-area-inset-bottom)); }
  .card { padding: 18px 16px; border-radius: 18px; }
  .panel, .platform-card { padding-top: 24px; }
  .preview { width: 100%; max-height: 440px; }
  .video-layout { gap: 14px; }
  .btn { min-height: 46px; }
  .btn-small { min-height: 40px; }
  /* 16px+ stops iPhones zooming in when a field is tapped */
  input[type="text"], input[type="email"], input[type="password"], input[type="datetime-local"], textarea, select { font-size: 16px; }
  .account-row { flex-wrap: wrap; }
  .platform-head > .row:last-child { flex-basis: 100%; }
  .platform-head > .row:last-child .btn { flex: 1; }
  .upsell { margin-top: 12px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-value { font-size: 1.45rem; }
  .bar-row { grid-template-columns: 1fr; }
  .bar-detail { grid-column: 1; }
  .stats-columns { grid-template-columns: minmax(0, 1fr); }
  .theme-options { gap: 8px; }
  .theme-option { padding: 8px 6px 10px; font-size: 0.84rem; }
  .ol-head-side { flex-basis: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 10px; text-align: left; }
  .ol-save-status { max-width: none; flex: 1 1 160px; }
  .ol-avatar-edit { gap: 12px; }
  .ol-avatar-thumb { width: 72px; height: 72px; }
  .ol-handle-host { max-width: 45%; }
  .modal { padding: 22px 18px; }
  .toasts { bottom: calc(var(--tabbar-height) + 16px + env(safe-area-inset-bottom)); }

  .tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    padding: 6px 8px env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
  }

  .tabbar a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-height: var(--tabbar-height);
    justify-content: center;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.74rem;
    font-weight: 700;
  }

  .tabbar a svg { width: 24px; height: 24px; }
  .tabbar a.active { color: var(--accent); }

  .tabbar a.tab-post span.tab-icon {
    width: 50px;
    height: 36px;
    border-radius: 14px;
    background: var(--grad);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.35);
  }
}
