/* Add this at the top if not already (your palette) */
:root {
  --primary: #6366f1; /* Indigo-500 for buttons/accents */
  --accent: #22c55e; /* Green-500 for success/highlights */
  --bg-primary: #0d1424; /* Slate-900 dark bg */
  --text-primary: #f8fafc; /* Slate-50 dark text */
  --bg-secondary: #1e293b; /* Slate-800 for cards/inputs */
  --text-secondary: #cbd5e1; /* Slate-300 labels */
  --placeholder: #64748b; /* Slate-400 placeholders (adjusted for contrast) */
  --border: #334155; /* Slate-700 borders */
  --logo-gradient: linear-gradient(to right, var(--primary), #a855f7);

}

.opacity-0 { opacity: 0; }
.opacity-100 { opacity: 1; }


@keyframes spin-slow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.animate-spin-slow {
  animation: spin-slow 2s linear infinite;
}



.swiper {
  width: 100%;
  padding-bottom: 1rem;
}

.swiper-wrapper {
  display: flex;
}

.swiper-slide {
  width: auto; /* let each card use its natural width */
  flex-shrink: 0;
}


body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.light {
  --bg-primary: #f8fafc; /* Light bg */
  --text-primary: #0f172a; /* Dark text */
  --bg-secondary: #ffffff;
  --text-secondary: #0f172a;
  --placeholder: #94a3b8; /* Adjusted for light mode contrast */
  --border: #cbd5e1;
  --logo-gradient: linear-gradient(to right, #4338ca, #7e22ce);

}

.logo {
  /* fill with your gradient */
  background: var(--logo-gradient);

  /* use the injected mask URL from inline style */
  -webkit-mask-image: var(--logo-mask);
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;

  mask-image: var(--logo-mask);
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;

  transition: background 0.3s ease;
}

.gradient-text {
  /* same gradient you use for logo & buttons */
  background: var(--logo-gradient);

  /* clip background into text, make text transparent to reveal it */
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;

  /* smooth transition on theme change */
  transition: background 0.3s ease;
}

body.light .template-section h2,
body.light #templateModalContent h2 {
  color: #1e293b;
}

body.light .template-section {
  background-color: #f9fafb; /* Tailwind slate-50 */
}

.template-section {
  transition: background-color 0.3s ease;
}

.template-card img {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); /* subtle, soft shadow */
  border-radius: 0.375rem; /* same as Tailwind rounded-md */
  background: white; /* ensures contrast even if image has transparency */
}

.swiper-button-next,
.swiper-button-prev {
  color: #6366f1; /* Tailwind indigo-500 */
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
  transition: color 0.3s ease;
}
body.light .swiper-button-next,
body.light .swiper-button-prev {
  color: #4f46e5; /* slightly darker for contrast in light mode */
}


/* Headings */
h1 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 2rem;
  text-align: center;
}

/* Labels */
label {
  font-weight: 500;
  color: var(--text-secondary);
  display: block;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  transition: color 0.3s ease;
}

body.dark label {
  color: #e2e8f0;  /* Your boost; overrides var if needed for contrast */
}

/* Unified input style (integrated with vars) */
.form-input {
  width: 100%;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  font-size: 0.95rem;
  resize: vertical;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.form-input::placeholder {
  color: var(--placeholder);
}

/* Button styles (integrated with vars) */
.button {
  margin-top: 2rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  background-color: var(--primary);
  color: white;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.button:hover {
  background-color: #4f46e5; /* Indigo-600; consider adding as --primary-hover in :root for var consistency */
}

body.light .button {
  background-color: #4338ca; /* Light mode override if needed; or use var(--primary) with adjustment in light :root */
}

body.light .button:hover {
  background-color: #3730a3;
}

.bar-wrapper {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
}


.bar-wrapper:hover .bar::before {
  transform: scaleY(var(--scale-factor));
}

.bar-wrapper:hover .bar {
  background: #3b82f6;
}


.result-box {
  margin-top: 3rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 0.5rem;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

@media (min-width: 768px) {
  .result-box {
    padding: 2rem;
  }
}


body.light .result-box {
  background-color: #ffffff;
  border-color: #cbd5e1;
}

.result-box h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 1.5rem;
}

/* Lists */
ul {
  margin-top: 0.5rem;
  padding-left: 1.25rem;
}

/* Step progress boxes */
.step {
  background-color: var(--bg-primary);
  border-left: 4px solid #475569;
  padding: 1rem;
  margin-top: 1rem;
  border-radius: 0.25rem;
  color: var(--text-secondary);
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.step.complete {
  border-color: var(--accent);
  color: var(--accent);
}

body.light .step {
  background-color: #f1f5f9;
  border-left-color: #94a3b8;
  color: #334155;
}

body.light .step.complete {
  border-color: #16a34a;
  color: #16a34a;
}

/* Insight boxes (integrated with vars) */
.insight-box {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: 1rem;
  margin-top: 1.5rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

body.light .insight-box {
  background-color: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.insight-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

body.light .insight-title {
  color: #0f172a;
}

.insight-value {
  margin-top: 0.5rem;
  font-size: 1rem;
  color: #e2e8f0;
}

body.light .insight-value {
  color: #334155;
}

.insight-list {
  margin-top: 0.5rem;
  padding-left: 1.25rem;
  list-style-type: disc;
  color: var(--text-secondary);
}

body.light .insight-list {
  color: #334155;
}

/* ATS list (kept as is) */
.ats-list {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 0.75rem;
}

.ats-item dt {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.ats-item dd {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

body.light .ats-item dt {
  color: #0f172a;
}

body.light .ats-item dd {
  color: #334155;
}

/* mt-2 (convert to Tailwind in HTML if possible, but keep if used) */
.mt-2 {
  margin-top: 0.5rem;
}



/* Template buttons (integrated with vars where possible) */
.template-button {
  padding: 0.75rem 1rem;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.template-button:hover {
  background-color: #334155;
}

.template-button.selected {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

body.light .template-button {
  background-color: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

body.light .template-button:hover {
  background-color: #e2e8f0;
}

body.light .template-button.selected {
  background-color: #4338ca;
  color: white;
  border-color: #4338ca;
}

/* Template previews (kept as is) */
.template-preview {
  cursor: pointer;
  transition: transform 0.2s ease, border 0.2s ease;
}

.template-preview:hover {
  transform: scale(1.02);
}

.template-preview.selected .preview-box {
  border: 2px solid var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

body.light .template-preview.selected .preview-box {
  border-color: #4338ca;
}




/* Word count and controls */
#wordCount {
  font-size: 0.875rem;
  color: #94a3b8; /* slate-400 */
}

/* Template cards (kept as is) */
.template-card {
  flex: 0 0 auto;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 0.5rem;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.2s;
}

.template-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.template-card.selected {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 1px #8b5cf6;
}

/* Swiper carousel template thumbnails */
#templateSwiper .template-img {
  width: 10rem;
  height: 14rem;
  object-fit: cover;
  object-position: top;
  border-radius: 0.375rem;
  background: #f8fafc;
}

/* Popup modal template thumbnails */
#templateModal .template-img {
  width: 100%;
  height: auto;
  aspect-ratio: 10 / 14;
  object-fit: cover;
  object-position: top;
  border-radius: 0.375rem;
  background: #f8fafc;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transition: box-shadow 0.3s ease;
}

#templateModalContent {
  background-color: #1e293b; /* Dark mode fallback */
  color: #f1f5f9;
  border: 1px solid #334155;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: background-color 0.3s ease, color 0.3s ease;
}


#templateContent {
  max-height: 1000px;
  opacity: 1;
  transition: none;
}

.rotate-180 {
  transform: rotate(180deg);
}

/* Rotate the SVG inside the button */
.collapse-toggle svg {
  transition: transform 0.3s ease;
}

.collapse-toggle.rotate-180 svg {
  transform: rotate(180deg);
}


body.light #templateModalContent {
  background-color: #ffffff;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

#job_description {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Light mode overrides */
body.light #job_description {
  background-color: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
}

body.light .collapse-toggle:hover svg {
  color: #4f46e5; /* indigo-600 */
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}


body.light #job_description::placeholder {
  color: #64748b;
  text-align: center;
}

/* === Job Description Scan Overlay (Premium) ======================= */

#job_description_wrapper { position: relative; }

/* Base overlay container */
.jd-scan-overlay{
  position:absolute;
  inset:0;
  border-radius:0.75rem;
  overflow:hidden;
  opacity:0;
  pointer-events:none;
  z-index:1;
  transform: translateZ(0);
  transition: opacity .22s ease-out;

  /* “glassy card” surface */
  background:
    radial-gradient(1200px 500px at 10% 0%, rgba(99,102,241,.22), transparent 60%),
    radial-gradient(900px 520px at 90% 100%, rgba(168,85,247,.18), transparent 62%),
    radial-gradient(700px 420px at 60% 40%, rgba(56,189,248,.10), transparent 55%),
    rgba(15, 23, 42, .92);

  border: 1px solid rgba(148,163,184,.22);
  box-shadow:
    0 12px 40px rgba(0,0,0,.35),
    inset 0 0 0 1px rgba(255,255,255,.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Light mode surface */
body.light .jd-scan-overlay{
  background:
    radial-gradient(1200px 500px at 10% 0%, rgba(99,102,241,.14), transparent 60%),
    radial-gradient(900px 520px at 90% 100%, rgba(168,85,247,.10), transparent 62%),
    radial-gradient(700px 420px at 60% 40%, rgba(56,189,248,.08), transparent 55%),
    rgba(248, 250, 252, .94);
  border-color: rgba(15,23,42,.10);
  box-shadow:
    0 12px 40px rgba(0,0,0,.10),
    inset 0 0 0 1px rgba(255,255,255,.55);
}

/* Visible state */
.jd-scan-overlay.is-active{ opacity:1; }

/* Subtle grain (premium texture) */
.jd-scan-overlay::before{
  content:"";
  position:absolute;
  inset:-40%;
  opacity:.16;
  mix-blend-mode: overlay;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.35) 0 1px, transparent 2px),
    radial-gradient(circle at 80% 40%, rgba(255,255,255,.25) 0 1px, transparent 2px),
    radial-gradient(circle at 40% 80%, rgba(255,255,255,.22) 0 1px, transparent 2px);
  background-size: 180px 180px, 220px 220px, 260px 260px;
  animation: jd-grain 6s steps(8) infinite;
  pointer-events:none;
}
@keyframes jd-grain{
  0%{ transform: translate3d(0,0,0); }
  100%{ transform: translate3d(-6%, -8%, 0); }
}

/* Soft vignette to “focus” the center */
.jd-scan-overlay::after{
  content:"";
  position:absolute;
  inset:0;
  background: radial-gradient(closest-side at 50% 50%,
    rgba(0,0,0,0) 55%,
    rgba(0,0,0,.28) 100%);
  pointer-events:none;
}

/* Dim layer over textarea (kept subtle) */
.jd-scan-layer{
  position:absolute;
  inset:0;
  background: linear-gradient(to bottom, rgba(2,6,23,.10), rgba(2,6,23,.40));
}
body.light .jd-scan-layer{
  background: linear-gradient(to bottom, rgba(2,6,23,.02), rgba(2,6,23,.08));
}

/* Moving scan band (glow + crisp core line) */
.jd-scan-line{
  position:absolute;
  left:-10%;
  right:-10%;
  height:84px;
  opacity:.96;
  transform: translateY(-130%);
  will-change: transform;
  animation: jd-scan-sweep 1.9s cubic-bezier(.2,.8,.2,1) infinite;
  -webkit-animation: jd-scan-sweep 1.9s cubic-bezier(.2,.8,.2,1) infinite;

  background:
    linear-gradient(to bottom,
      transparent 0%,
      rgba(56,189,248,.10) 18%,
      rgba(99,102,241,.55) 48%,
      rgba(168,85,247,.38) 62%,
      transparent 100%);
  box-shadow:
    0 0 26px rgba(99,102,241,.55),
    0 0 55px rgba(168,85,247,.22);
}

/* Crisp “laser” core */
.jd-scan-line::before{
  content:"";
  position:absolute;
  left:0;
  right:0;
  top:50%;
  height:2px;
  transform: translateY(-50%);
  background: linear-gradient(to right,
    transparent,
    rgba(255,255,255,.55),
    rgba(255,255,255,.18),
    transparent);
  filter: blur(.2px);
  opacity:.9;
}

/* Specular sweep inside the band (adds “expensive” motion) */
.jd-scan-line::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(120deg,
    transparent 0%,
    rgba(255,255,255,.10) 42%,
    transparent 70%);
  background-size: 220% 100%;
  animation: jd-shimmer 1.2s ease-in-out infinite;
  mix-blend-mode: screen;
  opacity:.55;
}
@keyframes jd-shimmer{
  0%{ background-position: 0% 50%; }
  100%{ background-position: 100% 50%; }
}

@keyframes jd-scan-sweep{
  0%   { transform: translateY(-130%); }
  100% { transform: translateY(130%); }
}
@-webkit-keyframes jd-scan-sweep{
  0%   { -webkit-transform: translateY(-130%); }
  100% { -webkit-transform: translateY(130%); }
}

/* Centered premium pill */
.jd-scan-label{
  position:absolute;
  left:50%;
  top:50%;
  transform: translate(-50%, -50%);
  display:inline-flex;
  align-items:center;
  gap:.55rem;

  padding: .55rem 1.05rem;
  border-radius: 999px;
  border: 1px solid transparent;

  /* Gradient border + glass fill */
  background:
    linear-gradient(rgba(15,23,42,.72), rgba(15,23,42,.72)) padding-box,
    linear-gradient(90deg, rgba(99,102,241,.9), rgba(168,85,247,.9)) border-box;

  color:#e5e7eb;
  font-size:.75rem;
  letter-spacing:.14em;
  text-transform:uppercase;

  box-shadow:
    0 18px 55px rgba(0,0,0,.55),
    0 0 0 1px rgba(255,255,255,.06) inset;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

body.light .jd-scan-label{
  background:
    linear-gradient(rgba(255,255,255,.78), rgba(255,255,255,.78)) padding-box,
    linear-gradient(90deg, rgba(99,102,241,.75), rgba(168,85,247,.75)) border-box;
  color:#0f172a;
  box-shadow: 0 18px 55px rgba(0,0,0,.12);
}

.jd-scan-label span{ white-space: nowrap; }

/* subtle label micro-motion (less “pulsing”, more “premium”) */
.jd-scan-overlay.is-active .jd-scan-label{
  animation: jd-label-float 2.4s ease-in-out infinite;
}
@keyframes jd-label-float{
  0%,100%{ transform: translate(-50%,-50%) translateY(0); }
  50%{ transform: translate(-50%,-50%) translateY(-2px); }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  .jd-scan-line,
  .jd-scan-line::after,
  .jd-scan-overlay::before,
  .jd-scan-overlay.is-active .jd-scan-label{
    animation: none !important;
  }
}

/* === Resume Upload (Premium) ======================= */

#resume-drop-zone{
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,.25);
  background:
    radial-gradient(900px 420px at 15% 0%, rgba(99,102,241,.18), transparent 60%),
    radial-gradient(800px 420px at 85% 100%, rgba(168,85,247,.14), transparent 62%),
    rgba(15,23,42,.72);
  box-shadow:
    0 18px 55px rgba(0,0,0,.35),
    inset 0 0 0 1px rgba(255,255,255,.04);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

#resume-drop-zone::before{
  content:"";
  position:absolute;
  inset:-1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(90deg,
    rgba(99,102,241,.70),
    rgba(168,85,247,.60),
    rgba(56,189,248,.45));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: .22;
  pointer-events:none;
}

#resume-drop-zone:hover{
  transform: translateY(-1px);
  border-color: rgba(148,163,184,.35);
  box-shadow:
    0 22px 70px rgba(0,0,0,.42),
    inset 0 0 0 1px rgba(255,255,255,.06);
}

#resume-drop-zone.is-dragover{
  border-color: rgba(99,102,241,.65);
  box-shadow:
    0 0 0 3px rgba(99,102,241,.18),
    0 26px 75px rgba(0,0,0,.48),
    inset 0 0 0 1px rgba(255,255,255,.06);
}

#resume-drop-zone.is-uploading{
  pointer-events: none;
}

#resume-drop-zone.is-uploading::after{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(to bottom, rgba(2,6,23,.10), rgba(2,6,23,.55));
  pointer-events:none;
}

/* spinner + bar */
.upload-spinner{ animation: upload-spin 1s linear infinite; }
@keyframes upload-spin{ to { transform: rotate(360deg); } }

.upload-bar{
  height: 8px;
  border-radius: 999px;
  background: rgba(148,163,184,.18);
  overflow:hidden;
  border: 1px solid rgba(148,163,184,.18);
}
.upload-bar > span{
  display:block;
  height:100%;
  width:40%;
  border-radius:inherit;
  background: linear-gradient(90deg, rgba(99,102,241,.9), rgba(168,85,247,.9));
  animation: upload-bar 1.15s ease-in-out infinite;
}
@keyframes upload-bar{
  0%{ transform: translateX(-60%); opacity:.55; }
  50%{ opacity:1; }
  100%{ transform: translateX(220%); opacity:.55; }
}

@media (prefers-reduced-motion: reduce){
  .upload-spinner, .upload-bar > span{ animation: none !important; }
}


/* Template section Copy (top one, if kept) */
.template-copy {
  background-color: var(--primary);
  z-index: 5;
}

/* Preview Copy (in toolbar) */
.preview-copy {
  position: relative;
  z-index: 15;
  padding: 0.5rem 1rem;
  background-color: #334155;
  color: white;
  border-radius: 0.5rem;
  font-size: 0.9rem;
}

/* Paper container: full-width white card that clips children.
   The scale transform goes on #resume_editor (the ink), never here. */
#resume_container {
  position: relative;
  background: white;
  border-radius: 0.75rem;   /* matches rounded-xl on the outer wrapper */
  overflow: hidden;         /* clips the blur gate and watermark cleanly */
}

/* ChatGPT-ish copy button (top-right, subtle glass) */
.resume-copy-btn{
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 30;

  display: inline-flex;
  align-items: center;
  gap: .5rem;

  padding: .45rem .7rem;
  border-radius: 999px;

  background: rgba(30, 41, 59, .72);
  color: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, .22);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  font-size: .85rem;
  line-height: 1;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease, opacity .15s ease;
}

.resume-copy-btn:hover{
  transform: translateY(-1px);
  border-color: rgba(99, 102, 241, .35);
}

.resume-copy-btn:active{
  transform: translateY(0px);
  opacity: .92;
}

/* icon toggle */
.resume-copy-btn .icon{ display:inline-flex; }
.resume-copy-btn .icon-check{ display:none; }
.resume-copy-btn.is-copied .icon-copy{ display:none; }
.resume-copy-btn.is-copied .icon-check{ display:inline-flex; }

/* label swap color on success */
.resume-copy-btn.is-copied{
  border-color: rgba(34, 197, 94, .35);
  background: rgba(15, 23, 42, .75);
}

/* error state (optional) */
.resume-copy-btn.is-error{
  border-color: rgba(248, 113, 113, .35);
}

/* Light mode */
body.light .resume-copy-btn{
  background: rgba(255, 255, 255, .78);
  color: #0f172a;
  border-color: rgba(15, 23, 42, .12);
}

/* Never show in print */
@media print{
  .resume-copy-btn{ display:none !important; }
}


/* Media queries - Hide top Copy on mobile if kept */
@media (max-width: 768px) {
  /* ... existing styles ... */
  .show-all-templates {
    width: 100%;
    padding: 0.5rem;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
  }
  .template-copy {
    display: none; /* Hide on mobile to avoid duplication */
  }
  .preview-copy {
    display: block !important;
    width: auto;
    position: absolute;
    right: 0.5rem;
    top: 0.4rem;
    padding: 0.4rem 0.8rem;
  }
  .template-gallery {
    gap: 0.5rem; /* Even tighter for 430px */
    padding-top: 0.5rem; /* Reduce vertical padding */
    padding-bottom: 0.5rem; /* Reduce vertical padding */
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  /* ... existing ... */
  .template-copy {
    display: inline-block; /* Show on larger */
  }
}

/* Add/expand transitions (applied to more elements for smoothness) */
body, .insight-box, .form-input, .button, .ql-toolbar, .ql-container, #resume_editor {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Strip browser/Tailwind default block margins from native resume tags.
   Without this, every <p> and <h2> adds ~1em top+bottom which inflates
   scrollHeight and triggers the vertical scaler unnecessarily. */
#resume_editor p,
#resume_editor ul,
#resume_editor ol,
#resume_editor li,
#resume_editor h1,
#resume_editor h2,
#resume_editor h3 {
  margin-top: 0 !important;
  margin-bottom: 0.25rem !important;
}

#resume_editor {
  max-width: 100%;  /* Full width of parent (no 800px cap) */
  margin: 0 auto;  /* Still center if needed */
  padding: 1rem 0;  /* Top/bottom only; sides handled below */
  font-family: Georgia, 'Times New Roman', serif; /* Keep your font */
  font-size: 12px;
  line-height: 1.75;
  color: #1e293b;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* —— Toolbar, scoped to *this* editor —— */
.resume-editor-wrapper > .ql-toolbar {
  max-width: 816px;
  margin: 0 auto;
  border-radius: .5rem .5rem 0 0;
  transition: background-color .3s, border-color .3s, color .3s;
}

/* Light-mode toolbar */
#resume_editor ~ .ql-toolbar {
  max-width: 816px;
  margin: 0 auto 8px;
  border-radius: .5rem .5rem 0 0;
}

/* Dark-mode toolbar */
body:not(.light) #resume_editor > .ql-toolbar {
  background: #1e293b !important;    /* slate-800 */
  border:     1px solid #334155 !important;  /* slate-700 */
  color:      #f8fafc !important;    /* slate-50 */
}

.resume-editor-wrapper > .ql-toolbar .ql-stroke,
#resume_editor ~ .ql-toolbar .ql-stroke { stroke: currentColor !important; }

.resume-editor-wrapper > .ql-toolbar .ql-fill,
#resume_editor ~ .ql-toolbar .ql-fill { fill: currentColor !important; }

/* —— The editable “paper” —— */
/* Make the paper scroll within the 11in container—don’t crop it */
#resume_editor .ql-editor {
  background: #fff !important;
  color: #111 !important;
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.2;

  /* Let content grow freely — the paper card (.resume-editor-wrapper) clips it
     via overflow: hidden. The global scaler then shrinks #resume_container to fit. */
  height: auto !important;
  min-height: calc(11in - 1in);      /* 0.5in top + 0.5in bottom padding */
  max-height: none !important;
  overflow: visible;

  padding: 0.5in 0.3in;
  box-sizing: border-box;
}




/* Make sure the custom skills list uses the SAME indent as other bullets */
#resume_editor .ql-editor ul.skills-list,
#resume_teaser ul.skills-list {
  list-style: disc;
  padding-left: 1em;                 /* match other lists */
  margin: .3em 0;
  list-style-position: outside;
}

ul.skills-list li {
  margin: .2em 0;
  padding-left: .5em;                /* match generic <li> padding */
  white-space: normal;               /* allow wrapping like other bullets */
  overflow: visible;
  text-overflow: clip;
}



/* Shared section headings for editor + guest */
#resume_editor .ql-editor h2,
#resume_teaser.ql-editor h2 {          /* <-- dot moves onto #resume_teaser */
  font-family: inherit;
  font-weight: 600;
  font-size: 1.1rem;
  margin: 1.5em 0 .5em;
  border-bottom: 1px solid #333;
  padding-bottom: .25em;
}

/* Fallback when AI outputs <p><strong>Section</strong></p> instead of <h2> */
#resume_editor .ql-editor p > strong:only-child,
#resume_teaser.ql-editor p > strong:only-child {  /* <-- same fix here */
  display: block;
  font-family: inherit;
  font-weight: 600;
  font-size: 1.1rem;
  margin: 1.5em 0 .5em;
  padding-bottom: .25em;
  border-bottom: 1px solid #333;
}


/* Keep your mobile hairline-friendly dividers (already present for guest) */


#resume_editor .ql-editor li {
  margin-bottom: 0.2em;  /* Tighter spacing between bullets */
  padding-left: 0.5em;   /* Reduce indent per bullet */
}

#resume_editor .ql-editor p {
  margin: 0.3em 0;       /* Tighter paragraph spacing, especially for summary */
  line-height: 1.3;      /* Slight override to compress multi-line text like the summary */
}

#resume_editor .ql-editor ul.skills {  /* Assume you can add a class in generation if needed; otherwise skip */
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding-left: 0;
}
#resume_editor .ql-editor ul.skills li {
  margin-right: 1em;
  margin-bottom: 0.2em;
  padding-left: 0;
}


/* 1) One paper look for BOTH editor + teaser */
#resume_editor .ql-editor,
#resume_teaser.ql-editor {
  /* match the teaser’s type + spacing exactly */
  font-family: Georgia, "Times New Roman", serif !important;
  font-size: 12px !important;      /* Quill sets 13px; override to 12 to match teaser */
  line-height: 1.2 !important;
  color: #111 !important;
  background: #fff !important;
  padding: 0.5in 0.3in !important;
  box-sizing: border-box !important;
}

/* 2) Safe wrapping so long emails/links don’t push width in editor
      (teaser already has this under html.user-guest) */
#resume_editor .ql-editor,
#resume_editor .ql-editor * {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}

/* 3) Reset default margins in the editor, then re-apply the same rhythm as teaser */
#resume_editor .ql-editor h1,
#resume_editor .ql-editor h2,
#resume_editor .ql-editor h3,
#resume_editor .ql-editor h4,
#resume_editor .ql-editor p,
#resume_editor .ql-editor ul,
#resume_editor .ql-editor ol,
#resume_editor .ql-editor li,
#resume_editor .ql-editor hr,
#resume_editor .ql-editor section,
#resume_editor .ql-editor div {
  margin: 0;
}

/* Section headings */
#resume_editor .ql-editor h2 {
  font-family: inherit; 
  font-weight: 600;
  font-size: 1.1rem;
  margin: 1em 0 .5em;
  border-bottom: 1px solid #333;
  padding-bottom: .15em;
}

#resume_editor .ql-editor p {            /* same as teaser */
  margin: .3em 0;
  line-height: 1.3;
}
#resume_editor .ql-editor ul {           /* same as teaser */
  margin: .3em 0;
  padding-left: 1em;
  list-style-position: outside;
}
#resume_editor .ql-editor li {           /* same as teaser */
  margin-bottom: .2em;
  padding-left: .5em;
  line-height: 1.2;
}

/* Paper look if Quill hasn't mounted yet (no .ql-editor) */
#resume_editor:not(:has(.ql-editor)) {
  background: #fff;
  color: #111;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  line-height: 1.2;
  padding: 0.5in 0.3in;
  box-sizing: border-box;
}

/* Heading + rhythm parity for the fallback */
#resume_editor:not(:has(.ql-editor)) h2 {
  font-family: inherit;
  font-weight: 600;
  font-size: 1.1rem;
  border-bottom: 1px solid #333;
  padding-bottom: .25em;
  margin: 1.5em 0 .5em;
}
#resume_editor:not(:has(.ql-editor)) p { margin:.3em 0; line-height:1.3; }
#resume_editor:not(:has(.ql-editor)) ul { margin:.3em 0; padding-left:1em; list-style-position:outside; }
#resume_editor:not(:has(.ql-editor)) li { margin-bottom:.2em; padding-left:.5em; line-height:1.2; }


/* —— Release the 850px cap on the wrapper —— */
/* Paper card: fixed Letter aspect ratio keeps the preview shape correct even before
   JS runs. The global scaler (scaleResumeForMobile) then locks pixel-exact dimensions,
   zeros padding, and applies overflow: hidden via inline styles.
   NOTE: box-sizing intentionally omitted — the Tailwind md:p-8 class on this element
   uses content-box sizing, and JS sets padding: 0 inline which overrides it.
   Adding border-box here would cause a 752px content area (816 - 64px padding) in the
   ~16ms window before JS runs, clipping the right edge of #resume_container. */
.resume-editor-wrapper {
  aspect-ratio: 8.5 / 11;
  overflow: hidden;
  /* Force a new stacking context so border-radius + overflow:hidden
     correctly clips children even when a CSS transform is applied. */
  transform: translateZ(0);
  isolation: isolate;
}

#preview-wrapper .resume-editor-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

/* Inner content container: self-clips its own corners so that even a sub-pixel
   bleed past the parent border-radius clip is invisible. overflow: hidden here
   is the "nuclear option" — the inner element hides its own overflow before it
   can escape the parent. transform-origin: top center matches margin: 0 auto. */
#resume_container {
  overflow: hidden;
  border-radius: 0.75rem; /* matches .resume-editor-wrapper rounded-xl (12px) */
  transform-origin: top center;
}

#resume_editor.ql-container {
  width: 8.5in;
  height: 11in;
  padding: 0;  /* Remove padding here to avoid compounding with .ql-editor */
  background: #fff !important;
  box-shadow: none !important;
  box-sizing: border-box;
  margin: 0 auto;
}

#resume_container {
  width: 8.5in;
  padding: 0;
  margin: 0 auto;
  box-sizing: border-box;
  max-width: 100%;
}

/* Keep text away from the curved bottom corner of #resume_container.
   The border-radius is ~12px; 20px of padding gives comfortable clearance. */
#resume_editor {
  padding-bottom: 20px !important;
}

/* ensure the Quill toolbar & editor fill that padded area */
#resume_editor,
#resume_editor .ql-toolbar,

/* Was: #resume_editor.ql-container { ... }  (targets nothing) */
#resume_editor .ql-container {
  width: 8.5in;
  height: 11in;
  padding: 0;                 /* don't add extra space around .ql-editor */
  background: #fff !important;
  box-shadow: none !important;
  box-sizing: border-box;
  margin: 0 auto;
}


/* In styles.css */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}
.scrollbar-hide {
  -ms-overflow-style: none;  /* IE/Edge */
  scrollbar-width: none;     /* Firefox */
}

#resume_editor .ql-editor .job-title-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: baseline !important;
  width: 100% !important;
  gap: 1rem !important; /* Space between title and dates */
}

#resume_editor .ql-editor .job-title {
  font-weight: 600 !important;
  flex-grow: 1 !important;
}

#resume_editor .ql-editor .dates {
  text-align: right !important;
  font-weight: normal !important;
  color: #333 !important;
  font-size: 0.95em !important;
}




.insight-box {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
body.light .insight-box {
  background-color: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.insight-title {
  color: var(--text-primary);
  font-size: 1.125rem;
  font-weight: 600;
}
body.light .insight-title {
  color: #0f172a;
}

.insight-list {
  list-style: disc;
  padding-left: 1.25rem;
  color: var(--text-secondary);
}
body.light .insight-list {
  color: #334155;
}


.flash-messages {
    padding: 10px;
    background-color: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
    margin-bottom: 10px;
    text-align: center;
}



@keyframes slideFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.loading-step-animate {
  animation: slideFadeIn 0.6s ease forwards;
}

#loading-steps {
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#step-card {
  max-width: 90%;
}



#loading-section {
  width: 100%;
  max-width: 840px;
  margin: 0 auto;
  background-color: rgba(30, 41, 59, 0.75); /* semi-transparent slate-800 */
  color: var(--text-primary);
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  text-align: center;
  backdrop-filter: blur(2px);
  position: relative; /* Contain .loading-background */
}

.loading-background {
 background-color: #081322; /* Deep blue */
  opacity: 1; /* Full opacity */
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.loading-background::before,
.loading-background::after,
.loading-background .layer-1,
.loading-background .layer-2 {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 200%;
  background-repeat: repeat;
  background-size: 300px 300px;
  opacity: 0.2;
  animation: drift linear infinite;
}

.loading-background .layer-1 {
  background-image: 
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1.5px 1.5px at 60% 70%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1.5px 1.5px at 40% 50%, rgba(255,255,255,0.9), transparent),
    radial-gradient(1.5px 1.5px at 80% 20%, rgba(255,255,255,0.9), transparent);
  background-size: 200px 200px;
  opacity: 0.3;
  animation: drift 120s linear infinite, twinkle 4s ease-in-out infinite alternate;
  animation-delay: 0s;
}

.loading-background .layer-2 {
  background-image: 
    radial-gradient(2px 2px at 10% 80%, rgba(255,255,255,0.8), transparent),
    radial-gradient(2px 2px at 50% 40%, rgba(255,255,255,0.8), transparent),
    radial-gradient(2px 2px at 90% 60%, rgba(255,255,255,0.8), transparent);
  background-size: 400px 400px;
  opacity: 0.25;
  animation: drift 80s linear infinite reverse, twinkle 6s ease-in-out infinite alternate;
  animation-delay: -10s;
}

.loading-background::before {
  background-image: 
    radial-gradient(3px 3px at 30% 10%, rgba(255,255,255,0.7), transparent),
    radial-gradient(3px 3px at 70% 90%, rgba(255,255,255,0.7), transparent);
  background-size: 600px 600px;
  opacity: 0.15;
  animation: drift 60s linear infinite, twinkle 5s ease-in-out infinite alternate;
  animation-delay: -20s;
}

.loading-background::after {
  background-image: 
    radial-gradient(4px 4px at 50% 50%, rgba(255,255,255,0.5), transparent);
  background-size: 800px 800px;
  opacity: 0.1;
  animation: drift 100s linear infinite reverse;
  animation-delay: -30s;
}

/* Consolidated Starfield Effect for main background */
.starfield-bg {
  position: fixed;
  top: 0;
  inset: 0 !important; 
  background-color: #121d2c; /* Deep blue/purple */
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
  opacity: 1;
}

.starfield-bg::before,
.starfield-bg::after,
.starfield-bg .layer-1,
.starfield-bg .layer-2 {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 200%;
  background-repeat: repeat;
  background-size: 300px 300px;
  opacity: 0.2;
  animation: drift linear infinite;
}

.starfield-bg .layer-1 {
  background-image: 
    radial-gradient(5px 5px at 20% 30%, rgba(255,255,255,1), transparent),
    radial-gradient(5px 5px at 60% 70%, rgba(255,255,255,1), transparent),
    radial-gradient(5px 5px at 40% 50%, rgba(255,255,255,1), transparent),
    radial-gradient(5px 5px at 80% 20%, rgba(255,255,255,1), transparent);
  background-size: 200px 200px;
  opacity: 1;
  animation: drift 120s linear infinite, twinkle 4s ease-in-out infinite alternate;
  animation-delay: 0s;
}

.starfield-bg .layer-2 {
  background-image: 
    radial-gradient(6px 6px at 10% 80%, rgba(255,255,255,0.8), transparent),
    radial-gradient(6px 6px at 50% 40%, rgba(255,255,255,0.8), transparent),
    radial-gradient(6px 6px at 90% 60%, rgba(255,255,255,0.8), transparent);
  background-size: 400px 400px;
  opacity: 0.8;
  animation: drift 80s linear infinite reverse, twinkle 6s ease-in-out infinite alternate;
  animation-delay: -10s;
}

.starfield-bg::before {
  background-image: 
    radial-gradient(8px 8px at 30% 10%, rgba(255,255,255,0.7), transparent),
    radial-gradient(8px 8px at 70% 90%, rgba(255,255,255,0.7), transparent);
  background-size: 600px 600px;
  opacity: 0.7;
  animation: drift 60s linear infinite, twinkle 5s ease-in-out infinite alternate;
  animation-delay: -20s;
}

.starfield-bg::after {
  background-image: 
    radial-gradient(10px 10px at 50% 50%, rgba(255,255,255,0.5), transparent);
  background-size: 800px 800px;
  opacity: 0.6;
  animation: drift 100s linear infinite reverse;
  animation-delay: -30s;
}


@keyframes starfieldOverlay {
  0%   { background-position: 0 0, 50px 50px; }
  100% { background-position: 1500px 1000px, 1600px 1100px; }
}


@keyframes starfieldAnim {
  0% {
    background-position: 0 0, 50px 50px;
  }
  100% {
    background-position: 1000px 1000px, 1050px 1050px;
  }
}
/* Consolidated Starfield Effect for main background */
.starfield-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-primary); /* Dynamic light/dark mode */
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
  opacity: 1;
}

.starfield-bg::before,
.starfield-bg::after,
.starfield-bg .layer-1,
.starfield-bg .layer-2 {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 200%;
  height: 200%;
  background-repeat: repeat;
  background-size: 300px 300px;
  opacity: 0.25;
  animation: drift linear infinite;
}

.starfield-bg .layer-1 {
  background-image: 
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 60% 70%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 40% 50%, rgba(255,255,255,0.8), transparent),
    radial-gradient(1px 1px at 80% 20%, rgba(255,255,255,0.8), transparent);
  background-size: 200px 200px;
  opacity: 0.4;
  animation: drift 120s linear infinite, twinkle 4s ease-in-out infinite alternate;
  animation-delay: 0s;
}

.starfield-bg .layer-2 {
  background-image: 
    radial-gradient(1.5px 1.5px at 10% 80%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.5px 1.5px at 50% 40%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.5px 1.5px at 90% 60%, rgba(255,255,255,0.7), transparent);
  background-size: 400px 400px;
  opacity: 0.3;
  animation: drift 80s linear infinite reverse, twinkle 6s ease-in-out infinite alternate;
  animation-delay: -10s;
}

.starfield-bg::before {
  background-image: 
    radial-gradient(2px 2px at 30% 10%, rgba(255,255,255,0.6), transparent),
    radial-gradient(2px 2px at 70% 90%, rgba(255,255,255,0.6), transparent);
  background-size: 600px 600px;
  opacity: 0.2;
  animation: drift 60s linear infinite, twinkle 5s ease-in-out infinite alternate;
  animation-delay: -20s;
}

.starfield-bg::after {
  background-image: 
    radial-gradient(3px 3px at 50% 50%, rgba(255,255,255,0.4), transparent);
  background-size: 800px 800px;
  opacity: 0.1;
  animation: drift 100s linear infinite reverse;
  animation-delay: -30s;
}

@keyframes drift {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(-50%, -50%);
  }
}

@keyframes twinkle {
  0%, 100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.5;
  }
}

/* -----------------------------------
   Light Mode Support
------------------------------------ */
body.light .gauge {
  background: conic-gradient(from 180deg at 50% 100%, #ff0000 0deg, #f97316 35%, #facc15 45%, #cbe4a3 50%, #008531 80%, #004018 100%);
}
body.light .gauge-score {
  color: #0f172a;
}
body.light .gauge-needle {
  background: black;
}
body.light .text-green-500 {
  color: #16a34a;
}

body.light .resify-gauge-score {
  color: #0f172a;
}

body.light .resify-gauge .needle::after {
  background: #0f172a;
}

body:not(.light) .resify-gauge .needle::after {
  background: white;
}

body.light .resify-gauge-inner {
  background: #1e293b; /* Match light mode background */
}

body:not(.light) .resify-gauge-inner {
  background: #1e293b; /* Match dark mode background */
}

.resify-gauge-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 200px;
  position: relative;
}

.resify-gauge {
  width: 200px;
  height: 100px;
  position: relative; /* No background or overflow here now */
}

.resify-gauge-arc {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: conic-gradient(from 180deg at 50% 100%, #ff0000 0deg, #f97316 35%, #facc15 45%, #cbe4a3 50%, #008531 80%, #004018 100%);
  border-radius: 100px 100px 0 0;
  overflow: hidden;
}

.resify-gauge-inner {
  position: absolute;
  bottom: 0;
  left: 5px;
  width: 190px;
  height: 95px;
  border-radius: 95px 95px 0 0;
  overflow: hidden;
}

.needle {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 95px;
  transform-origin: 50% 100%;
  z-index: 10;
  transition: transform 0.6s ease-in-out;
}

.needle::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.resify-gauge-score {
  position: absolute;
  top: 50px; /* Center vertically in the open space below the thin arch */
  left: 50%;
  transform: translate(-50%, 0);
  font-size: 2.5rem;
  font-weight: bold;
  text-align: center;
  z-index: 5;
}

.gauge-marks {
  position: absolute;
  top: 80px; /* Position below the score */
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 10px;
  box-sizing: border-box;
  font-size: 0.8rem;
  color: #6b7280;
  z-index: 5;
}

.gauge {
  transform: rotate(var(--needle-angle));
  transition: transform 0.4s ease;
}

.needle {
  transition: transform 1s ease;
  transform-origin: bottom center;
}

/* Container for Side by Side Layout */
.score-comparison-container {
  display: flex;
  justify-content: space-between;
  gap: 20px; /* Adjust spacing between gauge and graph */
  width: 520px; /* Adjusted for wider graph */
}

/* Comparison Graph Styles */
.comparison-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 300px; /* Increased width for easier viewing */
}
.comparison-graph {
  position: relative;
  width: 100%;
  max-width: 100%;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 12px 16px 8px 16px;
  overflow-x: auto;
  box-sizing: border-box;
}


.graph-bars {
  height: calc(var(--graph-height) * 1px);
  display: flex;
  flex-wrap: nowrap;         /* 🚫 prevent wrapping */
  align-items: flex-end;
  gap: 2px;
  overflow-x: auto;          /* ✅ allow scrolling */
  overflow-y: hidden;
}


.bar {
  width: 6px;
  background: #bfdbfe;
  border-radius: 4px 4px 0 0;
  min-height: 1px;
  position: relative;
  opacity: 0;
  height: 0;
  transition: height 0.5s ease, opacity 0.4s ease, background 0.2s ease;
}



.bar.reveal {
  opacity: 1;
}


/* Extend-to-top ghost effect */
.bar::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%; /* this alone limits it to bar height */
  background: rgba(191, 219, 254, 0.4);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.2s ease;
  z-index: 1;
  pointer-events: none;
}

.bar.hovering::before {
  transform: scaleY(var(--scale-factor));
}

.bar-wrapper {
  width: 4px;
  margin: 0 1px;
  display: flex;
  align-items: flex-end;
}


/* If fallback needed */
.bar:hover {
  background: #3b82f6;
}

/* User bar stays highlighted */
.user-bar {
  background: #f59e0b !important;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.user-label {
  position: absolute;
  bottom: 100%;
  font-size: 0.65rem;
  font-weight: bold;
  color: #f59e0b;
  white-space: nowrap;
  margin-bottom: 4px;
}

.bar.user-bar::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(253, 186, 116, 0.5);
  transform-origin: bottom;
  z-index: 1;
}

.bar.user-bar {
  background: #f59e0b !important;
}

.graph-labels {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding-top: 6px;
  font-size: 0.75rem;
  color: #6b7280;
  position: relative;
}

.graph-labels span {
  position: absolute;
  transform: translateX(-50%);
}


.graph-labels span:nth-child(1) { left: 0%; }
.graph-labels span:nth-child(2) { left: 30%; }
.graph-labels span:nth-child(3) { left: 60%; }
.graph-labels span:nth-child(4) { left: 90%; }
.graph-labels span:nth-child(5) { left: 100%; transform: translateX(-100%); }

#resifyScoreChart {
  height: 200px; /* or clamp(150px, 25vw, 250px) for responsiveness */
}

#needle {
  transition: transform 1s ease-in-out;
  transform-origin: bottom center;
}

#scoreBall {
  transition: cx 0.3s ease-out, cy 0.3s ease-out;
}


.score-circle {
  position: relative;
  width: 60px; /* Adjust size as needed */
  height: 60px;
  border-radius: 50%;
  background: conic-gradient(#E0E0E0 0% 100%); /* Default empty */
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF; /* Text color */
  font-weight: bold;
}

.score-circle::before {
  content: '';
  position: absolute;
  width: 50px; /* Inner circle for ring effect */
  height: 50px;
  border-radius: 50%;
  background: #2C2C3A; /* Match your dark background */
}

/* Optional: Change color based on score (add in JS if needed) */
.score-circle.low { --progress-color: #F44336; } /* Red for <50 */
.score-circle.medium { --progress-color: #FFEB3B; } /* Yellow for 50-75 */
.score-circle.high { --progress-color: #4CAF50; } /* Green for >75 */


/* when the hidden checkbox is checked… */
#themeToggle:checked ~ .toggle-thumb .sun {
  display: none;
}
#themeToggle:checked ~ .toggle-thumb .moon {
  display: block;
}



/* Center contact line whether or not Quill kept the ID */
#resume_editor .ql-editor #contact-info,
#resume_editor .ql-editor p:has(a[href*="linkedin"]),
#resume_editor .ql-editor p:has(.contact-item) {
  text-align: center !important;
  width: 100% !important;
  margin: 0 auto !important;
  display: block !important;
}

/* ───────── Guest teaser sizing (SOURCE OF TRUTH) ───────── */

/* Wrapper card */
#resume_teaser_paper { width: 100%; margin: 0 auto; }
@media (min-width: 901px) {
  #resume_teaser_paper { width: 816px; } /* 8.5in in CSS px */
}

/* Frame that holds Quill */
#resume_teaser_container {
  width: 100%;
  height: auto;
  overflow: visible;
  margin: 0 auto;
}

/* Make Quill fill the frame */
#resume_teaser_container .ql-container { 
  width: 100% !important; 
  border: 0 !important;
}
#resume_teaser_container .ql-container .ql-editor {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

/* The “paper” (editor root) */
#resume_teaser.ql-editor {
  box-sizing: border-box;
  background: #fff;
  color: #111;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  line-height: 1.2;
  padding: 0.5in 0.3in;
  margin: 0 auto;
  width: 100%;
}
@media (min-width: 901px) {
  #resume_teaser.ql-editor { width: 816px; }
}

/* Desktop one-page cap (keeps teaser/pdfs identical) */
@media (min-width: 901px) {
  #resume_teaser_container {
    height: 11in;
    overflow-y: hidden;
    overflow-x: visible;
  }
}


/* Safe wrapping (long emails/links never push width) */
html.user-guest #resume_teaser,
html.user-guest #resume_teaser * {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}

/* Reset default block margins, then re-introduce the editor rhythm */
html.user-guest #resume_teaser h1,
html.user-guest #resume_teaser h2,
html.user-guest #resume_teaser h3,
html.user-guest #resume_teaser h4,
html.user-guest #resume_teaser p,
html.user-guest #resume_teaser ul,
html.user-guest #resume_teaser ol,
html.user-guest #resume_teaser li,
html.user-guest #resume_teaser hr,
html.user-guest #resume_teaser section,
html.user-guest #resume_teaser div {
  margin: 0;
}

/* Headings – mirror editor look */
html.user-guest #resume_teaser h2 {
  font-family: inherit; 
  font-weight: 600;
  font-size: 1.1rem;
  border-bottom: 1px solid #333;
  padding-bottom: .25em;
  margin: 1.5em 0 .5em;      /* section gap exactly like editor */
}

/* Paragraphs & lists – editor rhythm */
html.user-guest #resume_teaser p {
  margin: .3em 0;
  line-height: 1.3;          /* editor paragraph leading */
}
html.user-guest #resume_teaser ul {
  margin: .3em 0;
  padding-left: 1em;
  list-style-position: outside;
}
html.user-guest #resume_teaser li {
  margin-bottom: .2em;
  padding-left: .5em;
  line-height: 1.2;          /* same as base .ql-editor */
}

/* Collapse blank Quill lines so they don’t create tall gaps */
html.user-guest #resume_teaser p:has(> br:only-child),
html.user-guest #resume_teaser p:empty {
  margin: 0;
  line-height: 0;
  height: 0;
}

/* First element shouldn’t add extra top gap */
html.user-guest #resume_teaser > *:first-child { margin-top: 0; }

/* Header: name + contact line (guest-only spacing) */
html.user-guest #resume_teaser #resume-name {
  text-align: center;
  margin: .3em 0 .15em;  /* keep name tight above */
  line-height: 1.3;
}

/* Contact line: nudged lower than the name - UNIVERSAL FIX */
#resume_teaser #contact-info,
#resume_teaser p.contact-line {
  text-align: center !important;
  line-height: 1.3 !important;
  margin-top: 0.75em !important;  /* This creates the gap */
  margin-bottom: 0.35em !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  display: block !important;
}
/* Job title row helpers – mirror editor */
html.user-guest #resume_teaser .job-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  width: 100%;
}
html.user-guest #resume_teaser .job-title {
  font-weight: 600;
  flex-grow: 1;
}
html.user-guest #resume_teaser .dates {
  text-align: right;
  color: #333;
  font-size: .95em;
  white-space: nowrap;
}

/* Teaser: let Quill wrappers size naturally */
html.user-guest #resume_teaser_container .ql-container {
  height: auto !important;
  border: 0 !important;           /* remove Snow border */
}
html.user-guest #resume_teaser_container .ql-container .ql-editor {
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}

/* Hide teaser only for subscribed/Pro */
html.user-pro #resume_teaser_paper,
html.user-pro #teaser_ribbon,
html.user-pro #guest-sticky-footer,
html.user-pro #footer-spacer,
html.user-pro #teaser_blur_gate,
html.user-pro #resify-watermark-overlay {
  display: none !important;
}

/* Always show the Pro download button — prevents any JS race from leaving it
   hidden. Safe because #download-pdf-btn lives inside #dynamic-content
   (hidden until generation completes), so it won't appear prematurely. */
html.user-pro #download-pdf-btn {
  display: inline-flex !important;
}

/* Belt-and-suspenders: kill any residual blur/backdrop-filter on paywall
   elements when the user is pro — covers any gate injected before JS sets
   window.isPro (race condition on slow connections). */
html.user-pro [id*="teaser"],
html.user-pro [id*="gate"],
html.user-pro [id*="blur_gate"] {
  display: none !important;
  backdrop-filter: none !important;
  filter: none !important;
}

/* Remove the default snow borders so the content box = the page box */
#resume_container .ql-container.ql-snow,
#resume_teaser_container .ql-container.ql-snow {
  border: 0 !important;
}

/* No trailing gap below the paper */
html.user-guest #preview-wrapper,
html.user-guest #resume_teaser_paper,
html.user-free  #preview-wrapper,
html.user-free  #resume_teaser_paper {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}
/* Kill the global page bottom padding */
html.user-guest body.pb-16,
html.user-free  body.pb-16 { padding-bottom: 0 !important; }

/* Name line — unify teaser + editor (h1 or p) */
#resume_teaser h1#resume-name,
#resume_editor .ql-editor h1#resume-name,
#resume_editor .ql-editor p#resume-name {
  display: block;
  width: 100%;
  text-align: center !important;
  font-weight: 700;
  font-size: 18px;       /* match the teaser’s look */
  line-height: 1.2;
  letter-spacing: 0.3px;
  margin: 0 0 8px;
}

/* Editor: style the name even if the <h1> has no id */
#resume_editor .ql-editor h1:first-of-type,
#resume_editor:not(:has(.ql-editor)) h1:first-of-type {
  display: block;
  width: 100%;
  text-align: center !important;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0.3px;
  margin: 0 0 8px;
}



/* ── Quill v2 bullet fix: make editor bullets look exactly like the teaser ── */

/* Job title row: match teaser (bold left side, dates right) */
#resume_editor .ql-editor .job-title-row {
  display: flex !important;
  justify-content: space-between !important;
  align-items: baseline !important;
  gap: 1rem !important;
  margin: .6em 0 .1em;
}
#resume_editor .ql-editor .job-title-row .job-title,
#resume_editor .ql-editor .job-title-row > :first-child {
  font-weight: 700 !important;  /* ensure bold even if spans were stripped */
}
#resume_editor .ql-editor .dates {
  margin-left: auto !important;
  text-align: right !important;
  font-weight: 400 !important;
  color: #333 !important;
  font-size: .95em !important;
  white-space: nowrap !important;
}

/* Teaser-matching rhythm in the editor (kept tight but readable) */
#resume_editor .ql-editor {
  font-family: Georgia, "Times New Roman", serif !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
  color: #111 !important;
  background: #fff !important;
  padding: 0.5in 0.3in !important;
  box-sizing: border-box !important;
}
#resume_editor .ql-editor p { margin: .3em 0; line-height: 1.3; }
#resume_editor .ql-editor ul,
#resume_editor .ql-editor ol { margin: .3em 0; padding-left: 1em; list-style-position: outside; }

/* Force Quill toolbar to sit above the paper neatly */
#ql-toolbar-host .ql-toolbar {
  width: 100% !important;
  margin: 0 auto !important;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fafafa;
}


/* ---- Fix skills bullets in editor & teaser (match other sections) ---- */
#resume_editor .ql-editor ul.skills,
#resume_editor .ql-editor ul.resume-bullets.skills {
  display: block !important;
  list-style: disc !important;
  padding-left: 1em !important;          /* same as other editor lists */
  margin: .3em 0 !important;
}

#resume_teaser ul.resume-bullets.skills {
  display: block !important;
  list-style: disc !important;
  padding-left: 1em !important;          /* same as other teaser lists */
  margin: .3em 0 !important;            /* same vertical rhythm */
}

/* Keep skills bullets tight, but aligned with other bullets */
#resume_editor .ql-editor ul.skills li,
#resume_editor .ql-editor ul.resume-bullets.skills li,
#resume_teaser ul.resume-bullets.skills li {
  margin: 0.15rem 0 !important;
  padding-left: .5em !important;        /* match generic <li> padding */
  white-space: normal !important;
}


/* ── Editor: contact line must look like body text (not a heading) ── */
#resume_editor .ql-editor #contact-info,
#resume_editor .ql-editor p.contact-line,
#resume_editor .ql-editor p:has(a[href*="linkedin"]),
#resume_editor .ql-editor p:has(.contact-item) {
  font-family: Georgia, "Times New Roman", serif !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1.3 !important;
  margin: .3em 0 !important;
  padding: 0 !important;
  border: 0 !important;
  text-align: center !important; /* parity with teaser */
}

/* If the contact line is <p><strong>…</strong></p>, neutralize the heading fallback */
#resume_editor .ql-editor p.contact-line > strong:only-child,
#resume_editor .ql-editor #contact-info > strong:only-child,
#resume_editor .ql-editor p:has(a[href*="linkedin"]) > strong:only-child {
  font-weight: 400 !important;
  font-size: 12px !important;
  padding: 0 !important;
  border: 0 !important;
  margin: .3em 0 !important;
}

/* Safety: if the contact line accidentally became a heading tag */
#resume_editor .ql-editor h1#contact-info,
#resume_editor .ql-editor h2#contact-info,
#resume_editor .ql-editor h3#contact-info {
  font-family: Georgia, "Times New Roman", serif !important;
  font-size: 12px !important;
  font-weight: 400 !important;
  line-height: 1.3 !important;
  padding: 0 !important;
  border: 0 !important;
  margin: .3em 0 !important;
  text-align: center !important;
}

/* === Desktop: clamp wrappers back to paper width === */
@media (min-width: 901px) {
  /* Keep both the editor and the guest teaser at paper width on desktop */
  #preview-wrapper .resume-editor-wrapper {
    width: auto !important;         /* stop forcing 100% */
    max-width: 8.5in !important;    /* match paper */
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Extra safety: explicitly clamp the guest wrapper too */
  #resume_teaser_paper {
    max-width: 8.5in !important;
  }
}

/* === Mobile: keep the full-width teaser fix === */
@media (max-width: 900px) {
  html.user-guest #resume_teaser_paper {
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  /* The wrapper may be 100% on mobile; that's fine */
  #preview-wrapper .resume-editor-wrapper {
    width: 100% !important;
  }
}


/* The hover ring */
.resume-section:hover {
  border-color: #6366f1; /* Tailwind Indigo-500 */
  background-color: rgba(99, 102, 241, 0.02);
}

/* The Floating Pill Menu */
.section-pill-menu {
  position: absolute;
  top: -16px;
  right: 16px;
  display: none;
  gap: 6px;
  background: var(--bg-secondary, #1e293b); 
  border: 1px solid var(--border, #334155);
  padding: 4px 10px;
  border-radius: 9999px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  z-index: 50;
}

.resume-section:hover .section-pill-menu {
  display: flex;
}

/* Sidebar Animation Transition */
#inspector-sidebar {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Fix Margin Collapse for Live Canvas --- */
/* This forces the wrappers to perfectly mimic the raw PDF spacing */
.resume-section > *:last-child {
  margin-bottom: 0 !important;
}
.resume-section > *:first-child {
  margin-top: 0 !important;
}
/* Re-introduce a single, controlled gap between sections */
.resume-section + .resume-section {
  margin-top: 1.25rem !important; 
}

/* --- WYSIWYG Locks: Kill Scrolling & Restore Hierarchy --- */

/* 1. Make the paper act like physical paper (Zero Scrolling) */
#resume_editor {
  overflow: hidden !important; 
}

/* 2. Force visual hierarchy so recruiters can scan */
#resume_editor strong,
#resume_editor b,
#resume_editor h3,
#resume_editor h4,
#resume_editor .job-title,
#resume_editor .project-title,
#resume_editor .degree {
  font-weight: 700 !important;
  color: #111827 !important; /* Deep contrast black */
}
/* === FINAL guest teaser sizing (wins over earlier rules) === */

/* Wrapper: full width on mobile, centered paper on desktop */
html.user-guest #resume_teaser_paper {
  max-width: none !important;
  width: 100% !important;
  padding: 0 !important;
}

/* Container: never crop; let height auto-expand */
html.user-guest #resume_teaser_container {
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

/* Quill wrappers: fill available width */
html.user-guest #resume_teaser_container .ql-container {
  width: 100% !important;
  height: auto !important;
  border: 0 !important; /* teaser is read-only */
}
html.user-guest #resume_teaser.ql-editor {
  width: 100% !important;      /* mobile: fill screen width */
  margin: 0 auto !important;
}

/* Desktop: restore fixed paper width (8.5in) without height truncation */
@media (min-width: 901px) {
  html.user-guest #resume_teaser.ql-editor {
    width: 816px !important;   /* 8.5in */
  }
}

/* Nuke any scaling/positioning that an older block might have added */
html.user-guest #resume_teaser_paper,
html.user-guest #resume_teaser_container,
html.user-guest #resume_teaser.ql-editor {
  transform: none !important;
  left: auto !important;
}

/* iOS/mobile: keep form controls at 16px to prevent auto-zoom */
@media (max-width: 430px) {
  input, select, textarea, #job_description {
    font-size: 16px !important;
  }
}

/* While the loading overlay is up, prevent scroll and overscroll bounce */
body.is-scroll-locked {
  overscroll-behavior: none;
}

/* The overlay itself should not allow scroll chaining */
#loading-overlay {
  overscroll-behavior: contain;
  touch-action: none;
}

/* === Micro-typography controls (dynamic fit) === */
:root{
  --line-h: 1.28;   /* p/li line-height */
  --p-gap: 7px;     /* p/li bottom margin */
  --h2-top: 14px;   /* space above section titles */
  --h2-bottom: 8px; /* space below section titles */
  --sec-gap: 12px;  /* gap between sections */
}

/* Apply vars to editor + teaser */
#resume_editor .ql-editor p,
#resume_editor .ql-editor li,
#resume_teaser.ql-editor p,
#resume_teaser.ql-editor li{
  line-height: var(--line-h) !important;
  margin: 0 0 var(--p-gap) !important;
}

#resume_editor .ql-editor h2.section-title,
#resume_teaser.ql-editor h2.section-title{
  margin: var(--h2-top) 0 var(--h2-bottom) !important;
}

#resume_editor .ql-editor .resume-section,
#resume_teaser.ql-editor .resume-section{
  margin-bottom: var(--sec-gap) !important;
}

/* Trim stray extra space at section edges */
#resume_editor .ql-editor .resume-section > :first-child,
#resume_teaser.ql-editor .resume-section > :first-child{ margin-top: 0 !important; }
#resume_editor .ql-editor .resume-section > :last-child,
#resume_teaser.ql-editor .resume-section > :last-child{ margin-bottom: 0 !important; }

/* Footer hover + subtle fade */
footer a { transition: color .2s ease, opacity .2s ease; }
footer nav a { opacity: .85; color: var(--text-secondary); }
footer nav a:hover { opacity: 1; }
footer nav a svg { color: inherit; }

/* Mobile: clamp logged-in widths to the viewport */
@media (max-width: 900px) {
  /* Results area */
  .score-comparison-container { width: 100% !important; max-width: 100% !important; }
  .comparison-wrapper { width: 100% !important; }
}

/* Safety: prevent any tiny horizontal scroll on mobile */
@media (max-width: 900px) {
  html, body { overflow-x: hidden; }
}


/* Explore Resify CTA */
.cta-resify{
  position: relative;
  border-radius: 9999px;                     /* pill */
  padding: 0.6rem 1rem;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  box-shadow:
    0 10px 24px rgba(99,102,241,.30),
    0 1px 0 rgba(255,255,255,.06) inset;
  border: 1px solid rgba(255,255,255,.08);

  /* keep sheen inside the round button, incl. Safari */
  overflow: hidden;                           /* clip children */
  clip-path: inset(0 round 9999px);           /* hard clip to pill shape */
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  contain: paint;                              /* new stacking context */

  will-change: transform;                      /* avoid box-shadow will-change to reduce artifacts */
}
.cta-resify:hover{
  transform: translateY(-1px);
  box-shadow:
    0 14px 28px rgba(99,102,241,.34),
    0 1px 0 rgba(255,255,255,.08) inset;
}
.cta-resify:active{
  transform: translateY(0);
  box-shadow:
    0 8px 18px rgba(99,102,241,.28),
    0 1px 0 rgba(255,255,255,.06) inset;
}
.cta-resify:focus-visible{
  outline: none;
  box-shadow:
    0 0 0 3px rgba(99,102,241,.35),
    0 10px 24px rgba(99,102,241,.30);
}

/* Subtle sheen sweep on hover (stays inside pill) */
.cta-resify .cta-sheen{
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;                      /* match pill corners */
  background:
    linear-gradient(120deg,
      transparent 0%,
      rgba(255,255,255,.35) 45%,
      rgba(255,255,255,.55) 50%,
      rgba(255,255,255,.35) 55%,
      transparent 100%);
  transform: translateX(-120%) skewX(-12deg) translateZ(0); /* force GPU clip */
  transition: transform .6s ease;
  mix-blend-mode: screen;
}
.cta-resify:hover .cta-sheen{
  transform: translateX(120%) skewX(-12deg) translateZ(0);
}

/* Light mode keeps the same vibe */
body.light .cta-resify{
  border-color: rgba(67,56,202,.25);
}


/* Ensure horizontal layout & crisp tap feel */
#download-pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  transform: translateY(0);
}
#download-pdf-btn:hover {
  transform: translateY(-1px);
}
#download-pdf-btn svg {
  display: inline-block;
  vertical-align: middle;
}


/* Lock page scroll when any app modal is open */
html.modal-open,
body.modal-open {
  overflow: hidden !important;
  height: 100%;
}

/* Prevent scroll chaining; allow only modal content to scroll */
#resify-modal,
#pricing-modal {
  overscroll-behavior: contain;
}

#resify-modal [data-modal-content],
#pricing-modal [data-modal-content]{
  max-height: 90vh;                 /* already in your HTML, this just enforces it */
  overflow-y: auto;                 /* scroll inside modal only */
  -webkit-overflow-scrolling: touch;/* smooth inertial scroll on iOS */
}


/* Guest teaser: prevent selecting when dragging in from outside */
html.user-guest #resume_teaser_paper,
html.user-guest #resume_teaser_paper * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none; /* iOS long press */
}

/* cleaner subheading */
.subheading {
  color: var(--text-primary);        /* white on dark */
  text-align: center;
  font-weight: 500;
  font-size: clamp(1rem, 0.95rem + 0.5vw, 1.25rem);
  opacity: 0.92;                     /* softer than H1 */
  margin: -1rem 0 1rem;
  text-wrap: balance;                /* nicer line breaks (safe fallback) */
}

/* subtle gradient ACCENT on words only (no pill) */
.subheading .accent {
  background: var(--logo-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 600;                  /* tiny emphasis */
}

/* Dropdown menu tweaks */
#userMenu { z-index: 60; }            /* above most content */
#userMenuButton { position: relative; } /* if the menu is absolutely positioned relative to it */

/* === Hide upgrade/subscribe CTAs for Pro users === */
html.user-pro [data-upgrade] {
  display: none !important;
}



/* === SUPREME OVERRIDE: Guest Teaser Formatting === */

/* === Watermark & Unlock Styles === */

/* The container for the watermark (matches JS ID) */
#resify-watermark-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none; /* Clicks pass through to the resume */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  opacity: 0.07; /* Subtle transparency */
  user-select: none;
  -webkit-user-select: none;
  transform: rotate(-10deg) scale(1.1);
}

/* The repeating text lines inside the watermark */
#resify-watermark-overlay > div {
  white-space: nowrap;
  font-family: sans-serif; /* Distinct from resume font */
  font-size: 3rem;
  font-weight: 900;
  text-transform: uppercase;
  color: #000;
  line-height: 1;
  margin-bottom: 4rem;
}

/* Ensure the unlocked teaser text remains unselectable */
.unlocked-guest-view,
#resume_teaser.unlocked-guest-view * {
  user-select: none !important;
  -webkit-user-select: none !important;
  cursor: default;
}


/* 1. FORCE HEADER FONT: Boost specificity with 'html' prefix */
html #resume_teaser h1,
html #resume_teaser h2,
html #resume_teaser h3,
html #resume_teaser .section-title {
  font-family: Georgia, "Times New Roman", serif !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
}

/* 2. FORCE FALLBACK HEADER FONT (for bold paragraphs) */
html #resume_teaser p > strong:only-child {
  font-family: Georgia, "Times New Roman", serif !important;
  font-weight: 600 !important;
}

/* 3. FORCE CONTACT LINE GAP: Target ID and Class with high specificity */
html #resume_teaser #contact-info,
html #resume_teaser .contact-line {
  display: block !important;
  margin-top: 1.0em !important;   /* Visible gap between name and contact */
  margin-bottom: 0.4em !important;
  line-height: 1.3 !important;
  font-family: Georgia, "Times New Roman", serif !important;
  font-weight: 400 !important; /* Ensure it doesn't look like a header */
}

/* 4. ENSURE CONTAINER FONT IS SERIF */
html #resume_teaser.ql-editor {
  font-family: Georgia, "Times New Roman", serif !important;
}

/* === Resify SweetAlert (error) === */

.resify-swal {
  border-radius: 1.25rem;
  padding: 1.75rem 1.75rem 1.5rem;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(148, 163, 184, 0.35);
  max-width: 420px;
}

.resify-swal-title {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #38bdf8; /* cyan accent */
  margin-bottom: 0.4rem;
}

.resify-swal-html {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #e5e7eb;
}

.resify-error-body p {
  margin: 0 0 0.35rem;
}

.resify-error-sub {
  font-size: 0.85rem;
  opacity: 0.8;
}

.resify-swal-confirm {
  margin-top: 0.75rem;
  border-radius: 9999px;
  padding: 0.55rem 1.6rem;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;

  /* Match your main gradient CTA vibe */
  background-image: linear-gradient(135deg, #22c55e, #22d3ee);
  color: #0f172a;
  box-shadow: 0 12px 35px rgba(34, 197, 94, 0.35);
}

.resify-swal-confirm:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.8);
  outline-offset: 2px;
}

/* --- BRUTE FORCE UNIFIED VISIBILITY --- */
/* This overrides any legacy JavaScript trying to hide the Pro wrapper from Guests */
#preview-wrapper,
#resume_editor {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* --- RESUME CONTENT TYPOGRAPHY (authoritative — wins cascade) ---
   Quill's sanitizer strips custom class names. The Python backend now
   generates native tags that Quill always preserves:
     <p><strong>Job Title</strong><em>2020 – Present</em></p>
   We target those native tags structurally so no custom classes are needed. */

/* Job title row: <p> whose first child is <strong> and contains an <em> date.
   :has() is supported in all modern browsers (Chrome 105+, FF 121+, Safari 15.4+). */
#resume_editor p:has(> strong:first-child) {
  display: flex !important;
  justify-content: space-between !important;
  align-items: baseline !important;
}

/* The <strong> element = job title — always bold */
#resume_editor p > strong {
  font-weight: 700 !important;
  flex-shrink: 1 !important;
}

/* The <em> element = date — undo italic, pin to right edge */
#resume_editor p > em {
  font-style: normal !important;
  white-space: nowrap !important;
  margin-left: 1rem !important;
}