/* KipperClipper — calm, warm, quiet UI */
/* Self-hosted fonts: no third-party requests. */
@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/assets/fonts/fraunces.woff2') format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: italic; font-weight: 400 600; font-display: swap; src: url('/assets/fonts/fraunces-italic.woff2') format('woff2'); }
@font-face { font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 400 800; font-display: swap; src: url('/assets/fonts/hanken-grotesk.woff2') format('woff2'); }

:root {
  color-scheme: light;
  --brand: #2f5d50;
  --nav-bg: rgba(245, 242, 236, 0.85);
  --honey-ink: #7a5512;
  --toast-bg: #1e2b26;
  --toast-ink: #f5f2ec;
  --danger-hover: #f0d3c8;
  --overlay: rgba(24, 33, 29, 0.45);
  --skeleton: #e9e4da;
  --skeleton-shine: #f4f0e8;
  --bg: #f5f2ec;
  --surface: #fffdf9;
  --surface-2: #efebe3;
  --ink: #1e2b26;
  --ink-2: #4c5a54;
  --ink-3: #85908a;
  --line: #e3ddd2;
  --line-2: #d6cfc2;
  --accent: #2f5d50;
  --accent-hover: #264d42;
  --accent-soft: #dfe9e3;
  --accent-ink: #f4f8f5;
  --honey: #e8b34b;
  --honey-soft: #f7ead0;
  --danger: #a9472a;
  --danger-soft: #f6e3dc;
  --ok: #3d7a5c;

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Hanken Grotesk', -apple-system, 'Segoe UI', Roboto, sans-serif;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(30, 43, 38, 0.05);
  --shadow: 0 1px 2px rgba(30, 43, 38, 0.04), 0 8px 24px -12px rgba(30, 43, 38, 0.14);
  --shadow-lg: 0 2px 4px rgba(30, 43, 38, 0.04), 0 24px 48px -20px rgba(30, 43, 38, 0.25);
  --ease: cubic-bezier(0.22, 0.7, 0.2, 1);
  --t: 220ms var(--ease);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
/* Adjustable text size (set from the globe menu, saved per browser). */
html[data-text='sm'] { font-size: 90%; }
html[data-text='lg'] { font-size: 112.5%; }
html[data-text='xl'] { font-size: 125%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: clip; /* never a sideways scroll on phones */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.015em; line-height: 1.15; margin: 0; color: var(--ink); }
h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); font-variation-settings: 'opsz' 96; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-variation-settings: 'opsz' 72; }
h3 { font-size: 1.2rem; font-family: var(--font-body); font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0; }
::selection { background: var(--honey-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--ink-2); }
.subtle { color: var(--ink-3); font-size: 0.9rem; }
.eyebrow { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.hidden { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px;
  border-radius: var(--r);
  border: 1px solid transparent;
  font: 600 0.95rem/1 var(--font-body);
  text-decoration: none; cursor: pointer;
  transition: background var(--t), color var(--t), border-color var(--t), transform var(--t), box-shadow var(--t);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--surface); color: var(--ink); border-color: var(--ink-3); }
.btn-quiet { background: transparent; color: var(--ink-2); height: 38px; padding: 0 12px; }
.btn-quiet:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); color: var(--danger); }
.btn-lg { height: 52px; padding: 0 26px; font-size: 1rem; border-radius: var(--r); }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-loading { opacity: 0.6; cursor: not-allowed; pointer-events: none; }
.btn .spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 30; background: var(--nav-bg); backdrop-filter: saturate(1.2) blur(10px); -webkit-backdrop-filter: saturate(1.2) blur(10px); border-bottom: 1px solid transparent; transition: border-color var(--t); }
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.logo:hover { color: var(--ink); }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a:not(.btn) { color: var(--ink-2); text-decoration: none; font-weight: 500; padding: 8px 12px; border-radius: var(--r-sm); transition: color var(--t), background var(--t); }
.nav-links a:not(.btn):hover { color: var(--ink); background: var(--surface-2); }
@media (max-width: 720px) { .nav-links .hide-sm { display: none; } }

/* ---------- Landing ---------- */
.hero { padding: 72px 0 96px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 64px; align-items: center; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .lede { font-size: 1.15rem; color: var(--ink-2); margin: 22px 0 32px; max-width: 34rem; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero-note { margin-top: 18px; font-size: 0.9rem; color: var(--ink-3); }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 48px; } .hero { padding: 40px 0 64px; } }

.phone {
  width: 280px; aspect-ratio: 9 / 16; margin: 0 auto;
  border-radius: 34px; padding: 10px; background: #18211d;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.phone-screen { width: 100%; height: 100%; border-radius: 26px; overflow: hidden; display: grid; grid-template-rows: 1fr 1fr; position: relative; }
.phone-top { background: linear-gradient(160deg, #3b5d52, #2a3f38 60%, #22332d); position: relative; overflow: hidden; }
.phone-top .speaker { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 110px; height: 120px; }
.phone-top .speaker .head { width: 54px; height: 54px; border-radius: 50%; background: #d9b99b; margin: 0 auto; }
.phone-top .speaker .body { width: 110px; height: 70px; border-radius: 55px 55px 0 0; background: #e8b34b; margin-top: 4px; }
.phone-top .mic { position: absolute; bottom: 30px; right: 46px; width: 10px; height: 52px; background: #111; border-radius: 6px; transform: rotate(-12deg); }
.phone-top .mic::before { content: ''; position: absolute; top: -12px; left: -6px; width: 22px; height: 26px; border-radius: 10px; background: #2b2b2b; }
.phone-bottom { background: #6aa3c9; position: relative; overflow: hidden; }
.phone-bottom .track { position: absolute; inset: 0; background:
  repeating-linear-gradient(90deg, transparent 0 46px, rgba(255,255,255,0.18) 46px 50px),
  linear-gradient(#8cc0de 0 40%, #7c9b5a 40% 100%);
  background-size: 200% 100%, 100% 100%;
  animation: run 2.6s linear infinite; }
.phone-bottom .runner { position: absolute; bottom: 34%; left: 44%; width: 26px; height: 40px; background: #f5f2ec; border-radius: 8px; animation: hop 0.9s var(--ease) infinite; }
.phone-bottom .block { position: absolute; bottom: 22%; width: 60px; height: 60px; background: #9a6b3f; border: 3px solid #6f4a29; animation: slide 2.6s linear infinite; }
@keyframes run { to { background-position: -100% 0, 0 0; } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(-26px); } }
@keyframes slide { from { left: 110%; } to { left: -30%; } }
.phone-caption { position: absolute; top: 50%; left: 0; right: 0; transform: translateY(-50%); text-align: center; z-index: 2; pointer-events: none; }
.phone-caption span { display: inline-block; font: 800 1.35rem/1 var(--font-body); color: #fff; text-transform: uppercase; letter-spacing: 0.01em; text-shadow: 0 0 4px #000, 0 2px 0 #000, 2px 0 0 #000, -2px 0 0 #000, 0 -2px 0 #000; margin: 0 3px; }
.phone-caption span.on { color: #ffe63c; animation: pop 0.25s var(--ease); }
@keyframes pop { from { transform: scale(0.85); } to { transform: scale(1); } }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); display: inline-block; }
.dot.honey { background: var(--honey); }

.section { padding: 88px 0; }
.section-head { max-width: 40rem; margin-bottom: 48px; }
.section-head p { margin-top: 14px; color: var(--ink-2); font-size: 1.08rem; }
.band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; list-style: none; padding: 0; margin: 0; }
.step { padding: 28px; border-radius: var(--r-lg); background: var(--bg); border: 1px solid var(--line); }
.step-num { font-family: var(--font-display); font-size: 1.6rem; color: var(--accent); margin-bottom: 14px; }
.step p { color: var(--ink-2); margin-top: 8px; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.feature { background: var(--surface); padding: 32px; }
.feature-icon { width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 18px; }
.feature-icon svg { width: 20px; height: 20px; }
.feature p { color: var(--ink-2); margin-top: 8px; }
@media (max-width: 760px) { .features { grid-template-columns: 1fr; } }

.pricing { display: grid; grid-template-columns: repeat(2, minmax(0, 380px)); gap: 20px; justify-content: center; }
.price-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 32px; display: flex; flex-direction: column; position: relative; }
.price-card.featured { border-color: var(--accent); box-shadow: var(--shadow); position: relative; }
.price-card .tag { position: absolute; top: -12px; right: 24px; background: var(--accent); color: var(--accent-ink); font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; letter-spacing: 0.04em; }
.price { font-family: var(--font-display); font-size: 3rem; margin: 14px 0 4px; letter-spacing: -0.03em; }
.price small { font-family: var(--font-body); font-size: 1rem; color: var(--ink-3); letter-spacing: 0; }
.checklist { list-style: none; padding: 0; margin: 22px 0 28px; display: grid; gap: 10px; flex: 1; }
.checklist li { display: flex; gap: 10px; color: var(--ink-2); }
.checklist li::before { content: ''; flex: none; width: 18px; height: 18px; margin-top: 3px; border-radius: 50%; background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%232f5d50'%3E%3Cpath d='M8.2 13.6 4.8 10.2l1.2-1.2 2.2 2.2 5.8-5.8 1.2 1.2z'/%3E%3C/svg%3E") center / 14px no-repeat; }
@media (max-width: 760px) { .pricing { grid-template-columns: 1fr; } }

.faq { max-width: 760px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: 22px 0; font-weight: 600; font-size: 1.05rem; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-family: var(--font-display); font-size: 1.5rem; line-height: 1; color: var(--ink-3); transition: transform var(--t); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-2); padding: 0 0 22px; max-width: 640px; }

.cta-band { text-align: center; padding: 88px 0; }
.cta-band p { color: var(--ink-2); margin: 14px auto 28px; max-width: 30rem; }

.footer { border-top: 1px solid var(--line); padding: 56px 0 32px; color: var(--ink-3); font-size: 0.92rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer a { color: var(--ink-2); text-decoration: none; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.footer-col h2 { font: 650 0.78rem/1.2 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.footer-col a, .footer-col .link-btn { color: var(--ink-2); font-size: 0.92rem; overflow-wrap: anywhere; }
.footer-base { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; border-top: 1px solid var(--line); margin-top: 40px; padding-top: 20px; font-size: 0.85rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 420px) { .footer-grid { grid-template-columns: 1fr; } }
.footer a:hover { color: var(--ink); }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 40px 36px; box-shadow: var(--shadow); animation: rise 420ms var(--ease) both; }
.auth-card .logo { margin-bottom: 28px; }
.auth-card h1 { font-size: 1.9rem; }
.auth-card .muted { margin: 8px 0 26px; }
.auth-foot { text-align: center; margin-top: 22px; color: var(--ink-2); font-size: 0.95rem; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (max-width: 480px) { .auth-card { padding: 32px 22px; } }

/* ---------- Forms ---------- */
.field { display: grid; gap: 7px; margin-bottom: 18px; }
.field label, .label { font-weight: 600; font-size: 0.9rem; color: var(--ink); }
.field .hint { font-size: 0.85rem; color: var(--ink-3); }
.input {
  width: 100%; height: 48px; padding: 0 14px;
  border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface);
  font: 400 1rem var(--font-body); color: var(--ink);
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
.input::placeholder { color: var(--ink-3); }
.input:hover { border-color: var(--ink-3); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.input.invalid { border-color: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; color: var(--ink-2); cursor: pointer; margin: 4px 0 20px; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.form-error { background: var(--danger-soft); color: var(--danger); border-radius: var(--r-sm); padding: 10px 14px; font-size: 0.92rem; margin-bottom: 18px; animation: rise 220ms var(--ease); }
.form-success { background: var(--accent-soft); color: var(--accent); border-radius: var(--r-sm); padding: 12px 14px; font-size: 0.95rem; margin-bottom: 18px; animation: rise 220ms var(--ease); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 64px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; padding: 0; display: grid; place-items: center; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; border-radius: var(--r-sm); transition: color var(--t), background var(--t); }
.pw-toggle:hover { color: var(--ink); background: var(--surface-2); }
.pw-toggle svg { width: 20px; height: 20px; }
.pw-toggle:hover { color: var(--ink); background: var(--surface-2); }

.segmented { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: var(--r); padding: 4px; gap: 4px; position: relative; width: 100%; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { text-align: center; padding: 10px 8px; border-radius: var(--r-sm); font-weight: 600; font-size: 0.95rem; color: var(--ink-2); cursor: pointer; transition: background var(--t), color var(--t), box-shadow var(--t); }
.segmented input:checked + label { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.segmented input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 1px; }

.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); height: 48px; }
.stepper button { width: 46px; height: 100%; border: 0; background: transparent; font-size: 1.3rem; color: var(--ink-2); cursor: pointer; border-radius: var(--r); transition: background var(--t), color var(--t); }
.stepper button:hover:not([disabled]) { background: var(--surface-2); color: var(--ink); }
.stepper button[disabled] { opacity: 0.35; cursor: not-allowed; }
.stepper output { min-width: 44px; text-align: center; font-weight: 700; font-size: 1.05rem; }

/* ---------- App shell ---------- */
.app-nav .tabs { display: flex; gap: 4px; }
.tab { border: 0; background: transparent; font: 600 0.95rem var(--font-body); color: var(--ink-2); padding: 9px 14px; border-radius: var(--r-sm); cursor: pointer; transition: background var(--t), color var(--t); text-decoration: none; }
.tab:hover { background: var(--surface-2); color: var(--ink); }
.tab[aria-selected='true'] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
@media (max-width: 760px) {
  .app-nav .tabs { position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--line); justify-content: space-around; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); z-index: 40; }
  .tab { flex: 1; text-align: center; }
  .app-main { padding-bottom: 96px !important; }
  .nav-right .plan-pill { display: none; }
}
.nav-right { display: flex; align-items: center; gap: 10px; }
.plan-pill { font-size: 0.82rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.plan-pill.pro { background: var(--accent-soft); color: var(--accent); }

.app-main { padding: 36px 0 72px; }
.view { animation: viewIn 320ms var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); }
.page-head p { color: var(--ink-2); margin-top: 6px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; }
.card + .card { margin-top: 20px; }
.card h2 { font-size: 1.35rem; margin-bottom: 4px; }

.create-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
@media (max-width: 960px) { .create-grid { grid-template-columns: 1fr; } }
.video-input { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.thumb-preview { width: 86px; height: 48px; border-radius: 8px; background: var(--surface-2) center / cover no-repeat; border: 1px solid var(--line); opacity: 0; transform: scale(0.95); transition: opacity var(--t), transform var(--t); }
.thumb-preview.show { opacity: 1; transform: none; }
.slot-label { display: flex; align-items: center; gap: 10px; }
.slot-chip { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }
.slot-chip.honey { background: var(--honey-soft); color: var(--honey-ink); }
.form-row { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; margin-bottom: 18px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.divider { height: 1px; background: var(--line); margin: 24px 0; border: 0; }

.side-card { position: sticky; top: 92px; }
.meter { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 14px 0 10px; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width 600ms var(--ease); }

.banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-radius: var(--r); background: var(--honey-soft); color: var(--honey-ink); margin-bottom: 24px; font-size: 0.95rem; flex-wrap: wrap; animation: rise 300ms var(--ease); }
.banner.ok { background: var(--accent-soft); color: var(--accent); }

/* Progress */
.progress-card { text-align: center; padding: 48px 28px; }
.progress-ring { width: 72px; height: 72px; margin: 0 auto 20px; position: relative; }
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring circle { fill: none; stroke-width: 6; }
.progress-ring .bg { stroke: var(--surface-2); }
.progress-ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 800ms var(--ease); }
.progress-ring .pct { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 0.95rem; }
.progress-stage { font-family: var(--font-display); font-size: 1.4rem; margin-bottom: 6px; }
.progress-steps { display: flex; justify-content: center; gap: 8px; margin-top: 28px; flex-wrap: wrap; }
.progress-steps span { font-size: 0.8rem; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-3); transition: background var(--t), color var(--t); }
.progress-steps span.done { background: var(--accent-soft); color: var(--accent); }
.progress-steps span.now { background: var(--accent); color: var(--accent-ink); }

/* Clips */
.clip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; }
.clip-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; cursor: pointer; transition: transform var(--t), box-shadow var(--t), border-color var(--t); text-align: left; padding: 0; font: inherit; color: inherit; animation: rise 360ms var(--ease) both; }
.clip-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-2); }
.clip-thumb { aspect-ratio: 9/16; background: var(--surface-2) center / cover no-repeat; position: relative; }
.clip-score { position: absolute; top: 10px; left: 10px; background: rgba(255, 253, 249, 0.92); color: #1e2b26; font-size: 0.75rem; font-weight: 700; padding: 4px 8px 4px 6px; border-radius: 999px; display: inline-flex; align-items: center; gap: 3px; }
.clip-score svg { width: 12px; height: 12px; fill: #c98a1b; stroke: #c98a1b; }
.clip-meta { padding: 12px 14px 14px; }
.clip-title { font-weight: 600; font-size: 0.92rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clip-sub { font-size: 0.8rem; color: var(--ink-3); margin-top: 4px; }

.empty { text-align: center; padding: 64px 24px; color: var(--ink-2); }
.empty h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.4rem; margin-bottom: 8px; }
.empty p { margin-bottom: 20px; }

.job-list { display: grid; gap: 10px; }
.job-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); font-size: 0.92rem; }
.job-row .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status { font-size: 0.78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; flex: none; }
.status.done { background: var(--accent-soft); color: var(--accent); }
.status.failed { background: var(--danger-soft); color: var(--danger); }
.status.processing, .status.queued { background: var(--honey-soft); color: var(--honey-ink); }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: var(--overlay); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; transition: opacity var(--t); }
.modal.open { opacity: 1; }
.modal-box { background: var(--surface); border-radius: var(--r-lg); max-width: 760px; width: 100%; max-height: calc(100vh - 40px); overflow: auto; display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 28px; padding: 24px; transform: translateY(12px) scale(0.98); transition: transform 280ms var(--ease); box-shadow: var(--shadow-lg); }
.modal.open .modal-box { transform: none; }
.modal-box video { width: 100%; aspect-ratio: 9/16; border-radius: var(--r); background: #111; }
.modal-info { display: flex; flex-direction: column; gap: 14px; padding-top: 6px; }
.modal-info h2 { font-size: 1.4rem; }
.modal-actions { display: grid; gap: 10px; margin-top: auto; }
.modal-close { justify-self: end; }
@media (max-width: 680px) { .modal-box { grid-template-columns: 1fr; } .modal-box video { max-height: 60vh; width: auto; margin: 0 auto; } }

/* Toast */
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 32px); }
@media (max-width: 760px) { .toasts { bottom: 92px; } }
.toast { background: var(--toast-bg); color: var(--toast-ink); padding: 12px 18px 12px 14px; border-radius: var(--r); display: flex; align-items: center; gap: 10px; font-size: 0.93rem; box-shadow: var(--shadow-lg); animation: toastIn 300ms var(--ease) both; }
.toast.error { background: var(--danger); }
.toast.out { animation: toastOut 260ms var(--ease) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

/* Tables (admin) */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.stat b { display: block; font-family: var(--font-display); font-size: 1.9rem; font-weight: 500; }
.stat span { font-size: 0.85rem; color: var(--ink-3); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); font-weight: 600; }
td.wrap { white-space: normal; max-width: 320px; }

/* Legal */
.prose { max-width: 720px; padding: 56px 0 80px; }
.prose h1 { margin-bottom: 8px; }
.prose h2 { font-size: 1.3rem; margin: 32px 0 10px; font-family: var(--font-body); font-weight: 650; }
.prose p, .prose li { color: var(--ink-2); margin-bottom: 10px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Utilities (no inline styles: CSP blocks them) ---------- */
.mt-6 { margin-top: 6px; } .mt-10 { margin-top: 10px; } .mt-14 { margin-top: 14px; } .mt-18 { margin-top: 18px; } .mt-48 { margin-top: 48px; }
.mb-0 { margin-bottom: 0; } .mb-16 { margin-bottom: 16px; } .mb-18 { margin-bottom: 18px; }
.w-0 { width: 0; } .w-280 { max-width: 280px; } .min-0 { min-width: 0; }
.rel { position: relative; }
.center { text-align: center; margin-left: auto; margin-right: auto; }
.text-center { text-align: center; }
.text-center .logo { justify-content: center; }
.h-sm { font-size: 1.25rem; }
.narrow { max-width: 640px; }
@media (max-width: 420px) { .hide-xs { display: none; } }

/* ---------- Layout refinements ---------- */
.create-grid > .card + .card { margin-top: 0; }
.video-input { grid-template-columns: 1fr auto; gap: 0; }
.thumb-preview { width: 0; border-width: 0; margin-left: 0; transition: opacity var(--t), transform var(--t), width var(--t), margin var(--t); }
.thumb-preview.show { width: 86px; border-width: 1px; margin-left: 12px; }
.stepper { justify-self: start; }
.nav-links a { white-space: nowrap; }
@media (max-width: 420px) { .nav-links { gap: 2px; } .nav-links a:not(.btn) { padding: 8px; } .nav-links .btn { padding: 0 14px; } }
.checklist { align-content: start; }

/* =========================================================
   Dark theme (toggle in header; defaults to OS preference)
   ========================================================= */
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #141a17;
  --surface: #1a221f;
  --surface-2: #232d29;
  --ink: #e9ede9;
  --ink-2: #b4beb9;
  --ink-3: #85928c;
  --line: #2b3632;
  --line-2: #3a4742;
  --accent: #86c0a9;
  --accent-hover: #9fd0bc;
  --accent-soft: #223a32;
  --accent-ink: #0f1714;
  --honey-soft: #3a2f19;
  --honey-ink: #f0c873;
  --danger: #ec9677;
  --danger-soft: #3b231b;
  --danger-hover: #4a2b21;
  --ok: #86c0a9;
  --nav-bg: rgba(20, 26, 23, 0.85);
  --toast-bg: #e9ede9;
  --toast-ink: #141a17;
  --overlay: rgba(0, 0, 0, 0.6);
  --skeleton: #222b28;
  --skeleton-shine: #2b3632;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.3), 0 24px 48px -20px rgba(0, 0, 0, 0.7);
}
:root[data-theme='dark'] .checklist li::before { background-color: var(--accent-soft); filter: brightness(1.6) saturate(0.8); }
:root[data-theme='dark'] .phone { background: #0b0f0d; box-shadow: 0 0 0 1px var(--line-2), var(--shadow-lg); }
body, .card, .nav, .input, .price-card, .feature, .step, .stat, .clip-card, .job-row { transition: background-color 300ms var(--ease), border-color 300ms var(--ease), color 300ms var(--ease); }

/* =========================================================
   Accessibility: skip link
   ========================================================= */
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 200; background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: var(--r); font-weight: 600; text-decoration: none; transition: top var(--t); }
.skip-link:focus { top: 12px; color: var(--accent-ink); }
main:focus { outline: none; }

/* =========================================================
   Scroll progress + network loading bar
   ========================================================= */
.scroll-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none; }
.net-loader { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 101; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity 200ms var(--ease); }
.net-loader.on { opacity: 1; }
.net-loader::before { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; background: var(--honey); border-radius: 2px; animation: netload 1.1s var(--ease) infinite; }
@keyframes netload { from { left: -40%; } to { left: 100%; } }

/* =========================================================
   Icon buttons (theme, search, menu)
   ========================================================= */
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 1px solid transparent; background: transparent; color: var(--ink-2); border-radius: var(--r-sm); cursor: pointer; transition: background var(--t), color var(--t), border-color var(--t); flex: none; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .kbd { display: none; }
.search-trigger { width: auto; padding: 0 10px 0 12px; gap: 8px; border-color: var(--line); background: var(--surface); }
.search-trigger .label { font-size: 0.88rem; color: var(--ink-3); }
.search-trigger kbd { font: 600 0.72rem var(--font-body); color: var(--ink-3); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
@media (max-width: 900px) { .search-trigger { width: 40px; padding: 0; border-color: transparent; background: transparent; } .search-trigger .label, .search-trigger kbd { display: none; } }
.corner-tools { position: fixed; top: 14px; right: 14px; z-index: 50; display: flex; gap: 6px; }
.theme-toggle .moon { display: none; }
:root[data-theme='dark'] .theme-toggle .sun { display: none; }
:root[data-theme='dark'] .theme-toggle .moon { display: block; }

/* =========================================================
   Mobile menu
   ========================================================= */
.menu-btn { display: none; }
@media (max-width: 720px) {
  .menu-btn { display: inline-grid; }
  .nav-links > a:not(.btn) { display: none; }
}
.mobile-menu { position: fixed; top: 68px; left: 0; right: 0; z-index: 29; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); padding: 8px 16px 16px; transform: translateY(-8px); opacity: 0; visibility: hidden; transition: transform var(--t), opacity var(--t), visibility var(--t); }
.mobile-menu.open { transform: none; opacity: 1; visibility: visible; }
.mobile-menu a, .mobile-menu button.mm-item { display: block; width: 100%; text-align: left; padding: 14px 8px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font: 600 1rem var(--font-body); text-decoration: none; cursor: pointer; }
.mobile-menu a:last-child { border-bottom: 0; }
.mobile-menu a:hover, .mobile-menu button.mm-item:hover { color: var(--accent); }
.menu-btn .x { display: none; }
.menu-btn[aria-expanded='true'] .x { display: block; }
.menu-btn[aria-expanded='true'] .bars { display: none; }

/* =========================================================
   Floating buttons: back to top + contact
   ========================================================= */
.fab { position: fixed; right: 20px; z-index: 45; width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); transition: transform var(--t), opacity var(--t), background var(--t), visibility var(--t), box-shadow var(--t); }
.fab:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.fab svg { width: 22px; height: 22px; }
.fab-contact { bottom: 20px; background: var(--brand); color: #fff; border-color: transparent; }
.fab-contact:hover { background: #264d42; }
.fab-top { bottom: 84px; width: 44px; height: 44px; right: 24px; opacity: 0; visibility: hidden; transform: translateY(8px); }
.fab-top.show { opacity: 1; visibility: visible; transform: none; }
.fab-top.show:hover { transform: translateY(-2px); }
body.has-tabbar .fab-contact { bottom: 88px; }
body.has-tabbar .fab-top { bottom: 152px; }
@media (min-width: 761px) { body.has-tabbar .fab-contact { bottom: 20px; } body.has-tabbar .fab-top { bottom: 84px; } }
body.cookie-open .fab { opacity: 0; visibility: hidden; }

.contact-panel { position: fixed; right: 20px; bottom: 84px; z-index: 46; width: min(380px, calc(100vw - 32px)); max-height: calc(100vh - 120px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 22px; transform: translateY(10px) scale(0.98); transform-origin: bottom right; opacity: 0; visibility: hidden; transition: transform var(--t), opacity var(--t), visibility var(--t); }
.contact-panel.open { transform: none; opacity: 1; visibility: visible; }
body.has-tabbar .contact-panel { bottom: 152px; }
@media (min-width: 761px) { body.has-tabbar .contact-panel { bottom: 84px; } }
.contact-panel h2 { font-size: 1.3rem; }
.contact-panel textarea.input { height: 110px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.contact-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 4px; }
.contact-success { text-align: center; padding: 18px 4px 6px; animation: rise 300ms var(--ease); }
.success-check { width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin: 0 auto 14px; }
.success-check svg { width: 28px; height: 28px; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw 500ms 120ms var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.char-count { font-size: 0.8rem; color: var(--ink-3); text-align: right; }

/* =========================================================
   Cookie banner
   ========================================================= */
.cookie-banner { position: fixed; left: 20px; bottom: 20px; z-index: 70; width: min(420px, calc(100vw - 40px)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 20px; animation: rise 400ms var(--ease) both; }
.cookie-banner p { font-size: 0.92rem; color: var(--ink-2); margin-bottom: 14px; }
.cookie-banner .row { display: flex; gap: 8px; flex-wrap: wrap; }
.cookie-banner .btn { height: 40px; flex: 1; }
@media (max-width: 760px) { .cookie-banner { left: 12px; right: 12px; bottom: 12px; width: auto; } body.has-tabbar .cookie-banner { bottom: 84px; } }
.link-btn { background: none; border: 0; padding: 0; margin-left: 18px; font: inherit; color: var(--ink-2); cursor: pointer; }
.link-btn:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* =========================================================
   Search dialog
   ========================================================= */
.search-dialog { position: fixed; inset: 0; z-index: 90; background: var(--overlay); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; opacity: 0; transition: opacity var(--t); }
.search-dialog.open { opacity: 1; }
.search-box { width: 100%; max-width: 560px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden; transform: translateY(-8px) scale(0.98); transition: transform 260ms var(--ease); }
.search-dialog.open .search-box { transform: none; }
.search-input-row { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.search-input-row svg { width: 20px; height: 20px; color: var(--ink-3); flex: none; }
.search-input-row input { flex: 1; height: 58px; border: 0; background: transparent; font: 400 1.05rem var(--font-body); color: var(--ink); outline: none; }
.search-results { list-style: none; margin: 0; padding: 8px; max-height: 50vh; overflow: auto; }
.search-results li a, .search-results li button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: var(--r-sm); border: 0; background: none; color: var(--ink); text-decoration: none; font: inherit; cursor: pointer; }
.search-results li[aria-selected='true'] a, .search-results li[aria-selected='true'] button, .search-results li a:hover, .search-results li button:hover { background: var(--surface-2); }
.search-results .r-title { font-weight: 600; display: block; }
.search-results .r-desc { font-size: 0.85rem; color: var(--ink-3); display: block; }
.search-results mark { background: var(--honey-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
.search-empty { padding: 28px 16px; text-align: center; color: var(--ink-3); }
.search-foot { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 0.78rem; color: var(--ink-3); }

/* =========================================================
   Confirmation modal
   ========================================================= */
.confirm-box { max-width: 420px; display: block; padding: 28px; }
.confirm-box h2 { font-size: 1.35rem; margin-bottom: 8px; }
.confirm-box p { color: var(--ink-2); margin-bottom: 22px; }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.confirm-icon { width: 44px; height: 44px; border-radius: var(--r); display: grid; place-items: center; margin-bottom: 16px; background: var(--accent-soft); color: var(--accent); }
.confirm-icon.danger { background: var(--danger-soft); color: var(--danger); }
.confirm-icon svg { width: 22px; height: 22px; }
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-danger-solid:hover { filter: brightness(0.92); color: #fff; }
:root[data-theme='dark'] .btn-danger-solid { color: #1a0d08; }

/* =========================================================
   Form field error / success states
   ========================================================= */
.field-error { font-size: 0.85rem; color: var(--danger); display: flex; gap: 6px; align-items: center; animation: rise 200ms var(--ease); }
.input[aria-invalid='true'] { border-color: var(--danger); }
.input.valid { border-color: var(--ok); }
.form-error::before, .form-success::before { content: ''; display: inline-block; width: 18px; height: 18px; margin-right: 8px; vertical-align: -4px; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.form-error::before { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5v.01'/%3E%3C/svg%3E"); }
.form-success::before { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 12.5l2.7 2.5L16 9.5'/%3E%3C/svg%3E"); }
.shake { animation: shake 360ms var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* =========================================================
   Copy button
   ========================================================= */
.copy-row { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border-radius: var(--r); padding: 6px 6px 6px 12px; }
.copy-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.92rem; }
.copy-btn { height: 34px; padding: 0 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); border-radius: var(--r-sm); font: 600 0.82rem var(--font-body); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background var(--t), color var(--t), border-color var(--t); flex: none; }
.copy-btn:hover { border-color: var(--ink-3); }
.copy-btn.copied { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.copy-btn svg { width: 14px; height: 14px; }

/* =========================================================
   Loading skeletons
   ========================================================= */
.skeleton { background: linear-gradient(90deg, var(--skeleton) 0%, var(--skeleton-shine) 50%, var(--skeleton) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: var(--r-sm); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.clip-card.is-skeleton { cursor: default; pointer-events: none; }
.clip-card.is-skeleton .clip-thumb { border-radius: 0; }
.sk-line { height: 12px; margin-top: 8px; }
.sk-line.short { width: 55%; }
.progress-ring { animation: breathe 2.4s var(--ease) infinite; }
@keyframes breathe { 50% { transform: scale(1.04); } }

/* FAQ smooth open */
.faq details[open] p { animation: faqIn 300ms var(--ease); }
@keyframes faqIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.faq details summary { transition: color var(--t); }
.faq details summary:hover { color: var(--accent); }

/* Toolbar used in "My clips" */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar .input { max-width: 320px; height: 42px; }
.updated-at { font-size: 0.85rem; color: var(--ink-3); display: inline-flex; align-items: center; gap: 8px; }
.sticky-thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.badge { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }

/* =========================================================
   Print stylesheet
   ========================================================= */
@media print {
  @page { margin: 18mm; }
  :root, :root[data-theme='dark'] { --bg: #fff; --surface: #fff; --surface-2: #fff; --ink: #000; --ink-2: #222; --ink-3: #444; --line: #ccc; --line-2: #ccc; --accent: #000; }
  body { background: #fff !important; color: #000; font-size: 11pt; line-height: 1.5; }
  .nav, .app-nav .tabs, .footer, .fab, .contact-panel, .cookie-banner, .scroll-progress, .net-loader, .skip-link, .toasts,
  .search-dialog, .modal, .mobile-menu, .btn, .hero-cta, .phone, .banner, .icon-btn, .corner-tools, .toolbar, form .btn, .stepper button { display: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .card, .price-card, .step, .feature, .clip-card, .stat { box-shadow: none !important; border: 1px solid #ccc !important; break-inside: avoid; }
  .band { background: #fff !important; border: 0; }
  .section, .hero { padding: 16pt 0; }
  h1, h2, h3 { break-after: avoid; }
  .faq details > p { display: block !important; }
  .faq details:not([open]) > p { display: block; }
  .prose a[href^='http']::after, .prose a[href^='/']::after { content: ' (' attr(href) ')'; font-size: 0.85em; color: #444; }
  * { animation: none !important; transition: none !important; }
}
.mb-8 { margin-bottom: 8px; }
.field-error svg { width: 14px; height: 14px; flex: none; }
.search-trigger { display: inline-flex; align-items: center; }
@media (max-width: 480px) {
  .nav-links > .btn { display: none; }
  .nav-inner { gap: 8px; }
  .logo { font-size: 1.15rem; }
  .app-nav .nav-right .btn-quiet#adminLink { display: none; }
}
@media (max-width: 760px) {
  /* backdrop-filter would trap the fixed bottom tab bar inside the header */
  .app-nav { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .tab { font-size: 0.85rem; padding: 9px 4px; white-space: nowrap; }
}

/* ETA */
.eta-line { font-weight: 650; font-size: 1.05rem; color: var(--accent); margin: 2px 0 2px; font-variant-numeric: tabular-nums; }
.eta-sub { font-size: 0.85rem; color: var(--ink-3); margin-bottom: 10px; font-variant-numeric: tabular-nums; min-height: 1.2em; }
.create-eta { text-align: center; font-size: 0.85rem; color: var(--ink-3); margin-top: 10px; min-height: 1.2em; }

/* =========================================================
   v2: new branding, plans, Studio, smoother motion
   ========================================================= */
/* Caption fonts (also used to preview captions in Studio) */
@font-face { font-family: 'kc-montserrat'; src: url('/assets/fonts/captions/Montserrat-Black.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'kc-anton'; src: url('/assets/fonts/captions/Anton-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'kc-bebas'; src: url('/assets/fonts/captions/BebasNeue-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'kc-bangers'; src: url('/assets/fonts/captions/Bangers-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'kc-luckiest'; src: url('/assets/fonts/captions/LuckiestGuy-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'kc-poppins'; src: url('/assets/fonts/captions/Poppins-ExtraBold.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'kc-archivo'; src: url('/assets/fonts/captions/ArchivoBlack-Regular.ttf') format('truetype'); font-display: swap; }

:root { --ease-out: cubic-bezier(0.16, 1, 0.3, 1); --spring: cubic-bezier(0.34, 1.4, 0.64, 1); --unl: #8d5b0c; --unl-ink: #fffaf0; --unl-soft: #f7ead0; }
:root[data-theme='dark'] { --unl: #f0c873; --unl-ink: #1c1406; --unl-soft: #3a2f19; }

/* Logo: icon + wordmark, swapping colours for dark mode */
.logo { gap: 10px; }
.logo-icon { width: 32px; height: 32px; border-radius: 8px; flex: none; transition: transform 400ms var(--spring); }
.logo:hover .logo-icon { transform: rotate(-6deg) scale(1.06); }
.logo-words { display: inline-flex; align-items: center; }
.logo-word { height: 30px; width: auto; display: block; }
.logo-word-dark { display: none; }
:root[data-theme='dark'] .logo-word-light { display: none; }
:root[data-theme='dark'] .logo-word-dark { display: block; }
.auth-card .logo-word { height: 34px; }

/* Cross-page and in-app view transitions (where supported) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vtOut 220ms var(--ease) both; }
::view-transition-new(root) { animation: vtIn 380ms var(--ease-out) both; }
:root[data-nav-dir='forward']::view-transition-new(root) { animation-name: vtInRight; }
:root[data-nav-dir='back']::view-transition-new(root) { animation-name: vtInLeft; }
@keyframes vtOut { to { opacity: 0; transform: scale(0.99); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes vtInRight { from { opacity: 0; transform: translateX(24px); } }
@keyframes vtInLeft { from { opacity: 0; transform: translateX(-24px); } }
.panel-in { animation: panelIn 460ms var(--ease-out) both; }
@keyframes panelIn { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }

/* Sliding tab indicator */
@media (min-width: 761px) { .app-nav .tabs { position: relative; } }
.tab-indicator { position: absolute; left: 0; top: 0; height: 100%; border-radius: var(--r-sm); background: var(--surface); box-shadow: var(--shadow-sm); opacity: 0; transition: transform 420ms var(--ease-out), width 420ms var(--ease-out), opacity 200ms; pointer-events: none; }
.tab-indicator.ready { opacity: 1; }
.app-nav .tab { position: relative; z-index: 1; }
.app-nav .tab[aria-selected='true'] { background: transparent; box-shadow: none; }
@media (max-width: 760px) { .tab-indicator { top: 8px; height: calc(100% - 16px - env(safe-area-inset-bottom)); } }

/* Buttons: lift + press */
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px -8px rgba(47, 93, 80, 0.55); }
.btn:active { transform: translateY(0) scale(0.98); transition-duration: 80ms; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 0.88rem; }
.row-gap { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Cards: smoother hover, thumbnail zoom */
.clip-card .clip-thumb { transition: transform 600ms var(--ease-out); }
.clip-card { overflow: hidden; }
.clip-card:hover .clip-thumb { transform: scale(1.04); }
.clip-card:hover { transform: translateY(-4px); }
.clip-kept { position: absolute; top: 10px; right: 10px; background: var(--unl); color: var(--unl-ink); font-size: 0.7rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.price-card { transition: transform 300ms var(--ease-out), box-shadow 300ms var(--ease-out), border-color 300ms; }
.price-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

/* Plan pill */
.plan-pill.pro { background: var(--accent-soft); color: var(--accent); }
.plan-pill.unlimited { background: var(--unl-soft); color: var(--unl); }
.badge-unl { background: var(--unl-soft); color: var(--unl); }

/* Three plans */
.pricing-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); justify-content: stretch; }
@media (max-width: 960px) { .pricing-3 { grid-template-columns: 1fr; max-width: 460px; } }
.price-card.plan-unlimited.featured { border-color: var(--unl); }
.price-card.plan-unlimited .tag { background: var(--unl); color: var(--unl-ink); }
.price-card.plan-unlimited .btn-primary { background: var(--unl); color: var(--unl-ink); }
.price-card.plan-unlimited .btn-primary:hover { background: var(--unl); filter: brightness(1.08); box-shadow: 0 6px 18px -8px rgba(141, 91, 12, 0.55); }
.price-card.is-current { border-color: var(--accent); }
.tag.tag-quiet { background: var(--surface-2); color: var(--ink-2); }
.mini-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 0.9rem; color: var(--ink-2); }
.mini-list li { display: flex; gap: 8px; }
.mini-list li::before { content: ''; flex: none; width: 16px; height: 16px; margin-top: 3px; background: var(--accent); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5 10 17 19 7'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5 10 17 19 7'/%3E%3C/svg%3E") center / contain no-repeat; }

/* Collapsible blocks (smooth height) */
.collapsible { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 360ms var(--ease-out), opacity 260ms, margin 360ms var(--ease-out); }
.collapsible > * { min-height: 0; }
.collapsible.collapsed { grid-template-rows: 0fr; opacity: 0; margin: 0; pointer-events: none; }
.collapsible.collapsed > * { overflow: hidden; }
#bgField { display: grid; grid-template-rows: auto auto auto; }
#bgField.collapsed { display: none; }
.hint { font-size: 0.85rem; color: var(--ink-3); }

/* Segmented controls with 4 options; smaller variant */
.segmented.seg-4 { grid-auto-columns: 1fr; }
.segmented.small label { padding: 7px 6px; font-size: 0.85rem; }
.segmented label .lock { display: none; }
.segmented label.locked .lock { display: inline-block; width: 10px; height: 10px; margin-left: 3px; border: 2px solid currentColor; border-radius: 3px 3px 2px 2px; opacity: 0.6; vertical-align: -1px; }

/* Length wheel */
.wheel-wrap { margin-top: 12px; }
.wheel { height: 132px; overflow-y: auto; scroll-snap-type: y mandatory; border-radius: var(--r); background: var(--surface-2); position: relative; scrollbar-width: none; overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(transparent, #000 30%, #000 70%, transparent); }
.wheel::-webkit-scrollbar { display: none; }
.wheel:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wheel-pad { height: 44px; }
.wheel-item { height: 44px; display: grid; place-items: center; scroll-snap-align: center; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; cursor: pointer; transition: color 200ms, transform 300ms var(--ease-out); }
.wheel-item.sel { color: var(--ink); font-size: 1.25rem; transform: scale(1.06); }

/* Switches */
.switch { display: flex; align-items: center; gap: 12px; margin: 10px 0; font-size: 0.92rem; color: var(--ink-2); cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { flex: none; width: 40px; height: 24px; border-radius: 999px; background: var(--line-2); position: relative; transition: background 250ms var(--ease); }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.25); transition: transform 320ms var(--spring); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Studio */
.studio { margin-top: 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.studio > summary { list-style: none; cursor: pointer; padding: 16px 40px 16px 0; display: flex; flex-direction: column; gap: 2px; transition: background var(--t); }
.studio > summary::-webkit-details-marker { display: none; }
.studio > summary:hover .studio-title { color: var(--accent); }
.studio > summary::after { content: '+'; position: absolute; right: 4px; font-family: var(--font-display); font-size: 1.4rem; color: var(--ink-3); transition: transform var(--t); }
.studio { position: relative; }
.studio[open] > summary::after { transform: rotate(45deg); }
.studio-title { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.studio-sub { font-size: 0.86rem; color: var(--ink-3); }
.studio[open] .studio-body { animation: studioIn 420ms var(--ease-out); }
@keyframes studioIn { from { opacity: 0; transform: translateY(-6px); } }
.studio-body { padding: 4px 0 18px; }
.studio-lock { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--unl-soft); color: var(--ink); border-radius: var(--r); padding: 12px 14px; margin-bottom: 14px; font-size: 0.92rem; }
.studio-lock .btn-primary { background: var(--unl); color: var(--unl-ink); }
.studio-grid { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 22px; align-items: start; }
@media (max-width: 720px) { .studio-grid { grid-template-columns: 1fr; } .studio-preview { order: -1; } }
.studio-group { border: 0; padding: 0; margin: 0 0 18px; }
.studio-group legend { font-family: var(--font-display); font-size: 1.05rem; margin-bottom: 10px; padding: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
textarea.input { height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.color-field { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.color-field input[type=color] { width: 44px; height: 40px; padding: 2px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); cursor: pointer; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; transition: transform 200ms var(--spring); }
.swatch:hover { transform: scale(1.15); }

/* Studio live preview: a tiny 9:16 phone */
.studio-preview { position: sticky; top: 92px; }
.pv-phone { --pv-main: 50%; position: relative; width: 200px; aspect-ratio: 9 / 16; border-radius: 22px; overflow: hidden; background: #111; box-shadow: var(--shadow); margin: 0 auto; border: 6px solid #18211d; }
.pv-main, .pv-bg { position: absolute; left: 0; right: 0; display: grid; place-items: center; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; transition: top 420ms var(--ease-out), height 420ms var(--ease-out), opacity 300ms; }
.pv-main { background: linear-gradient(160deg, #3b5d52, #22332d); color: #dfe9e3; }
.pv-bg { background: repeating-linear-gradient(90deg, #7c9b5a 0 18px, #86a764 18px 36px); color: #fff; }
.pv-main span, .pv-bg span { opacity: 0.7; }
.pv-phone[data-layout='split'] .pv-main { top: 0; height: var(--pv-main); }
.pv-phone[data-layout='split'] .pv-bg { top: var(--pv-main); height: calc(100% - var(--pv-main)); }
.pv-phone[data-layout='swap'] .pv-bg { top: 0; height: calc(100% - var(--pv-main)); }
.pv-phone[data-layout='swap'] .pv-main { top: calc(100% - var(--pv-main)); height: var(--pv-main); }
.pv-phone[data-layout='main'] .pv-main { top: 0; height: 100%; }
.pv-phone[data-layout='main'] .pv-bg { top: 100%; height: 0; opacity: 0; }
.pv-caption { position: absolute; left: 6px; right: 6px; text-align: center; transform: translateY(-50%); font-family: var(--pv-font); font-size: 15px; line-height: 1.1; color: var(--pv-text); transition: top 420ms var(--ease-out), font-size 300ms; z-index: 2; }
.pv-phone[data-layout='split'] .pv-caption { top: var(--pv-main); }
.pv-phone[data-layout='swap'] .pv-caption { top: calc(100% - var(--pv-main)); }
.pv-phone[data-layout='main'] .pv-caption { top: 66%; }
.pv-phone[data-pos='top'] .pv-caption { top: 20%; }
.pv-phone[data-pos='bottom'] .pv-caption { top: 80%; }
.pv-phone[data-size='s'] .pv-caption { font-size: 12px; }
.pv-phone[data-size='l'] .pv-caption { font-size: 18px; }
.pv-phone[data-size='xl'] .pv-caption { font-size: 21px; }
.pv-phone[data-preset='pop'] .pv-caption { font-size: 20px; }
.pv-caption span { display: inline-block; margin: 0 2px; text-shadow: 0 0 2px #000, 0 1px 0 #000, 1px 0 0 #000, -1px 0 0 #000, 0 -1px 0 #000, 0 2px 3px rgba(0,0,0,0.6); }
.pv-caption span.on { color: var(--pv-hi); animation: pop 220ms var(--spring); }
.pv-phone[data-preset='boxed'] .pv-caption span { background: rgba(20, 20, 20, 0.75); padding: 1px 4px; border-radius: 4px; text-shadow: none; }
.pv-phone[data-preset='minimal'] .pv-caption span { text-shadow: 0 1px 2px rgba(0,0,0,0.8); }
.pv-hook { position: absolute; top: 6%; left: 10px; right: 10px; text-align: center; background: var(--honey); color: #141414; font-family: var(--pv-font); font-size: 9px; padding: 4px; border-radius: 4px; z-index: 2; animation: rise 300ms var(--ease-out); }
.pv-handle { position: absolute; bottom: 7px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,0.8); font-family: var(--pv-font); font-size: 8px; z-index: 2; }
.pv-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; z-index: 3; }
.pv-bar span { display: block; height: 100%; width: 40%; background: var(--honey); animation: pvBar 6s linear infinite; }
@keyframes pvBar { from { width: 0; } to { width: 100%; } }
.pv-wm { position: absolute; left: 50%; transform: translateX(-50%); width: 56px; opacity: 0.4; z-index: 2; }
.pv-wm-top { top: 6px; }
.pv-wm-bottom { bottom: 6px; }
.pv-note { text-align: center; margin-top: 8px; font-size: 0.8rem; }
.studio.is-locked .studio-controls { opacity: 0.85; }

/* Post kit + storage */
.post-kit { background: var(--surface-2); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 6px; }
.post-kit p { font-size: 0.92rem; color: var(--ink-2); }
.post-kit .tags { color: var(--accent); font-weight: 600; }
.post-kit .copy-btn { justify-self: start; }
.storage-bar { max-width: 420px; margin: -6px 0 18px; }
.storage-bar .meter { margin: 6px 0 0; }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
  .collapsible { transition: none; }
}

/* =====================================================================
   v3: language + text size menu, shortcuts, share, legal pages, tables,
   filters, live typing feedback, offline bar, footer, age + consent.
   ===================================================================== */
.inline-ic { width: 1em; height: 1em; vertical-align: -0.15em; }
.stack { display: grid; gap: 10px; }
.input-sm { height: 40px; font-size: 0.92rem; }
.input-auto { width: auto; }
.h-sm { font-size: 1.05rem; font-family: var(--font-body); font-weight: 650; display: flex; align-items: center; gap: 8px; }
.h-sm svg { width: 18px; height: 18px; color: var(--ink-3); }

/* Header: language + text size */
.prefs { position: relative; }
.prefs-btn { width: auto; padding: 0 8px; gap: 4px; display: inline-flex; align-items: center; }
.prefs-btn svg { width: 18px; height: 18px; }
.prefs-btn .code { font: 650 0.75rem var(--font-body); letter-spacing: 0.04em; }
.prefs-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 80; width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 14px; animation: rise 200ms var(--ease-out); }
.corner-tools .prefs-pop { top: calc(100% + 8px); }
.pref-label { font: 650 0.75rem var(--font-body); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin: 0 0 8px; display: flex; align-items: center; gap: 6px; }
.pref-label svg { width: 14px; height: 14px; }
.pref-row { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.pref-opt { flex: 1; min-width: 0; height: 36px; padding: 0 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); border-radius: var(--r-sm); font: 600 0.88rem var(--font-body); cursor: pointer; transition: background var(--t), border-color var(--t), color var(--t); }
.pref-opt:hover { border-color: var(--ink-3); }
.pref-opt[aria-pressed='true'] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pref-opt.big { font-size: 1.05rem; }
.pref-note { font-size: 0.78rem; color: var(--ink-3); margin: -6px 0 14px; }
.pref-keys { display: inline-flex; align-items: center; gap: 6px; font-size: 0.88rem; }
.pref-keys svg { width: 16px; height: 16px; }

/* Keyboard shortcuts */
.shortcuts-box { display: block; max-width: 460px; }
.shortcuts-box h2 { display: flex; align-items: center; gap: 8px; font-size: 1.25rem; }
.shortcuts-box h2 svg { width: 22px; height: 22px; color: var(--accent); }
.shortcut-list { margin: 8px 0 0; display: grid; gap: 2px; }
.shortcut-list > div { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.shortcut-list dt { display: flex; gap: 6px; align-items: center; flex: none; }
.shortcut-list dd { margin: 0; color: var(--ink-2); text-align: right; font-size: 0.92rem; }
.shortcut-list .then { font-size: 0.75rem; color: var(--ink-3); }
kbd { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; font: 650 0.78rem var(--font-body); color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; }

/* Search: groups + better selection */
.search-group { display: flex; align-items: center; gap: 6px; padding: 10px 12px 4px; font: 650 0.72rem var(--font-body); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.search-group svg { width: 14px; height: 14px; }
.search-empty .link-btn { font-size: inherit; }

/* Share */
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 18px; }
.share-label { font-size: 0.85rem; color: var(--ink-3); margin-right: 4px; }
.share-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; transition: color var(--t), border-color var(--t), transform 160ms var(--ease-out), background var(--t); }
.share-btn svg { width: 16px; height: 16px; }
.share-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.share-btn.copied { color: var(--ok); border-color: var(--ok); }

/* Legal pages: table of contents beside the text */
.legal-wrap.has-toc { display: grid; grid-template-columns: 220px minmax(0, 720px); gap: 56px; justify-content: center; }
.toc { position: sticky; top: 96px; align-self: start; padding-top: 64px; font-size: 0.9rem; }
.toc-title { font: 650 0.75rem var(--font-body); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); margin-bottom: 10px; }
.toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--ink-2); text-decoration: none; transition: color var(--t), border-color var(--t); }
.toc a:hover { color: var(--ink); }
.toc a.on { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.prose h2 { scroll-margin-top: 90px; }
.prose ul { padding-left: 20px; }
@media (max-width: 960px) {
  .legal-wrap.has-toc { display: block; }
  .toc { position: static; padding: 32px 0 0; }
  .toc ol { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); border-left: 0; gap: 4px 16px; }
  .toc a { padding-left: 0; border-left: 0; }
}

/* FAQ search */
.faq-search { position: relative; max-width: 760px; margin-bottom: 8px; display: flex; align-items: center; gap: 12px; }
.faq-search > svg { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.faq-search .input { padding-left: 42px; max-width: 420px; }
.faq-count { white-space: nowrap; }
.faq-empty { padding: 22px 0; }

/* Comparison table */
.compare { margin-top: 56px; }
.compare-head { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 14px; }
.compare-head h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.4rem; }
.compare-tools { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.compare-tools .input { width: 220px; }
.compare-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; font-size: 0.94rem; min-width: 520px; }
.compare-table th, .compare-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.compare-table thead th { font-weight: 700; background: var(--surface-2); cursor: default; }
.compare-table thead th:not(:first-child) { cursor: pointer; text-align: center; }
.compare-table td { text-align: center; color: var(--ink-2); }
.compare-table tbody th { font-weight: 500; color: var(--ink); text-transform: none; letter-spacing: 0; font-size: inherit; }
.compare-table thead th { text-transform: none; letter-spacing: 0; font-size: 0.95rem; color: var(--ink); }
.compare-table tbody tr:last-child > * { border-bottom: 0; }
.compare-table tbody tr { transition: background var(--t); }
.compare-table tbody tr:hover { background: var(--bg); }
.compare-table .col-on { background: var(--accent-soft); color: var(--ink); }
.compare-table .ic-yes { width: 18px; height: 18px; color: var(--ok); vertical-align: -4px; stroke-width: 2.5; }
.compare-table .ic-no { width: 16px; height: 16px; color: var(--ink-3); vertical-align: -3px; }
.compare-empty { padding: 16px 0; }

/* Interactive (sortable) tables */
.th-sort { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: inherit; font: inherit; font-weight: 700; cursor: pointer; padding: 0; }
.th-sort .sort-ic { width: 14px; height: 14px; opacity: 0.35; transition: opacity var(--t); }
.th-sort:hover .sort-ic, th[aria-sort='ascending'] .sort-ic, th[aria-sort='descending'] .sort-ic { opacity: 1; color: var(--accent); }

/* Clip filters */
.filter-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: -6px 0 20px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips label { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 0.86rem; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: background var(--t), color var(--t), border-color var(--t); }
.chips label:hover { border-color: var(--ink-3); color: var(--ink); }
.chips input:checked + label { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chips input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.empty-inline { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* Live typing feedback */
.input.valid { padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233d7a5c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5 10 17 19 7'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; }
.pw-strength { display: none; align-items: center; gap: 10px; margin-top: 8px; min-height: 18px; }
.pw-strength.on { display: flex; animation: rise 200ms var(--ease-out); }
.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; width: 140px; flex: none; }
.pw-meter span { height: 4px; border-radius: 2px; background: var(--line); transition: background 240ms var(--ease); }
.pw-meter[data-score='1'] span:nth-child(-n+1) { background: var(--danger); }
.pw-meter[data-score='2'] span:nth-child(-n+2) { background: var(--honey); }
.pw-meter[data-score='3'] span:nth-child(-n+3) { background: var(--ok); }
.pw-meter[data-score='4'] span { background: var(--ok); }
.pw-meter-text { font-size: 0.8rem; color: var(--ink-3); }
.pw-wrap .input { padding-right: 52px; }
.draft-note { font-size: 0.8rem; color: var(--ink-3); text-align: center; margin: 8px 0 0; min-height: 1.2em; opacity: 0; transition: opacity 300ms; }
.draft-note.on { opacity: 1; }
.toast-ic { width: 18px; height: 18px; flex: none; color: var(--ok); }
.toast.error .toast-ic { color: var(--danger); }
:root[data-theme='dark'] .toast-ic { color: #2f6b52; }
:root[data-theme='dark'] .toast.error .toast-ic { color: #a9472a; }

/* Offline */
.offline-bar { position: fixed; left: 50%; top: 72px; transform: translateX(-50%); z-index: 90; display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 32px); background: var(--toast-bg); color: var(--toast-ink); padding: 10px 16px; border-radius: 999px; font-size: 0.88rem; box-shadow: var(--shadow-lg); animation: rise 300ms var(--ease-out); }
.offline-bar svg { width: 18px; height: 18px; flex: none; }

/* Auth pages: legal links, date of birth, wider consent card */
.auth-legal { display: flex; justify-content: center; gap: 18px; margin: 22px 0 0; font-size: 0.85rem; }
.auth-legal a { color: var(--ink-3); text-decoration: none; }
.auth-legal a:hover { color: var(--ink); text-decoration: underline; }
.auth-card.wide { max-width: 560px; }
fieldset.field { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
fieldset.field legend { padding: 0; margin-bottom: 8px; }
.dob-row { display: grid; grid-template-columns: 1.4fr 1fr 1.1fr; gap: 8px; }
.banner-form { display: flex; gap: 8px; flex-wrap: wrap; }
.banner-form .input { height: 40px; width: 240px; max-width: 100%; }
.big-code { font-family: var(--font-display); font-size: 4.5rem; line-height: 1; color: var(--accent); margin: 18px 0 6px; letter-spacing: -0.04em; }
.recent-box { margin-top: 28px; text-align: left; }
.recent-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; }
.recent-list a { display: block; padding: 8px 12px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink); text-decoration: none; transition: background var(--t); }
.recent-list a:hover { background: var(--accent-soft); }

/* Small screens: the header keeps only what fits */
@media (max-width: 520px) {
  .nav-links .hide-xs { display: none; }
  .prefs-btn .code { display: none; }
  .prefs-btn { width: 40px; padding: 0; justify-content: center; }
  .prefs-pop { position: fixed; left: 16px; right: 16px; top: 64px; width: auto; }
  .compare-tools .input { width: 100%; }
  .compare-tools { width: 100%; }
}
@media print { .share, .toc, .faq-search, .compare-tools, .prefs, .offline-bar { display: none !important; } }
