:root {
  --bg: #fbfbfd;
  --surface: #ffffff;
  --surface-alt: #f5f5f7;
  --text: #1d1d1f;
  --text-sec: #6e6e73;
  --border: #e5e5ea;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --cyan: #00b8d9;
  --danger: #d93025;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

.brand-logo { height: 32px; margin-bottom: 18px; }
.brand-logo-sm { height: 24px; display: block; }

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--blue);
  margin: 0 0 6px;
}

.sub { color: var(--text-sec); font-size: 14px; line-height: 1.5; margin: 0 0 18px; }
.sub-sm { color: var(--text-sec); font-size: 13px; margin: 4px 0 0; }

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.04);
}

.auth-card h1 { margin: 0 0 8px; font-size: 24px; letter-spacing: -0.02em; }

.stack { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; }

input, select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
}

input:focus, select:focus {
  outline: 2px solid rgba(0, 113, 227, 0.25);
  border-color: var(--blue);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}

.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); }
.btn-secondary { background: var(--surface-alt); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #ebebef; }
.btn-sm { padding: 8px 12px; font-size: 12.5px; }
.btn-link {
  background: none; border: none; color: var(--text-sec); cursor: pointer; font-size: 12.5px; padding: 4px 0; text-align: left;
}

.divider {
  display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--text-sec); font-size: 12px;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.msg-error { color: var(--danger); font-size: 13px; margin: 12px 0 0; }
.msg-ok { color: #166534; background: #dcfce7; border: 1px solid #bbf7d0; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin: 12px 0 0; }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 18px;
}

.auth-tab {
  border: none;
  background: transparent;
  color: var(--text-sec);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 10px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.guide-banner {
  background: #09090b;
  color: #ffffff;
  border-radius: 16px;
  padding: 20px 22px;
  border: 1px solid #27272a;
}

.guide-banner h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.guide-banner p {
  margin: 0 0 14px;
  color: #a1a1aa;
  font-size: 13.5px;
  line-height: 1.5;
}

.guide-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.guide-step {
  background: #141417;
  border: 1px solid #27272a;
  border-radius: 12px;
  padding: 12px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #e4e4e7;
}

.guide-step strong {
  display: block;
  color: #38bdf8;
  margin-bottom: 4px;
  font-size: 12px;
}

.subtabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.subtab-btn {
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-sec);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.subtab-btn.active {
  background: var(--text);
  color: #ffffff;
  border-color: var(--text);
}

.viral-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.viral-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.viral-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.badge-matrix {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 113, 227, 0.1);
  color: var(--blue);
}

.step-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.note-box {
  font-size: 13px;
  color: var(--text-sec);
  background: #f0f7ff;
  border: 1px solid #cce3ff;
  border-radius: 10px;
  padding: 10px 12px;
  line-height: 1.5;
}

.app-shell {
  display: grid;
  grid-template-columns: 256px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-head { display: flex; flex-direction: column; gap: 10px; padding: 0 4px; }

.plan-pill {
  display: inline-block;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
}

.plan-pill.paid { background: rgba(0, 113, 227, 0.1); color: var(--blue); border-color: rgba(0, 113, 227, 0.25); }

.nav-list { display: flex; flex-direction: column; gap: 4px; flex: 1; }

.nav-btn {
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.nav-btn:hover { background: var(--surface-alt); }
.nav-btn.active { background: var(--text); color: #fff; font-weight: 600; }

.sidebar-foot {
  border-top: 1px solid var(--border);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-email { font-size: 12px; color: var(--text-sec); margin: 0; word-break: break-all; }

.workspace {
  display: flex;
  flex-direction: column;
  padding: 28px 36px;
  max-width: 1280px;
  width: 100%;
}

.top-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.top-bar h2 { margin: 0; font-size: 24px; letter-spacing: -0.02em; }
.tab-body { flex: 1; display: flex; flex-direction: column; gap: 18px; }

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.chips { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
}

.chip.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.chip.locked { opacity: 0.65; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card.locked { background: var(--surface-alt); }

.card-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card-title { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.35; }
.card-text { margin: 0; font-size: 13px; color: var(--text-sec); line-height: 1.5; }

.video-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 10px;
  background: #111;
}

.lock-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 600px;
}

.workflow-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

pre.prompt-out {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.5;
  margin: 0;
}

audio { width: 100%; height: 34px; }

.app-footer {
  margin-top: 36px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-sec);
}
.app-footer a { color: var(--blue); text-decoration: none; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(29, 29, 31, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal-card {
  background: var(--surface);
  border-radius: 18px;
  padding: 26px;
  width: 100%;
  max-width: 440px;
  border: 1px solid var(--border);
}

.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.modal-head h3 { margin: 0; font-size: 19px; }
.btn-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-sec); }

@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .nav-list { flex-direction: row; flex-wrap: wrap; }
  .workspace { padding: 20px 16px; }
}
