/* Fonts loaded via <link> in document head (parallel, non-blocking). */

/* Tokens live in tokens.css */

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--font);
  background: var(--canvas);
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }
em { font-style: normal; color: var(--accent-text); }

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  font: 650 15px/1 var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0) scale(0.98); }
.btn-primary {
  background: var(--primary);
  color: var(--on-accent);
  box-shadow: none;
}
.btn-primary:hover { background: var(--primary-deep); color: var(--on-accent); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-tiktok {
  background: var(--tiktok);
  color: var(--on-accent);
  box-shadow: none;
}
.btn-tiktok:hover { filter: brightness(1.06); color: var(--on-accent); }
.btn-quiet {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.btn-quiet:hover { border-color: var(--line-strong); color: var(--ink); }
.btn-danger {
  background: var(--danger);
  color: var(--on-accent);
  box-shadow: none;
}
.btn-danger:hover { background: var(--danger-ink); color: var(--on-accent); }
.btn-danger-quiet {
  background: transparent;
  color: var(--danger-ink);
  border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
}
.btn-danger-quiet:hover {
  border-color: var(--danger);
  color: var(--danger-ink);
  background: var(--danger-soft);
}
.btn-block { width: 100%; }

/* ========== LOGIN ========== */
.page-login {
  --login-ink: var(--ink);
  --login-muted: var(--muted);
  --login-line: var(--line);
  --login-surface: var(--glass);
  min-height: 100vh;
  color: var(--login-ink);
  background:
    radial-gradient(920px 520px at 12% -8%, rgba(var(--primary-rgb), 0.07), transparent 58%),
    radial-gradient(780px 480px at 96% 108%, rgba(var(--primary-rgb), 0.05), transparent 52%),
    var(--canvas);
}

.login-stage {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  align-items: stretch;
}

.login-atmosphere {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
}
.login-orb-a {
  width: min(48vw, 520px);
  height: min(48vw, 520px);
  left: -8%;
  top: -12%;
  background: radial-gradient(circle, rgba(var(--primary-rgb), 0.1), transparent 68%);
  animation: drift 12s ease-in-out infinite alternate;
}
.login-orb-b {
  width: min(42vw, 420px);
  height: min(42vw, 420px);
  right: 8%;
  bottom: -18%;
  background: radial-gradient(circle, rgba(var(--primary-rgb), 0.08), transparent 70%);
  animation: float 9s ease-in-out infinite alternate;
}
.login-grid {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 35% 40%, #000 20%, transparent 75%);
}

.login-hero {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(40px, 8vw, 88px) clamp(28px, 6vw, 72px);
  animation: rise 0.65s ease both;
}

.login-mark {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: none;
  animation: float 8s ease-in-out infinite alternate;
}

.login-brand {
  margin: 28px 0 14px;
  font-family: var(--display);
  font-size: clamp(2.35rem, 5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.98;
  color: var(--login-ink);
}

.login-tagline {
  margin: 0;
  max-width: 18ch;
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.2;
  color: var(--primary-deep);
}

.login-lede {
  margin: 14px 0 0;
  max-width: 34ch;
  color: var(--login-muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.login-apps {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 22px 28px;
}

.login-apps li {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.login-apps img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 10px 22px rgba(10, 12, 16, 0.12);
}

.login-apps span {
  font-size: 14px;
  font-weight: 650;
  color: var(--ink-soft);
}

.login-gate {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: clamp(28px, 5vw, 48px) 24px;
  border-left: 1px solid var(--login-line);
  background:
    linear-gradient(180deg, var(--glass) 0%, var(--glass) 100%);
  backdrop-filter: blur(18px);
}

.login-gate-inner {
  width: min(100%, 380px);
  animation: rise 0.7s ease 0.1s both;
}

.login-gate h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.65rem, 2.4vw, 2rem);
  letter-spacing: -0.04em;
}

.login-gate-lede {
  margin: 8px 0 28px;
  color: var(--login-muted);
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-field {
  display: grid;
  gap: 8px;
}
.auth-field span {
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-soft);
}
.auth-field input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: 500 15px/1.2 var(--font);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-field input:focus {
  outline: none;
  border-color: rgba(var(--primary-rgb), 0.7);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.12);
}

.form-alert {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 600;
}
.form-alert.err {
  background: var(--danger-soft);
  color: var(--danger-ink);
}

.auth-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0 0;
}

/* ========== APP SHELL ========== */
.app-shell {
  min-height: 100vh;
  background:
    var(--canvas);
}

.app-frame {
  width: min(100% - 2.5rem, 1080px);
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
}
.brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: none;
}
.brand:hover { color: var(--ink); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-link {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 10px;
}
.nav-link:hover {
  color: var(--accent-text);
  background: rgba(var(--primary-rgb), 0.06);
}
.nav-btn {
  appearance: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
}
.nav-danger {
  color: var(--danger-ink);
}
.nav-danger:hover {
  color: var(--danger-ink);
  background: var(--danger-soft);
}

/* Sign-out confirm modal */
body.modal-open { overflow: hidden; }
.modal[hidden] { display: none !important; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
}
@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--backdrop);
  backdrop-filter: blur(4px);
  animation: backdrop-in 0.18s ease both;
}
.modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  padding: 28px 26px 24px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 28px 70px rgba(10, 12, 16, 0.22);
  animation: rise 0.25s ease both;
}
.modal-kicker {
  margin: 0 0 8px;
  color: var(--accent-text);
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.modal-card h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 750;
  letter-spacing: -0.03em;
}
.modal-copy {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}
.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}
.modal-actions form { margin: 0; }

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 200px;
  padding: 5px 10px 5px 5px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
}
.user-pill img,
.user-initial {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}
.user-pill img {
  object-fit: cover;
  background: var(--primary-soft);
}
.user-initial {
  display: grid;
  place-items: center;
  background: var(--primary);
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 700;
}
.user-pill span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-main { padding: 8px 0 40px; }

.app-footer {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.footer-copy { font-weight: 500; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.footer-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 650;
  box-shadow: 0 4px 12px rgba(10, 12, 16, 0.04);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.footer-link:hover {
  color: var(--accent-text);
  border-color: rgba(var(--primary-rgb), 0.35);
  background: var(--surface);
  box-shadow: 0 8px 18px rgba(var(--primary-rgb), 0.1);
}
.page-login .footer-link {
  background: var(--surface);
}

/* ========== HOME ========== */
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(220px, 0.85fr);
  gap: 28px;
  align-items: center;
  min-height: 420px;
  padding: clamp(28px, 5vw, 48px);
  border-radius: 28px;
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(135deg, var(--surface-2) 0%, var(--surface) 100%);
  box-shadow: var(--shadow);
  animation: rise 0.55s ease both;
}

.home-kicker {
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.home-hero h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 0.98;
}

.home-lede {
  margin: 16px 0 0;
  max-width: 36ch;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.55;
}

.status-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 600;
}
.status-line .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 4px var(--warn-soft);
}
.status-line.ok .dot {
  background: var(--ok);
  box-shadow: 0 0 0 4px var(--ok-soft);
}

.inline-alert {
  margin: 16px 0 0;
  color: var(--warn-ink);
  font-size: 14px;
  font-weight: 600;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.home-hero-visual {
  display: grid;
  place-items: center;
  min-height: 260px;
}
.home-hero-visual img {
  width: min(100%, 260px);
  opacity: 0.95;
  filter: none;
  animation: float 7s ease-in-out infinite alternate;
}

.home-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}
.home-feature {
  padding: 22px 20px;
  border-radius: 20px;
  background: var(--glass);
  border: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(10, 12, 16, 0.05);
  animation: rise 0.65s ease both;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}
.home-feature:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 14px 34px rgba(10, 12, 16, 0.18);
}
.home-feature:nth-child(2) { animation-delay: 0.06s; }
.home-feature:nth-child(3) { animation-delay: 0.12s; }
.feature-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--accent-text);
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.home-feature h2 {
  margin: 14px 0 8px;
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.home-feature p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.home-apps {
  margin-top: 22px;
}
.home-apps-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.home-apps-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.home-app {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.home-app img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--line);
}
.home-app span {
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ========== STUDIO / SHARED ========== */
.panel {
  position: relative;
  overflow: visible;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(22px, 3vw, 32px);
  box-shadow: 0 12px 32px rgba(10, 12, 16, 0.05);
}

.page-head { margin: 4px 0 22px; }
.section-title {
  margin: 8px 0 0;
  font-family: var(--display);
  font-size: clamp(1.5rem, 2.5vw, 1.9rem);
  letter-spacing: -0.03em;
}
.lede {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
  max-width: 52ch;
}
.badge {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 700;
}

.post-layout { display: grid; gap: 14px; }
@media (min-width: 920px) {
  .post-layout {
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
    align-items: start;
  }
  .post-side { position: sticky; top: 16px; }
}

/* Compact studio density — keep publish + toggles reachable */
.page-post .page-head-compact { margin: 0 0 12px; }
.page-post .page-head-compact .section-title {
  margin: 4px 0 0;
  font-size: 1.35rem;
}
.page-post .panel-studio {
  padding: 16px 16px 88px;
  border-radius: 18px;
}
.page-post .post-side {
  padding: 14px;
  border-radius: 18px;
}
.page-post .creator {
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: 12px;
}
.page-post .creator img {
  width: 40px;
  height: 40px;
}
.page-post .creator .name { font-size: 14px; }
.page-post .creator .handle { font-size: 12px; }
.page-post .field { margin-bottom: 12px; }
.page-post .field-label {
  margin-bottom: 5px;
  font-size: 12px;
}
.page-post .hint {
  margin-top: 4px;
  font-size: 11px;
}
.page-post input[type="text"],
.page-post input[type="url"],
.page-post input[type="number"],
.page-post input[type="datetime-local"],
.page-post textarea,
.page-post select,
.page-post .select-trigger {
  min-height: 42px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 14px;
}
.page-post select {
  padding-right: 40px;
}
.page-post textarea { min-height: 72px; }
.page-post #title { min-height: 64px; }
.page-post .select-trigger-account {
  min-height: 46px;
  padding: 8px 14px 8px 12px;
}
.page-post .select-trigger-face,
.page-post .select-option-face {
  width: 28px;
  height: 28px;
  font-size: 12px;
}
.page-post .select-option {
  min-height: 44px;
  padding: 8px 10px;
  gap: 10px;
}
.page-post .segmented {
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
}
.page-post .segmented label {
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12px;
}
.page-post .toggles { gap: 6px; }
.page-post .toggle {
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
}
.page-post .toggle-ui {
  width: 40px;
  height: 22px;
  flex-basis: 40px;
}
.page-post .toggle-ui::after {
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
}
.page-post .toggle input:checked + .toggle-ui::after {
  transform: translateX(18px);
}
.page-post .toggle-copy strong { font-size: 13px; }
.page-post .toggle-copy small { font-size: 11px; }
.page-post .disclosure {
  padding: 8px;
  border-radius: 12px;
}
.page-post .consent {
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px;
}
.page-post .file-drop {
  padding: 14px 12px;
  border-radius: 12px;
}
.page-post .file-drop.has-file { padding: 10px 12px; }
.page-post .file-drop-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}
.page-post .file-drop-icon.is-done {
  width: 36px;
  height: 36px;
}
.page-post .file-drop-title { font-size: 13px; }
.page-post .file-drop-sub { font-size: 12px; }
.page-post .btn {
  min-height: 40px;
  padding: 0 14px;
  font-size: 14px;
  border-radius: 10px;
}
.page-post .preview-shell {
  min-height: 180px;
  max-height: min(420px, 52vh);
  border-radius: 12px;
}
.page-post .preview-video {
  max-height: min(420px, 52vh);
}
.page-post .studio-actions {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin: 12px -16px -16px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, var(--glass), var(--surface) 28%);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.page-post .studio-actions .status { margin-top: 10px; }
.page-post .studio-actions .hint { margin-top: 6px; }

.creator {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  margin-bottom: 8px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--primary-soft);
}
.creator img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--primary-soft);
}
.creator .name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
}
.creator .handle { color: var(--muted); font-size: 13px; margin-top: 2px; }

.field { margin-bottom: 18px; }
.field > label:not(.toggle),
.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
label.toggle {
  display: flex;
  margin-bottom: 0;
  font-size: inherit;
  font-weight: inherit;
}
.hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

input[type="text"],
input[type="url"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  min-height: 48px;
}
textarea { min-height: 110px; resize: vertical; }

.cover-picker {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}
.cover-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.cover-btn:hover:not(:disabled) {
  border-color: rgba(var(--primary-rgb), 0.4);
  color: var(--accent-text);
  background: var(--surface);
}
.cover-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.cover-current {
  min-width: 0;
  text-align: center;
}
.cover-current strong {
  display: block;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.cover-current span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.file-drop {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  padding: 22px 18px;
  border: 1.5px dashed rgba(var(--primary-rgb), 0.35);
  border-radius: 18px;
  background:
    radial-gradient(420px 180px at 50% 0%, rgba(var(--primary-rgb), 0.08), transparent 70%),
    var(--surface-2);
  color: var(--ink-soft);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.file-drop-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}
.file-drop:hover,
.file-drop:focus-within {
  border-color: rgba(var(--primary-rgb), 0.65);
  background:
    radial-gradient(420px 180px at 50% 0%, rgba(var(--primary-rgb), 0.12), transparent 70%),
    var(--surface);
  box-shadow: 0 12px 28px rgba(var(--primary-rgb), 0.08);
}
.file-drop.is-dragging {
  border-color: var(--primary);
  border-style: solid;
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(var(--primary-rgb), 0.14);
}
.file-drop.has-file {
  border-style: solid;
  border-color: rgba(var(--primary-rgb), 0.45);
  background: var(--surface);
  padding: 14px 16px;
}
.file-drop-idle {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
}
.file-drop.has-file .file-drop-idle { display: none; }
.file-drop-selected {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.file-drop-selected[hidden] { display: none !important; }
.file-drop-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--primary-soft);
  color: var(--accent-text);
  flex-shrink: 0;
}
.file-drop-icon.is-done {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--ok-soft);
  color: var(--ok-ink);
}
.file-drop-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.file-drop-title {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-drop-sub {
  font-size: 13px;
  color: var(--muted);
}
.file-drop-sub em {
  color: var(--accent-text);
  font-style: normal;
  font-weight: 700;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: rgba(var(--primary-rgb), 0.55);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.12);
}
.select {
  position: relative;
  width: 100%;
  min-width: 0;
}
.select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.select-trigger:hover {
  border-color: var(--line-strong);
}
.select.is-open .select-trigger,
.select-trigger:focus {
  outline: none;
  border-color: rgba(var(--primary-rgb), 0.55);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.12);
}
.select-trigger-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.select-trigger-label.is-placeholder {
  color: var(--muted);
  font-weight: 500;
}
.select-chevron {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--muted);
  transition: transform 0.15s ease;
}
.select.is-open .select-chevron {
  transform: rotate(180deg);
  color: var(--accent-text);
}
@keyframes menu-pop {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.select-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 80;
  margin: 0;
  padding: 8px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 22px 48px rgba(10, 12, 16, 0.16);
  overflow: auto;
  max-height: min(320px, 50vh);
  animation: menu-pop 0.16s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.select-menu[hidden] {
  display: none !important;
}
.select-option {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 12px;
  border-radius: 14px;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.select-option + .select-option {
  margin-top: 4px;
}
.select-option:hover,
.select-option:focus {
  outline: none;
  background: var(--surface-2);
  color: var(--accent-text);
}
.select-option.is-selected {
  background: var(--primary-soft);
  color: var(--accent-text);
}
.select-option.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  color: var(--muted);
}
.select-option.is-disabled:hover {
  background: transparent;
  color: var(--muted);
}
.select-option-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink-soft);
}
.select-option:hover .select-option-icon,
.select-option.is-selected .select-option-icon {
  background: var(--surface);
  color: var(--accent-text);
}
.select-option-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.select-option-label {
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.select-option-hint {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.select-option.is-selected .select-option-hint {
  color: var(--accent-text);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.segmented label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) {
  background: var(--primary);
  color: var(--on-accent);
  box-shadow: none;
}

.toggles { display: grid; gap: 10px; }
.toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.toggle:hover { border-color: var(--line-strong); background: var(--surface); }
.toggle.disabled { opacity: 0.45; cursor: not-allowed; }
.toggle input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.toggle-ui {
  position: relative;
  z-index: 1;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background 0.15s ease;
  flex: 0 0 48px;
  pointer-events: none;
}
.toggle-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 4px 10px rgba(10, 12, 16, 0.16);
  transition: transform 0.15s ease;
}
.toggle input:checked + .toggle-ui {
  background: var(--primary);
}
.toggle input:checked + .toggle-ui::after {
  transform: translateX(20px);
}
.toggle:focus-within {
  border-color: rgba(var(--primary-rgb), 0.45);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.12);
}
.toggle-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
  pointer-events: none;
}
.toggle-copy strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.toggle-copy small {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.35;
}

.disclosure {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: var(--surface-2);
}
.disclosure > .toggle {
  background: var(--surface);
}
.disclosure .sub { margin-top: 10px; display: grid; gap: 8px; }
.prompt { margin-top: 10px; padding: 0 4px; color: var(--warn); font-size: 13px; font-weight: 600; }

.consent {
  margin: 18px 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(var(--primary-rgb), 0.06);
  border: 1px solid rgba(var(--primary-rgb), 0.16);
  font-size: 14px;
  line-height: 1.5;
}

.preview-player {
  width: 100%;
  min-width: 0;
}
.preview-shell {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  width: 100%;
  min-width: 0;
  min-height: 240px;
  max-height: min(640px, 75vh);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Avoid aspect-ratio + max-height clash (Edge clips portrait videos). */
  aspect-ratio: auto;
  box-sizing: border-box;
}
.preview-shell.is-video {
  min-height: 0;
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
  height: auto;
}
/* Empty / photo placeholders fill the shell */
.preview-shell > .preview-empty,
.preview-shell > .photo-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.preview-video {
  position: relative;
  z-index: 2;
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(640px, 75vh);
  object-fit: contain;
  object-position: center;
  background: #000;
  vertical-align: middle;
}
.preview-shell.is-video .preview-video {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
}
.preview-video[hidden] { display: none !important; }
.preview-empty {
  z-index: 1;
  display: grid;
  place-content: center;
  text-align: center;
  color: rgba(255, 255, 255, 0.82);
  padding: 24px;
  pointer-events: none;
  box-sizing: border-box;
}
.preview-empty[hidden] { display: none !important; }
.photo-preview[hidden] { display: none !important; }

/* Fullscreen: letterbox, never stretch/crop */
.preview-shell:fullscreen,
.preview-shell:-webkit-full-screen {
  max-height: none;
  width: 100%;
  height: 100%;
  min-height: 100%;
  border: 0;
  border-radius: 0;
  background: #000;
}
.preview-shell:fullscreen .preview-video,
.preview-shell:-webkit-full-screen .preview-video {
  width: auto;
  height: auto;
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
}
.preview-video:fullscreen,
.preview-video:-webkit-full-screen {
  width: auto !important;
  height: auto !important;
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
  background: #000;
}
.select-trigger-account {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 12px;
  text-align: left;
}
.select-trigger-face,
.select-option-face {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--line);
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
}
.select-trigger-face img,
.select-option-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.select-trigger-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.select-trigger-hint {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.account-select .select-option {
  grid-template-columns: 36px minmax(0, 1fr);
}
.preview-empty strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--display);
  font-size: 15px;
  color: #fff;
}
.preview-empty span { font-size: 13px; line-height: 1.45; }

.photo-preview {
  width: 100%;
  height: 100%;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
  overflow: auto;
}
.photo-thumb {
  appearance: none;
  display: grid;
  margin: 0;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--line-strong);
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.photo-thumb:hover {
  border-color: rgba(var(--primary-rgb), 0.55);
}
.photo-thumb.cover {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
  border-color: transparent;
}
.photo-thumb img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}
.photo-thumb span {
  display: block;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 650;
}

.app-context { margin-top: 16px; }
.app-context .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px 7px 7px;
  font-size: 12px;
  font-weight: 700;
}
.chip img {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  object-fit: cover;
  background: var(--surface);
  border: 1px solid var(--line);
}

.status {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  line-height: 1.45;
}
.status-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.status-body { min-width: 0; flex: 1; }
.status-dismiss {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1;
}
.status-dismiss:hover { color: var(--ink); background: var(--surface-2); }
.status-label {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.status-msg {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  white-space: pre-wrap;
  word-break: break-word;
}
.status-spinner {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  border: 2.5px solid rgba(var(--primary-rgb), 0.22);
  border-top-color: var(--primary);
  animation: status-spin 0.7s linear infinite;
}
.status-mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}
.status-mark.ok { background: var(--ok); color: var(--on-accent); }
.status-mark.err { background: var(--danger); color: var(--on-accent); }
.status-pending {
  border-color: rgba(var(--primary-rgb), 0.28);
  background: var(--surface-2);
  color: var(--accent-text);
}
.status-pending .status-label { color: var(--accent-text); }
.status-ok,
.status.ok {
  border-color: color-mix(in srgb, var(--ok) 40%, transparent);
  background: var(--ok-soft);
  color: var(--ok-ink);
}
.status-ok .status-label,
.status.ok .status-label { color: var(--ok-ink); }
.status-err,
.status.err {
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  background: var(--danger-soft);
  color: var(--danger-ink);
}
.status-err .status-label,
.status.err .status-label { color: var(--danger-ink); }
@keyframes status-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .status-spinner { animation: none; border-top-color: var(--primary); opacity: 0.85; }
}

/* Legal */
.page-legal { background: var(--canvas); min-height: 100vh; }
.legal-wrap {
  width: min(100% - 2.5rem, 800px);
  margin: 0 auto;
  padding: 28px 0 64px;
}
.legal-brand { margin-bottom: 24px; }
.legal h1 { margin-top: 0; font-family: var(--display); }
.legal h2 { margin-top: 28px; font-size: 18px; font-family: var(--display); }
.legal p, .legal li { color: var(--muted); line-height: 1.55; }

.account-panel { margin: 0 0 28px; }
.account-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.account-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.account-card.is-active {
  border-color: rgba(var(--primary-rgb), 0.45);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.08);
}
.account-card img,
.account-card .user-initial {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}
.account-card-copy { flex: 1; min-width: 0; }
.account-card-copy strong { display: block; }
.account-card-copy small { color: var(--muted); }
.account-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-sm { padding: 8px 12px; font-size: 13px; min-height: 40px; }
.native-select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 40px 10px 14px;
  font: inherit;
  background-color: var(--surface-2);
}
.schedule-row { margin-top: 12px; display: grid; gap: 8px; }
.schedule-row input[type="datetime-local"] {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
}
.schedule-panel { margin-top: 20px; }
.schedule-panel[hidden],
.schedule-panel[data-timing="now"],
.schedule-panel[data-timing="draft"] {
  display: none !important;
}
.schedule-panel[data-timing="now"] .schedule-calendar {
  opacity: 0.55;
}
.schedule-panel[data-timing="now"] .cal-hint {
  display: none;
}
.schedule-calendar {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.cal-toolbar {
  display: grid;
  grid-template-columns: 40px 1fr 40px auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.cal-title {
  text-align: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
}
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 4px;
}
.cal-weekdays span {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 0;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.cal-cell {
  appearance: none;
  min-width: 0;
  overflow: hidden;
  min-height: 64px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font: inherit;
  color: inherit;
}
.cal-cell.is-empty {
  background: transparent;
  border-color: transparent;
  min-height: 64px;
  pointer-events: none;
}
.cal-cell:hover:not(.is-empty) {
  border-color: rgba(var(--primary-rgb), 0.45);
  background: var(--surface-2);
}
.cal-cell.is-today {
  box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), 0.55);
}
.cal-cell.is-selected {
  background: var(--primary-soft);
  border-color: var(--primary);
}
.cal-cell.has-jobs {
  background: var(--surface);
}
.cal-daynum {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}
.cal-chips {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.cal-chip {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.3;
  padding: 2px 4px;
  border-radius: 4px;
  background: var(--primary-soft);
  color: var(--accent-text);
}
.cal-chip.status-failed {
  background: var(--danger-soft);
  color: var(--danger-ink);
}
.cal-chip.status-running {
  background: var(--warn-soft);
  color: var(--warn-ink);
}
.cal-more {
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
}
.cal-hint { margin-top: 10px; }
.schedule-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.schedule-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1.5px solid color-mix(in srgb, var(--st, var(--line)) 80%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--st, transparent) 20%, transparent);
  background: var(--surface-2);
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.schedule-item.status-pending { --st: var(--st-pending); }
.schedule-item.status-running { --st: var(--st-running); }
.schedule-item.status-publishing { --st: var(--st-publishing); }
.schedule-item.status-posted { --st: var(--st-posted); }
.schedule-item.status-failed { --st: var(--st-failed); background: var(--danger-soft); }
.schedule-item.status-draft { --st: var(--st-draft); }
.schedule-item strong { display: block; }
.schedule-item small { display: block; color: var(--muted); margin-top: 2px; }
.schedule-item .err-line { color: var(--danger-ink); }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-20px, -16px, 0) scale(1.08); }
}
@keyframes float {
  from { transform: translateY(0); }
  to { transform: translateY(-12px); }
}

@media (max-width: 900px) {
  .login-stage { grid-template-columns: 1fr; }
  .login-hero {
    padding: 40px 24px 28px;
    min-height: auto;
  }
  .login-brand {
    margin-top: 20px;
    font-size: clamp(2rem, 9vw, 2.6rem);
  }
  .login-tagline {
    font-size: clamp(1.2rem, 4.5vw, 1.45rem);
    max-width: none;
  }
  .login-apps { margin-top: 24px; }
  .login-gate {
    border-left: 0;
    border-top: 1px solid var(--login-line);
    padding: 28px 24px 40px;
    align-items: start;
  }
  .home-hero { grid-template-columns: 1fr; }
  .home-hero-visual { min-height: 180px; order: -1; }
  .home-hero-visual img { width: min(100%, 180px); }
  .home-features,
  .home-apps-row { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .login-orb, .login-mark, .home-hero-visual img,
  .login-hero, .login-gate-inner, .home-hero {
    animation: none;
    transition: none;
  }
}

/* ——— Dark form controls ——— */
input, textarea, select {
  color: var(--ink);
  background: var(--surface-2);
  border-color: var(--line);
}
select {
  appearance: none;
  -webkit-appearance: none;
  color-scheme: dark;
  padding-right: 40px;
  background-color: var(--surface-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239aa3b2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
select:hover { border-color: var(--line-strong); }
.select-trigger {
  background: var(--surface-2);
  padding: 10px 14px;
}
input::placeholder, textarea::placeholder { color: var(--muted); }

/* ——— Platform badges (TikTok / Facebook) ——— */
.avatar-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.platform-dot {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.platform-dot.is-sm { width: 14px; height: 14px; right: -2px; bottom: -2px; border-width: 1.5px; }
.platform-dot.is-facebook { background: #1877f2; }
.platform-dot.is-tiktok { background: #0f0f12; border-color: #25f4ee; }
.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
  vertical-align: middle;
}
.platform-badge.is-facebook {
  background: rgba(24, 119, 242, 0.16);
  color: #60a5fa;
  border: 1px solid rgba(24, 119, 242, 0.35);
}
.platform-badge.is-tiktok {
  background: rgba(254, 44, 85, 0.14);
  color: #f472b6;
  border: 1px solid rgba(254, 44, 85, 0.35);
}

/* ——— Upload progress bar ——— */
.upload-progress {
  margin: 10px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.upload-progress[hidden] { display: none; }
.upload-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-soft);
}
.upload-progress-pct {
  margin-left: auto;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.upload-dock {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1050;
  display: grid;
  gap: 8px;
  width: min(340px, calc(100vw - 24px));
}
.upload-dock-item {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
}
.upload-dock-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.upload-dock-head strong {
  min-width: 0;
  flex: 1 1 auto;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upload-dock-pct {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.upload-dock-sub {
  font-size: 12px;
  color: var(--muted);
}
.upload-dock-item.is-error .upload-dock-sub { color: var(--danger-ink); }
.upload-dock-dismiss {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1;
}
.upload-dock-dismiss:hover { color: var(--ink); background: var(--surface-2); }
.nav-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 2000;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  animation: nav-pulse 0.8s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes nav-pulse { from { opacity: 0.55; } to { opacity: 1; } }
.upload-progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
}
.upload-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  transition: width 0.12s linear;
}

/* ——— Platform separation (Home, Integrations, Studio dropdown) ——— */
.btn-facebook {
  background: #1877f2;
  color: #fff;
}
.btn-facebook:hover {
  background: #166fe5;
  color: #fff;
}
.home-platform-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 24px 0 28px;
}
@media (max-width: 900px) {
  .home-platform-grid { grid-template-columns: 1fr; }
}
.platform-panel {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.platform-panel.is-tiktok {
  border-top: 3px solid #fe2c55;
}
.platform-panel.is-facebook {
  border-top: 3px solid #1877f2;
}
.platform-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.platform-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.platform-panel-title h2 {
  margin: 0;
  font-size: 1.2rem;
}
.platform-count {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.select-group-label {
  padding: 8px 12px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-top: 1px solid var(--line);
  margin-top: 4px;
  list-style: none;
}
.select-group-label:first-child {
  border-top: 0;
  margin-top: 0;
}
.integrations-sections {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.integrations-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.integrations-section-head h2 {
  margin: 0;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
