/* ============================================================
   SplitFace — shared design tokens & components (mockups)
   Brand: CareerOS consumer GREEN colorway, TikTok-adjacent energy
   ============================================================ */
/* Plus Jakarta Sans is vendored locally (vendor/fonts/) and loaded via
   <link> in index.html — no CDN font dependency at runtime. */

:root {
  /* Brand — fresh greens */
  --green-50:  #ECFDF5;
  --green-100: #D1FAE5;
  --green-200: #A7F3D0;
  --green-500: #10B981;
  --green-600: #0E9F6E;
  --green-700: #047857;
  --green-800: #065F46;
  --green-900: #064E3B;
  --deep:     #0B241C;   /* deep green-black for hero bands */
  --lime-300: #BEF264;   /* playful pop accent */
  --lime-200: #D9F99D;

  /* Neutrals */
  --ink:     #101F18;
  --ink-2:   #2C3E35;
  --muted:   #5F7168;
  --faint:   #8AA093;
  --line:    #E3EDE7;
  --bg:      #F5F9F6;
  --card:    #FFFFFF;

  /* Feedback */
  --red-600: #DC2626;
  --red-50:  #FEF2F2;
  --amber-500: #F59E0B;
  --amber-50:  #FFFBEB;

  /* Shape */
  --r-xl: 24px;
  --r-lg: 18px;
  --r-md: 14px;
  --r-sm: 10px;
  --pill: 999px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(11, 36, 28, .06);
  --shadow-md: 0 6px 20px -6px rgba(11, 36, 28, .14);
  --shadow-lg: 0 18px 44px -12px rgba(11, 36, 28, .22);
  --shadow-green: 0 10px 26px -8px rgba(14, 159, 110, .55);

  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* Visible keyboard focus on every interactive element (a11y) */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--lime-300);
  outline-offset: 2px;
  border-radius: 6px;
}
.preview-shell a:focus-visible,
.preview-shell button:focus-visible,
.upgrade-card a:focus-visible,
.upgrade-card button:focus-visible,
.m-pro-strip button:focus-visible,
.pro-nudge button:focus-visible {
  outline-color: var(--lime-300);
}
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
a { color: inherit; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 28px; }

/* ---------- App header (compact) ---------- */
.app-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.app-header .wrap {
  display: flex; align-items: center; gap: 14px;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -0.02em; }
.brand-home { text-decoration: none; cursor: pointer; }

/* License key unlock (free export panel) */
.key-details{margin-top:14px;border-top:1px solid var(--line);padding-top:12px}
.key-details summary{cursor:pointer;font-weight:700;font-size:14px;color:var(--muted)}
.key-details summary:hover{color:var(--ink)}
.key-row{display:flex;gap:8px;margin-top:10px}
.key-input{flex:1;min-width:0;padding:10px 12px;border:1.5px solid var(--line);border-radius:12px;font:inherit;font-size:14px;letter-spacing:.06em;text-transform:uppercase;background:#fff;color:var(--ink)}
.key-input:focus{outline:none;border-color:var(--green-500)}
.key-hint{font-size:12.5px;color:var(--muted);margin:8px 0 0}
.brand-mark {
  width: 34px; height: 34px; border-radius: 50%;
  background:
    linear-gradient(90deg, var(--green-500) 0 46%, #fff 46% 54%, var(--deep) 54% 100%);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.6), var(--shadow-sm);
  position: relative;
}
.brand-mark::after {
  content: ''; position: absolute; inset: 9px 9px;
  border-radius: 50%; background: rgba(255,255,255,.92);
  clip-path: polygon(30% 20%, 72% 20%, 72% 34%, 30% 34%, 30% 42%, 72% 42%, 72% 56%, 30% 56%, 30% 64%, 72% 64%, 72% 78%, 30% 78%);
  opacity: .9;
}
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 22px; font-size: 14px; font-weight: 600; color: var(--muted); }
.nav-links a:hover { color: var(--ink); }
.btn-pro {
  background: var(--deep); color: #fff; font-weight: 700; font-size: 14px;
  padding: 10px 18px; border-radius: var(--pill);
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: var(--shadow-sm);
}
.btn-pro .spark { color: var(--lime-300); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 700; font-size: 15px; border-radius: var(--pill);
  padding: 13px 26px; transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  line-height: 1.2;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--green-600); color: #fff; box-shadow: var(--shadow-green);
}
.btn-primary:hover { background: var(--green-700); }
.btn-dark { background: var(--deep); color: #fff; }
.btn-dark:hover { background: #12352a; }
.btn-ghost {
  background: #fff; color: var(--ink); border: 1.5px solid var(--line); box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { border-color: var(--green-500); }
.btn-lg { padding: 16px 34px; font-size: 16px; }
.btn-block { width: 100%; }

/* ---------- Hero (compact) ---------- */
.hero {
  background:
    radial-gradient(600px 300px at 12% 0%, rgba(190,242,100,.14), transparent 60%),
    radial-gradient(700px 380px at 88% 20%, rgba(16,185,129,.22), transparent 60%),
    var(--deep);
  color: #fff; border-radius: 0 0 36px 36px;
  padding: 56px 0 60px; position: relative; overflow: hidden;
}
.hero h1 {
  font-size: clamp(30px, 4vw, 44px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.08;
  max-width: 620px;
}
.hero h1 .hl { color: var(--lime-300); }
.hero p { color: rgba(255,255,255,.72); font-size: 17px; margin-top: 14px; max-width: 560px; }
.hero-badges { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--pill); padding: 8px 15px; font-size: 13px; font-weight: 600; color: rgba(255,255,255,.88);
}
.hero-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime-300); }
.hero-shape { position: absolute; right: -40px; top: -40px; width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(190,242,100,.25), transparent 70%); pointer-events: none; }

/* ---------- Section titles ---------- */
.section { padding: 44px 0 8px; }
.kicker { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--green-700); }
.h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin-top: 6px; }
.sub { color: var(--muted); font-size: 15px; margin-top: 6px; max-width: 640px; }

/* ---------- Upload slots ---------- */
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 24px; }
.slot {
  background: var(--card); border-radius: var(--r-lg);
  border: 2px dashed #C9D8CE;
  padding: 44px 28px; text-align: center;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
  position: relative;
  align-self: start;
}
.slot:hover { border-color: var(--green-500); }
.slot.dragover {
  border-color: var(--green-600); border-style: solid;
  box-shadow: 0 0 0 5px rgba(16,185,129,.16), var(--shadow-md);
  transform: translateY(-2px);
  background: var(--green-50);
}
.slot-tag {
  position: absolute; top: 16px; left: 16px;
  background: var(--deep); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .06em;
  padding: 6px 12px; border-radius: var(--pill);
}
.slot-tag.b { background: var(--green-700); }
.slot-icon {
  width: 64px; height: 64px; margin: 6px auto 18px; border-radius: 50%;
  background: var(--green-50); border: 1.5px solid var(--green-100);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; color: var(--green-700);
}
.slot.dragover .slot-icon { background: var(--green-600); color: #fff; border-color: var(--green-600); }
.slot h3 { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.slot .slot-sub { color: var(--muted); font-size: 14px; margin: 6px 0 20px; }
.slot .or { display: block; margin: 14px 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.slot-filled {
  border-style: solid; border-color: var(--green-200); padding: 0; overflow: hidden;
}
.slot-filled img.thumb { width: 100%; height: 230px; object-fit: cover; object-position: top center; }
.slot-filled .slot-foot {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: #fff; text-align: left;
}
.slot-filled .slot-foot .name { font-weight: 700; font-size: 14px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-filled .slot-foot .ok { color: var(--green-700); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.link-btn { color: var(--green-700); font-weight: 700; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Sample button row ---------- */
.sample-row { display: flex; align-items: center; gap: 14px; margin-top: 22px; }
.sample-row .divider { flex: 1; height: 1px; background: var(--line); }
.sample-row .or-text { color: var(--muted); font-size: 13px; font-weight: 700; }

/* ---------- How it works strip ---------- */
.steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 26px 0 64px;
}
.step {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 22px 22px; display: flex; gap: 16px; align-items: flex-start; box-shadow: var(--shadow-sm);
}
.step-num {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  background: var(--green-50); color: var(--green-700); font-weight: 800; font-size: 16px;
  display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--green-100);
}
.step h4 { font-size: 15px; font-weight: 800; }
.step p { font-size: 13.5px; color: var(--muted); margin-top: 4px; }

/* ---------- Editor ---------- */
.editor-layout {
  display: grid; grid-template-columns: 210px minmax(0, 1fr) 300px; gap: 26px;
  margin: 30px 0 70px; align-items: start;
}
.src-col { display: flex; flex-direction: column; gap: 16px; }
.src-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.src-card img { width: 100%; height: 150px; object-fit: cover; object-position: top center; }
.src-card .src-meta { padding: 12px 14px; display: flex; align-items: center; gap: 8px; }
.src-card .src-name { font-size: 13px; font-weight: 800; }
.src-card .src-role { font-size: 12px; color: var(--muted); }
.align-pill {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  background: var(--green-50); color: var(--green-800); border: 1px solid var(--green-200);
  font-size: 11.5px; font-weight: 800; padding: 5px 11px; border-radius: var(--pill); white-space: nowrap;
}
.src-actions { padding: 0 14px 14px; display: flex; gap: 12px; }

.preview-shell {
  background: var(--deep); border-radius: var(--r-xl); padding: 26px;
  box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.preview-shell::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(500px 260px at 50% -10%, rgba(190,242,100,.12), transparent 60%);
}
.preview-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; position: relative; }
.preview-top .t { color: #fff; font-weight: 800; font-size: 16px; letter-spacing: -0.01em; }
.live-pill {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 800;
  background: rgba(190,242,100,.14); color: var(--lime-200);
  border: 1px solid rgba(190,242,100,.35); border-radius: var(--pill); padding: 5px 12px;
}
.live-pill .blink { width: 7px; height: 7px; border-radius: 50%; background: var(--lime-300); animation: blink 1.6s infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.canvas-wrap {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  aspect-ratio: 4 / 5; max-height: 640px; margin: 0 auto; width: 100%; max-width: 512px;
  box-shadow: 0 12px 40px rgba(0,0,0,.45); background: #06130e;
  touch-action: none;
}
.canvas-wrap img { width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }

/* The draggable split line */
.split-line {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 0; z-index: 5;
  cursor: ew-resize;
}
.split-line::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: -1.5px; width: 3px;
  background: #fff; box-shadow: 0 0 14px rgba(255,255,255,.9), 0 0 3px rgba(0,0,0,.4);
}
.split-handle {
  position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%);
  width: 52px; height: 52px; border-radius: 50%;
  background: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.35), 0 0 0 4px rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center; gap: 2px;
  color: var(--green-800); font-size: 17px; font-weight: 800;
}
.split-handle .chev { line-height: 1; }
.split-tag {
  position: absolute; z-index: 6; font-size: 11px; font-weight: 800; letter-spacing: .08em;
  background: rgba(6,19,14,.72); color: #fff; padding: 5px 11px; border-radius: var(--pill);
  backdrop-filter: blur(4px);
}
.split-tag.left { left: 12px; top: 12px; }
.split-tag.right { right: 12px; top: 12px; }
.drag-hint {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 6;
  background: rgba(6,19,14,.72); color: #fff; font-size: 12.5px; font-weight: 700;
  padding: 8px 16px; border-radius: var(--pill); backdrop-filter: blur(4px);
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}

/* Control column */
.controls { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 92px; }
.control-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.control-card h4 { font-size: 14px; font-weight: 800; margin-bottom: 4px; }
.control-card .desc { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.flip-btn {
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--green-50); border: 1.5px solid var(--green-200); color: var(--green-800);
  font-weight: 800; font-size: 14px; padding: 12px; border-radius: var(--r-md);
}
.flip-btn:hover { background: var(--green-100); }
.flip-faces { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; }
.flip-faces img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: var(--shadow-sm); }
.flip-faces .swap { color: var(--green-700); font-weight: 800; }
.stat-row { display: flex; justify-content: space-between; font-size: 13px; padding: 8px 0; border-top: 1px dashed var(--line); }
.stat-row:first-of-type { border-top: none; }
.stat-row .k { color: var(--muted); font-weight: 600; }
.stat-row .v { font-weight: 800; }
.stat-row .v.ok { color: var(--green-700); }
.pro-nudge {
  background: linear-gradient(135deg, var(--green-800), var(--green-600));
  border-radius: var(--r-lg); padding: 20px; color: #fff; box-shadow: var(--shadow-md);
}
.pro-nudge .price { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.pro-nudge .price small { font-size: 13px; font-weight: 600; opacity: .75; }
.pro-nudge p { font-size: 13px; opacity: .85; margin: 8px 0 14px; }
.pro-nudge .btn { background: #fff; color: var(--green-800); width: 100%; padding: 12px; font-size: 14px; }
.pro-nudge .btn:hover { background: var(--lime-200); }

/* ---------- Export ---------- */
.export-layout { display: grid; grid-template-columns: minmax(0,1fr) 380px; gap: 30px; margin: 30px 0 70px; align-items: start; }
.export-preview-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: 26px; box-shadow: var(--shadow-md);
}
.export-preview-card .cap { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.export-preview-card .cap h3 { font-size: 17px; font-weight: 800; }
.format-chip {
  margin-left: auto; font-size: 12px; font-weight: 800; color: var(--muted);
  background: var(--bg); border: 1px solid var(--line); padding: 6px 12px; border-radius: var(--pill);
  white-space: nowrap; flex: none;
}
.format-chip.hd {
  color: var(--green-800); background: var(--green-50); border-color: var(--green-200);
}
.control-card.mb-16 { margin-bottom: 16px; }
.export-img { position: relative; border-radius: var(--r-lg); overflow: hidden; max-width: 460px; margin: 0 auto; box-shadow: var(--shadow-md); }
.export-img img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.export-actions { display: flex; gap: 12px; margin-top: 22px; justify-content: center; flex-wrap: wrap; }

.upgrade-card {
  background: var(--deep); color: #fff; border-radius: var(--r-xl); padding: 28px;
  box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.upgrade-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(420px 220px at 90% 0%, rgba(190,242,100,.18), transparent 60%);
  pointer-events: none;
}
.upgrade-card .flag {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--lime-300); color: var(--deep);
  font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  padding: 6px 13px; border-radius: var(--pill); margin-bottom: 16px;
}
.upgrade-card h3 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.upgrade-card .price-row { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 4px; }
.upgrade-card .price { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; color: var(--lime-300); }
.upgrade-card .per { font-size: 14px; font-weight: 600; opacity: .7; }
.upgrade-card .blurb { font-size: 14px; opacity: .8; margin-bottom: 18px; }
.upgrade-list { list-style: none; display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.upgrade-list li { display: flex; gap: 11px; align-items: flex-start; font-size: 14px; font-weight: 600; }
.upgrade-list .tick {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(190,242,100,.18); border: 1px solid rgba(190,242,100,.5); color: var(--lime-300);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800;
}
.upgrade-card .btn-upgrade {
  width: 100%; background: var(--lime-300); color: var(--deep);
  font-size: 16px; padding: 15px; box-shadow: 0 10px 24px -8px rgba(190,242,100,.5);
}
.upgrade-card .btn-upgrade:hover { background: var(--lime-200); }
.upgrade-card .secure { text-align: center; font-size: 12px; opacity: .6; margin-top: 12px; font-weight: 600; }
.free-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px; margin-top: 16px; box-shadow: var(--shadow-sm); text-align: center;
}
.free-card p { font-size: 13px; color: var(--muted); margin-bottom: 12px; }

/* Unlocked state */
.unlocked-banner {
  display: flex; align-items: center; gap: 14px;
  background: var(--green-50); border: 1.5px solid var(--green-200);
  border-radius: var(--r-lg); padding: 16px 20px; margin-bottom: 22px;
}
.unlocked-banner .big-tick {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: var(--green-600); color: #fff; font-size: 20px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.unlocked-banner h3 { font-size: 16px; font-weight: 800; color: var(--green-900); }
.unlocked-banner p { font-size: 13px; color: var(--green-800); opacity: .8; }
.hd-chip {
  position: absolute; left: 12px; top: 12px;
  background: var(--lime-300); color: var(--deep); font-size: 11px; font-weight: 800; letter-spacing: .08em;
  padding: 6px 12px; border-radius: var(--pill);
}

/* ---------- Toast / error states ---------- */
.toast {
  display: flex; align-items: flex-start; gap: 12px;
  border-radius: var(--r-md); padding: 15px 18px; margin: 22px 0 0;
  font-size: 14px; box-shadow: var(--shadow-md);
}
.toast.error { background: var(--red-50); border: 1.5px solid #FECACA; color: #7F1D1D; }
.toast.warn  { background: var(--amber-50); border: 1.5px solid #FDE68A; color: #78350F; }
.toast .t-icon {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px;
}
.toast.error .t-icon { background: var(--red-600); color: #fff; }
.toast.warn .t-icon { background: var(--amber-500); color: #fff; }
.toast b { font-weight: 800; }
.toast .t-actions { margin-top: 10px; display: flex; gap: 10px; }

.slot-error-note {
  border-top: 1.5px dashed var(--line); padding: 16px; text-align: left;
  background: var(--amber-50);
}
.slot-error-note p { font-size: 13.5px; color: #78350F; margin-bottom: 12px; }
.slot-error-note p b { font-weight: 800; }
.btn-sm { padding: 9px 18px; font-size: 13px; }
.btn-warn { background: var(--amber-500); color: #451A03; }

/* ---------- Mobile page ---------- */
body.mobile-page { background: #fff; }
.mobile-shell { max-width: 430px; margin: 0 auto; background: var(--bg); min-height: 100vh; position: relative; padding-bottom: 96px; }
.m-header {
  position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.94); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.m-header .row { display: flex; align-items: center; gap: 10px; height: 58px; padding: 0 16px; }
.m-header .brand { font-size: 17px; }
.m-header .brand-mark { width: 30px; height: 30px; }
.m-step { margin-left: auto; font-size: 12px; font-weight: 800; color: var(--muted); background: var(--green-50); border: 1px solid var(--green-100); padding: 6px 12px; border-radius: var(--pill); }
.m-body { padding: 18px 16px 0; }
.m-body h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.m-body .sub { font-size: 13.5px; }
.m-slots { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.m-slot {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border: 1.5px dashed #C9D8CE; border-radius: var(--r-lg); padding: 12px 14px;
}
.m-slot img { width: 58px; height: 58px; border-radius: 12px; object-fit: cover; object-position: top center; }
.m-slot .info { flex: 1; }
.m-slot .info b { font-size: 14px; font-weight: 800; display: block; }
.m-slot .info span { font-size: 12px; color: var(--muted); }
.m-slot .mini-btn {
  background: var(--green-50); color: var(--green-800); font-weight: 800; font-size: 12.5px;
  padding: 10px 14px; min-height: 44px; border-radius: var(--pill); border: 1px solid var(--green-100); white-space: nowrap;
}
.m-slot.filled { border-style: solid; border-color: var(--green-200); }
.m-preview { margin-top: 18px; }
.m-preview .canvas-wrap { max-width: none; border-radius: var(--r-lg); }
.m-align { display: inline-flex; align-items: center; gap: 7px; margin-top: 12px;
  background: var(--green-50); color: var(--green-800); border: 1px solid var(--green-200);
  font-size: 12px; font-weight: 800; padding: 7px 13px; border-radius: var(--pill); }
.m-sticky {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px; z-index: 60;
  background: rgba(255,255,255,.96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  display: flex; gap: 12px;
}
.m-sticky .btn { flex: 1; padding: 15px 10px; font-size: 15px; }
.m-sticky .btn-flip { flex: 0 0 56px; padding: 15px 0; }
.m-pro-strip {
  margin: 18px 16px 0; background: linear-gradient(135deg, var(--green-800), var(--green-600));
  border-radius: var(--r-lg); padding: 18px; color: #fff; display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow-md);
}
.m-pro-strip .txt { flex: 1; }
.m-pro-strip b { font-size: 14px; font-weight: 800; display: block; }
.m-pro-strip span { font-size: 12.5px; opacity: .8; }
.m-pro-strip .go {
  background: var(--lime-300); color: var(--deep); font-weight: 800; font-size: 13px;
  padding: 11px 18px; border-radius: var(--pill); white-space: nowrap;
}

/* ---------- Footer mini ---------- */
.mini-footer { text-align: center; color: var(--faint); font-size: 12.5px; padding: 34px 0 46px; font-weight: 600; }

/* ---------- Responsive tweaks for desktop pages at small widths ---------- */
@media (max-width: 980px) {
  .editor-layout { grid-template-columns: 1fr; }
  .controls { position: static; }
  .src-col { flex-direction: row; }
  .src-card { flex: 1; }
  .export-layout { grid-template-columns: 1fr; }
  .nav-links a { display: none; }
}
@media (max-width: 640px) {
  .upload-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
}

/* ============================================================
   SplitFace APP — additions on top of the mockup design system
   (views, toasts, pills, sticky mobile bar, canvas)
   ============================================================ */

/* Views: only one visible at a time */
.view[hidden] { display: none !important; }
.view { animation: viewIn .28s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Toasts ---------- */
#toasts {
  position: fixed; top: 76px; left: 50%; transform: translateX(-50%);
  z-index: 200; width: min(560px, calc(100vw - 32px));
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
#toasts .toast {
  margin: 0; pointer-events: auto;
  animation: toastIn .25s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
#toasts .toast.out { opacity: 0; transform: translateY(-8px); transition: all .25s ease; }
.toast .t-close {
  margin-left: auto; flex: none; width: 28px; height: 28px; border-radius: 50%;
  font-size: 14px; font-weight: 800; line-height: 1; color: inherit; opacity: .6;
  display: inline-flex; align-items: center; justify-content: center; min-width: 28px; min-height: 28px;
}
.toast .t-close:hover { opacity: 1; background: rgba(0,0,0,.06); }

/* ---------- Buttons: disabled ---------- */
.btn[disabled], .btn.disabled {
  opacity: .45; cursor: not-allowed; box-shadow: none; transform: none !important;
}

/* ---------- Continue row (upload view) ---------- */
.continue-row { text-align: center; margin: 26px 0 64px; }
.continue-row .btn { min-width: 240px; }

/* ---------- Back link (proper button) ---------- */
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--green-800); font-weight: 800; font-size: 14px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 999px;
  padding: 10px 20px; margin-top: 12px; cursor: pointer;
  box-shadow: 0 1px 3px rgba(6,19,14,.08);
  transition: border-color .15s, color .15s, transform .15s, box-shadow .15s;
}
.back-link:hover {
  color: var(--green-700); border-color: var(--green-600);
  transform: translateY(-1px); box-shadow: 0 4px 12px rgba(6,19,14,.12);
}
.back-link:active { transform: translateY(0); }

/* ---------- Style variant segmented control ---------- */
.variant-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.variant-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 4px; border: 1.5px solid var(--line); border-radius: 14px;
  background: #fff; color: var(--ink-2); font-weight: 800; font-size: 12px;
  cursor: pointer; transition: border-color .15s, background .15s, color .15s, transform .15s;
}
.variant-btn .vb-ico { font-size: 20px; line-height: 1; }
.variant-btn:hover { border-color: var(--green-600); transform: translateY(-1px); }
.variant-btn.active {
  border-color: var(--green-600); background: var(--green-50); color: var(--green-800);
  box-shadow: 0 2px 8px rgba(14,159,110,.18);
}

/* ---------- Face-status pills ---------- */
.align-pill.pending { background: var(--bg); color: var(--muted); border-color: var(--line); }
.align-pill.pending .spin {
  display: inline-block; width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid var(--green-200); border-top-color: var(--green-700);
  animation: spin .8s linear infinite; vertical-align: -1px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.align-pill.none {
  background: var(--amber-50); color: #92400E; border-color: #FDE68A;
}
.align-pill.crop { background: var(--bg); color: var(--muted); border-color: var(--line); }

/* ---------- Merge canvas ---------- */
.canvas-wrap canvas#merge-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
}
.drag-hint.hidden { display: none; }

/* Split stat value */
.stat-row .v.split-v { font-variant-numeric: tabular-nums; }

/* ---------- Editor sticky bar (mobile only) ---------- */
#editor-sticky { display: none; }
@media (max-width: 640px) {
  /* Grid blowout guard: long nowrap content (e.g. pro-nudge strip)
     must not force tracks wider than the viewport. */
  .editor-layout > * { min-width: 0; }
  .controls .pro-nudge { flex-wrap: wrap; }
  .controls .pro-nudge p { flex: 1 1 140px; }
  .controls .pro-nudge .btn { flex: 1 1 100%; }
  #editor-sticky {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
    background: rgba(255,255,255,.96); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    gap: 12px;
  }
  #editor-sticky .btn { flex: 1; padding: 15px 10px; font-size: 15px; min-height: 52px; }
  #editor-sticky .btn-flip { flex: 0 0 60px; padding: 15px 0; }
  .editor-page { padding-bottom: 96px; }

  /* Compact source cards on mobile (match mockup 04 rows) */
  .editor-layout .src-col { flex-direction: column; gap: 10px; }
  .editor-layout .src-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
  .editor-layout .src-card img { width: 58px; height: 58px; border-radius: 12px; flex: none; }
  .editor-layout .src-card .src-meta { padding: 0; flex: 1; min-width: 0; display: block; }
  .editor-layout .src-card .align-pill { margin: 6px 0 0; }
  .editor-layout .src-actions { padding: 0; flex: none; }
  .editor-layout .src-actions .link-btn {
    background: var(--green-50); color: var(--green-800); text-decoration: none;
    font-size: 12.5px; padding: 10px 14px; min-height: 44px; border-radius: var(--pill);
    border: 1px solid var(--green-100); display: inline-flex; align-items: center;
  }
  /* Pro nudge becomes a strip above the sticky bar */
  .controls .pro-nudge { display: flex; align-items: center; gap: 12px; padding: 16px 18px; }
  .controls .pro-nudge .price { font-size: 18px; white-space: nowrap; }
  .controls .pro-nudge p { margin: 0; flex: 1; font-size: 12.5px; }
  .controls .pro-nudge .btn { width: auto; white-space: nowrap; padding: 11px 18px; min-height: 44px; }
  .preview-shell { padding: 16px; }
  /* Keep desktop Export button reachable but sticky bar is primary */
}

/* ---------- Export preview img ---------- */
.export-img img#export-img { background: #06130e; }

/* ---------- Upload slot: detecting state ---------- */
.slot .slot-status { font-size: 13px; font-weight: 700; color: var(--muted); margin-top: 10px; }
.slot-filled .slot-foot .pill-slot { margin-left: auto; }

/* Slot thumbnail uses same framing as mockups */
.slot-filled img.thumb { background: #0B241C; }

/* ---------- Pro-active header state ---------- */
.btn-pro.pro-on { background: var(--green-600); }

/* ---------- Small helper ---------- */
.mt-8 { margin-top: 8px; }
.center { text-align: center; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .view, #toasts .toast { animation: none; }
  .live-pill .blink { animation: none; }
}
