/* Clipton — application, auth and public page styles */

:root {
  color-scheme: dark;
  --bg: #09090b;
  --surface: #111114;
  --surface-2: #18181c;
  --surface-3: #212127;
  --line: #232329;
  --line-strong: #32323a;
  --line-hover: #55555f;
  --ink: #f4f4f5;
  --ink-2: #d4d4d8;
  --muted: #a1a1aa;
  --brand: #c8f53c;
  --on-accent: #0b0b0e;
  --brand-tint: rgba(200, 245, 60, .1);
  --brand-grad: linear-gradient(135deg, #e4ff8a 0%, #c8f53c 50%, #a3e635 100%);
  --mint: #c8f53c;
  --mint-tint: rgba(200, 245, 60, .12);
  --cyan: #c8f53c;
  --violet: #9d8fff;
  --success: #86efac;
  --success-bg: rgba(34, 197, 94, .14);
  --draft: #b4a9ff;
  --draft-bg: rgba(124, 106, 255, .16);
  --card: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, 0) 60%), var(--surface);
  --glow: 0 0 0 1px rgba(200, 245, 60, .28), 0 30px 80px -30px rgba(200, 245, 60, .35);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 20px 50px -24px rgba(0, 0, 0, .85);
  --shadow-lg: 0 40px 100px -40px rgba(0, 0, 0, .95);
  --font: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sidebar: 248px;
  --topbar: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 500 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -.02em; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Brand ---------- */
.app-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.04em;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark { display: inline-flex; align-items: flex-end; gap: 3px; height: 22px; }
.brand-mark i { width: 6px; border-radius: 2px; background: var(--brand-grad); transform: skewX(-14deg); }
.brand-mark i:nth-child(1) { height: 11px; }
.brand-mark i:nth-child(2) { height: 22px; }
.brand-mark i:nth-child(3) { height: 16px; }

/* ---------- Buttons ---------- */
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, border-color .15s ease;
}
.primary-button {
  border: 0;
  color: var(--on-accent);
  background: var(--brand-grad);
  box-shadow: 0 10px 26px -12px rgba(200, 245, 60, .5);
}
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 14px 32px -12px rgba(200, 245, 60, .65); }
.secondary-button {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}
.secondary-button:hover { border-color: var(--line-hover); }

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
}
.icon-button:hover { border-color: var(--line-hover); }

.region-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface);
  font-size: 13px;
  white-space: nowrap;
}
.region-button strong { font-weight: 800; }
.region-button span { color: var(--muted); font-weight: 600; }
.region-button svg { width: 14px; height: 14px; color: var(--muted); }
.region-button:hover { border-color: var(--line-hover); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: max-content;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.draft { background: var(--draft-bg); color: var(--draft); }
.status.progress { background: var(--brand); color: var(--on-accent); }

/* ---------- App shell ---------- */
.app-page { min-height: 100vh; }

.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  width: var(--sidebar);
  padding: 22px 14px 16px;
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.app-sidebar .app-logo { padding: 2px 10px 22px; }

.workspace-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  text-align: left;
}
.workspace-switch > i {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 9px;
  background: var(--brand-grad);
  color: var(--on-accent);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}
.workspace-switch span { display: flex; flex-direction: column; font-size: 14px; font-weight: 700; line-height: 1.3; }
.workspace-switch small { color: var(--muted); font-size: 12px; font-weight: 500; }
.workspace-switch svg { width: 16px; margin-left: auto; color: var(--muted); }

.side-label {
  margin: 24px 12px 8px;
  color: var(--muted);
  font: 500 11px/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.side-nav a svg { color: var(--muted); }
.side-nav a:hover { background: var(--surface-2); color: var(--ink); }
.side-nav a.active { background: var(--brand-tint); color: var(--brand); }
.side-nav a.active svg { color: var(--brand); }

.sidebar-bottom { margin-top: auto; padding-top: 24px; }
.usage-mini { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.usage-mini header { display: flex; justify-content: space-between; font-size: 13px; }
.usage-mini header span { color: var(--brand); font-weight: 800; }
.usage-bar { height: 6px; margin: 10px 0 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.usage-bar b { display: block; width: 68%; height: 100%; border-radius: inherit; background: var(--brand-grad); }
.usage-mini small { color: var(--muted); font-size: 12px; }

.user-menu { display: flex; align-items: center; gap: 10px; padding: 14px 6px 0; }
.user-menu div { display: flex; flex-direction: column; font-size: 14px; font-weight: 700; line-height: 1.3; min-width: 0; }
.user-menu small { color: var(--muted); font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.user-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffcab0, #8a7fe0);
  color: var(--on-accent);
  font-size: 12px;
  font-weight: 800;
}
.user-avatar.avatar-2 { background: linear-gradient(135deg, #ffd2a9, #e783a6); }
.user-avatar.avatar-3 { background: linear-gradient(135deg, #b3e5bb, #599b9f); }
.user-avatar.avatar-4 { background: linear-gradient(135deg, #cbb7fa, #8c75c7); }

.sidebar-backdrop { display: none; }

.app-main { margin-left: var(--sidebar); min-width: 0; }

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--topbar);
  padding: 12px 32px;
  background: rgba(9, 9, 11, .78);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.mobile-menu { display: none; }
.page-title { min-width: 0; font-size: 20px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25; }
.page-title small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.top-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.app-content { width: 100%; max-width: 1320px; padding: 28px 32px 56px; }
.app-content.narrow { max-width: 980px; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ---------- Panels & shared blocks ---------- */
.panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.panel + .panel { margin-top: 16px; }
.stack > .panel + .panel { margin-top: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-heading h2 { font-size: 17px; font-weight: 800; }
.panel-heading a { color: var(--brand); font-size: 13px; font-weight: 700; text-decoration: none; }
.panel-heading a:hover { text-decoration: underline; }
.panel-heading button {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
}
.panel-heading button:hover { border-color: var(--line-hover); }

.roadmap-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 18px 22px;
  border: 1px solid rgba(200, 245, 60, .2);
  border-radius: var(--radius-lg);
  background: radial-gradient(70% 140% at 0% 0%, rgba(200, 245, 60, .1), transparent 60%), radial-gradient(60% 140% at 100% 100%, rgba(124, 106, 255, .12), transparent 60%), var(--surface);
}
.roadmap-banner b { display: block; font-size: 15px; font-weight: 800; }
.roadmap-banner small { display: block; margin-top: 3px; color: var(--muted); font-size: 14px; }
.roadmap-banner .empty-note { flex: none; }

.empty-note { color: var(--muted); font: 500 12px/1.4 var(--mono); letter-spacing: .06em; }
.empty-state { padding: 48px 16px; color: var(--muted); text-align: center; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.metric-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.metric-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font: 500 11px/1.3 var(--mono);
  letter-spacing: .1em;
}
.metric-card header i {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--brand-tint);
  color: var(--brand);
  font: 700 12px/1 var(--font);
  font-style: normal;
  letter-spacing: 0;
}
.metric-card strong { display: block; margin: 12px 0 4px; font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.metric-card strong.metric-text { font-size: 24px; line-height: 1.5; }
.metric-card footer { color: var(--muted); font-size: 13px; }
.metric-card .up { color: var(--success); font-weight: 700; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }

.quick-upload {
  display: block;
  padding: 44px 24px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 16px;
  background: radial-gradient(60% 80% at 50% 0%, rgba(200, 245, 60, .07), transparent 70%), rgba(255, 255, 255, .015);
  color: inherit;
  text-align: center;
  text-decoration: none;
  transition: border-color .15s ease, background-color .15s ease;
}
.quick-upload:hover { border-color: var(--brand); }
.upload-center { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.upload-center i,
.drop-zone i {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--brand-grad);
  color: var(--on-accent);
  font-size: 22px;
  font-style: normal;
  box-shadow: 0 14px 30px -12px rgba(200, 245, 60, .55);
}
.upload-center b { font-size: 17px; }
.upload-center p { margin-bottom: 12px; color: var(--muted); font-size: 14px; }

.project-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.project-table td { padding: 12px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.project-table tr:first-child td { border-top: 0; }
.project-table td:last-child { color: var(--muted); text-align: right; white-space: nowrap; }
.project-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.project-name b { display: block; font-weight: 700; }
.project-name small { display: block; margin-top: 2px; letter-spacing: .02em; }
.video-thumb {
  display: grid;
  place-items: center;
  width: 56px;
  height: 40px;
  flex: none;
  border-radius: 9px;
  background: linear-gradient(135deg, #3b2c68, #9a76da);
  color: #fff;
  font-size: 11px;
}
.video-thumb.blue { background: linear-gradient(135deg, #1f3c68, #4f9ad6); }
.video-thumb.gold { background: linear-gradient(135deg, #6b4a22, #d9a35d); }

.activity-list { display: flex; flex-direction: column; }
.activity-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
  font-weight: 700;
}
.activity-row:first-child { border-top: 0; padding-top: 0; }
.activity-row > i {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand-tint);
  color: var(--brand);
  font-style: normal;
  font-size: 14px;
}
.activity-row div small { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; font-weight: 500; }
.activity-row > small { color: var(--muted); font-size: 12px; font-weight: 600; }

/* ---------- Forms ---------- */
.field, .form-control { margin-bottom: 16px; min-width: 0; }
.field label,
.form-control label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 700;
}
.field input,
.field select,
.form-control input,
.form-control select,
.team-row select {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field select,
.form-control select,
.team-row select {
  padding-right: 38px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.field input:focus,
.field select:focus,
.form-control input:focus,
.form-control select:focus,
.team-row select:focus,
.search:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(200, 245, 60, .15);
}
.field input::placeholder { color: #71717a; }
.field-help { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.color-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.color-dot {
  width: 34px;
  height: 34px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--line-strong);
  font-style: normal;
}
.color-dot.active { box-shadow: 0 0 0 2px var(--brand); }
.color-row .icon-button { width: 34px; height: 34px; border-radius: 50%; }

.search {
  flex: 1 1 240px;
  height: 44px;
  min-width: 0;
  padding: 0 14px 0 40px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface) 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='%23a1a1aa' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px center;
  font-size: 14px;
  font-weight: 600;
}
.search.compact { flex: 0 1 260px; }

/* ---------- Projects ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.filter-button {
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 700;
}
.filter-button:hover { border-color: var(--line-hover); }

.project-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.project-card {
  position: relative;
  padding: 10px 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.project-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.project-preview {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(135deg, #3b2c68, #9a76da);
}
.project-preview::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, .92) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z' fill='%230b0b0e'/%3E%3C/svg%3E") no-repeat 55% center;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .5);
  opacity: .9;
}
.project-preview.blue { background: linear-gradient(135deg, #1f3c68, #4f9ad6); }
.project-preview.green { background: linear-gradient(135deg, #29403e, #739a71); }
.project-preview.gold { background: linear-gradient(135deg, #6b4a22, #d9a35d); }
.project-preview.violet { background: linear-gradient(135deg, #30225d, #9a76da); }
.project-preview.rose { background: linear-gradient(135deg, #65424d, #b77f92); }
.project-card h3 { margin: 14px 4px 8px; font-size: 15px; font-weight: 800; }
.project-card h3 a { text-decoration: none; }
.project-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.project-card footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px; color: var(--muted); font-size: 13px; }

/* ---------- New project ---------- */
.drop-zone {
  display: grid;
  place-items: center;
  padding: 48px 24px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 16px;
  background: radial-gradient(60% 80% at 50% 0%, rgba(200, 245, 60, .07), transparent 70%), rgba(255, 255, 255, .015);
  text-align: center;
}
.drop-zone > div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.drop-zone h2 { font-size: 22px; font-weight: 800; }
.drop-zone p { color: var(--muted); font-size: 14px; }
.drop-zone .primary-button { margin: 12px 0 6px; }
.upload-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.option-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
  transition: border-color .15s ease;
}
.option-card:hover { border-color: var(--line-hover); }
.option-card span { color: var(--muted); font: 500 11px/1.3 var(--mono); letter-spacing: .1em; }
.option-card b { font-size: 15px; }

/* ---------- Templates ---------- */
.template-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.category-tabs { display: flex; gap: 6px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.category-tabs::-webkit-scrollbar { display: none; }
.category-tabs button {
  flex: none;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
}
.category-tabs button:hover { border-color: var(--line-hover); }
.category-tabs button.active { border-color: var(--ink); background: var(--ink); color: var(--on-accent); }

.template-app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.template-app-card {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease;
}
.template-app-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.template-app-preview,
.editor-video,
.brand-preview {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(160deg, #26324f, #6d5a8e);
}
.template-app-preview { aspect-ratio: 4 / 5; border-radius: 12px; }
.template-app-preview::before,
.editor-video::before,
.editor-person::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 22%;
  width: 26%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translateX(-50%);
  background: linear-gradient(160deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, .18));
}
.template-app-preview::after,
.editor-video::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: -8%;
  width: 62%;
  height: 50%;
  border-radius: 48% 48% 0 0;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(12, 12, 34, .42), rgba(12, 12, 34, .16));
}
.template-app-preview.purple { background: linear-gradient(160deg, #2a1d5a, #8a63e0); }
.template-app-preview.silver { background: linear-gradient(160deg, #3c3e46, #9a9ca6); }
.template-app-preview.green { background: linear-gradient(160deg, #1f3a35, #6f9a78); }
.template-app-preview.orange { background: linear-gradient(160deg, #5c2c1c, #d98b52); }
.template-words {
  position: absolute;
  inset: auto 10px 16%;
  color: #fff;
  font-size: clamp(17px, 1.6vw, 21px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -.01em;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .35);
  text-transform: uppercase;
}
.template-words b { display: block; color: var(--mint); }
.template-app-card footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 6px 4px; }
.template-app-card footer div { font-size: 14px; font-weight: 800; }
.template-app-card footer small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.fav-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}
.fav-button:hover { border-color: var(--line-hover); color: var(--ink); }
.fav-button[aria-pressed="true"] { border-color: rgba(251, 113, 133, .4); background: rgba(251, 113, 133, .12); color: #fb7185; }

/* ---------- Editor ---------- */
.editor-page .app-content { max-width: none; padding: 20px 24px 32px; }
.editor-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 300px;
  grid-template-areas: "transcript canvas style" "timeline timeline timeline";
  gap: 16px;
}
.editor-panel,
.style-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.editor-panel { grid-area: transcript; }
.style-panel { grid-area: style; }
.editor-panel .panel-heading,
.style-panel .panel-heading { margin: 18px 0 10px; }
.style-panel .panel-heading { margin-top: 0; }
.tool-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.tool-tabs button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 4px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}
.tool-tabs button:hover { color: var(--ink); }
.tool-tabs button.active { border-color: rgba(200, 245, 60, .3); background: var(--brand-tint); color: var(--brand); }
.transcript-row {
  display: block;
  width: 100%;
  margin-bottom: 4px;
  padding: 10px 12px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}
.transcript-row small { display: block; margin-bottom: 2px; color: var(--muted); font: 500 11px/1.4 var(--mono); }
.transcript-row:hover { background: var(--surface-2); }
.transcript-row.active { border-left-color: var(--brand); background: var(--brand-tint); color: var(--ink); font-weight: 700; }

.editor-canvas {
  grid-area: canvas;
  position: relative;
  display: grid;
  place-items: center;
  min-height: 600px;
  padding: 64px 20px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .06) 1px, transparent 0) 0 0 / 18px 18px,
    radial-gradient(60% 60% at 50% 40%, rgba(124, 106, 255, .12), transparent 70%),
    #0c0c0f;
}
.canvas-controls { position: absolute; top: 14px; right: 14px; display: flex; gap: 6px; }
.canvas-controls button {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
}
.editor-video {
  width: auto;
  height: min(540px, 64vh);
  aspect-ratio: 9 / 16;
  border-radius: 20px;
  background: linear-gradient(170deg, #2b3552 0%, #564a7a 60%, #b0766a 100%);
  box-shadow: var(--shadow-lg);
}
.editor-person { position: absolute; inset: 0; z-index: -1; }
.editor-person::before { top: 20%; width: 30%; }
.editor-caption {
  position: absolute;
  inset: auto 14px 20%;
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .4);
  text-transform: uppercase;
}
.editor-caption b { display: table; margin: 6px auto 0; padding: 2px 10px; border-radius: 6px; background: var(--mint); color: var(--on-accent); text-shadow: none; }

.mini-style-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.mini-style {
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}
.mini-style:hover { border-color: var(--line-hover); }
.mini-style.active { border-color: var(--brand); background: var(--brand-tint); box-shadow: 0 0 0 1px var(--brand); }
.mini-style .tint-cyan { color: var(--cyan); }
.mini-style .tint-violet { color: var(--violet); }

.editor-timeline {
  grid-area: timeline;
  padding: 16px 18px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow-x: auto;
}
.timeline-ruler,
.track { min-width: 720px; }
.timeline-ruler {
  display: flex;
  justify-content: space-between;
  margin-left: 122px;
  color: var(--muted);
  font: 500 11px/1 var(--mono);
}
.track { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; align-items: center; margin-top: 12px; }
.track-label { color: var(--ink-2); font-size: 13px; font-weight: 700; }
.track-clips { display: flex; gap: 4px; }
.track-clips i {
  flex: 1;
  height: 44px;
  padding: 7px 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.track.video .track-clips i { border-color: transparent; background: linear-gradient(90deg, #3b3a5c, #7a6390); }
.track-clips i.active { border-color: var(--mint); background: var(--mint-tint); color: var(--brand); }

/* ---------- Settings & brand kit ---------- */
.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { position: sticky; top: calc(var(--topbar) + 20px); display: flex; flex-direction: column; gap: 2px; }
.settings-nav a,
.settings-nav button {
  display: flex;
  align-items: center;
  height: 42px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
}
.settings-nav a:hover,
.settings-nav button:hover { background: var(--surface); }
.settings-nav .active { border-color: var(--line); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.settings-nav .add { color: var(--brand); }
.settings-panel { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.settings-section {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  scroll-margin-top: calc(var(--topbar) + 20px);
}
.settings-section h2 { font-size: 18px; font-weight: 800; }
.settings-section > p { margin: 4px 0 18px; color: var(--muted); font-size: 14px; }
.settings-section > .field:last-child,
.settings-section > .form-row:last-child .field { margin-bottom: 0; }
.region-summary { margin: 0; }
.region-summary > span { color: var(--brand); font-weight: 800; }

.brand-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 7;
  border-radius: 16px;
  background: radial-gradient(70% 90% at 80% 20%, rgba(200, 245, 60, .22), transparent 60%), linear-gradient(135deg, #17122e, #3a2d8a 60%, #5a45e6);
}
.brand-preview div {
  color: #fff;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  text-transform: uppercase;
}
.brand-preview b { display: block; color: var(--mint); }

.tilt { transform: perspective(1000px) rotateX(var(--tilt-y, 0deg)) rotateY(var(--tilt-x, 0deg)); transition: transform .25s ease; }

/* ---------- Team ---------- */
.team-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 160px 36px;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
  font-weight: 700;
}
.team-row:first-of-type { border-top: 0; padding-top: 0; }
.team-row .user-avatar { width: 40px; height: 40px; }
.team-row div small { display: block; color: var(--muted); font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.team-row select { height: 38px; font-size: 13px; }
.row-menu {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  letter-spacing: 1px;
}
.row-menu:hover { background: var(--surface-2); color: var(--ink); }

/* ---------- Public pages ---------- */
.pricing-public { width: min(1200px, 100% - 48px); margin: 0 auto; }
.public-nav {
  position: sticky;
  top: 12px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  padding: 12px 12px 12px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(17, 17, 20, .72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
}
.public-nav-links { display: flex; gap: 4px; margin: 0 auto; }
.public-nav-links a { padding: 8px 14px; border-radius: 9px; color: var(--ink-2); font-size: 14px; font-weight: 700; text-decoration: none; }
.public-nav-links a:hover { background: var(--surface-2); color: var(--ink); }
.public-nav .top-actions { margin-left: 0; }

.eyebrow,
.legal-hero > span {
  display: inline-block;
  color: var(--brand);
  font: 500 12px/1.4 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
}
.pricing-hero { padding: 88px 0 48px; text-align: center; }
.pricing-hero.tight { padding-bottom: 56px; }
.pricing-hero h1,
.legal-hero h1 {
  margin: 14px 0 16px;
  font-size: clamp(40px, 6.2vw, 76px);
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1;
}
.pricing-hero p { max-width: 560px; margin: 0 auto; color: var(--muted); font-size: 17px; }
.billing-toggle {
  display: inline-flex;
  gap: 4px;
  margin-top: 28px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
}
.billing-toggle button {
  height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 700;
}
.billing-toggle button.active { background: var(--ink); color: var(--on-accent); }

.public-pricing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; padding-bottom: 24px; }
.public-pricing-grid.roadmap { padding-bottom: 88px; }
.public-price-card {
  display: flex;
  flex-direction: column;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.public-price-card h2 { color: var(--muted); font: 500 12px/1.4 var(--mono); letter-spacing: .12em; }
.public-price-card h2.tone-mint { color: var(--cyan); }
.public-price-card h2.tone-violet { color: var(--violet); }
.public-price-card h3 { margin-top: 12px; font-size: 26px; font-weight: 800; }
.price-number { margin: 22px 0 2px; font-size: 52px; font-weight: 800; letter-spacing: -.04em; line-height: 1; }
.price-sub { color: var(--muted); font-size: 14px; }
.public-price-card ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 24px 0 28px;
  padding: 24px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
  font-size: 15px;
}
.public-price-card li { display: flex; gap: 10px; }
.public-price-card li::before { content: "✓"; color: var(--brand); font-weight: 800; }
.public-price-card > a,
.public-price-card > .status { margin-top: auto; }
.public-price-card > a { width: 100%; min-height: 48px; }
.public-price-card.featured {
  border-color: rgba(200, 245, 60, .35);
  background: radial-gradient(120% 70% at 50% 0%, rgba(200, 245, 60, .14), transparent 65%), var(--surface);
  box-shadow: var(--glow);
}
.public-price-card.featured h2 { color: var(--brand); }
.public-price-card.featured .status { background: var(--brand); color: var(--on-accent); }
.pricing-note { margin: 12px 0 72px; color: var(--muted); font-size: 13px; text-align: center; }

.legal-hero { padding: 80px 0 40px; }
.legal-hero p { color: var(--muted); font-size: 15px; }
.legal-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 40px; align-items: start; padding-bottom: 88px; }
.legal-layout aside { position: sticky; top: 104px; display: flex; flex-direction: column; gap: 2px; }
.legal-layout aside a { padding: 9px 12px; border-radius: 9px; color: var(--ink-2); font-size: 14px; font-weight: 700; text-decoration: none; }
.legal-layout aside a:hover { background: var(--surface); }
.legal-layout article section {
  margin-bottom: 16px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  scroll-margin-top: 104px;
}
.legal-layout article span { color: var(--brand); font: 500 12px/1 var(--mono); letter-spacing: .12em; }
.legal-layout article h2 { margin: 10px 0 14px; font-size: 26px; font-weight: 800; }
.legal-layout article h3 { margin: 22px 0 8px; font-size: 17px; font-weight: 800; }
.legal-layout article p { margin-bottom: 12px; color: var(--ink-2); font-size: 16px; line-height: 1.7; }
.legal-layout article ul { margin: 0; padding-left: 20px; color: var(--ink-2); line-height: 1.9; }

.public-footer { width: min(1200px, 100% - 48px); margin: 0 auto; padding: 48px 0 32px; border-top: 1px solid var(--line); }
.public-footer-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 40px; }
.public-footer-brand p { max-width: 320px; margin-top: 14px; color: var(--muted); font-size: 14px; }
.public-footer-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.public-footer-links b { display: block; margin-bottom: 12px; color: var(--muted); font: 500 11px/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.public-footer-links a { display: block; padding: 5px 0; color: var(--ink-2); font-size: 14px; font-weight: 600; text-decoration: none; }
.public-footer-links a:hover { color: var(--brand); }
.public-footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: 500 12px/1.4 var(--mono);
  letter-spacing: .06em;
}
.system-status { display: inline-flex; align-items: center; gap: 8px; }
.system-status i { width: 8px; height: 8px; border-radius: 50%; background: #1fbf85; box-shadow: 0 0 0 3px rgba(31, 191, 133, .2); }

/* ---------- Auth ---------- */
.auth-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.auth-art {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 40px 48px 48px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: #0c0c0f;
  color: var(--ink);
}
.auth-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 50% at 20% 10%, rgba(124, 106, 255, .28), transparent 70%),
    radial-gradient(60% 50% at 90% 90%, rgba(200, 245, 60, .16), transparent 70%),
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .05) 1px, transparent 0) 0 0 / 22px 22px;
}
.auth-art > * { position: relative; }
.auth-orb {
  align-self: center;
  width: min(280px, 60%);
  aspect-ratio: 9 / 13;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 28px;
  background: linear-gradient(170deg, #2a2440, #16141f 70%);
  box-shadow: 0 50px 100px -40px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .03);
  backdrop-filter: blur(6px);
  transform: rotate(-4deg);
}
.auth-orb::before,
.auth-orb::after {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}
.auth-orb::before { content: "Make it"; bottom: 30%; font-size: 26px; }
.auth-orb::after { content: "Unskippable."; bottom: 19%; padding: 2px 10px; border-radius: 6px; background: var(--mint); color: var(--on-accent); font-size: 20px; }
.auth-quote { max-width: 520px; margin: 0; font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; letter-spacing: -.02em; line-height: 1.3; }
.auth-quote small { display: block; margin-top: 16px; font: 500 12px/1.4 var(--mono); letter-spacing: .12em; opacity: .85; }

.auth-form-wrap { display: grid; place-items: center; padding: 48px 24px; }
.auth-form { width: min(420px, 100%); }
.auth-form > .app-logo { display: none; margin-bottom: 28px; }
.auth-form h1 { font-size: 34px; font-weight: 800; letter-spacing: -.03em; }
.auth-form > p:not([class]) { margin: 8px 0 28px; color: var(--muted); font-size: 16px; }
.social-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  margin-bottom: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  font-size: 15px;
  font-weight: 700;
}
.social-button:hover { border-color: var(--line-hover); }
.social-button svg { width: 18px; height: 18px; }
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--muted);
  font: 500 11px/1 var(--mono);
  letter-spacing: .12em;
}
.divider::before,
.divider::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.auth-form .field input { height: 48px; }
.auth-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -2px 0 20px; font-size: 14px; }
.auth-options label { display: inline-flex; align-items: center; gap: 8px; }
.auth-options input { width: 16px; height: 16px; accent-color: var(--brand); }
.auth-options a,
.auth-switch a,
.auth-legal a { color: var(--brand); font-weight: 700; text-decoration: none; }
.auth-options a:hover,
.auth-switch a:hover,
.auth-legal a:hover { text-decoration: underline; }
.auth-form .primary-button { width: 100%; min-height: 50px; margin-top: 4px; font-size: 15px; }
.auth-switch { margin-top: 20px; font-size: 14px; text-align: center; }
.auth-legal { margin-top: 12px; color: var(--muted); font-size: 12px; text-align: center; }

/* ---------- Region popover & toast ---------- */
.region-popover {
  position: fixed;
  z-index: 100;
  display: none;
  width: min(340px, calc(100vw - 24px));
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  font-family: var(--font);
}
.region-popover.open { display: block; }
.region-popover header b { font-size: 15px; }
.region-popover header p { margin: 2px 0 12px; color: var(--muted); font-size: 13px; }
.region-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.region-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
}
.region-option span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 22px;
  flex: none;
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 800;
}
.region-option:hover { background: var(--surface-2); }
.region-option.active { border-color: rgba(200, 245, 60, .3); background: var(--brand-tint); color: var(--brand); }
.region-option.active span { background: var(--brand); color: var(--on-accent); }
.region-tax { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 110;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--on-accent);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .editor-shell { grid-template-columns: 280px minmax(0, 1fr); grid-template-areas: "transcript canvas" "style canvas" "timeline timeline"; }
  .editor-canvas { min-height: 0; }
}

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .public-pricing-grid { grid-template-columns: minmax(0, 1fr); max-width: 520px; margin: 0 auto; }
}

@media (max-width: 960px) {
  .app-sidebar {
    transform: translateX(-100%);
    visibility: hidden;
    box-shadow: var(--shadow-lg);
    transition: transform .25s ease, visibility .25s;
  }
  .app-sidebar.open { transform: none; visibility: visible; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 35; display: block; background: rgba(0, 0, 0, .6); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
  .sidebar-backdrop.open { opacity: 1; pointer-events: auto; }
  .app-main { margin-left: 0; }
  .mobile-menu { display: inline-grid; }
  .app-topbar { padding: 12px 20px; }
  .app-content { padding: 20px 20px 48px; }
  .editor-page .app-content { padding: 16px 20px 32px; }
  .editor-shell { grid-template-columns: minmax(0, 1fr); grid-template-areas: "canvas" "transcript" "style" "timeline"; }
  .editor-canvas { min-height: 0; }
  .settings-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .settings-nav a, .settings-nav button { flex: none; }
  .legal-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .legal-layout aside { position: static; flex-direction: row; flex-wrap: wrap; }
  .public-nav-links { display: none; }
  .public-nav { justify-content: space-between; }
  .auth-page { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
  .auth-form > .app-logo { display: inline-flex; }
  .public-footer-main { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .app-topbar { gap: 10px; padding: 10px 16px; }
  .page-title { font-size: 17px; }
  .top-actions { gap: 8px; }
  .top-actions .region-button,
  .top-actions .icon-button { display: none; }
  .top-actions .secondary-button + .primary-button { padding: 0 14px; }
  .top-actions .secondary-button:has(+ .primary-button) { display: none; }
  .app-content, .editor-page .app-content { padding: 16px 16px 40px; }
  .panel, .settings-section { padding: 18px; }
  .metric-grid { gap: 10px; }
  .metric-card { padding: 16px; }
  .metric-card strong { font-size: 28px; }
  .metric-card strong.metric-text { font-size: 20px; line-height: 1.4; }
  .roadmap-banner { flex-direction: column; align-items: flex-start; padding: 16px 18px; }
  .project-table, .project-table tbody { display: block; }
  .project-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
  .project-table tr:first-child { border-top: 0; padding-top: 0; }
  .project-table td { padding: 0; border: 0; }
  .project-table td:nth-child(2) { align-self: center; }
  .project-table td:last-child { display: none; }
  .form-row, .upload-options { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .settings-section > .form-row:last-child .field:not(:last-child) { margin-bottom: 16px; }
  .upload-options { gap: 10px; }
  .template-app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .template-app-card footer { padding: 10px 4px 2px; }
  .template-toolbar .search { flex: 1 1 100%; }
  .team-row { grid-template-columns: 40px minmax(0, 1fr) 36px; }
  .team-row select { grid-column: 2 / 3; grid-row: 2; }
  .team-row .row-menu { grid-column: 3; grid-row: 1; }
  .editor-video { height: min(460px, 70vh); }
  .editor-canvas { padding: 60px 12px 20px; }
  .pricing-public, .public-footer { width: calc(100% - 32px); }
  .public-nav { padding: 10px 10px 10px 16px; }
  .public-nav .secondary-button { display: none; }
  .public-nav .region-button span { display: none; }
  .pricing-hero { padding: 56px 0 36px; }
  .pricing-hero p { font-size: 16px; }
  .public-price-card { padding: 24px; }
  .legal-hero { padding: 56px 0 28px; }
  .legal-layout article section { padding: 22px; }
  .public-footer-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-options { flex-wrap: wrap; }
}

@media (max-width: 360px) {
  .template-app-grid { grid-template-columns: minmax(0, 1fr); }
  .public-nav .region-button { display: none; }
}
