@import url('https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap');
/* ========== HireFlow shared styles ========== */
:root {
  --font-display: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, sans-serif;
  --bg-0: #07091a;
  --bg-1: #0d1130;
  --bg-2: #141938;
  --bg-3: #1c2247;
  --border: #2a2f55;
  --text: #e6e9f5;
  --muted: #9aa3c7;
  --accent: #5b54e8;         /* deeper, richer indigo — less "default AI purple" */
  --accent-deep: #4840cf;    /* button depth / pressed */
  --accent-2: #8b5cf6;
  --primary: #4840cf;
  --primary-hover: #3a33b8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  /* Reserved for hero moments only (banner, featured tier, hero CTA). Regular
     buttons use a restrained vertical sheen instead of this diagonal gradient. */
  --gradient: linear-gradient(135deg, #4840cf 0%, #6d5cf0 100%);
  --gradient-soft: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);

  /* ---- Design tokens (Tier 1 system) ---- */
  /* Radius scale */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px; --r-full: 999px;
  /* Elevation — layered, low-opacity shadows read as more premium */
  --sh-1: 0 1px 2px rgba(0,0,0,.25), 0 2px 8px rgba(0,0,0,.16);
  --sh-2: 0 4px 12px rgba(0,0,0,.28), 0 14px 34px rgba(0,0,0,.22);
  --sh-3: 0 8px 24px rgba(0,0,0,.34), 0 24px 60px rgba(0,0,0,.30);
  /* Subtle top highlight for glassy depth on surfaces */
  --hi: inset 0 1px 0 rgba(255,255,255,.05);
  /* Spacing scale (8px rhythm) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-8: 48px;
  /* Type scale */
  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 14px; --fs-md: 16px; --fs-lg: 18px;
  --fs-xl: 22px; --fs-2xl: 28px; --fs-3xl: 36px; --fs-4xl: 44px;
  /* Motion */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --dur: .16s;
  /* Focus ring */
  --ring: 0 0 0 3px rgba(99,102,241,.35);
}

/* ===== Light mode ===== */
html.light-mode {
  --bg-0: #f0f2f8;
  --bg-1: #ffffff;
  --bg-2: #e8eaf2;
  --bg-3: #d8dce8;
  --border: #c8cde0;
  --text: #1a1f3c;
  --muted: #5a6080;
  --gradient-soft: linear-gradient(135deg, #e0e4f8 0%, #c8d0f0 100%);
  /* Softer, cool-gray elevation for light mode */
  --sh-1: 0 1px 2px rgba(20,30,70,.06), 0 2px 8px rgba(20,30,70,.06);
  --sh-2: 0 4px 12px rgba(20,30,70,.08), 0 14px 34px rgba(20,30,70,.08);
  --sh-3: 0 8px 24px rgba(20,30,70,.10), 0 24px 60px rgba(20,30,70,.10);
  --hi: inset 0 1px 0 rgba(255,255,255,.7);
  --ring: 0 0 0 3px rgba(99,102,241,.22);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-0);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Real kerning + ligatures + proportional/lining figures — a subtle premium tell */
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}
/* Headings: balanced wrapping (no orphan words) + tighter optical tracking */
h1, h2, h3, h4 { text-wrap: balance; }
h1, .hero-title, .section-title { letter-spacing: -0.022em; }
h2, h3 { letter-spacing: -0.015em; }
/* Tabular, lining numerals for anything numeric-heavy so figures align crisply */
.stat, .stat-num, [class*="-score"], [class*="-num"], .price, table td { font-variant-numeric: tabular-nums lining-nums; }

/* ===== Fine grain texture — tactile depth like premium dark UIs (Linear/Vercel) ===== */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
html.light-mode body::before { opacity: .015; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }

/* Consistent keyboard focus ring across interactive elements */
a:focus-visible, button:focus-visible, [tabindex]:focus-visible,
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none; box-shadow: var(--ring); border-radius: var(--r-sm);
}
@media (prefers-reduced-motion: reduce) { * { transition-duration: .01ms !important; animation-duration: .01ms !important; } }

/* ===== Hide scrollbars but keep scroll ===== */
.no-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.no-scrollbar::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* ===== SVG icons ===== */
.ico { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; flex-shrink: 0; }
.ico svg { width: 100%; height: 100%; display: block; }
.ico-sm { width: 14px; height: 14px; }
.ico-lg { width: 20px; height: 20px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 11px 18px; border-radius: var(--r-md);
  font-size: var(--fs-base); font-weight: 600; cursor: pointer;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease);
  border: 1px solid transparent;
}
.btn:active { transform: translateY(0) scale(.985); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary { background: linear-gradient(180deg, var(--accent), var(--accent-deep)); color: #fff; box-shadow: var(--sh-1), inset 0 1px 0 rgba(255,255,255,.16); }
.btn-primary:hover { background: linear-gradient(180deg, #6a63ee, var(--accent)); transform: translateY(-1px); box-shadow: var(--sh-2), inset 0 1px 0 rgba(255,255,255,.18); }
.btn-secondary { background: var(--bg-2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-3); border-color: var(--accent); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--bg-2); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-xs { padding: 5px 9px; font-size: 12px; gap: 5px; }

/* ===== Brand ===== */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.brand-logo {
  width: 32px; height: 32px; border-radius: 8px;
  object-fit: cover; display: block;
}

/* ===== Landing ===== */
.landing-body { background: var(--bg-0); }
.landing-grid {
  display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh;
}
.hero-left {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
  padding: 48px 64px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.hero-left::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(139,92,246,.3), transparent 50%),
              radial-gradient(circle at 20% 80%, rgba(99,102,241,.3), transparent 50%);
  pointer-events: none;
}
.hero-left > * { position: relative; z-index: 1; }
.hero-content { margin-top: 60px; }
.hero-content h1 {
  font-size: 64px; font-weight: 800; line-height: 1.05; letter-spacing: -2px;
  margin-bottom: 24px;
}
.accent { background: linear-gradient(135deg, #fbbf24, #f59e0b); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: 17px; color: rgba(255,255,255,.75); max-width: 380px; margin-bottom: 40px; }
.feature-list { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.feature-list li { display: flex; align-items: center; gap: 12px; font-size: 15px; color: rgba(255,255,255,.9); }
.dot { width: 8px; height: 8px; border-radius: 50%; }
.dot-amber { background: #fbbf24; }
.dot-emerald { background: #10b981; }
.dot-violet { background: #a78bfa; }
.dot-sky { background: #38bdf8; }
.hero-foot { margin-top: 56px; color: rgba(255,255,255,.5); font-size: 13px; }

.hero-right {
  background: var(--bg-0); padding: 48px 64px;
  display: flex; align-items: center; justify-content: center;
}
.cta-card { width: 100%; max-width: 420px; }
.cta-card h2 { font-size: 36px; font-weight: 700; letter-spacing: -1px; margin-bottom: 16px; }
.cta-sub { color: var(--muted); margin-bottom: 32px; font-size: 15px; line-height: 1.6; }
.cta-card .btn { margin-bottom: 12px; padding: 14px 20px; font-size: 15px; }
.fine-print { margin-top: 20px; color: var(--muted); font-size: 12px; text-align: center; }

@media (max-width: 900px) {
  .landing-grid { grid-template-columns: 1fr; }
  .hero-left, .hero-right { padding: 32px 24px; }
  .hero-content h1 { font-size: 44px; }
}

/* ===== Auth ===== */
.auth-body {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: radial-gradient(circle at 50% 0%, #1e1b4b, var(--bg-0) 70%);
  padding: 24px;
}
.auth-card {
  width: 100%; max-width: 420px; background: var(--bg-1);
  border: 1px solid var(--border); border-radius: 16px; padding: 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.auth-card .brand { justify-content: center; margin-bottom: 24px; }
.auth-card h2 { font-size: 24px; text-align: center; margin-bottom: 8px; }
.auth-card .sub { text-align: center; color: var(--muted); margin-bottom: 28px; }
.form-field { margin-bottom: 14px; }
.form-field label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; color: var(--muted); }
.form-field input, .form-field textarea, .form-field select {
  width: 100%; padding: 10px 13px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: var(--r-sm); color: var(--text); font-size: var(--fs-base);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--ring);
}
.auth-foot { margin-top: 18px; display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.auth-foot a { color: var(--accent); }
.auth-foot a:hover { text-decoration: underline; }
.auth-msg { padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; display: none; }
.auth-msg.error { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); color: #fca5a5; display: block; }
.auth-msg.success { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.3); color: #6ee7b7; display: block; }

/* ===== App shell ===== */
.app-body { background: var(--bg-0); height: 100vh; overflow: hidden; }
.app-body-scroll { background: var(--bg-0); min-height: 100vh; }
.app-topbar {
  grid-column: 1 / -1; height: 56px; background: var(--bg-1);
  border-bottom: 1px solid var(--border); display: flex; align-items: center;
  padding: 0 18px; gap: 18px;
}
.app-topbar .brand { font-size: 15px; }
.app-topbar .topbar-tabs { display: flex; gap: 4px; margin-left: 18px; min-width: 0; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.app-topbar .topbar-tabs::-webkit-scrollbar { display: none; }
.topbar-tab {
  padding: 7px 12px; border-radius: 7px; font-size: 13px; color: var(--muted);
  font-weight: 500; white-space: nowrap; flex-shrink: 0;
}
.topbar-tab.active, .topbar-tab:hover { background: var(--bg-2); color: var(--text); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* ===== Expandable action buttons (icon-only, reveal label on hover) ===== */
/* Each .exp-act button shows just its icon; the trailing label span expands on
   hover with a spring-ish easing, the ExpandableTabs interaction applied to the
   topbar utility actions (Import / Save / Feedback). */
.exp-act {
  gap: 0;            /* override .btn gap so a collapsed label leaves no dead space */
  overflow: hidden;
  transition: background .2s ease, color .2s ease, padding .4s cubic-bezier(.2,.8,.2,1);
}
.exp-act .ico { flex-shrink: 0; }
/* The label is the non-icon span the button renders after its icon. */
.exp-act > span:not(.ico) {
  display: inline-block; max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap;
  margin-left: 0;
  transition: max-width .45s cubic-bezier(.2,.8,.2,1), opacity .3s ease, margin-left .4s cubic-bezier(.2,.8,.2,1);
}
.exp-act:hover > span:not(.ico),
.exp-act:focus-visible > span:not(.ico) { max-width: 160px; opacity: 1; margin-left: 6px; }
@media (prefers-reduced-motion: reduce) {
  .exp-act, .exp-act > span:not(.ico) { transition: none; }
}

.app-shell-inner { display: grid; grid-template-columns: 220px 1fr 340px; height: calc(100vh - 56px); }

.sidebar {
  background: var(--bg-1); border-right: 1px solid var(--border);
  padding: 10px 0; overflow-y: auto;
  scrollbar-width: none; -ms-overflow-style: none;
}
.sidebar::-webkit-scrollbar { display: none; }
.sidebar-progress { margin: 4px 12px 8px; padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg-1); }
.sidebar-progress .sp-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.sidebar-progress .sp-label { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.sidebar-progress .sp-count { font-size: 12px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.sidebar-progress .sp-track { height: 6px; border-radius: 999px; background: var(--bg-3); overflow: hidden; }
.sidebar-progress .sp-fill { height: 100%; border-radius: 999px; background: var(--gradient); transition: width .5s cubic-bezier(.3,.8,.3,1); }
.sidebar-progress .sp-done { color: var(--success); }
.sidebar-section { padding: 10px 16px 4px; font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.sidebar-item {
  display: flex; align-items: center; gap: 10px; padding: 8px 16px;
  font-size: 13px; color: var(--muted); cursor: pointer; border-left: 2px solid transparent;
}
.sidebar-item:hover { background: var(--bg-2); color: var(--text); }
.sidebar-item.active { background: var(--bg-2); color: var(--text); border-left-color: var(--accent); }
.sidebar-item .ico { opacity: .85; }

.main-area {
  overflow-y: auto; padding: 20px 26px;
  scrollbar-width: none; -ms-overflow-style: none;
}
.main-area::-webkit-scrollbar { display: none; }

.right-panel {
  background: linear-gradient(180deg, var(--bg-1), var(--bg-0));
  border-left: 1px solid var(--border);
  padding: 16px; overflow-y: auto;
  scrollbar-width: none; -ms-overflow-style: none;
}
.right-panel::-webkit-scrollbar { display: none; }

/* ===== Cards & form sections ===== */
.section-card {
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 22px; margin-bottom: 14px;
  box-shadow: var(--sh-1), var(--hi);
}
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; }
.section-head h3 { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.section-head .ai-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  background: linear-gradient(135deg, rgba(139,92,246,.2), rgba(99,102,241,.2));
  border: 1px solid rgba(139,92,246,.3); border-radius: 6px; font-size: 12px; color: #c4b5fd;
  cursor: pointer;
}
.section-head .ai-btn:hover { background: linear-gradient(135deg, rgba(139,92,246,.3), rgba(99,102,241,.3)); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.action-row { display: flex; justify-content: space-between; margin-top: 18px; }
.empty-state { text-align: center; padding: 32px 20px; color: var(--muted); }
.add-btn {
  width: 100%; padding: 12px; border: 1px dashed var(--border);
  border-radius: var(--r-md); color: var(--muted); font-size: 13px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: transparent; transition: border-color var(--dur) var(--ease), color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.add-btn:hover { border-color: var(--accent); color: var(--text); background: rgba(99,102,241,.05); }

/* Win journal → bullet inserter (Experience/Projects entries) */
.wins-helper { margin-top: 8px; }
.wins-toggle { display: inline-flex; align-items: center; gap: 5px; font: inherit; font-size: 12px; font-weight: 600; color: var(--accent); background: none; border: 0; cursor: pointer; padding: 2px 0; }
.wins-toggle:hover { color: var(--text); }
.wins-panel { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.wins-panel[hidden] { display: none; }
.wins-chip { font: inherit; font-size: 12.5px; line-height: 1.4; text-align: left; padding: 8px 11px; border-radius: var(--r-sm); background: var(--bg-2); border: 1px solid var(--border); color: var(--text); cursor: pointer; transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease); }
.wins-chip:hover { border-color: var(--accent); background: var(--bg-3); }
.wins-chip::before { content: '+ '; color: var(--accent); font-weight: 700; }

/* ===== Tags ===== */
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag {
  padding: 4px 10px; background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r-sm); font-size: 12px;
}

/* ===== Templates (compact grid, formal mini-previews) ===== */
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tpl-cat-label {
  display: flex; align-items: center; gap: 10px;
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin: 18px 0 10px;
}
.tpl-cat-label::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.tpl-cat-label:first-of-type { margin-top: 4px; }
.template-card {
  border: 2px solid var(--border); border-radius: 10px; overflow: hidden;
  cursor: pointer; background: var(--bg-2); transition: all .15s;
  padding: 8px;
}
.template-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.template-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,.25); }
.template-preview {
  width: 100%; aspect-ratio: 8.5 / 11; background: #fff;
  border-radius: 4px; overflow: hidden; position: relative;
  font-family: Inter, sans-serif; color: #1f2937;
  font-size: 4px; line-height: 1.35;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.template-name {
  padding: 6px 4px 2px; font-size: 12px; font-weight: 500; text-align: center;
}

/* ===== Right panel preview ===== */
.preview-panel h4 { font-size: 11px; color: var(--muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
/* Zoom/mode controls as one clean segmented control */
.preview-controls { display: inline-flex; gap: 2px; margin-bottom: 12px; padding: 3px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 9px; }
.preview-btn {
  padding: 5px 10px; background: transparent; border: 0;
  border-radius: 6px; font-size: 11.5px; font-weight: 600; color: var(--muted); cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.preview-btn:hover { color: var(--text); background: rgba(255,255,255,.05); }
.preview-btn.active { color: var(--text); background: var(--bg-3); }
/* The paper: a real document floating on a subtly recessed desk. */
.preview-mini {
  /* A scaled iframe (true 816px page) is mounted inside; this is just the frame.
     Content + page gutters live inside the iframe, so no font-size scaling here. */
  background: #fff;
  min-height: 420px;        /* ~one page tall at the wider panel, before scaling */
  border-radius: 6px; overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,.28), 0 20px 48px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.06);
}

/* ===== Color swatches ===== */
.swatch-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.swatch { height: 32px; border-radius: 6px; cursor: pointer; border: 2px solid transparent; }
.swatch.selected { border-color: #fff; }

/* ===== Toggle ===== */
.toggle-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: none; }
.toggle {
  width: 36px; height: 20px; background: var(--bg-3); border-radius: 10px;
  position: relative; cursor: pointer;
}
.toggle::after {
  content: ""; position: absolute; left: 2px; top: 2px;
  width: 16px; height: 16px; background: #fff; border-radius: 50%;
  transition: transform .15s;
}
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(16px); }

/* ===== Misc ===== */
.banner-gradient {
  position: relative;
  background: var(--primary); color: #fff;
  padding: 11px 13px; border-radius: var(--r-md);
  font-size: 12.5px; font-weight: 600; letter-spacing: .01em;
  margin: 0 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  box-shadow: var(--sh-1);
}
.banner-gradient > span:first-child { position: relative; z-index: 1; }
.kbd {
  position: relative; z-index: 1; font-family: ui-monospace, "SF Mono", monospace; font-weight: 700;
  background: rgba(255,255,255,.22); border: 1px solid rgba(255,255,255,.30);
  padding: 2px 7px; border-radius: 6px; font-size: 10px; letter-spacing: .08em;
}
@media (prefers-reduced-motion: reduce) { .banner-gradient::after { display: none; } }
.notice {
  background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.3);
  color: #fcd34d; padding: 10px 12px; border-radius: 8px; font-size: 12px; margin-bottom: 12px;
}

/* ===== Modal ===== */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none; align-items: center; justify-content: center; z-index: 100; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 28px; max-width: 480px; width: 90%; position: relative; box-shadow: var(--sh-3), var(--hi); }
.modal h3 { margin-bottom: 16px; }
.modal-close { position: absolute; top: 12px; right: 12px; color: var(--muted); font-size: 18px; padding: 4px 8px; }

/* ===== Pill ===== */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 12px; background: var(--bg-3); color: var(--muted); border: 1px solid var(--border); }
.pill.success { background: rgba(16,185,129,.15); color: #6ee7b7; border-color: rgba(16,185,129,.3); }
.pill.warn { background: rgba(245,158,11,.15); color: #fcd34d; border-color: rgba(245,158,11,.3); }
.pill.error { background: rgba(239,68,68,.15); color: #fca5a5; border-color: rgba(239,68,68,.3); }

/* ===== Toast (in-page replacement for alert) ===== */
#toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.app-toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 10px;
  background: var(--bg-1); color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  font-size: 13px; min-width: 220px; max-width: 360px;
  opacity: 0; transform: translateX(12px);
  transition: opacity .2s ease, transform .2s ease;
}
.app-toast.app-toast-in { opacity: 1; transform: translateX(0); }
.app-toast.app-toast-out { opacity: 0; transform: translateX(12px); }
.app-toast-ico {
  width: 18px; height: 18px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.app-toast-ico svg { width: 100%; height: 100%; }
.app-toast-msg { line-height: 1.4; }
.app-toast-success { border-left: 3px solid var(--success); }
.app-toast-success .app-toast-ico { color: var(--success); }
.app-toast-error   { border-left: 3px solid var(--danger); }
.app-toast-error   .app-toast-ico { color: var(--danger); }
.app-toast-warn    { border-left: 3px solid var(--warning); }
.app-toast-warn    .app-toast-ico { color: var(--warning); }
.app-toast-info    { border-left: 3px solid var(--accent); }
.app-toast-info    .app-toast-ico { color: var(--accent); }

/* keep old class for backwards compat */
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--success); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 200; display: flex; align-items: center; gap: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.3); }

/* ===== Notify / Confirm dialogs ===== */
.app-dialog-bd {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(2,4,16,.65); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; transition: opacity .18s ease;
}
.app-dialog-bd.app-dialog-bd-in { opacity: 1; }
.app-dialog {
  background: var(--bg-1); border: 1px solid var(--border); border-radius: 14px;
  max-width: 480px; width: 100%; padding: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
  transform: translateY(8px); opacity: 0;
  transition: transform .18s ease, opacity .18s ease;
}
.app-dialog-bd-in .app-dialog { transform: translateY(0); opacity: 1; }
.app-dialog-title { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.app-dialog-body {
  font-size: 14px; color: var(--muted); line-height: 1.55;
  margin-bottom: 18px; white-space: pre-wrap;
  max-height: 50vh; overflow-y: auto;
}
.app-dialog-actions {
  display: flex; justify-content: flex-end; gap: 8px;
}
.app-dialog-actions .btn { min-width: 80px; }

/* ===== Sidebar indicators ===== */
.s-check {
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: auto; color: var(--success); width: 14px; height: 14px; flex-shrink: 0;
}
.s-check svg { width: 100%; height: 100%; }
.s-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--border); margin-left: auto; flex-shrink: 0;
}
.sidebar-item.has-content .s-dot { background: var(--accent); }

/* ===== Pro badge ===== */
.pro-badge {
  display: inline-flex; align-items: center; gap: 4px;
  vertical-align: middle;
}

/* ===== Account modal rows ===== */
.acct-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.acct-row:last-child { border-bottom: none; }
.acct-label { color: var(--muted); font-size: 13px; font-weight: 500; }
.acct-value { font-size: 14px; font-weight: 500; }

/* ===== Template card footer & thumb ===== */
.template-thumb {
  position: relative; width: 100%; aspect-ratio: 5 / 4; overflow: hidden; border-radius: 4px;
  /* Soft fade at the cropped page bottom. Uses a mask so it fades to
     transparent (revealing the card behind) instead of to solid white — the
     old white fade looked broken over dark templates (Tech/Slate/Onyx). */
  -webkit-mask-image: linear-gradient(to bottom, #000 84%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 84%, transparent 100%);
}
.template-thumb svg { width: 100%; height: auto; display: block; }
.template-card-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 3px 1px;
}
.t-name { font-size: 12px; font-weight: 500; color: var(--text); }
.t-badge { font-size: 11px; color: #a5b4fc; font-weight: 600; }

/* ===== Drag-to-reorder items ===== */
.drag-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.drag-item {
  display: flex; gap: 10px; align-items: flex-start;
  border-radius: 10px; transition: opacity .15s;
}
.drag-item.dragging { opacity: .4; }
.drag-item.drag-over { outline: 2px dashed var(--accent); outline-offset: 2px; border-radius: 10px; }
.drag-handle {
  display: flex; align-items: center; justify-content: center;
  width: 20px; flex-shrink: 0; margin-top: 18px; cursor: grab;
  color: var(--border); opacity: .6;
}
.drag-handle:hover { color: var(--muted); opacity: 1; }
.drag-handle svg { width: 16px; height: 16px; }

/* Resume Sections drag-and-drop reorder */
.sec-drag-item { transition: opacity .15s, background .15s; }
.sec-drag-item.dragging { opacity: .4; }
.sec-drag-item.drag-over { outline: 2px dashed var(--accent); outline-offset: -2px; border-radius: 8px; background: rgba(99,102,241,.06); }
.sec-drag-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; }
.sec-grip { display: inline-flex; align-items: center; color: var(--border); cursor: grab; }
.sec-grip:hover { color: var(--muted); }
.sec-drag-item.dragging .sec-grip { cursor: grabbing; }

/* ===== Item cards (experience, education, etc.) ===== */
.item-card {
  flex: 1; background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px;
}
.item-card-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 12px; gap: 8px;
}
.item-card-title { font-size: 14px; font-weight: 600; color: var(--text); }
.item-card-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.item-card-remove {
  flex-shrink: 0; color: var(--muted); padding: 4px;
  border-radius: 6px; transition: all .15s;
}
.item-card-remove:hover { color: var(--danger); background: rgba(239,68,68,.1); }

/* ===== Skills tag input ===== */
.tag-input-wrap {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 8px 10px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 8px;
  cursor: text; min-height: 44px;
  transition: border-color .15s;
}
.tag-input-wrap:focus-within { border-color: var(--accent); }
.tag-input-wrap input {
  border: none; background: transparent; color: var(--text);
  font-size: 14px; outline: none; flex: 1; min-width: 140px; padding: 2px 0;
}
.tag-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; background: var(--bg-3); border: 1px solid var(--border);
  border-radius: 6px; font-size: 13px; color: var(--text);
}
.tag-pill button {
  color: var(--muted); font-size: 15px; line-height: 1;
  padding: 0; transition: color .1s;
}
.tag-pill button:hover { color: var(--danger); }
.tag-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ===== Export page ===== */
.export-preview-container {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 32px rgba(0,0,0,.35);
  /* Fixed letterbox: content scrolls inside, container stays letter-shaped */
  width: 100%;
  max-width: 850px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  color: #111;
}

/* ===== AI sections: Tailor / ATS / Analysis ===== */
.ai-card { padding: 0 !important; overflow: hidden; }
.ai-card-header {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 20px 22px; border-bottom: 1px solid var(--border);
}
.ai-card-body { padding: 20px 22px; }
.ai-card-title { font-size: 16px; font-weight: 700; margin: 0 0 3px; }
.ai-card-sub { font-size: 12px; color: var(--muted); margin: 0; }

/* Icon circle per variant */
.ai-card-icon {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
/* Indigo, Tailor */
.ai-card-indigo .ai-card-header { background: linear-gradient(135deg, rgba(99,102,241,.08) 0%, transparent 100%); }
.ai-icon-indigo { background: rgba(99,102,241,.15); color: #818cf8; }
.ai-card-indigo { border-top: 3px solid #6366f1 !important; }
/* Emerald, ATS */
.ai-card-emerald .ai-card-header { background: linear-gradient(135deg, rgba(16,185,129,.08) 0%, transparent 100%); }
.ai-icon-emerald { background: rgba(16,185,129,.15); color: #34d399; }
.ai-card-emerald { border-top: 3px solid #10b981 !important; }
/* Violet, Analysis */
.ai-card-violet .ai-card-header { background: linear-gradient(135deg, rgba(139,92,246,.08) 0%, transparent 100%); }
.ai-icon-violet { background: rgba(139,92,246,.15); color: #a78bfa; }
.ai-card-violet { border-top: 3px solid #8b5cf6 !important; }

/* Accent-colored CTA buttons */
.btn-emerald {
  background: #059669; color: #fff; border: none;
  padding: 10px 16px; border-radius: 8px; font-size: 14px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s; width: 100%;
}
.btn-emerald:hover { background: #047857; }
.btn-violet {
  background: rgba(139,92,246,.15); color: #a78bfa;
  border: 1px solid rgba(139,92,246,.3);
  padding: 7px 14px; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s;
}
.btn-violet:hover { background: rgba(139,92,246,.25); }

/* AI result boxes */
.ai-result-box {
  border-radius: 10px; overflow: hidden; margin: 0 22px 16px;
}
.ai-result-label {
  font-size: 11px; font-weight: 700; letter-spacing: .6px;
  padding: 8px 14px; text-transform: uppercase;
}
.ai-result-indigo { border: 1px solid rgba(99,102,241,.3); }
.ai-result-indigo .ai-result-label { background: rgba(99,102,241,.12); color: #818cf8; }
.ai-result-indigo > div:last-child { padding: 12px 14px; }

/* Bullet strength meter */
.bm-track {
  height: 3px; background: rgba(255,255,255,.08); border-radius: 2px; margin-top: 5px;
}
html.light-mode .bm-track { background: rgba(0,0,0,.08); }
.bm-fill { height: 3px; border-radius: 2px; transition: width .3s, background .3s; }

/* ===== Light mode toggle ===== */
.theme-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 8px;
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--muted); font-size: 13px; cursor: pointer;
  transition: all .15s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--accent); }

/* Compact icon-only theme button for the editor topbar */
.theme-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--muted); cursor: pointer; transition: all .15s;
}
.theme-icon-btn:hover { color: var(--text); border-color: var(--accent); }

/* ===== Section transition (fade + slide up) ===== */
@keyframes section-enter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.main-section-enter { animation: section-enter .22s ease both; }

/* ===== Mobile responsive editor ===== */
.mobile-fab {
  display: none; position: fixed; z-index: 200;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-1); border: 1px solid var(--border);
  color: var(--text); align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
  cursor: pointer; transition: background .15s, transform .15s;
}
.mobile-fab:hover { background: var(--bg-2); transform: scale(1.06); }
.mob-sidebar-btn  { bottom: 20px; left: 16px; }
.mob-preview-btn  { bottom: 20px; right: 16px; }

.mob-overlay {
  display: none; position: fixed; inset: 0; z-index: 150;
  background: rgba(0,0,0,.45); backdrop-filter: blur(2px);
}
.mob-overlay.open { display: block; }

@media (max-width: 900px) {
  /* Show FABs */
  .mobile-fab { display: inline-flex; }

  /* Stack layout vertically, full width */
  .app-shell-inner { grid-template-columns: 1fr; height: auto; min-height: calc(100vh - 56px); }

  /* Sidebar becomes a slide-in drawer */
  .sidebar {
    position: fixed; top: 56px; left: 0; bottom: 0; z-index: 160;
    width: 240px; transform: translateX(-100%);
    transition: transform .25s ease; box-shadow: 4px 0 24px rgba(0,0,0,.4);
  }
  .sidebar.mob-open { transform: translateX(0); }

  /* Main area takes full width */
  .main-area { padding: 16px; min-height: calc(100vh - 56px - 80px); }

  /* Right panel becomes a slide-in drawer from the right */
  .right-panel {
    position: fixed; top: 56px; right: 0; bottom: 0; z-index: 160;
    width: 280px; transform: translateX(100%);
    transition: transform .25s ease; box-shadow: -4px 0 24px rgba(0,0,0,.4);
  }
  .right-panel.mob-open { transform: translateX(0); }

  /* Topbar: hide secondary items on very small screens */
  .topbar-tabs { display: none; }
  .topbar-right .btn-ghost:last-child { display: none; }

  /* grid-2 stacks on mobile */
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .app-topbar { padding: 0 12px; gap: 10px; }
  .brand span { display: none; }
  .topbar-right { gap: 6px; }
  .topbar-right #save-status { display: none; }
  .template-grid { grid-template-columns: repeat(auto-fill, minmax(125px, 1fr)); gap: 8px; }
  .main-area { padding: 12px; }
}

/* ===== ATS Result Card ===== */
.ats-result-card {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 14px;
  padding: 28px 24px; display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.ats-ring-wrap {
  position: relative; width: 120px; height: 120px; flex-shrink: 0;
}
.ats-ring-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.ats-ring-num { font-size: 36px; font-weight: 800; line-height: 1; color: var(--text); letter-spacing: -1px; }
.ats-ring-sub { font-size: 11px; color: var(--muted); font-weight: 500; }
.ats-verdict  { font-size: 15px; font-weight: 700; }
/* Score breakdown bars */
.ats-breakdown { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.ats-bd-row { width: 100%; }
.ats-bd-head { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text); margin-bottom: 5px; }
.ats-bd-track { height: 6px; background: var(--bg-1); border-radius: 4px; overflow: hidden; }
.ats-bd-fill { height: 100%; border-radius: 4px; transition: width .9s cubic-bezier(.2,0,.2,1); }
.ats-kw-section { width: 100%; }
.ats-kw-title { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.ats-kw-list  { display: flex; flex-wrap: wrap; gap: 6px; }
@keyframes pill-pop {
  from { opacity: 0; transform: scale(.7); }
  to   { opacity: 1; transform: scale(1); }
}
.ats-kw-pill {
  padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
  animation: pill-pop .22s cubic-bezier(.34,1.56,.64,1) both;
}
.ats-kw-matched { background: rgba(34,197,94,.12); color: #16a34a; border: 1px solid rgba(34,197,94,.25); }
.ats-kw-missing { background: rgba(239,68,68,.1);  color: #dc2626; border: 1px solid rgba(239,68,68,.2); }

/* ===== Tailor results: pill grids + emphasis cards ===== */
.tailor-result { display: flex; flex-direction: column; gap: 12px; }
.tailor-block {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 13px 15px;
}
.tailor-good { border-left: 3px solid #22c55e; }
.tailor-bad  { border-left: 3px solid #ef4444; }
.tailor-card { border-left: 3px solid var(--accent); }
.tailor-block-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 11px;
}
.tailor-count {
  font-size: 11px; font-weight: 700; color: var(--accent);
  background: rgba(99,102,241,.16); border-radius: 20px; padding: 1px 8px;
}
.tailor-hint { font-size: 12px; color: var(--muted); margin: -6px 0 11px; line-height: 1.5; }
.tailor-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.tailor-pills .ats-kw-pill { font-size: 12.5px; }
/* brighter for dark theme readability */
.tailor-pills .ats-kw-matched { background: rgba(34,197,94,.15); color: #4ade80; border-color: rgba(34,197,94,.32); }
.tailor-pills .ats-kw-missing { background: rgba(239,68,68,.13); color: #f87171; border-color: rgba(239,68,68,.3); }
.tailor-block .ai-rec { background: var(--bg-1); }

/* Tailor before→after bullet diff */
.td-diff { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-top: 10px; }
.td-diff:first-of-type { margin-top: 4px; }
.td-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 12px; font-size: 13px; line-height: 1.5; }
.td-before { background: rgba(239,68,68,.06); color: var(--muted); }
.td-before span:not(.td-tag) { text-decoration: line-through; text-decoration-color: rgba(239,68,68,.5); }
.td-after { background: rgba(34,197,94,.07); color: var(--text); border-top: 1px solid var(--border); }
.td-tag { flex-shrink: 0; font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 2px 7px; border-radius: 5px; margin-top: 1px; }
.td-tag-before { background: rgba(239,68,68,.15); color: #f87171; }
.td-tag-after { background: rgba(34,197,94,.16); color: #4ade80; }
.td-after > span:not(.td-tag) { flex: 1; min-width: 0; }
.td-copy { flex-shrink: 0; font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; color: var(--muted); background: var(--bg-2); border: 1px solid var(--border); border-radius: 6px; padding: 3px 8px; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.td-copy:hover { color: var(--text); border-color: var(--accent); }

/* ===== Resume Analysis: score + fix cards ===== */
.an-score {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px; margin-bottom: 14px;
}
.an-score-num { font-size: 40px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.an-score-num span { font-size: 16px; font-weight: 600; color: var(--muted); }
.an-score-label { font-size: 12px; color: var(--muted); }
/* Resume-quality score ring (AI Analysis) */
.an-ring-wrap { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 4px 0 18px; }
.an-ring-svg { position: relative; width: 100px; height: 100px; }
.an-ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.an-ring-num { font-size: 30px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.an-ring-sub { font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 1px; }
.an-ring-verdict { font-size: 15px; font-weight: 700; margin-top: 8px; }
.an-ring-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* ===== Shared AI-result reveal + score animations ===== */
@keyframes aiReveal { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes aiRingDraw { from { stroke-dashoffset: var(--ring-c, 264); } }
@keyframes aiPop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
/* Stagger children of an AI result so blocks cascade in */
.tailor-result > *, .ai-reveal > * {
  animation: aiReveal .5s cubic-bezier(.2,.7,.2,1) both;
}
.tailor-result > *:nth-child(1), .ai-reveal > *:nth-child(1) { animation-delay: .02s; }
.tailor-result > *:nth-child(2), .ai-reveal > *:nth-child(2) { animation-delay: .09s; }
.tailor-result > *:nth-child(3), .ai-reveal > *:nth-child(3) { animation-delay: .16s; }
.tailor-result > *:nth-child(4), .ai-reveal > *:nth-child(4) { animation-delay: .23s; }
.tailor-result > *:nth-child(5), .ai-reveal > *:nth-child(5) { animation-delay: .30s; }
.tailor-result > *:nth-child(n+6), .ai-reveal > *:nth-child(n+6) { animation-delay: .37s; }
/* Score ring "draws" itself in; number pops */
.an-ring-svg circle:last-child { animation: aiRingDraw 1.1s cubic-bezier(.3,.8,.3,1) both; }
.an-ring-num { animation: aiPop .5s cubic-bezier(.2,.9,.3,1.2) both .25s; }
/* Meter/progress bars grow from 0 — pure CSS (final width stays as the inline value) */
/* ===== Add custom section (sidebar) ===== */
.sidebar-add { opacity: .8; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--r-sm); margin-top: 4px; }
.sidebar-add:hover { opacity: 1; color: var(--accent); border-color: var(--accent); background: rgba(99,102,241,.06); }
.sidebar-add .s-dot, .sidebar-add .s-check { display: none; }

/* ===== Resume file upload / drop zone ===== */
.rf-upload { border: 1px dashed var(--border); border-radius: var(--r-md); background: var(--bg-2);
  padding: 12px 14px; display: flex; align-items: center; gap: 12px; cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease); }
.rf-upload:hover { border-color: var(--accent); }
.rf-upload.rf-dragover { border-color: var(--accent); background: rgba(99,102,241,.08); }
.rf-upload-ico { width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: rgba(99,102,241,.14); color: var(--accent); }
.rf-upload-ico svg { width: 18px; height: 18px; }
.rf-upload-txt { font-size: 13px; line-height: 1.4; }
.rf-upload-txt strong { color: var(--text); font-weight: 650; }
.rf-upload-txt span { color: var(--muted); }
.rf-upload .rf-pick { color: var(--accent); font-weight: 650; text-decoration: underline; background: none; padding: 0; }
.rf-status { font-size: 12px; margin-top: 8px; min-height: 15px; }
.rf-status.err { color: var(--danger); }
.rf-status.ok { color: var(--muted); }
.rf-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; margin: 12px 0; }
.rf-or::before, .rf-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

@keyframes aiBarGrow { from { width: 0 !important; } }
.ac-bar-fill, .sm-bar-fill, .bm-bar-fill, .bm-sub-bar > div, .ip-fb-bar > i {
  animation: aiBarGrow .8s cubic-bezier(.3,.8,.3,1) both;
}
@media (prefers-reduced-motion: reduce) {
  .tailor-result > *, .ai-reveal > *, .an-ring-svg circle:last-child, .an-ring-num,
  .ac-bar-fill, .sm-bar-fill, .bm-bar-fill, .bm-sub-bar > div, .ip-fb-bar > i { animation: none !important; }
}
/* Loading skeleton: shimmer placeholders shaped like the AI result */
.sk { position: relative; overflow: hidden; background: var(--border); }
.sk::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.07), transparent);
  animation: skShimmer 1.3s infinite;
}
@keyframes skShimmer { 100% { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .sk::after { animation: none; } }
.an-fix { align-items: flex-start; }
.an-fix-num {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; margin-top: 1px;
}
.an-fix strong { font-size: 13.5px; color: var(--text); }
.an-fix-pri { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; border-radius: 20px; padding: 1px 7px; margin-left: 6px; vertical-align: middle; }
.an-fix-where { display: block; font-size: 12px; color: var(--accent); margin-top: 3px; margin-bottom: 1px; }
.an-fix-why { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.an-fix-example { display: block; font-size: 12.5px; color: var(--text); line-height: 1.5; margin-top: 6px; padding: 7px 10px; background: var(--bg-2); border-left: 2px solid var(--success); border-radius: 0 6px 6px 0; }

/* ===== Analysis empty / pre-run state ===== */
.an-pre { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; padding: 18px 8px 6px; }
.an-pre-ring { position: relative; }
.an-pre-ring svg { display: block; animation: an-pre-spin 14s linear infinite; }
@keyframes an-pre-spin { to { transform: rotate(360deg); } }
.an-pre-ring svg text { animation: an-pre-counter 14s linear infinite; transform-origin: 60px 60px; }
@keyframes an-pre-counter { to { transform: rotate(-360deg); } }
.an-pre-lead { font-size: 14px; line-height: 1.6; color: var(--muted); max-width: 420px; margin: 0; }
.an-pre-lead b { color: var(--text); }
.an-pre-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.an-pre-tile {
  display: flex; align-items: flex-start; gap: 9px; text-align: left;
  padding: 12px; border-radius: 12px; background: var(--bg-1); border: 1px solid var(--border);
  transition: transform .15s, border-color .15s;
}
.an-pre-tile:hover { transform: translateY(-2px); }
.an-pre-tile b { display: block; font-size: 13px; color: var(--text); margin-bottom: 2px; }
.an-pre-tile span { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
.an-pre-ico { flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.an-pre-ico .ico { width: 14px; height: 14px; }
.an-pre-good { border-left: 3px solid #22c55e; } .an-pre-good .an-pre-ico { background: rgba(34,197,94,.15); color: #4ade80; }
.an-pre-bad  { border-left: 3px solid #ef4444; } .an-pre-bad  .an-pre-ico { background: rgba(239,68,68,.14); color: #f87171; }
.an-pre-fix  { border-left: 3px solid var(--accent); } .an-pre-fix .an-pre-ico { background: rgba(99,102,241,.16); color: #a5b4fc; }
.an-pre-emerald { border-left: 3px solid #10b981; } .an-pre-emerald .an-pre-ico { background: rgba(16,185,129,.15); color: #34d399; }
.an-pre-grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 560px) { .an-pre-grid, .an-pre-grid-4 { grid-template-columns: 1fr; } }

/* Tailor pre-run before → after preview */
.tailor-pre { display: flex; flex-direction: column; gap: 16px; padding: 4px 0 2px; }
.tailor-ba {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 12px;
}
.tailor-ba-col {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 7px;
}
.tailor-ba-col p { margin: 0; font-size: 12.5px; line-height: 1.55; }
.tailor-ba-before p { color: var(--muted); }
.tailor-ba-after { border-color: rgba(99,102,241,.4); background: linear-gradient(135deg, rgba(99,102,241,.1), transparent 80%); }
.tailor-ba-after p { color: var(--text); }
.tailor-ba-after p b { color: #a5b4fc; font-weight: 700; }
.tailor-ba-tag { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.tailor-ba-after .tailor-ba-tag { color: #818cf8; }
.tailor-ba-arrow { display: flex; align-items: center; justify-content: center; color: var(--accent); }
.tailor-ba-arrow .ico { width: 22px; height: 22px; }
.tailor-pre-note { text-align: center; font-size: 11.5px; color: var(--muted); margin: 0; }
@media (max-width: 560px) {
  .tailor-ba { grid-template-columns: 1fr; }
  .tailor-ba-arrow { transform: rotate(90deg); }
}
@media (prefers-reduced-motion: reduce) { .an-pre-ring svg, .an-pre-ring svg text { animation: none; } }
.ats-feedback-text {
  width: 100%; font-size: 13px; line-height: 1.65; color: var(--muted);
  white-space: pre-wrap; border-top: 1px solid var(--border); padding-top: 14px; margin-top: 4px;
}
.ats-feedback-text.ai-body { white-space: normal; text-align: left; }

/* ===== AI output: pretty formatting ===== */
.ai-body { white-space: normal; }
.ai-body .ai-para {
  font-size: 13.5px; line-height: 1.7; color: var(--text); margin: 0 0 10px;
}
.ai-body .ai-subhead {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); margin: 16px 0 8px;
}
.ai-body .ai-subhead::before {
  content: ''; width: 14px; height: 2px; border-radius: 2px; flex-shrink: 0;
  background: linear-gradient(90deg, var(--accent), transparent);
}
.ai-body .ai-subhead:first-child { margin-top: 0; }
/* Recommendation list/cards, shared by AI suggestion modal, tailor & analysis */
.ai-rec-list { list-style: none; margin: 0 0 2px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ai-rec-list li::marker { content: ''; }
.ai-rec {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13.5px; line-height: 1.55; color: var(--text);
  background: var(--bg-1); border: 1px solid var(--border); border-left: 2px solid transparent;
  border-radius: 10px; padding: 10px 12px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
  animation: aiRecIn .42s cubic-bezier(.2,.7,.2,1) both;
}
.ai-rec:hover { border-color: var(--accent); border-left-color: var(--accent); transform: translateX(2px); box-shadow: 0 4px 14px rgba(99,102,241,.12); }
.ai-rec-ico {
  flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; margin-top: 1px;
  box-shadow: 0 2px 6px rgba(99,102,241,.35);
}
.ai-rec-ico .ico { width: 12px; height: 12px; }
/* Staggered entrance so recommendations cascade in instead of popping all at once */
@keyframes aiRecIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.ai-rec:nth-child(1) { animation-delay: .03s; } .ai-rec:nth-child(2) { animation-delay: .09s; }
.ai-rec:nth-child(3) { animation-delay: .15s; } .ai-rec:nth-child(4) { animation-delay: .21s; }
.ai-rec:nth-child(5) { animation-delay: .27s; } .ai-rec:nth-child(6) { animation-delay: .33s; }
.ai-rec:nth-child(7) { animation-delay: .39s; } .ai-rec:nth-child(8) { animation-delay: .45s; }
@media (prefers-reduced-motion: reduce) { .ai-rec { animation: none; } }

/* AI suggestion modal */
.app-dialog.ai-suggest { max-width: 520px; padding: 0; overflow: hidden; }
.ai-suggest-head {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px; position: relative;
  background: linear-gradient(135deg, rgba(99,102,241,.22), rgba(139,92,246,.16));
  border-bottom: 1px solid var(--border);
}
.ai-suggest-head h3 { font-size: 16px; font-weight: 700; margin: 0; color: var(--text); }
.ai-suggest-spark {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff;
  box-shadow: 0 4px 14px rgba(99,102,241,.45);
}
.ai-suggest-spark .ico { width: 17px; height: 17px; }
.ai-suggest-head .modal-close {
  position: absolute; top: 14px; right: 16px; background: none; border: none;
  color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer;
}
.ai-suggest-body {
  padding: 18px 20px; max-height: 52vh; overflow-y: auto;
}
.ai-suggest-hint {
  margin: 0; padding: 0 20px 4px; font-size: 12px; color: var(--muted); line-height: 1.5;
}
.ai-suggest-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 14px 20px 18px; border-top: 1px solid var(--border);
}
.ai-suggest-actions .btn { display: inline-flex; align-items: center; gap: 6px; }

/* AI inline result panel (Analysis) */
.ai-result-panel {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden; margin-top: 4px;
}
.ai-result-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  background: linear-gradient(135deg, rgba(99,102,241,.18), rgba(139,92,246,.12));
  border-bottom: 1px solid var(--border);
}
.ai-result-head h4 { margin: 0; font-size: 14px; font-weight: 700; color: var(--text); }
.ai-result-panel .ai-body { padding: 16px; }

/* ===== Clickable preview headings ===== */
.preview-jump {
  cursor: pointer !important; position: relative;
}
.preview-jump::after {
  content: '✏ Edit'; position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  font-size: 8px; font-weight: 700; color: #6366f1;
  background: rgba(99,102,241,.12); border-radius: 4px; padding: 2px 5px;
  opacity: 0; transition: opacity .15s; pointer-events: none; white-space: nowrap;
}
.preview-jump:hover::after { opacity: 1; }
.preview-jump:hover { background: rgba(99,102,241,.06) !important; border-radius: 3px; }

/* ===== Template hover zoom popup ===== */
#template-zoom-popup {
  position: absolute; z-index: 300; pointer-events: none;
  opacity: 0; transform: scale(.92) translateX(-4px);
  transition: opacity .18s ease, transform .18s ease;
}
#template-zoom-popup.active {
  opacity: 1; transform: scale(1) translateX(0); pointer-events: auto;
}
.tzp-inner {
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.3);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  width: 160px;
}
.tzp-thumb { width: 130px; border-radius: 6px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.2); }
.tzp-thumb svg { width: 100%; height: auto; display: block; }
.tzp-name { font-size: 13px; font-weight: 700; color: var(--text); }
.tzp-hint { font-size: 11px; color: var(--muted); }
.template-card:hover { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(99,102,241,.2); }

/* ===== Quick Fixes (free, client-side checklist) ===== */
.qf-free-tag {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 999px;
  font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: none;
  background: rgba(16,185,129,.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,.3);
}
.qf-free-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  background: rgba(16,185,129,.13); color: #6ee7b7; border: 1px solid rgba(16,185,129,.3);
}
.qf-progress { margin-bottom: 16px; }
.qf-progress-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.qf-track { height: 7px; border-radius: 999px; background: var(--bg-3); overflow: hidden; }
.qf-fill { height: 100%; border-radius: 999px; transition: width .35s ease; }
.qf-list { display: flex; flex-direction: column; gap: 10px; }
.qf-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 14px; border-radius: 10px;
  background: var(--bg-2); border: 1px solid var(--border);
}
.qf-card.qf-warn { border-color: rgba(245,158,11,.35); }
.qf-card.qf-info { border-color: rgba(99,102,241,.3); }
.qf-card.qf-pass { opacity: .72; }
.qf-ico {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center; margin-top: 1px;
}
.qf-ico-ok { background: rgba(16,185,129,.15); color: #6ee7b7; }
.qf-ico-warn { background: rgba(245,158,11,.15); color: #fcd34d; }
.qf-ico-info { background: rgba(99,102,241,.15); color: #a5b4fc; }
.qf-card-body { flex: 1; min-width: 0; }
.qf-card-title { font-size: 13px; font-weight: 600; color: var(--text); }
.qf-card-detail { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.qf-btn { flex-shrink: 0; align-self: center; padding: 7px 14px; font-size: 12px; }
.qf-goto {
  flex-shrink: 0; align-self: center; background: none; border: none; cursor: pointer;
  color: var(--accent); font-size: 12px; font-weight: 600; padding: 4px 2px; white-space: nowrap;
}
.qf-goto:hover { text-decoration: underline; }
.qf-flash {
  animation: qf-flash-anim 1.6s ease;
  border-color: var(--accent) !important; box-shadow: 0 0 0 2px rgba(99,102,241,.25);
}
@keyframes qf-flash-anim {
  0%, 70% { box-shadow: 0 0 0 2px rgba(99,102,241,.35); }
  100% { box-shadow: 0 0 0 0 rgba(99,102,241,0); }
}

/* ===== Account center dropdown (editor topbar) ===== */
.acct-center { position: relative; }
.acct-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 999px;
  padding: 4px 8px 4px 4px; cursor: pointer; color: var(--text);
  transition: border-color .15s, background .15s;
}
.acct-trigger:hover { border-color: var(--accent); }
.acct-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff;
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.acct-chevron { color: var(--muted); transition: transform .2s ease; }
.acct-center.open .acct-chevron { transform: rotate(180deg); }
.acct-menu {
  position: absolute; top: calc(100% + 8px); right: 0; width: 264px; z-index: 200;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,.38); padding: 8px;
  animation: acct-in .14s ease;
}
@keyframes acct-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.acct-head { display: flex; align-items: center; gap: 10px; padding: 6px 8px 10px; }
.acct-avatar-lg { width: 38px; height: 38px; font-size: 15px; }
.acct-head-text { min-width: 0; }
.acct-email { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 188px; }
.acct-plan { font-size: 11px; color: var(--muted); margin-top: 1px; }
.acct-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.acct-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 9px 10px; border-radius: 9px;
  font-size: 13px; color: var(--text); background: none; border: none; text-align: left;
}
.acct-row-static { cursor: default; }
.acct-row-btn { cursor: pointer; }
.acct-row-btn:hover { background: var(--bg-3); }
.acct-row-label { color: var(--muted); }
.acct-row-btn .acct-row-label { color: var(--text); }
.acct-row-main { display: inline-flex; align-items: center; gap: 9px; }
.acct-row-icon { display: inline-flex; color: var(--muted); }
.acct-row-val { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.acct-row-danger { color: #f87171; }
.acct-row-danger:hover { background: rgba(248,113,113,.12); }
.acct-row-danger .acct-row-icon { color: #f87171; }

/* ===== Dashboard (command center) ===== */
.dash-hero { display: flex; align-items: center; gap: 20px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 14px; padding: 20px; margin-bottom: 16px; }
.dash-ring { position: relative; width: 96px; height: 96px; flex-shrink: 0; }
.dash-ring svg circle:last-child { transition: stroke-dashoffset .9s cubic-bezier(.2,.7,.2,1); }
.dash-ring-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dash-ring-score { font-size: 26px; font-weight: 800; line-height: 1; }
.dash-ring-lbl { font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.dash-verdict-title { font-size: 18px; font-weight: 700; }
.dash-verdict-sub { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.dash-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.dash-tile { background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px; cursor: pointer; transition: border-color .15s, transform .15s; }
.dash-tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.dash-tile-label { font-size: 11px; color: var(--muted); }
.dash-tile-val { font-size: 24px; font-weight: 700; margin-top: 6px; }
.dash-tile-bar { height: 5px; border-radius: 999px; background: var(--bg-3); margin-top: 8px; overflow: hidden; }
.dash-tile-bar > span { display: block; height: 100%; border-radius: 999px; transition: width .6s ease; }
.dash-card { background: var(--bg-2); border: 1px solid var(--border); border-radius: 14px; padding: 18px; margin-bottom: 16px; }
.dash-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dash-card-head h4 { font-size: 14px; font-weight: 700; margin: 0; }
.dash-ready-list { display: flex; flex-direction: column; gap: 8px; }
.dash-ready-item { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.dash-ready-ico { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; }
.dash-ready-ok { background: rgba(16,185,129,.15); color: #6ee7b7; }
.dash-ready-no { background: rgba(245,158,11,.15); color: #fcd34d; }
.dash-sub-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.dash-sub-card .btn { flex-shrink: 0; }
.dash-sub-meta { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
@media (max-width: 720px) {
  .dash-tiles { grid-template-columns: repeat(2, 1fr); }
  .dash-hero, .dash-sub-card { flex-direction: column; text-align: center; align-items: center; }
}

/* ===== Editor mobile bottom nav + drawers (styles were missing) =====
   The editor uses its own classes (.mobile-nav, .mobile-open, #sidebar-overlay)
   which had no CSS, so the bar rendered raw and showed on every screen. These
   rules style it and confine it to mobile widths. */
.mobile-nav { display: none; }
#sidebar-overlay { position: fixed; inset: 56px 0 0 0; background: rgba(0,0,0,.5); z-index: 155; display: none; }
#sidebar-overlay.show { display: block; }

@media (max-width: 900px) {
  .mobile-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 52px; z-index: 170;
    background: var(--bg-1); border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .mobile-nav-btn {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    background: none; border: none; color: var(--muted); font-size: 10px; font-weight: 600;
    cursor: pointer; text-decoration: none; transition: color .15s;
  }
  .mobile-nav-btn .ico { width: 20px; height: 20px; }
  .mobile-nav-btn:hover, .mobile-nav-btn.active { color: var(--accent); }
  /* Sidebar slide-in (editor JS toggles .mobile-open) */
  .sidebar.mobile-open { transform: translateX(0); }
  /* Preview overlay between the top bar and the bottom nav */
  .right-panel.mob-show {
    transform: none !important; position: fixed; inset: 56px 0 52px 0; width: auto; z-index: 165; overflow-y: auto;
  }
  /* Keep page content clear of the fixed bottom bar */
  .main-area { padding-bottom: 64px; }
}

/* ===== Display/accent font on app UI headings (never the resume templates) ===== */
.brand, .app-dialog-title, .section-head h3, .auth-card h2,
.dash-verdict-title, .ai-result-head h4, .ai-suggest-head h3,
.dash-ring-score, .dash-tile-val { font-family: var(--font-display); letter-spacing: -.01em; }

/* ===== First-signup welcome overlay ===== */
#welcome-overlay { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center;
  overflow: hidden; animation: welIn .4s ease both; }
#welcome-overlay.wel-out { animation: welOut .42s ease both; }
@keyframes welIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes welOut { from { opacity: 1; } to { opacity: 0; transform: scale(1.02); } }
.wel-bg { position: absolute; inset: 0;
  background: linear-gradient(135deg, #1e1b4b 0%, #4338ca 42%, #6366f1 72%, #8b5cf6 100%);
  background-size: 220% 220%; animation: welGrad 9s ease infinite; }
.wel-bg::after { content: ''; position: absolute; inset: 0;
  background: radial-gradient(45% 40% at 50% 28%, rgba(255,255,255,.20), transparent 70%); }
@keyframes welGrad { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.wel-card { position: relative; text-align: center; color: #fff; padding: 40px; max-width: 580px; }
.wel-logo img { width: 66px; height: 66px; border-radius: 18px; box-shadow: 0 16px 50px rgba(0,0,0,.45);
  animation: welPop .65s cubic-bezier(.2,1.3,.4,1) both; }
.wel-eyebrow { margin-top: 24px; font-family: var(--font-display); font-size: 13px; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; color: rgba(255,255,255,.82); opacity: 0; animation: welUp .6s ease .25s both; }
.wel-title { font-family: var(--font-display); font-size: clamp(34px, 5.2vw, 54px); font-weight: 800;
  line-height: 1.06; letter-spacing: -.02em; margin-top: 10px; opacity: 0; animation: welUp .7s ease .42s both; }
.wel-sub { font-size: 16px; line-height: 1.65; color: rgba(255,255,255,.85); max-width: 460px;
  margin: 18px auto 0; opacity: 0; animation: welUp .7s ease .62s both; }
.wel-btn { margin-top: 32px; padding: 14px 30px; border-radius: 12px; font-family: var(--font-display);
  font-size: 15px; font-weight: 700; color: #4338ca; background: #fff; box-shadow: 0 16px 44px rgba(0,0,0,.32);
  opacity: 0; animation: welUp .7s ease .82s both; transition: transform .15s ease, box-shadow .15s ease; }
.wel-btn:hover { transform: translateY(-2px); box-shadow: 0 20px 54px rgba(0,0,0,.4); }
@keyframes welPop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
@keyframes welUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .wel-bg { animation: none; }
  .wel-logo img, .wel-eyebrow, .wel-title, .wel-sub, .wel-btn { animation-duration: .01ms; opacity: 1; }
}

/* ===== AI card polish (Tailor / ATS / Analysis) ===== */
.ai-card-title { font-family: var(--font-display); letter-spacing: -.01em; }
.ai-card-icon { width: 46px; height: 46px; border-radius: 13px; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.ai-card-icon svg, .ai-card-icon .ico { width: 22px; height: 22px; }
.ai-icon-indigo  { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; }
.ai-icon-emerald { background: linear-gradient(135deg, #10b981, #34d399); color: #fff; }
.ai-icon-violet  { background: linear-gradient(135deg, #8b5cf6, #a78bfa); color: #fff; }
.ai-card-header { padding: 22px 24px; }
.ai-card-indigo  .ai-card-header { background: linear-gradient(135deg, rgba(99,102,241,.16), transparent 72%); }
.ai-card-emerald .ai-card-header { background: linear-gradient(135deg, rgba(16,185,129,.16), transparent 72%); }
.ai-card-violet  .ai-card-header { background: linear-gradient(135deg, rgba(139,92,246,.16), transparent 72%); }
/* Job-description textarea: soft focus glow */
.ai-card-body textarea { transition: border-color .15s ease, box-shadow .15s ease; }
.ai-card-body textarea:focus { box-shadow: 0 0 0 3px rgba(99,102,241,.18); }
/* Results animate in */
.ats-result-card, .ai-result-box { animation: aiResultIn .5s cubic-bezier(.2,.7,.2,1) both; }
@keyframes aiResultIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ats-result-card, .ai-result-box { animation: none; } }

/* ===== Free-tier on-ramp: AI trial banner, label, sidebar Pro badge ===== */
.free-ai-banner {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--muted);
  background: rgba(99,102,241,.08);
  border: 1px solid rgba(99,102,241,.22);
  border-radius: 10px; padding: 9px 12px; margin-bottom: 14px;
}
.free-ai-banner b { color: var(--text); font-weight: 600; }
.free-ai-banner a { color: var(--accent); font-weight: 600; text-decoration: none; }
.free-ai-banner a:hover { text-decoration: underline; }
.free-ai-banner.used {
  background: rgba(245,158,11,.08);
  border-color: rgba(245,158,11,.25);
}
.free-ai-label { font-size: 11px; color: var(--muted); opacity: .85; }
.sidebar-pro-badge {
  margin-left: auto;
  font-size: 10px; font-weight: 700; letter-spacing: .04em;
  color: var(--accent);
  background: rgba(99,102,241,.12);
  border: 1px solid rgba(99,102,241,.28);
  border-radius: 6px; padding: 1px 6px;
}

/* Button press micro-interaction, subtle tactile feedback on click. */
.btn { transition: transform .08s ease, filter .15s ease, background .15s ease, box-shadow .15s ease; }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }

/* Toast action button (e.g. Undo). */
.app-toast-action {
  margin-left: 10px; flex: none; background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.28); color: inherit; font-weight: 700;
  font-size: 12px; padding: 3px 11px; border-radius: 6px; cursor: pointer;
}
.app-toast-action:hover { background: rgba(255,255,255,.28); }

/* Loading skeleton shimmer. */
.skeleton {
  background: linear-gradient(90deg, var(--bg-2) 25%, rgba(148,163,184,.18) 37%, var(--bg-2) 63%);
  background-size: 400% 100%; animation: sk-shimmer 1.4s ease infinite;
  border-radius: 8px; min-height: 14px;
}
@keyframes sk-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* Respect users who prefer reduced motion: calm all animations/transitions.
   (The WebGL waves background already self-disables via matchMedia.) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
