/* Retakeless — hand-authored CSS (replaces Tailwind).
 * Sourced from the NEW LAYOUT prototype; one stylesheet for both
 * the public landing and every authenticated surface. Designer
 * tweak panels / Figma-canvas wrappers stripped. */

/* ============ DESIGN SYSTEM ============ */
:root {
  --bg: #ffffff;
  --bg-soft: #f7f7f5;
  --bg-card: #fbfbfa;
  --line: #e8e6e0;
  --line-strong: #d4d2cc;
  --ink: #14161c;
  --ink-2: #2a2e3a;
  --ink-3: #5b6172;
  --ink-4: #8a8f9d;

  /* Accent palette — "forest" per the designer's default tweak.
   * The var names keep the legacy "indigo" label so every call site
   * references --indigo-* regardless of which palette ships. */
  --indigo: #15803d;
  --indigo-600: #166534;
  --indigo-50: #ecfdf5;
  --indigo-100: #d1fae5;
  --indigo-soft: rgba(21, 128, 61, 0.08);
  --indigo-grad: #bbf7d0;  /* gradient partner for .avatar / .nav-user .av */

  /* Job status colors */
  --slate: #64748b;     --slate-bg: #f1f5f9;
  --amber: #d97706;     --amber-bg: #fef3c7;
  --sky: #0284c7;       --sky-bg: #e0f2fe;
  --indigo-s: #15803d;  --indigo-s-bg: #ecfdf5;
  --violet: #7c3aed;    --violet-bg: #f3e8ff;
  --emerald: #059669;   --emerald-bg: #d1fae5;
  --rose: #e11d48;      --rose-bg: #ffe4e6;

  --sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  font-feature-settings: "ss01", "cv11";
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body > main, body > .auth-wrap, body > .app-main { flex: 1; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -0.02em; line-height: 1.08; font-weight: 700; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 32px; }
.narrow { max-width: 920px; margin: 0 auto; padding: 0 32px; }

/* ============ BRAND ============ */
.brand { display: inline-flex; align-items: baseline; font-weight: 800; letter-spacing: -0.02em; font-size: 22px; color: var(--ink); }
.brand .r {
  color: var(--indigo);
  font-weight: 900;
  font-size: 26px;
  line-height: 1;
  margin-right: 1px;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 10px; font-family: inherit; font-size: 14px;
  font-weight: 600; cursor: pointer; border: 1px solid transparent;
  transition: transform 80ms ease, background 120ms ease, border-color 120ms ease;
  white-space: nowrap; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--indigo); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 1px 2px rgba(21,128,61,0.4); }
.btn-primary:hover { background: var(--indigo-600); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--bg-soft); border-color: var(--ink-4); color: var(--ink); }
.btn-emerald { background: var(--emerald); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset; }
.btn-emerald:hover { background: #047857; color: #fff; }
.btn-lg { padding: 13px 22px; font-size: 15px; border-radius: 11px; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 8px; }
.btn-wide { width: 100%; padding: 12px 18px; }
.btn-disabled, .btn[disabled] {
  background: var(--bg-soft); color: var(--ink-4); border-color: var(--line);
  cursor: not-allowed; pointer-events: none;
}

/* ============ NAV ============ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; max-width: 1180px; margin: 0 auto; padding: 0 28px;
}
.nav-toggle {
  display: none; background: transparent; border: 0;
  /* 40×40 px tap target on mobile (Task #97). */
  min-width: 40px; min-height: 40px; padding: 8px 12px;
  font-size: 24px; line-height: 1;
  color: var(--ink-2); cursor: pointer;
}
.nav-close {
  /* Drawer close button — only visible inside the open drawer on mobile. */
  display: none; background: transparent; border: 0;
  min-width: 40px; min-height: 40px; padding: 6px 10px;
  font-size: 28px; line-height: 1;
  color: var(--ink-2); cursor: pointer;
  align-self: flex-end;
}
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { color: var(--ink-3); font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); }
.nav-links a.btn-primary { color: #fff; padding: 8px 14px; }
.nav-links a.btn-primary:hover { color: #fff; }
.nav-user {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 10px 6px 12px; border-radius: 999px;
  background: var(--bg-soft); border: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-2); font-weight: 500;
}
.nav-user .av {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo-grad), var(--indigo));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 11px;
}
.nav-links .nav-user .nav-user-link {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: inherit; cursor: pointer;
  white-space: nowrap; flex-shrink: 0;
}
.nav-links .nav-user .nav-user-link:hover { color: var(--ink); }
.nav-links .nav-user .nav-user-link .av { flex-shrink: 0; }
.nav-user form { margin: 0; }
.nav-user .logout-btn {
  background: transparent; border: 0; padding: 0;
  color: var(--ink-3); font-size: 12.5px; font-weight: 500;
  cursor: pointer; font-family: inherit;
}
.nav-user .logout-btn:hover { color: var(--ink); }

/* ============ FLASH / BANNERS ============ */
.flash-stack { position: fixed; top: 16px; right: 16px; display: grid; gap: 8px; z-index: 70; max-width: 360px; }
.flash {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 10px;
  background: #fff; border: 1px solid var(--line);
  box-shadow: 0 10px 20px -10px rgba(15,18,30,0.15);
  font-size: 13px; color: var(--ink-2);
}
.flash .ic { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.flash.success { border-left: 3px solid var(--emerald); }
.flash.success .ic { color: var(--emerald); }
.flash.error { border-left: 3px solid var(--rose); }
.flash.error .ic { color: var(--rose); }
.flash.info, .flash.debug { border-left: 3px solid var(--indigo); }
.flash.info .ic, .flash.debug .ic { color: var(--indigo); }
.flash.warning { border-left: 3px solid var(--amber); }
.flash.warning .ic { color: var(--amber); }
.flash .x { color: var(--ink-4); font-family: var(--mono); font-size: 14px; cursor: pointer; margin-left: auto; background: transparent; border: 0; padding: 0; }

.unverified {
  padding: 10px 28px;
  background: var(--amber-bg);
  border-bottom: 1px solid #f3d48a;
  color: #78350f;
  font-size: 13px;
  display: flex; align-items: center; gap: 10px;
}
.unverified a { color: #78350f; text-decoration: underline; font-weight: 600; }
.unverified .ic { width: 14px; height: 14px; }

/* ============ FORM / INPUT ============ */
.field { display: block; margin-bottom: 16px; }
.field label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--ink-2); margin-bottom: 6px;
}
.field .hint { font-size: 12px; color: var(--ink-4); margin-top: 6px; }
.input, input[type="text"].input, input[type="email"].input, input[type="password"].input, select.input, textarea.input {
  width: 100%; padding: 11px 13px;
  border: 1px solid var(--line-strong); border-radius: 9px;
  font-family: inherit; font-size: 14px; color: var(--ink);
  background: #fff; outline: none;
}
.input:focus, input.input:focus, textarea.input:focus, select.input:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 3px var(--indigo-soft);
}
.input.err { border-color: var(--rose); }
.err-msg { color: var(--rose); font-size: 12.5px; margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.errorlist { margin: 4px 0 0; padding: 0; list-style: none; color: var(--rose); font-size: 12.5px; }

/* ============ CARD + KICKER ============ */
.card {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--indigo); font-weight: 600;
  margin-bottom: 16px;
}
.kicker::before { content: ""; width: 16px; height: 1.5px; background: var(--indigo); }
.mono { font-family: var(--mono); }
.tag {
  display: inline-flex; align-items: center;
  padding: 3px 8px; border-radius: 5px;
  background: var(--bg-soft); border: 1px solid var(--line);
  color: var(--ink-3); font-family: var(--mono);
  font-size: 10.5px; letter-spacing: 0.04em; font-weight: 500;
}

/* ============ STATUS BADGE ============ */
.status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.status .dot { width: 7px; height: 7px; border-radius: 50%; }
.status.pending, .status.pending_payment, .status.slate { background: var(--slate-bg); color: var(--slate); }
.status.pending .dot, .status.pending_payment .dot, .status.slate .dot { background: var(--slate); }
.status.uploading, .status.amber { background: var(--amber-bg); color: var(--amber); }
.status.uploading .dot, .status.amber .dot { background: var(--amber); animation: pulse 1.4s infinite; }
.status.uploaded, .status.sky { background: var(--sky-bg); color: var(--sky); }
.status.uploaded .dot, .status.sky .dot { background: var(--sky); }
.status.queued, .status.indigo { background: var(--indigo-s-bg); color: var(--indigo-s); }
.status.queued .dot, .status.indigo .dot { background: var(--indigo-s); }
.status.processing, .status.violet { background: var(--violet-bg); color: var(--violet); }
.status.processing .dot, .status.violet .dot { background: var(--violet); animation: pulse 1.2s infinite; }
.status.completed, .status.emerald { background: var(--emerald-bg); color: var(--emerald); }
.status.completed .dot, .status.emerald .dot { background: var(--emerald); }
.status.failed, .status.rose { background: var(--rose-bg); color: var(--rose); }
.status.failed .dot, .status.rose .dot { background: var(--rose); }
.status.refunded { background: var(--slate-bg); color: var(--slate); }
.status.refunded .dot { background: var(--slate); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============ DIVIDER ============ */
.div-or {
  display: flex; align-items: center; gap: 14px; margin: 18px 0;
  color: var(--ink-4); font-size: 11.5px; font-family: var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
}
.div-or::before, .div-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ============ AUTH LAYOUT ============ */
.auth-wrap {
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: var(--bg-soft);
}
.auth-main {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 40px 28px;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: 0 20px 40px -20px rgba(15,18,30,0.1);
}
.auth-card .h {
  font-size: 26px; font-weight: 800; letter-spacing: -0.025em;
  margin-bottom: 8px;
}
.auth-card .sub { color: var(--ink-3); font-size: 14px; margin-bottom: 28px; }
.auth-card .foot-text {
  text-align: center; margin-top: 20px;
  font-size: 13px; color: var(--ink-3);
}
.auth-card .foot-text a { color: var(--indigo); font-weight: 600; }

.btn-google {
  width: 100%; padding: 11px; border-radius: 9px;
  background: #fff; color: var(--ink);
  border: 1px solid var(--line-strong);
  font-family: inherit; font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  cursor: pointer;
}
.btn-google:hover { background: var(--bg-soft); }
.g-ic { width: 16px; height: 16px; }

/* Success badge (password reset done, email confirm) */
.success-badge {
  width: 52px; height: 52px; margin: 0 auto 16px;
  border-radius: 13px; background: var(--emerald-bg); color: var(--emerald);
  display: flex; align-items: center; justify-content: center;
}

/* ============ DASHBOARD / APP LAYOUT ============ */
.app-main { padding: 40px 28px; background: var(--bg-soft); min-height: calc(100vh - 64px); }
.app-wrap { max-width: 1000px; margin: 0 auto; }

.page-head { margin-bottom: 28px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.page-head .h { font-size: 32px; font-weight: 800; letter-spacing: -0.025em; }
.page-head .sub { color: var(--ink-3); font-size: 15px; margin-top: 6px; }

/* credits card */
.credits-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.credits-card.empty { background: linear-gradient(180deg, #fff 0%, #ecfdf5 100%); border-color: #a7f3d0; }
.credits-card.has { background: linear-gradient(180deg, #fff 0%, var(--indigo-50) 100%); border-color: var(--indigo-100); }
.credits-label {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-3); font-weight: 600;
  margin-bottom: 8px;
}
.credits-val {
  font-size: 38px; font-weight: 800; letter-spacing: -0.03em;
  line-height: 1;
}
.credits-val .unit { font-size: 15px; font-weight: 500; color: var(--ink-4); margin-left: 8px; letter-spacing: 0; }

/* jobs list */
.jobs-list {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.jobs-head {
  padding: 16px 22px; border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-4); font-weight: 500;
  display: grid; grid-template-columns: 2.2fr 0.9fr 1.2fr 1fr auto;
  gap: 20px; background: var(--bg-soft);
}
.job-row {
  padding: 18px 22px; border-bottom: 1px solid var(--line);
  display: grid; grid-template-columns: 2.2fr 0.9fr 1.2fr 1fr auto;
  gap: 20px; align-items: center;
  color: inherit;
}
.job-row:last-child { border-bottom: none; }
.job-row:hover { background: var(--bg-soft); }
.job-title { font-weight: 600; font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-meta { font-size: 12px; color: var(--ink-4); font-family: var(--mono); }
.job-dur { font-family: var(--mono); font-size: 13px; color: var(--ink-2); }
.job-time { font-family: var(--mono); font-size: 12.5px; color: var(--ink-3); }

.empty-jobs {
  padding: 56px 22px; text-align: center; color: var(--ink-3);
}
.empty-jobs .title { font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }

/* ============ UPLOAD PAGE ============ */
.upload-grid {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: start;
}
.dropzone {
  border: 2px dashed var(--line-strong); border-radius: var(--radius-lg);
  background: #fff;
  padding: 48px 24px;
  text-align: center;
  position: relative;
  transition: border-color 120ms;
}
.dropzone:hover { border-color: var(--indigo); background: var(--indigo-50); }
.dropzone.has-file { border-style: solid; border-color: var(--indigo); background: var(--indigo-50); text-align: left; padding: 22px; }
.dz-ic {
  width: 44px; height: 44px; border-radius: 11px;
  background: var(--indigo-50); color: var(--indigo);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.dz-t { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.dz-s { color: var(--ink-3); font-size: 13px; margin-bottom: 16px; }
.dz-formats { font-family: var(--mono); font-size: 11px; color: var(--ink-4); }
.dropzone input[type="file"] {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
}

.file-row { display: flex; align-items: center; gap: 14px; }
.file-ic {
  width: 40px; height: 40px; border-radius: 9px;
  background: #fff; border: 1px solid var(--indigo-100);
  display: flex; align-items: center; justify-content: center;
  color: var(--indigo); flex-shrink: 0;
}
.file-name { font-weight: 600; font-size: 14px; margin-bottom: 2px; word-break: break-all; }
.file-size { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }

.progress {
  margin-top: 16px;
  height: 6px; background: var(--indigo-100); border-radius: 999px; overflow: hidden;
}
.progress .bar {
  height: 100%; background: var(--indigo);
  border-radius: 999px;
  background-image: linear-gradient(45deg, rgba(255,255,255,0.2) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.2) 50%, rgba(255,255,255,0.2) 75%, transparent 75%);
  background-size: 16px 16px;
  animation: stripes 1s linear infinite;
  transition: width 200ms ease;
}
@keyframes stripes { 0% { background-position: 0 0; } 100% { background-position: 16px 0; } }

.progress-meta {
  display: flex; justify-content: space-between; margin-top: 8px;
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-3);
}

/* tier picker */
.tier-list { display: grid; gap: 10px; }
.tier {
  padding: 16px 18px; border: 1.5px solid var(--line);
  border-radius: 12px; cursor: pointer;
  display: flex; align-items: center; gap: 14px;
  background: #fff;
  transition: border-color 120ms;
}
.tier:hover { border-color: var(--ink-4); }
.tier.selected { border-color: var(--indigo); background: var(--indigo-50); }
.tier.disabled { opacity: 0.5; cursor: not-allowed; background: var(--bg-soft); }
.tier input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.tier .radio {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--line-strong); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.tier.selected .radio { border-color: var(--indigo); }
.tier.selected .radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--indigo); }
.tier-info { flex: 1; }
.tier-dur { font-size: 14px; font-weight: 600; }
.tier-best { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.tier-price { font-size: 16px; font-weight: 700; }

/* ============ JOB DETAIL ============ */
.job-card { padding: 32px; }
.job-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.job-hero h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 8px; word-break: break-all; }
.job-kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 20px 0; }
.job-kv.kv-4 { grid-template-columns: repeat(4, 1fr); }
.kv-label { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-4); font-weight: 500; margin-bottom: 4px; }
.kv-val { font-size: 14px; font-weight: 600; color: var(--ink); }
.kv-val.mono { font-family: var(--mono); font-weight: 500; }

.status-panel {
  margin-top: 8px; padding: 20px 24px;
  background: var(--bg-soft); border-radius: 12px; border: 1px solid var(--line);
}
.status-panel.completed { background: #ecfdf5; border-color: #a7f3d0; }
.status-panel.failed { background: #fff1f2; border-color: #fecdd3; }
.status-panel.processing { background: #f5f3ff; border-color: #ddd6fe; }
.status-panel .copy { font-size: 14px; color: var(--ink-2); margin-bottom: 14px; }
.status-panel .copy strong { color: var(--ink); }

/* job status badge row — right-aligned on desktop, centered on mobile */
.job-status-row { display: flex; justify-content: flex-end; margin-bottom: 4px; }

/* progress stepper */
.stepper { display: flex; gap: 0; margin: 16px 0 24px; }
.stepper .s {
  flex: 1; display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  position: relative;
}
.stepper .s + .s { border-left: 1px solid var(--line); }
.stepper .s .n {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--bg-soft); border: 1.5px solid var(--line-strong);
  color: var(--ink-3);
  font-size: 11px; font-weight: 700; font-family: var(--mono);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stepper .s .lbl { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.stepper .s.done .n { background: var(--emerald); border-color: var(--emerald); color: #fff; }
.stepper .s.done .lbl { color: var(--ink-2); }
.stepper .s.active .n { background: var(--indigo); border-color: var(--indigo); color: #fff; animation: pulse 1.6s infinite; }
.stepper .s.active .lbl { color: var(--ink); font-weight: 600; }

/* ============ PRICING / CREDITS PAGE ============ */
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tier-card {
  background: #fff; border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  display: flex; flex-direction: column;
}
.tier-card.featured { border-color: var(--indigo); box-shadow: 0 0 0 4px var(--indigo-soft); }
.tier-card.disabled { opacity: 0.55; background: var(--bg-soft); }
.tier-card .pop {
  position: absolute; top: -11px; left: 20px;
  background: var(--indigo); color: #fff;
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
}
.tier-card .dur { font-size: 14px; font-weight: 600; color: var(--ink-3); margin-bottom: 12px; }
.tier-card .price { font-size: 38px; font-weight: 800; letter-spacing: -0.03em; }
.tier-card .price .per { font-size: 13px; font-weight: 500; color: var(--ink-4); margin-left: 4px; }
.tier-card .feat-list { margin: 20px 0; padding: 0; list-style: none; font-size: 13.5px; color: var(--ink-2); display: grid; gap: 8px; flex: 1; }
.tier-card .feat-list li { display: flex; align-items: flex-start; gap: 8px; }
.tier-card .feat-list .ck { color: var(--emerald); font-weight: 700; }
.tier-card form { margin: 0; }

/* ============ LEGAL PAGE ============ */
.legal-main { padding: 48px 28px; background: var(--bg-soft); min-height: calc(100vh - 64px); }
.legal-wrap {
  max-width: 720px; margin: 0 auto;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 48px 56px;
}
.legal-wrap .h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.025em; margin-bottom: 6px; }
.legal-wrap .eff { font-family: var(--mono); font-size: 11.5px; color: var(--ink-4); letter-spacing: 0.04em; margin-bottom: 32px; }
.legal-wrap h2 { font-size: 17px; margin: 28px 0 10px; font-weight: 700; color: var(--ink); }
.legal-wrap p, .legal-wrap li { font-size: 14.5px; color: var(--ink-2); line-height: 1.65; }
.legal-wrap p + p { margin-top: 10px; }
.legal-wrap ul, .legal-wrap ol { padding-left: 20px; margin: 10px 0; }
.legal-wrap ul li + li, .legal-wrap ol li + li { margin-top: 4px; }
.legal-wrap .draft-banner {
  padding: 12px 16px; border-radius: 10px; margin: 18px 0 24px;
  background: var(--amber-bg); border: 1px solid #f3d48a;
  color: #78350f; font-size: 12.5px;
}

/* ============ ERROR PAGES ============ */
.err-wrap {
  min-height: calc(100vh - 64px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 28px; background: var(--bg-soft);
}
.err-card { max-width: 480px; text-align: center; }
.err-code {
  font-family: var(--mono); font-size: 100px; font-weight: 700;
  letter-spacing: -0.04em; line-height: 1; color: var(--ink);
  margin-bottom: 16px;
}
.err-code span + span { margin-left: 4px; }
.err-code .dig { color: var(--indigo); }
.err-title { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 10px; }
.err-sub { color: var(--ink-3); font-size: 15px; margin-bottom: 28px; line-height: 1.5; }
.err-meta { font-family: var(--mono); font-size: 11.5px; color: var(--ink-4); margin-top: 20px; letter-spacing: 0.04em; }

/* ============ LANDING ============ */
.hero { padding: 80px 0 90px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.15fr); gap: 64px; align-items: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 8px; border-radius: 999px;
  background: var(--indigo-50); color: var(--indigo-600);
  font-size: 12px; font-weight: 600; letter-spacing: 0.01em;
  border: 1px solid var(--indigo-100);
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--indigo); }

.h1 {
  font-size: 64px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.02;
  margin: 22px 0 22px;
}
.h1 .accent {
  background: linear-gradient(180deg, transparent 60%, var(--indigo-100) 60%);
  padding: 0 4px;
}
.lede { font-size: 19px; line-height: 1.55; color: var(--ink-3); max-width: 540px; margin-bottom: 32px; }
.cta-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.cta-meta { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 13px; margin-top: 18px; }
.cta-meta .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--indigo); }

/* Demo card */
.demo {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 0 #fff inset, 0 30px 60px -30px rgba(15, 18, 30, 0.18), 0 12px 24px -12px rgba(15, 18, 30, 0.08);
  overflow: hidden;
  position: relative;
}
.demo-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.demo-dots { display: flex; gap: 6px; }
.demo-dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--line-strong); }
.demo-title {
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-3);
  flex: 1; text-align: center; letter-spacing: 0.02em;
}
.demo-title b { color: var(--ink); font-weight: 600; }
.demo-body { padding: 20px 22px 22px; }

.track-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px; gap: 12px;
}
.track-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-3); font-weight: 600;
}
.track-label .tag {
  padding: 2px 7px; border-radius: 4px;
  background: var(--bg-soft); border: 1px solid var(--line);
  color: var(--ink-3); font-size: 9.5px; letter-spacing: 0.06em;
}
.track-label.accent { color: var(--indigo); }
.track-label.accent .tag { background: var(--indigo-50); border-color: var(--indigo-100); color: var(--indigo); }
.track-meta { font-family: var(--mono); font-size: 11px; color: var(--ink-4); }
.track-meta b { color: var(--ink-2); font-weight: 600; }

.tl {
  display: flex; height: 40px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--line); background: var(--bg-soft);
}
.tl .seg { position: relative; height: 100%; }
.tl .seg.kept { background: #15803d; }
.tl .seg.kept + .seg.kept { border-left: 1px solid rgba(255,255,255,0.22); }
.tl .seg.cut { background: #ffe4dc; }
.tl .seg.cut::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1.5px;
  background: #e85a44; transform: translateY(-50%); opacity: 0.6;
}

.ruler {
  display: flex; justify-content: space-between; margin-top: 6px;
  font-family: var(--mono); font-size: 10px; color: var(--ink-4); letter-spacing: 0.04em;
}
.ruler span { position: relative; padding-top: 5px; }
.ruler span::before {
  content: ""; position: absolute; top: 0; left: 50%; width: 1px; height: 3px; background: var(--line-strong);
}
.ruler span:first-child::before { left: 0; }
.ruler span:last-child::before { left: auto; right: 0; }

.demo-arrow { display: flex; align-items: center; gap: 10px; margin: 18px 0 16px; }
.demo-arrow .l { flex: 1; height: 1px; background: var(--line); }
.demo-arrow .chip {
  padding: 5px 12px; border-radius: 999px;
  background: var(--indigo); color: #fff;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.04em; display: inline-flex; align-items: center; gap: 6px;
}

.legend { display: flex; gap: 16px; align-items: center; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend .sw.kept { background: #16a34a; }
.legend .sw.cut { background: #ffe4dc; border: 1px solid #ffd6c9; }

/* Sections */
.section { padding: 96px 0; border-top: 1px solid var(--line); }
.section.tinted { background: var(--bg-soft); }
.section-head { margin-bottom: 56px; }
.h2 { font-size: 44px; font-weight: 800; letter-spacing: -0.025em; max-width: 640px; }
.h2-sub { color: var(--ink-3); font-size: 17px; margin-top: 14px; max-width: 560px; line-height: 1.55; }

/* How-it-works steps */
.steps { max-width: 760px; margin: 0 auto; position: relative; }
.steps::before {
  content: ""; position: absolute; left: 31px; top: 40px; bottom: 40px;
  width: 2px; background: linear-gradient(180deg, var(--indigo) 0%, var(--indigo-100) 100%);
  border-radius: 2px;
}
.step { display: grid; grid-template-columns: 64px 1fr; gap: 24px; padding: 18px 0; position: relative; }
.step + .step { margin-top: 18px; }
.step-num {
  width: 64px; height: 64px; border-radius: 50%;
  background: #fff; border: 2px solid var(--indigo);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: var(--indigo);
  z-index: 1; box-shadow: 0 0 0 6px var(--bg-soft);
}
.step-body { padding-top: 12px; }
.step-title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 8px; }
.step-desc { color: var(--ink-3); font-size: 15.5px; line-height: 1.6; max-width: 520px; }

/* Pricing table (landing) */
.price-head { text-align: center; margin-bottom: 40px; }
.price-head .h2 { margin: 0 auto; }
.price-head .h2-sub { margin: 14px auto 0; }
.free-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--ink); color: #fff;
  font-size: 12px; font-weight: 600;
  margin-top: 18px;
}
.free-badge .star { color: #ffd86b; }
.price-table {
  max-width: 820px; margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
}
.price-row { display: grid; grid-template-columns: 1.4fr 0.9fr 1.6fr 1fr; align-items: center; }
.price-row + .price-row { border-top: 1px solid var(--line); }
.price-row.head { background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.price-cell { padding: 22px 22px; }
.price-row.head .price-cell {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-4); padding: 14px 22px; font-weight: 500;
}
.price-row.head .price-cell:nth-child(2),
.price-row.head .price-cell:nth-child(3) { text-align: center; }
.price-row.head .price-cell:nth-child(4) { text-align: right; }
.dur { font-size: 16px; font-weight: 600; }
.price { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; text-align: center; }
.price .per { font-size: 13px; font-weight: 500; color: var(--ink-4); margin-left: 2px; }
.best { text-align: center; color: var(--ink-3); font-size: 14px; }
.price-action { text-align: right; }
.price-row.featured { background: linear-gradient(180deg, var(--indigo-50) 0%, transparent 100%); position: relative; }
.price-row.featured .price { color: var(--indigo); }
.featured-tag {
  position: absolute; top: 10px; left: 22px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; font-weight: 700; color: var(--indigo);
}

/* Testimonials */
.test-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; }
.test { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 32px; background: #fff; }
.test.featured { background: linear-gradient(180deg, #fff 0%, var(--indigo-50) 100%); border-color: var(--indigo-100); }
.test .quote-mark { color: var(--indigo); font-size: 56px; line-height: 0.7; font-weight: 800; margin-bottom: 12px; font-family: Georgia, serif; }
.test.featured .body { font-size: 22px; line-height: 1.45; color: var(--ink); font-weight: 500; letter-spacing: -0.01em; margin-bottom: 28px; }
.test.small { padding: 22px; }
.test.small .body { font-size: 15px; line-height: 1.5; color: var(--ink-2); margin-bottom: 18px; }
.test-author { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo-grad), var(--indigo));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px; flex-shrink: 0;
}
.test.small .avatar { width: 34px; height: 34px; font-size: 13px; }
.test-name { font-weight: 600; font-size: 15px; }
.test.small .test-name { font-size: 13px; }
.test-meta { color: var(--ink-4); font-size: 12.5px; font-family: var(--mono); }
.test-stack { display: grid; grid-template-rows: 1fr 1fr; gap: 24px; }

/* FAQ */
.faq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 36px 56px; }
.faq-q { display: flex; gap: 12px; align-items: baseline; margin-bottom: 10px; }
.faq-q .marker { font-family: var(--mono); font-size: 13px; color: var(--indigo); font-weight: 700; }
.faq-q .text { font-size: 16.5px; font-weight: 600; letter-spacing: -0.005em; }
.faq-a { color: var(--ink-3); font-size: 14.5px; line-height: 1.6; padding-left: 28px; }

/* Footer */
.footer { padding: 36px 0 48px; border-top: 1px solid var(--line); background: var(--bg); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; max-width: 1180px; margin: 0 auto; padding: 0 32px; flex-wrap: wrap; gap: 12px; }
.footer-brand { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 13px; }
.footer-brand .brand-mark {
  width: 22px; height: 22px; font-size: 11px; border-radius: 6px;
  background: var(--indigo); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 900;
}
.footer-links { display: flex; gap: 28px; }
.footer-links a { color: var(--ink-3); font-size: 13px; }
.footer-links a:hover { color: var(--ink); }

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .h1 { font-size: 52px; }
  .hero { padding: 56px 0 64px; }
  .upload-grid { grid-template-columns: 1fr; }
  .price-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .job-status-row { justify-content: center; }
  /* Mobile navbar (Task #97 §A): hamburger pinned to the right end of
     the bar; .nav-links collapses to a full-height right-side drawer.
     `display: none` (not transform) when closed — Chromium's
     scrollWidth picks up offscreen elements positioned via transform
     even with overflow-clip, breaking the no-h-scroll assertion. */
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .nav-close { display: inline-flex; align-items: center; justify-content: center; }

  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column; align-items: stretch; gap: 4px;
    position: fixed; top: 0; right: 0;
    width: min(320px, 88vw);
    /* Both for older / iOS browsers without dvh, and the dynamic
       viewport for the rest. */
    height: 100vh;
    height: 100dvh;
    background: #fff;
    border-left: 1px solid var(--line);
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.08);
    padding: 12px 18px 24px;
    z-index: 100;
    overflow-y: auto;
  }

  /* Override any sibling `.nav-links a {…}` defaults; we want every
     anchor inside the open drawer to render as a tappable list item.
     Specificity: `.nav-links.open a` (.0.2.1) beats `.nav-links a`
     (.0.1.1). */
  .nav-links.open a {
    display: flex; align-items: center;
    min-height: 44px; padding: 10px 8px;
    font-size: 16px;
  }
  .nav-links.open a.btn-primary {
    margin-top: auto; justify-content: center;
    padding: 12px 14px; font-size: 16px;
  }

  /* Authed avatar+email block: stack inside the drawer instead of the
     pill the desktop layout uses. */
  .nav-links.open .nav-user {
    display: flex; flex-direction: column; align-items: stretch; gap: 4px;
    padding: 0; background: transparent; border: 0; border-radius: 0;
  }
  .nav-links.open .nav-user .nav-user-link {
    flex-direction: row; align-items: center; gap: 10px;
    min-height: 48px; padding: 10px 8px; white-space: normal;
    border-bottom: 1px solid var(--line);
  }
  .nav-links.open .nav-user .nav-user-link .nav-user-email {
    overflow: hidden; text-overflow: ellipsis;
  }
  .nav-links.open .nav-user form { display: flex; margin: 0; }
  .nav-links.open .nav-user .logout-btn {
    width: 100%; text-align: left; padding: 10px 8px;
    font-size: 16px; min-height: 44px;
  }

  /* Existing responsive bits — preserved. */
  .job-kv, .job-kv.kv-4 { grid-template-columns: repeat(2, 1fr); }
  .jobs-head { display: none; }
  .job-row { grid-template-columns: 1fr; gap: 6px; padding: 14px 18px; }
  .test-grid, .faq-grid { grid-template-columns: 1fr; }
  .price-row, .price-row.head { grid-template-columns: 1fr; gap: 4px; }
  .price-row.head { display: none; }
  .price-cell { padding: 14px 18px; }
  /* Featured row badge is position:absolute top:10px; on mobile the
     stacked cells leave no room above the first cell so the badge
     overlaps "Up to N minutes". Push the whole row down to clear it. */
  .price-row.featured { padding-top: 32px; }
  /* Bigger, bolder duration label on mobile so it reads as the row header. */
  .price-row .dur { font-size: 19px; font-weight: 700; color: var(--ink); }
  .price-action, .best, .price { text-align: left; }
  .legal-wrap { padding: 28px 24px; }

  /* Footer (Task #97 §C kept from #96): centre both rows, breathe
     between them, give the legal links real tap separation. */
  .footer-inner { flex-direction: column; gap: 18px; text-align: center; }
  .footer-brand { justify-content: center; flex-wrap: wrap; }
  .footer-links { justify-content: center; flex-wrap: wrap; gap: 18px; }

  /* Pricing card "MOST POPULAR" badge (Task #97 §B kept from #96). */
  .tier-card.featured { padding-top: 36px; }

  /* Stepper (Task #97 §D): four steps × default padding overflow at
     375px. Stack the label below the icon — keeps each label fully
     readable instead of single-char ellipsis. */
  .stepper .s {
    flex-direction: column; align-items: center; text-align: center;
    padding: 8px 4px; gap: 4px; min-width: 0;
  }
  .stepper .s .lbl { font-size: 11px; line-height: 1.2; }
}
@media (max-width: 640px) {
  .h1 { font-size: 40px; }
  .h2 { font-size: 32px; }
  .wrap { padding: 0 20px; }
}
