/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
* { caret-color: transparent; }
textarea, input:focus, [contenteditable="true"] { caret-color: auto; }

/* ── Design Tokens ── */
:root {
  /* Typography */
  --font-ui: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-resume: Georgia, "Times New Roman", serif;
  --text-xs:   11px;
  --text-sm:   13px;
  --text-base: 14px;
  --text-md:   16px;
  --text-lg:   20px;
  --text-xl:   24px;
  --text-2xl:  36px;
  --text-3xl:  48px;

  /* Colors — Backgrounds */
  --color-bg:             #F2F2F4;
  --color-surface:        #ffffff;
  --color-surface-subtle: #fafafa;
  --color-surface-hover:  #f5f5f7;

  /* Colors — Text */
  --color-ink:            #1d1d1f;
  --color-ink-secondary:  #86868b;
  --color-ink-tertiary:   #999;
  --color-ink-body:       #444;

  /* Colors — Borders */
  --color-border:         #d0d0d0;
  --color-border-strong:  #DBDBDB;
  --color-border-subtle:  #e0e0e0;

  /* Colors — Status */
  --color-success:        #80BD79;
  --color-success-text:   #15803d;
  --color-success-bg:     #f0fdf4;
  --color-error:          #b91c1c;
  --color-error-bg:       #fef2f2;

  /* Colors — Accent */
  --color-accent-blue:    #46A7F0;

  /* Spacing */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Border Radius */
  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);

  /* Easing */
  --ease-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-blade:  cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-ink);
  height: 100vh;
  overflow: hidden;
}

/* ── Landing Page ── */
.landing-page {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  z-index: 100;

}

.landing-page[hidden] { display: none !important; }
html.app-active .landing-page { display: none; }
html.app-active .app { display: flex !important; }

.landing-content {
  text-align: center;
  padding: 0 24px;
}

.landing-title {
  font-size: 64px;
  font-weight: 700;
  color: var(--color-ink);
  letter-spacing: 0px;
  margin: 0;
  line-height: 1;
}

.dot-accent {
  color: var(--color-accent-blue);
}

.landing-tagline {
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--color-ink-secondary);
  margin: 8px 0 40px;
}

.landing-cta {
  background: var(--color-ink);
  color: #fff;
  border: none;
  padding: 14px 40px;
  font-size: 16px;
  font-weight: 500;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.landing-cta:hover {
  opacity: 0.85;
}

/* ── App Layout ── */
.app {
  display: flex;
  height: 100vh;
}

/* ── Sidebar Nav ── */
.sidebar {
  width: 296px;
  min-width: 296px;
  background: var(--color-surface);
  border-right: 3px solid var(--color-border-strong);
  display: flex;
  flex-direction: column;
  padding: 20px 0 0;
}

.sidebar-brand {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-ink-secondary);
  padding: 0 20px 8px;
  background: none;
  border: none;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: color 0.15s;
}

.sidebar-brand:hover {
  color: var(--color-ink);
}

.sidebar-divider {
  height: 2px;
  background: var(--color-ink);
  margin: 8px 20px;
  border-radius: 1px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px 8px 0;
}

.sidebar-nav-bottom {
  margin-top: auto;
  padding: 0 8px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 4px;
  border: none;
  background: none;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-ink-secondary);
  cursor: pointer;
  transition: background 0.3s var(--ease-smooth),
              color 0.3s var(--ease-smooth),
              transform 0.4s var(--ease-spring);
  transform-origin: left center;
  text-align: left;
  width: 100%;
  user-select: none;
}

.nav-item:hover {
  background: #e8e8ed;
  color: var(--color-ink);
}

.nav-item.active {
  background: none;
  color: var(--color-ink);
  font-weight: 700;
  transform: scale(1.04);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ── Main Content Area ── */
.main-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

#main-scroll-content {
  display: flex;
  flex-direction: column;
  will-change: transform;
  position: relative;
  z-index: 5;
}

/* ── Page System ── */
.page[hidden] { display: none !important; }

.page {
  min-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
}

#page-builder {
  display: flex;
  flex-direction: column;
}

.page-inner {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 32px;
}

.main-top {
  padding: 0 32px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  flex-shrink: 0;
  width: 100%;
  max-width: 8.5in;
  align-self: center;
}

/* ── Step Indicator ── */
.step-indicator {
  display: flex;
  align-items: flex-start;
  width: 100%;
  max-width: 8.5in;
  align-self: center;
  position: relative;
  padding: 48px 32px 40px;
  flex-shrink: 0;
  user-select: none;
  cursor: default;
}

/* Connecting line segments — one ::after per non-last step, each with its own end caps */
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  /* Dot center is at top:0 + half of 37px = 18.5px within the step */
  top: 18.5px;
  transform: translateY(-50%);
  /* Start 4px past right edge of this dot (center=50%, radius=18.5px, gap=4px) */
  left: calc(50% + 22.5px);
  /* End 4px before left edge of next dot (next center = 150% from this left, gap=4px) */
  right: calc(-50% + 22.5px);
  height: 3px;
  z-index: 0;
  /* SVG path centered at y=1.5 in a 3px-tall canvas, matching the element height exactly */
  /* so border-radius: 99px creates true semicircular end caps on the stroke */
  background: var(--color-border);
  border-radius: 99px;
}

.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.step-dot {
  width: 29px;
  height: 29px;
  margin-top: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  box-shadow: 0 0 0 4px var(--color-bg);
  transition: all 0.3s ease;
  position: relative;
}

/* Perfect circle outline */
.step-dot::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid #e0e0e0;
  pointer-events: none;
}

.step-dot-inner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--color-border);
  transition: all 0.3s ease;
}

/* Active step — restore full size */
.step.active .step-dot {
  width: 37px;
  height: 37px;
  margin-top: 0;
}

.step.active .step-dot-inner {
  width: 23px;
  height: 23px;
}

/* Active step — blue outline + fill */
.step.active .step-dot::before {
  border-color: #8ecef6;
}

.step.active .step-dot-inner {
  background: var(--color-accent-blue);
}

/* Completed step — inherits base size (29px), green fill with checkmark */
.step.completed .step-dot {
  background: var(--color-accent-blue);
}

.step.completed .step-dot::before {
  display: none;
}

.step.completed .step-dot-inner {
  display: none;
}

.step.completed .step-dot::after {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
}

.step-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-ink-secondary);
  transition: color 0.2s;
}

.step.active .step-label {
  color: var(--color-ink);
  font-weight: 600;
}

.step.completed .step-label {
  color: var(--color-ink);
}

/* ── Wizard Content ── */
#wizard-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

#wizard-content[hidden] {
  display: none;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.control-group label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #666;
}

textarea {
  width: 100%;
  height: 180px;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  line-height: 1.5;
}

textarea:focus {
  outline: none;
  border-color: #111;
}

/* ── Job Input Group ── */
.job-optional-fields {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.job-optional-field {
  flex: 1;
}

.job-optional-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-ink-secondary);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.optional-tag {
  font-weight: 400;
  color: var(--color-ink-tertiary);
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.7rem;
}

.job-optional-input {
  width: 100%;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  font-size: 0.9rem;
  font-family: var(--font-ui);
  color: var(--color-ink-primary);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.job-optional-input::placeholder {
  color: #c0c0c0;
  font-weight: 400;
}

.job-optional-input:focus {
  outline: none;
  border-color: var(--color-ink-tertiary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.job-input-group {
  align-items: center;
  margin-left: -32px;
  margin-right: -32px;
  width: calc(100% + 64px);
}

.job-textarea {
  border: 2px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 20px;
  height: 220px;
  min-height: 62px;
  max-height: 440px;
  box-shadow: var(--shadow-md);
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
}

.job-textarea::placeholder {
  color: #c0c0c0;
  font-weight: 400;
}

.job-textarea:focus {
  border-color: var(--color-ink-tertiary);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.1);
}

.job-textarea::-webkit-resizer {
  display: none;
}

.job-textarea::-webkit-scrollbar {
  width: 22px;
}

.job-textarea::-webkit-scrollbar-track {
  background: transparent;
}

.job-textarea::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-pill);
  border: 8px solid transparent;
  min-height: 48px;
  background-clip: content-box;
}

.job-textarea::-webkit-scrollbar-thumb:hover {
  background: #aaa;
  background-clip: content-box;
}

.job-textarea::-webkit-scrollbar-corner {
  background: transparent;
}

.job-input-group {
  position: relative;
}

.job-input-group::after {
  content: "";
  position: absolute;
  bottom: 66px;
  right: 8px;
  width: 16px;
  height: 16px;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cline x1='14' y1='2' x2='2' y2='14' stroke='%23c0c0c0' stroke-width='3' stroke-linecap='round'/%3E%3Cline x1='14' y1='9' x2='9' y2='14' stroke='%23c0c0c0' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
}

.job-input-group .btn-primary {
  width: auto;
  margin-top: 14px;
}

/* Buttons */
.btn {
  padding: 12px 32px;
  min-width: 120px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, opacity 0.15s, transform 0.4s var(--ease-spring);
}

.btn:active:not(:disabled) {
  transform: scale(0.94);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: #111;
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: #333;
}

.btn-secondary {
  background: #e8e8e8;
  color: #333;
}

.btn-secondary:hover:not(:disabled) {
  background: #ddd;
}

.btn-bounce {
  animation: btn-bounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes btn-bounce {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.03); }
  70%  { transform: scale(0.99); }
  100% { transform: scale(1); }
}

.actions {
  gap: 8px;
  flex-direction: row;
}

.status-msg {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: #f5f5f5;
  color: #555;
}

.status-msg.error {
  background: var(--color-error-bg);
  color: var(--color-error);
}

.status-msg.success {
  background: var(--color-success-bg);
  color: var(--color-success-text);
}

.analyze-btn-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
}

.status-msg.analyzing-dots {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: none;
  padding: 0;
  display: flex;
  justify-content: center;
  white-space: nowrap;
}

/* ── Analysis Card ── */
.analysis-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-md);
  margin-left: -32px;
  margin-right: -32px;
  width: calc(100% + 64px);
}

.analysis-scroll {
  min-height: 0;
}

.analysis-old-new-toggle {
  margin-bottom: 24px;
}

.analysis-old-new-toggle + .analysis-hero {
  padding-top: 0;
}

.analysis-old-new-toggle + .analysis-hero .score-meta {
  padding-top: 0;
}

/* ── Analysis Hero ── */
.analysis-hero {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  padding: 12px 0 24px;
  margin-bottom: 24px;
  position: relative;
  min-height: 156px; /* 12px top + 120px badge + 24px bottom padding */
}

.analysis-hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-border);
  border-radius: 2px;
}

.score-badge-wrap {
  position: absolute;
  right: 18px;
  top: 12px;
  width: 120px;
  height: 120px;
}

.score-badge {
  display: block;
  width: 100%;
  height: 100%;
}

.score-meta {
  flex: 1;
  min-width: 0;
  padding-top: 32px;
}

.score-verdict {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: 4px;
}

.score-brief-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.score-brief {
  flex: 1;
  max-width: 80%;
  font-size: var(--text-md);
  line-height: 1.5;
  color: var(--color-ink-body);
}

.score-out-of {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-ink-secondary);
  flex-shrink: 0;
  line-height: 1.5;
}

.score-hundred {
  position: relative;
  top: 2px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* ── Analysis Groups ── */
.analysis-group {
  margin-bottom: 20px;
}

.analysis-group-label {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-ink-secondary);
  margin-bottom: 10px;
}

.analysis-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  font-size: var(--text-md);
  line-height: 1.45;
  color: var(--color-ink);
}

.analysis-item--strength {
  background: none;
}

.analysis-item--gap {
  background: none;
}

.analysis-item-icon {
  flex-shrink: 0;
  margin-top: 5px;
}

/* ── Analysis Callout ── */
.analysis-callout {
  background: var(--color-surface-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
}

.analysis-callout .analysis-group-label {
  margin-bottom: 8px;
}

.analysis-callout p {
  font-size: var(--text-md);
  line-height: 1.6;
  color: var(--color-ink-body);
  margin: 0;
  color: var(--color-ink-body);
}

.analysis-section p {
  font-size: 16px;
  color: var(--color-ink-body);
  line-height: 1.5;
}

/* ── Questions Header ── */
.questions-header {
  margin-bottom: 8px;
}

.questions-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.questions-title {
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--color-ink);
}

.questions-subtitle {
  font-size: var(--text-md);
  line-height: 1.5;
  color: var(--color-ink-body);
}

/* ── Question Cards ── */
.question-card {
  background: var(--color-bg);
  border-radius: 10px;
  padding: 20px;
  position: relative;
}

.question-card .question-number {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-ink-tertiary);
  position: absolute;
  top: 20px;
  right: 20px;
}

.question-card .question-gap {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-ink);
  line-height: 1.35;
  margin-bottom: 4px;
}

.question-card .question-text {
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--color-ink-secondary);
  line-height: 1.5;
}

.question-card .question-hint {
  font-size: var(--text-xs);
  color: var(--color-ink-tertiary);
  font-style: italic;
  margin-bottom: 12px;
  line-height: 1.4;
}

.question-card textarea {
  caret-color: auto;
  height: 80px;
  font-size: 14px;
  line-height: 1.6;
  font-family: inherit;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 16px;
  resize: none;
  min-height: 62px;
  max-height: 300px;
}

.question-card textarea::placeholder {
  color: #c0c0c0;
  font-weight: 400;
}

.question-card textarea:focus {
  border-color: var(--color-ink-tertiary);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.1);
}

.question-card textarea::-webkit-resizer {
  display: none;
}

.question-textarea-wrap {
  position: relative;
  width: 100%;
  margin-top: 16px;
}

/* ── Questions Container (between toolbar and resume) ── */
.questions-container {
  width: 100%;
  background: var(--color-surface);
  padding: 32px 32px 24px;
  caret-color: transparent;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: visible;
  /* 4-corner notch masks — ticket punch holes */
  -webkit-mask-image:
    radial-gradient(circle 10px at 0 0, transparent 9.5px, black 10px),
    radial-gradient(circle 10px at 100% 0, transparent 9.5px, black 10px),
    radial-gradient(circle 10px at 0 100%, transparent 9.5px, black 10px),
    radial-gradient(circle 10px at 100% 100%, transparent 9.5px, black 10px);
  -webkit-mask-size: 100% 100%;
  -webkit-mask-position: 0 0;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-composite: source-in;
  mask-image:
    radial-gradient(circle 10px at 0 0, transparent 9.5px, black 10px),
    radial-gradient(circle 10px at 100% 0, transparent 9.5px, black 10px),
    radial-gradient(circle 10px at 0 100%, transparent 9.5px, black 10px),
    radial-gradient(circle 10px at 100% 100%, transparent 9.5px, black 10px);
  mask-size: 100% 100%;
  mask-position: 0 0;
  mask-repeat: no-repeat;
  mask-composite: intersect;
}

.questions-container::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 20px;
  right: 20px;
  height: 3px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='3'%3E%3Cline x1='1.5' y1='1.5' x2='16' y2='1.5' stroke='%23d0d0d0' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 28px 3px;
}

.questions-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding-top: 8px;
  position: relative;
}

.questions-actions .btn {
  width: auto;
}

/* ── Toggle Switch ── */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.toolbar-wizard-slot .toggle-row {
  margin-top: 4px;
  align-items: flex-end;
}

.toggle-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.download-report {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  font-weight: 500;
  caret-color: transparent;
  color: var(--color-accent-blue);
  cursor: pointer;
  transition: color 0.15s, opacity 0.4s ease;
  margin-left: 12px;
  margin-bottom: var(--space-8);
}

.download-report:hover {
  color: var(--color-ink);
}

.download-report:hover svg path {
  stroke: var(--color-ink);
}

.download-report.loading {
  opacity: 0.35;
  pointer-events: none;
  cursor: default;
}

.toolbar-wizard-slot .toggle-row .toggle-label {
  align-self: flex-end;
  margin-bottom: 4px;
}

.toolbar-wizard-slot .toggle-row .info-icon {
  align-self: flex-end;
  margin-bottom: 3px;
}

.toggle-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-ink-body);
}

.info-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  color: var(--color-ink-tertiary);
  transition: color 0.15s;
}

.info-icon:hover {
  color: var(--color-ink-secondary);
}

.info-tooltip {
  position: absolute;
  bottom: calc(100% - 56px);
  left: 50%;
  transform: translateX(-50%) scale(0.85);
  transform-origin: bottom center;
  width: 300px;
  height: 300px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 70px 24px 80px;
  text-align: center;
  color: #fff;
  font-size: var(--text-md);
  font-weight: 400;
  line-height: 1.5;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-spring), transform 0.25s var(--ease-spring);
}

.info-tooltip::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 300'%3E%3Cpath fill='%231d1d1f' d='M279.3,72.4H21c-10.2,0-18.5,8.3-18.5,18.5v100.6c0,10.2,8.3,18.5,18.5,18.5h99.3c4.7,0,9.2,1.9,12.5,5.2l10.6,10.6c3.7,3.7,9.7,3.7,13.3,0l10.9-10.9c3.1-3.1,7.4-4.9,11.8-4.9h99.7c10.2,0,18.5-8.3,18.5-18.5v-100.6c0-10.2-8.3-18.5-18.5-18.5Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15));
}

.info-icon:hover .info-tooltip,
.info-icon.active .info-tooltip {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  pointer-events: auto;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--color-border);
  border-radius: var(--radius-pill);
  transition: background 0.2s;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: var(--color-surface);
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--color-accent-blue);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

/* ── Processing Spinner ── */
.processing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 48px 0;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--color-border-subtle);
  border-top-color: #111;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Bouncing dots (iMessage style) ── */
.bounce-dots {
  display: flex;
  gap: 5px;
  margin-top: 6px;
  width: 100%;
  justify-content: center;
}

.bounce-dots span {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-ink);
  font-size: 0;
  animation: dot-bounce 1.2s var(--ease-smooth) infinite;
}

.bounce-dots span:nth-child(2) { animation-delay: 0.18s; }
.bounce-dots span:nth-child(3) { animation-delay: 0.36s; }

@keyframes dot-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%            { transform: translateY(-2px); }
}

.btn .bounce-dots {
  margin-top: 0;
  width: auto;
  height: 1lh;
  align-items: center;
  justify-content: center;
}
.btn .bounce-dots span { background: #fff; }

.processing p {
  font-size: 14px;
  color: #555;
  font-weight: 500;
}

/* ── Change Summary Cards ── */
.change-card {
  background: var(--color-surface-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  border-left: 3px solid var(--color-border);
}

.change-card.type-reworded { border-left-color: #3b82f6; }
.change-card.type-added { border-left-color: var(--color-success-text); }
.change-card.type-removed { border-left-color: var(--color-error); }
.change-card.type-reordered { border-left-color: #a16207; }

.change-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.change-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 4px;
  color: #fff;
}

.badge-reworded { background: #3b82f6; }
.badge-added { background: var(--color-success-text); }
.badge-removed { background: var(--color-error); }
.badge-reordered { background: #a16207; }

.change-section-label {
  font-size: 11px;
  font-weight: 600;
  color: #888;
}

.change-diff {
  font-size: 12px;
  line-height: 1.5;
}

.change-before {
  background: var(--color-error-bg);
  color: #991b1b;
  padding: 6px 10px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.change-after {
  background: var(--color-success-bg);
  color: #166534;
  padding: 6px 10px;
  border-radius: 4px;
}

.change-reason {
  font-size: 11px;
  color: #888;
  margin-top: 6px;
  font-style: italic;
}

.change-source {
  font-size: 10px;
  color: #87864a;
  font-weight: 600;
  margin-top: 2px;
}

/* ── Right Panel: Resume Preview ── */
.preview-container {
  flex-shrink: 0;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeInContent 0.6s cubic-bezier(0.25, 0.1, 0.25, 1) both;
}

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

.preview-container:has(.toolbar-expanded) {
  padding-top: 0;
}

/* ── Single-width wrapper — every child inherits this width ── */
.preview-inner {
  width: 8.5in;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* ── Resume Container ── */
.resume {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  width: 100%;
  overflow: hidden;
  caret-color: transparent;
  /* Top-corner punch-holes — lives here (not on children) so they
     stay at wrapper width and never scale with transform: scale(). */
  -webkit-mask-image:
    radial-gradient(circle 10px at 0 0, transparent 9.5px, black 10px),
    radial-gradient(circle 10px at 100% 0, transparent 9.5px, black 10px);
  -webkit-mask-size: 100% 100%, 100% 100%;
  -webkit-mask-position: 0 0, 0 0;
  -webkit-mask-repeat: no-repeat, no-repeat;
  -webkit-mask-composite: source-in;
  mask-image:
    radial-gradient(circle 10px at 0 0, transparent 9.5px, black 10px),
    radial-gradient(circle 10px at 100% 0, transparent 9.5px, black 10px);
  mask-size: 100% 100%, 100% 100%;
  mask-position: 0 0, 0 0;
  mask-repeat: no-repeat, no-repeat;
  mask-composite: intersect;
}

/* ── Individual Page Frame ── */
.resume-page {
  width: 8.5in;
  height: 11in;
  padding: 0.55in 0.65in;
  background: #fff;
  box-shadow: 0 2px 16px rgba(0,0,0,0.1);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10.5pt;
  line-height: 1.45;
  color: #222;
  flex-shrink: 0;
}

/* Punch-holes for .receipt-attached now live on .resume wrapper
   so they don't scale with transform: scale() on mobile. */

.resume-page-clip {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.resume-page-inner {
  position: absolute;
  width: 100%;
  left: 0;
}

/* ── Offscreen Measurer ── */
.resume-measurer {
  position: absolute;
  visibility: hidden;
  width: 7.2in;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10.5pt;
  line-height: 1.45;
  color: #222;
}

/* ── PDF Source (rendered onscreen briefly for html2canvas capture) ── */
.resume-pdf-source {
  position: absolute;
  left: 0;
  top: 0;
  width: 7.2in;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10.5pt;
  line-height: 1.45;
  color: #222;
  background: #fff;
}

/* ── Header ── */
.resume-header {
  margin-bottom: 10px;
}

.resume-header h1 {
  font-size: 32pt;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #000;
  margin-bottom: 4px;
}

.resume-header .title {
  font-size: 16pt;
  font-style: italic;
  font-weight: 400;
  color: #333;
  margin-bottom: 10px;
}

.resume-header hr {
  border: none;
  border-top: 2px solid #87864a;
  margin-bottom: 0;
}

/* ── Summary ── */
.resume-summary {
  padding: 12px 0 16px 0;
  font-size: 10pt;
  line-height: 1.5;
  color: #333;
}

/* ── Two-Column Body ── */
.resume-body {
  display: flex;
  gap: 32px;
}

.resume-left {
  width: 34%;
  min-width: 34%;
}

.resume-right {
  flex: 1;
}

/* ── Two-Column Equal Body ── */
.resume-body-equal {
  display: flex;
  gap: 32px;
}

.resume-body-equal .resume-col {
  flex: 1;
  min-width: 0;
}

/* ── Section Headers ── */
.resume-section {
  margin-bottom: 16px;
}

.resume-section h2 {
  font-size: 10pt;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #000;
  padding-bottom: 4px;
  border-bottom: 2px solid #87864a;
  margin-bottom: 10px;
}

/* ── Expertise (left column skill list) ── */
.expertise-list {
  list-style: none;
  font-size: 9.5pt;
  line-height: 1.65;
}

.expertise-list li {
  color: #333;
}

.expertise-list li.sub {
  font-style: italic;
  color: #666;
}

/* ── Education (left column) ── */
.education-item {
  font-size: 9.5pt;
  line-height: 1.5;
}

.education-item strong {
  font-weight: 700;
}

/* ── Contact (left column) ── */
.contact-list {
  list-style: none;
  font-size: 9.5pt;
  line-height: 1.7;
  color: #333;
}

.contact-list a {
  color: #333;
  text-decoration: none;
}

/* ── Experience Entries ── */
.exp-entry {
  margin-bottom: 18px;
}

.exp-entry .exp-title {
  font-size: 10.5pt;
  font-style: italic;
}

.exp-entry .exp-title strong {
  font-weight: 700;
  font-style: normal;
}

.exp-entry .exp-date {
  font-size: 9.5pt;
  font-style: italic;
  color: #777;
  margin-bottom: 6px;
}

.exp-entry .exp-desc {
  font-size: 10pt;
  line-height: 1.5;
  margin-bottom: 10px;
  color: #333;
}

.exp-bullets {
  list-style: none;
  padding-left: 16px;
  font-size: 10pt;
  line-height: 1.5;
}

.exp-bullets li {
  margin-bottom: 8px;
  color: #333;
}

.exp-bullets li::before {
  content: "•";
  font-weight: 700;
  color: #87864a;
  margin-right: 6px;
}

.exp-bullets li strong {
  font-weight: 700;
}

/* ── Compact One-Page Layout ──
   Same font sizes as normal — only layout (single-column) and tighter spacing */
.compact .resume-header { margin-bottom: 6px; }
.compact .resume-header h1 { margin-bottom: 2px; }
.compact .resume-header .title { margin-bottom: 6px; }

.compact .resume-summary {
  padding: 8px 0 10px 0;
}

.compact .resume-section { margin-bottom: 10px; }
.compact .resume-section h2 {
  margin-bottom: 6px;
  padding-bottom: 3px;
}

.expertise-inline {
  font-size: 9.5pt;
  line-height: 1.5;
  color: #333;
}

.compact .exp-entry { margin-bottom: 10px; }
.compact .exp-entry .exp-date { margin-bottom: 3px; }
.compact .exp-entry .exp-desc {
  margin-bottom: 4px;
}

.compact .exp-bullets li { margin-bottom: 4px; }

/* Footer row for education + contact side-by-side in compact mode */
.resume-footer {
  display: flex;
  gap: 32px;
  border-top: 1px solid #e0e0e0;
  padding-top: 8px;
  margin-top: 4px;
}
.resume-footer .resume-section { margin-bottom: 0; }

/* ── Resume Toolbar ── */
.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

.resume-file-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 10px;
  position: relative;
}

.resume-file-block::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2.5px;
  background: var(--color-accent-blue);
  border-radius: var(--radius-pill);
}

.resume-file-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #aaaaaa;
}

.resume-active-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-ink);
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-height: 1.3em;
}

@keyframes filename-char-pop {
  0%   { transform: scale(1.3); opacity: 0.5; }
  100% { transform: scale(1);   opacity: 1; }
}

.filename-char {
  display: inline-block;
  animation: filename-char-pop 0.3s var(--ease-spring) both;
}

.resume-change-link {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #aaaaaa;
  cursor: pointer;
  transition: color 0.15s;
  position: relative;
  display: inline-flex;
  align-items: center;
}

.resume-change-link:hover,
.resume-action-block:hover .resume-change-link {
  color: var(--color-ink);
}

/* ── Floating scissors — two body-level layers ── */

/* Shared base styles for both layers */
#scissors-back,
#scissors-front {
  position: fixed;
  transform: translateY(-50%) translateX(10px);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.25s var(--ease-spring);
  pointer-events: none;
  display: flex;
  align-items: center;
}

#scissors-back svg,
#scissors-front svg {
  width: 80px;
  height: 80px;
  transform: scaleX(-1);
}

/* Red-handle blade — behind toolbar + resume cards */
#scissors-back  { z-index: 4; }

/* Gray-handle blade — above everything */
#scissors-front { z-index: 20; }

#scissors-back.visible,
#scissors-front.visible {
  opacity: 1;
  transform: translateY(-50%) translateX(4px);
}

/* Blade pivot — screw hole center at ~(108, 105) in 216×216 viewBox */
.blade-upper,
.blade-lower {
  transform-box: view-box;
  transform-origin: 108px 105px;
}

/* Replay open→close animation on each hover */
#scissors-back.visible .blade-upper {
  animation: blade-upper-close 0.5s var(--ease-blade) forwards;
}

#scissors-front.visible .blade-lower {
  animation: blade-lower-close 0.5s var(--ease-blade) forwards;
}

@keyframes blade-upper-close {
  from { transform: rotate(8deg); }
  to   { transform: rotate(-8deg); }
}

@keyframes blade-lower-close {
  from { transform: rotate(-8deg); }
  to   { transform: rotate(8deg); }
}

/* Reverse: closed → open (plays on mouse out) */
#scissors-back.hiding .blade-upper {
  animation: blade-upper-open 0.4s var(--ease-blade) forwards;
}

#scissors-front.hiding .blade-lower {
  animation: blade-lower-open 0.4s var(--ease-blade) forwards;
}

@keyframes blade-upper-open {
  from { transform: rotate(-8deg); }
  to   { transform: rotate(8deg); }
}

@keyframes blade-lower-open {
  from { transform: rotate(8deg); }
  to   { transform: rotate(-8deg); }
}

/* Mobile: scissors traverse across while snipping */
#scissors-back.mobile-cutting,
#scissors-front.mobile-cutting {
  opacity: 1;
  animation: scissors-traverse 1.54s var(--ease-blade) forwards;
}

#scissors-back.mobile-cutting {
  z-index: 20;
}

#scissors-back.mobile-cutting .blade-upper {
  animation: blade-upper-snip 0.5s var(--ease-blade) infinite;
}

#scissors-front.mobile-cutting .blade-lower {
  animation: blade-lower-snip 0.5s var(--ease-blade) infinite;
}

@keyframes scissors-traverse {
  from { transform: translateY(-50%) translateX(0); }
  to   { transform: translateY(-50%) translateX(var(--scissors-travel)); }
}

@keyframes blade-upper-snip {
  0%, 100% { transform: rotate(8deg); }
  50%      { transform: rotate(-8deg); }
}

@keyframes blade-lower-snip {
  0%, 100% { transform: rotate(-8deg); }
  50%      { transform: rotate(8deg); }
}

#resume-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 16px;
  flex-shrink: 0;
  width: 100%;
  background: var(--color-surface);
  padding: 32px 32px 24px;
  position: relative;
  margin-bottom: 0;
  overflow: visible;
  transition: padding 0.3s ease;
  /* True cutouts via mask: scalloped top + side notches
     Circle radius = 10px, first center at 16px from left, last at 16px from right.
     8.5in = 816px. Usable span = 816 - 32 = 784px. 22 circles → tile = 784/22 ≈ 35.636px.
     Circle center within tile = half tile ≈ 17.818px. Offset = 16 - 17.818 = -1.818px.
     Simpler: use 35.636px tile, offset so first center lands at 16px. */
  --scallop-tile: 35.636px;
  --scallop-offset: -1.818px;
  -webkit-mask-image:
    radial-gradient(circle 10px at calc(var(--scallop-tile) / 2) 0, transparent 9.5px, black 10px),
    radial-gradient(circle 10px at 0 100%, transparent 9.5px, black 10px),
    radial-gradient(circle 10px at 100% 100%, transparent 9.5px, black 10px);
  -webkit-mask-size: var(--scallop-tile) 100%, 100% 100%, 100% 100%;
  -webkit-mask-position: var(--scallop-offset) 0, 0 0, 0 0;
  -webkit-mask-repeat: repeat-x, no-repeat, no-repeat;
  -webkit-mask-composite: source-in, source-in;
  mask-image:
    radial-gradient(circle 10px at calc(var(--scallop-tile) / 2) 0, transparent 9.5px, black 10px),
    radial-gradient(circle 10px at 0 100%, transparent 9.5px, black 10px),
    radial-gradient(circle 10px at 100% 100%, transparent 9.5px, black 10px);
  mask-size: var(--scallop-tile) 100%, 100% 100%, 100% 100%;
  mask-position: var(--scallop-offset) 0, 0 0, 0 0;
  mask-repeat: repeat-x, no-repeat, no-repeat;
  mask-composite: intersect, intersect;
}

/* Dashed divider with rounded caps (SVG) */
#resume-toolbar::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 20px;
  right: 20px;
  height: 3px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='3'%3E%3Cline x1='1.5' y1='1.5' x2='16' y2='1.5' stroke='%23d0d0d0' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 28px 3px;
}

/* ── Expanded Toolbar (Step 1 — textarea inside) ── */
#resume-toolbar.toolbar-expanded {
  flex-direction: column;
  align-items: stretch;
  padding: 32px 32px 24px;
  gap: 0;
}

.toolbar-wizard-slot {
  display: flex;
  flex-direction: column;
  flex: 1;
  caret-color: transparent;
}

.toolbar-wizard-slot:not(.toolbar-onboarding-slot) {
  padding-bottom: 0;
}

.toolbar-wizard-slot .job-input-group {
  margin-left: 0;
  margin-right: 0;
  width: 100%;
  align-items: stretch;
}

.toolbar-wizard-slot .job-textarea {
  caret-color: auto;
  flex: 1;
  height: 180px;
  border-color: var(--color-border-subtle);
  box-shadow: none;
  border-radius: var(--radius-lg);
  padding: 16px;
  resize: none;       /* disable native — JS handles resize */
  min-height: 62px;
  max-height: 440px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
}

.toolbar-wizard-slot .job-textarea:focus {
  border-color: var(--color-ink-tertiary);
  box-shadow: var(--shadow-md);
}

/* Hide the cosmetic ::after — replaced by .resize-handle inside the textarea wrapper */
.toolbar-wizard-slot .job-input-group::after {
  display: none;
}

/* Drag handle inside textarea container */
.textarea-wrapper {
  position: relative;
  width: 100%;
}

.resize-handle {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  cursor: ns-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cline x1='14' y1='2' x2='2' y2='14' stroke='%23c0c0c0' stroke-width='3' stroke-linecap='round'/%3E%3Cline x1='14' y1='9' x2='9' y2='14' stroke='%23c0c0c0' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
}

.toolbar-file-row .analyze-btn-wrapper {
  margin-left: auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Onboarding content inside toolbar ── */
#resume-toolbar:has(.toolbar-onboarding-slot) {
  height: auto;
}

#resume-toolbar:has(.analysis-scroll) {
  height: auto;
}

.analysis-reloading { opacity: 0.4; transition: opacity 0.3s ease; }

.shimmer-line {
  background: linear-gradient(
    90deg,
    var(--shimmer-base, #222) 0%, var(--shimmer-base, #222) 25%,
    var(--color-accent-blue) 45%, var(--color-accent-blue) 55%,
    var(--shimmer-base, #222) 75%, var(--shimmer-base, #222) 100%
  );
  background-size: 300% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation:
    shimmer-read var(--shimmer-duration, 4.5s) var(--shimmer-delay, 0s) cubic-bezier(0.4, 0, 0.2, 1) infinite,
    shimmer-fade var(--shimmer-duration, 4.5s) var(--shimmer-fade-delay, 0s) ease-in-out infinite;
}

@keyframes shimmer-read {
  0%   { background-position: 100% 0; }
  40%  { background-position: 0% 0; }
  100% { background-position: 0% 0; }
}

@keyframes shimmer-fade {
  0%, 100% { opacity: 1; }
  15%      { opacity: 0.25; }
  33%      { opacity: 1; }
}

.shimmer-pulse {
  animation: page-pulse 3s ease-in-out infinite;
}

@keyframes page-pulse {
  0%, 100% { background: #fff; }
  50%      { background: #EDF5FD; }
}

.toolbar-onboarding-slot {
  align-items: center;
  text-align: center;
  gap: 20px;
  flex: 0 0 auto;
  justify-content: center;
  overflow: visible;
}

.toolbar-onboarding-slot .onboarding-header {
  text-align: center;
  max-width: 480px;
}

.toolbar-onboarding-slot .onboarding-heading {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-ink);
  margin-bottom: 10px;
}

.toolbar-onboarding-slot .onboarding-subheading {
  font-size: var(--text-lg);
  font-weight: 400;
  color: var(--color-ink-secondary);
  line-height: 1.5;
  padding: 0;
}

.toolbar-onboarding-slot .onboarding-upload {
  width: 480px;
  max-width: 100%;
  height: auto;
  flex: 1;
  min-height: 0;
}

.toolbar-onboarding-slot .onboarding-upload.file-accepted {
  height: 100%;
}

.toolbar-onboarding-slot .onboarding-preview {
  flex: 1;
  min-height: 0;
}

.toolbar-onboarding-slot .onboarding-filetype-ext {
  font-weight: 600;
}

.toolbar-onboarding-slot #onboarding-analyze-btn {
  align-self: flex-end;
}

.toolbar-onboarding-slot .consent-row {
  max-width: 480px;
  padding: 0;
}

.toolbar-file-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding-top: 16px;
  padding-bottom: 8px;
}

.resume-action-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 2px;
  margin-left: auto;
  cursor: pointer;
}

.resume-action-hint {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-ink);
}

.resume-action-block .bounce-dots {
  margin-top: -10px;
  justify-content: flex-end;
}

.onboarding-parse-status {
  margin-left: auto;
  font-size: var(--text-sm);
  color: var(--color-ink-secondary);
}

/* ── History Panel ── */
#history-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

#history-content[hidden] {
  display: none;
}

.history-filter {
  display: flex;
  gap: 8px;
  align-items: center;
}

.history-filter select {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: inherit;
  background: var(--color-surface);
}

.history-filter select:focus {
  outline: none;
  border-color: var(--color-ink);
}

.history-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.history-stat {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: 24px;
  transition: box-shadow 0.2s;
}

.history-stat:hover {
  box-shadow: var(--shadow-lg);
}

.history-stat .stat-value {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 6px;
  color: var(--color-ink);
}

.history-stat .stat-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-ink-secondary);
}

.history-section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-ink-secondary);
  margin-bottom: 12px;
}

.history-page-header {
  display: flex;
  flex-direction: column;
}

.history-page-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-ink);
  margin: 0;
  padding: 0;
  line-height: 1.2;
}

.history-page-subtitle {
  font-size: var(--text-lg);
  font-weight: 400;
  color: var(--color-ink-secondary);
  line-height: 1.5;
  margin: 6px 0 0;
  padding: 0;
}

.history-search-wrap {
  position: relative;
  padding-bottom: 0;
  margin-bottom: 0;
}

.history-search-wrap::after {
  content: "";
  display: block;
  width: 120px;
  height: 3px;
  background: var(--color-border);
  border-radius: 3px;
  margin: 24px auto 8px;
}

.history-filter-btn {
  position: absolute;
  right: 10px;
  top: 22px;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-ink-tertiary);
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.history-filter-btn:hover {
  color: var(--color-ink-primary);
  background: #e8e8ea;
}

.history-filter-dropdown {
  position: absolute;
  right: 0;
  top: 52px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  padding: 8px 0;
  z-index: 100;
  min-width: 180px;
}

.filter-group-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-ink-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 16px 4px;
}

.filter-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 16px;
  border: none;
  background: none;
  font-size: 0.85rem;
  color: var(--color-ink-primary);
  cursor: pointer;
  transition: background 0.1s;
  font-family: var(--font-sans);
}

.filter-option:hover {
  background: #f0f0f2;
}

.filter-option.active {
  color: var(--color-accent-blue);
  font-weight: 600;
}

.history-search-icon {
  position: absolute;
  left: 14px;
  top: 22px;
  transform: translateY(-50%);
  color: var(--color-ink-tertiary);
  pointer-events: none;
}

.history-search {
  width: 100%;
  padding: 14px 42px 14px 40px;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  background: var(--color-surface);
  color: var(--color-ink-primary);
  outline: none;
  box-sizing: border-box;
}

.history-search::placeholder {
  opacity: 0.4;
}


.history-sessions {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.history-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
}

.history-delete-wrap {
  display: flex;
  justify-content: center;
  margin-top: 8px;
  padding-bottom: 16px;
}

.history-delete-btn {
  background: none;
  border: none;
  color: var(--color-ink-tertiary);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}

.history-delete-btn:hover {
  color: var(--color-error);
  background: var(--color-error-bg, rgba(211, 0, 63, 0.06));
}

.page-btn {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 10px;
  background: #fff;
  color: var(--color-ink-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.page-btn:hover:not(:disabled):not(.page-active) {
  background: #f0f0f2;
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.page-btn.page-active {
  background: var(--color-accent-blue);
  color: #fff;
}

.page-btn.page-arrow {
  font-size: 1.1rem;
  background: transparent;
  color: var(--color-ink-tertiary);
}

.page-btn.page-arrow:hover:not(:disabled) {
  background: #e8e8ea;
  color: var(--color-ink-primary);
}

.page-ellipsis {
  width: 38px;
  text-align: center;
  color: var(--color-ink-tertiary);
  font-size: 0.85rem;
  letter-spacing: 2px;
}

.page-jump-wrap {
  position: relative;
  margin-left: 8px;
}

.page-jump-select {
  appearance: none;
  -webkit-appearance: none;
  height: 38px;
  padding: 0 36px 0 14px;
  border: none;
  border-radius: 10px;
  background: #fff;
  color: var(--color-ink-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  caret-color: transparent;
}

.page-jump-select:focus {
  outline: none;
}

.page-jump-chevron {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--color-ink-secondary);
}

.history-session {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: none;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08), 0 2px 12px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.history-session:hover {
  transform: scale(1.02);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12), 0 4px 20px rgba(0, 0, 0, 0.06);
}

.history-session .session-score {
  font-size: 22px;
  font-weight: 700;
  min-width: 56px;
  text-align: center;
  flex-shrink: 0;
}

.history-session .session-info {
  flex: 1;
  min-width: 0;
}

.history-session .session-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-session .session-title .session-company {
  font-weight: 400;
  color: var(--color-ink-secondary);
}

.history-session .session-meta {
  font-size: 14px;
  color: var(--color-ink-secondary);
  margin-top: 3px;
}

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

.history-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--color-surface-subtle);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--color-ink-body);
}

.history-list-item .item-count {
  font-size: 11px;
  font-weight: 700;
  background: #e8e8e8;
  color: #666;
  padding: 2px 7px;
  border-radius: 10px;
  flex-shrink: 0;
}

.history-list-item .item-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Clickable Session Rows ── */
.history-session[data-session-id] {
  cursor: pointer;
}

.history-session[data-session-id]:hover {
  border-color: #B0B0B0;
}

.session-arrow {
  font-size: 20px;
  color: #C0C0C0;
  font-weight: 400;
  flex-shrink: 0;
}

/* ── Session Detail View ── */
.history-back {
  background: none;
  border: none;
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-ui);
  color: var(--color-accent-blue);
  cursor: pointer;
  padding: 4px 0;
  margin-bottom: 4px;
  align-self: flex-start;
  transition: opacity 0.15s;
}

.history-back:hover {
  opacity: 0.7;
}

.history-detail-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
}

.history-detail-header .detail-score {
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
}

.history-detail-header .detail-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-ink);
}

.history-detail-header .detail-company {
  font-size: 12px;
  color: var(--color-ink-secondary);
  margin-top: 2px;
}

.detail-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-verdict {
  font-size: 14px;
  font-weight: 700;
  color: #222;
}

.detail-summary {
  font-size: 13px;
  color: var(--color-ink-body);
  line-height: 1.5;
}

.detail-bottom-line {
  font-size: 12px;
  color: #666;
  font-style: italic;
  line-height: 1.5;
}

.detail-list {
  margin-left: 16px;
  font-size: 13px;
  color: var(--color-ink-body);
  line-height: 1.6;
}

.detail-list li {
  margin-bottom: 2px;
}

.detail-answer-card {
  background: var(--color-surface-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.detail-answer-gap {
  font-size: 11px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.detail-answer-question {
  font-size: 13px;
  color: #333;
  margin-bottom: 6px;
  line-height: 1.4;
}

.detail-answer-text {
  font-size: 13px;
  color: #555;
  line-height: 1.5;
}

.detail-skipped {
  color: #bbb;
  font-style: italic;
}

.detail-answer-used {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-success-text);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ── History Detail Builder Layout ── */
.history-detail-builder {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 8.5in;
}

/* Toolbar-style ticket container for analysis */
.history-toolbar-ticket {
  width: 100%;
  background: var(--color-surface);
  padding: 32px 32px 24px;
  position: relative;
  /* Scallop top + bottom corner cutouts */
  --scallop-tile: 35.636px;
  --scallop-offset: -1.818px;
  -webkit-mask-image:
    radial-gradient(circle 10px at calc(var(--scallop-tile) / 2) 0, transparent 9.5px, black 10px),
    radial-gradient(circle 10px at 0 100%, transparent 9.5px, black 10px),
    radial-gradient(circle 10px at 100% 100%, transparent 9.5px, black 10px);
  -webkit-mask-size: var(--scallop-tile) 100%, 100% 100%, 100% 100%;
  -webkit-mask-position: var(--scallop-offset) 0, 0 0, 0 0;
  -webkit-mask-repeat: repeat-x, no-repeat, no-repeat;
  -webkit-mask-composite: source-in, source-in;
  mask-image:
    radial-gradient(circle 10px at calc(var(--scallop-tile) / 2) 0, transparent 9.5px, black 10px),
    radial-gradient(circle 10px at 0 100%, transparent 9.5px, black 10px),
    radial-gradient(circle 10px at 100% 100%, transparent 9.5px, black 10px);
  mask-size: var(--scallop-tile) 100%, 100% 100%, 100% 100%;
  mask-position: var(--scallop-offset) 0, 0 0, 0 0;
  mask-repeat: repeat-x, no-repeat, no-repeat;
  mask-composite: intersect, intersect;
}

/* Dashed divider at bottom — same as #resume-toolbar::after */
.history-toolbar-ticket::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 20px;
  right: 20px;
  height: 3px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='3'%3E%3Cline x1='1.5' y1='1.5' x2='16' y2='1.5' stroke='%23d0d0d0' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 28px 3px;
}

/* Resume wrapper — matches .resume in builder (corner punch-holes) */
.history-resume-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  -webkit-mask-image:
    radial-gradient(circle 10px at 0 0, transparent 9.5px, black 10px),
    radial-gradient(circle 10px at 100% 0, transparent 9.5px, black 10px);
  -webkit-mask-size: 100% 100%, 100% 100%;
  -webkit-mask-position: 0 0, 0 0;
  -webkit-mask-repeat: no-repeat, no-repeat;
  -webkit-mask-composite: source-in;
  mask-image:
    radial-gradient(circle 10px at 0 0, transparent 9.5px, black 10px),
    radial-gradient(circle 10px at 100% 0, transparent 9.5px, black 10px);
  mask-size: 100% 100%, 100% 100%;
  mask-position: 0 0, 0 0;
  mask-repeat: no-repeat, no-repeat;
  mask-composite: intersect;
}

/* Resume page inside history — constrain to container width */
.history-resume-wrap .resume-page {
  width: 100%;
  height: auto;
  overflow: hidden;
}

.history-detail-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 32px;
  width: 100%;
  background: var(--color-surface);
  position: relative;
  -webkit-mask-image:
    radial-gradient(circle 10px at 0 0, transparent 9.5px, black 10px),
    radial-gradient(circle 10px at 100% 0, transparent 9.5px, black 10px),
    radial-gradient(circle 10px at 0 100%, transparent 9.5px, black 10px),
    radial-gradient(circle 10px at 100% 100%, transparent 9.5px, black 10px);
  -webkit-mask-size: 100% 100%;
  -webkit-mask-position: 0 0;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-composite: source-in;
  mask-image:
    radial-gradient(circle 10px at 0 0, transparent 9.5px, black 10px),
    radial-gradient(circle 10px at 100% 0, transparent 9.5px, black 10px),
    radial-gradient(circle 10px at 0 100%, transparent 9.5px, black 10px),
    radial-gradient(circle 10px at 100% 100%, transparent 9.5px, black 10px);
  mask-size: 100% 100%;
  mask-position: 0 0;
  mask-repeat: no-repeat;
  mask-composite: intersect;
}

/* Only bottom dashed line — top is provided by analysis ticket's ::after */
.history-detail-controls::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 20px;
  right: 20px;
  height: 3px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='3'%3E%3Cline x1='1.5' y1='1.5' x2='16' y2='1.5' stroke='%23d0d0d0' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 28px 3px;
}

/* ── Section Title Row (title + see all) ── */
.history-section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.history-section-title-row .history-section-title {
  margin-bottom: 0;
}

.history-see-all {
  background: none;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-ink-secondary);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}

.history-see-all:hover {
  color: var(--color-ink);
}

/* ── All Sessions Panel (preview area) ── */
.all-sessions-panel {
  width: 100%;
  max-width: 8.5in;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.all-sessions-header {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-ink);
  margin-bottom: 8px;
}

.all-sessions-list {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.all-sessions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid #f0f0f2;
}

.all-sessions-row:last-child {
  border-bottom: none;
}

.all-sessions-row:hover {
  background: var(--color-surface-hover);
}

.all-sessions-row .session-score {
  font-size: 16px;
  font-weight: 700;
  min-width: 50px;
  text-align: center;
}

.all-sessions-row .session-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-ink);
}

.all-sessions-row .session-meta {
  font-size: 11px;
  color: var(--color-ink-secondary);
  margin-top: 2px;
}

.all-sessions-row .session-verdict {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-ink-secondary);
  flex-shrink: 0;
}

.history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 60vh;
  padding: 48px 16px;
}

/* ── Diff Resume ── */
.diff-resume-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
}

.diff-resume-page {
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

del.diff-removed {
  text-decoration: line-through;
  color: var(--color-error);
  background: var(--color-error-bg);
  padding: 1px 3px;
  border-radius: 2px;
  text-decoration-color: var(--color-error);
}

ins.diff-added {
  text-decoration: none;
  color: var(--color-success-text);
  background: var(--color-success-bg);
  padding: 1px 3px;
  border-radius: 2px;
}

/* Removed bullets in diff */
.diff-resume-page .exp-bullets li:has(> del.diff-removed:only-child) {
  opacity: 0.7;
}

/* ── Disabled questions after tailoring ── */
.questions-container.disabled .question-card {
  pointer-events: none;
  opacity: 0.5;
}
.questions-container.disabled .toggle-group {
  pointer-events: none;
  opacity: 0.5;
}

/* ── Results Controls Section (between questions and resume) ── */
.results-controls {
  width: 100%;
  background: var(--color-surface);
  padding: 24px 32px;
  display: flex;
  flex-direction: row;
  align-items: center;
  position: relative;
  /* 4-corner notch masks — ticket punch holes at outer edges */
  -webkit-mask-image:
    radial-gradient(circle 10px at 0 0, transparent 9.5px, black 10px),
    radial-gradient(circle 10px at 100% 0, transparent 9.5px, black 10px),
    radial-gradient(circle 10px at 0 100%, transparent 9.5px, black 10px),
    radial-gradient(circle 10px at 100% 100%, transparent 9.5px, black 10px);
  -webkit-mask-size: 100% 100%;
  -webkit-mask-position: 0 0;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-composite: source-in;
  mask-image:
    radial-gradient(circle 10px at 0 0, transparent 9.5px, black 10px),
    radial-gradient(circle 10px at 100% 0, transparent 9.5px, black 10px),
    radial-gradient(circle 10px at 0 100%, transparent 9.5px, black 10px),
    radial-gradient(circle 10px at 100% 100%, transparent 9.5px, black 10px);
  mask-size: 100% 100%;
  mask-position: 0 0;
  mask-repeat: no-repeat;
  mask-composite: intersect;
}

.results-controls-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.results-controls .btn {
  white-space: nowrap;
  padding: 12px 24px;
  min-width: 180px;
  text-align: center;
}

/* Dashed divider at bottom of results controls */
.results-controls::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 20px;
  right: 20px;
  height: 3px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='3'%3E%3Cline x1='1.5' y1='1.5' x2='16' y2='1.5' stroke='%23d0d0d0' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 28px 3px;
}

/* ── Resume View Toggle (Changes / Final) ── */
.resume-view-toggle {
  display: flex;
  justify-content: center;
  gap: 0;
  background: var(--color-surface-hover);
  border-radius: var(--radius-pill);
  padding: 3px;
  width: fit-content;
}
.view-toggle-btn {
  border: none;
  background: none;
  padding: 6px 20px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-ink-secondary);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.2s var(--ease-smooth), color 0.2s var(--ease-smooth);
  font-family: var(--font-ui);
}
.view-toggle-btn:hover {
  color: var(--color-ink);
}
.view-toggle-btn.active {
  background: var(--color-surface);
  color: var(--color-ink);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

/* Diff view: no fixed height so markup can overflow */
.diff-resume-page {
  height: auto;
  min-height: 11in;
}

/* Final preview: auto height, shows honest content length */
.final-preview {
  height: auto;
  min-height: 11in;
}

/* ── Onboarding ── */
.onboarding {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 48px 48px;
  text-align: center;
  width: 100%;
  max-width: 8.5in;
  margin: 0 auto;
  gap: 48px;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}

/* ── Horizontal layout: upload zone + consent side by side ── */
.onboarding-hstack {
  display: flex;
  gap: 24px;
  align-items: stretch;
  width: 100%;
  flex: 0 0 auto;
  overflow: visible;
}

.onboarding-hstack .onboarding-upload,
.onboarding-hstack .onboarding-upload.file-accepted {
  flex: 1;
  width: auto;
  height: 300px;
  min-height: 300px;
  max-height: 300px;
  overflow: visible;
  padding-bottom: 8px;
}

.onboarding-right-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: left;
  flex: 0 0 280px;
  gap: 0;
  padding-top: var(--space-8);
  padding-bottom: 0;
}

.onboarding-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.onboarding-consent-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 16px;
  max-width: 70%;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  width: 100%;
}

.onboarding-consent-row .consent-text {
  cursor: pointer;
}

.onboarding-right-stack.disabled {
  pointer-events: none;
  opacity: 0.4;
}

/* ── Secondary container below toolbar (phase 1) ── */
.onboarding-secondary {
  width: 100%;
  height: 160px;
  background: var(--color-surface);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  box-shadow: var(--shadow-md);
  user-select: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px 32px;
  text-align: left;
  /* Punch-holes now on .resume wrapper — no mask needed here */
}

.onboarding-secondary .onboarding-heading {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: 6px;
}

.onboarding-secondary .onboarding-subheading {
  font-size: var(--text-lg);
  padding: 0;
}

/* ── Floating heading + consent below toolbar (phase 1) ── */
.onboarding-below {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 8.5in;
  align-self: center;
  padding: 40px 32px 0;
  gap: 28px;
}

.onboarding-below .onboarding-header {
  max-width: 480px;
}

.onboarding-below .consent-row {
  text-align: left;
}

.onboarding-header {
  text-align: center;
  width: 100%;
}

.onboarding-heading {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: 10px;
}

.onboarding-subheading {
  font-size: 15px;
  font-weight: 400;
  color: var(--color-ink-secondary);
  line-height: 1.5;
  padding: 0 120px;
}

.onboarding-upload {
  border: none;
  border-radius: var(--radius-xl);
  padding: 0 48px;
  height: 262px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: background 0.25s ease;
  width: calc(75% + 37px);
  cursor: pointer;
  position: relative;
}

/* Round-capped dashed border via SVG ::before */
.onboarding-upload::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 262' preserveAspectRatio='none'%3E%3Crect x='1.5' y='1.5' width='597' height='259' rx='16' ry='16' fill='none' stroke='%23d0d0d0' stroke-width='3' stroke-dasharray='8 5' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
  background-size: 100% 100%;
}

.onboarding-upload:hover {
  background: var(--color-surface-subtle);
}

.onboarding-upload:hover::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 262' preserveAspectRatio='none'%3E%3Crect x='1.5' y='1.5' width='597' height='259' rx='16' ry='16' fill='none' stroke='%23999999' stroke-width='3' stroke-dasharray='8 5' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
}

.onboarding-upload.dragover {
  background: #f5f5f5;
  transform: scale(1.01);
}

.onboarding-upload.dragover::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 262' preserveAspectRatio='none'%3E%3Crect x='1.5' y='1.5' width='597' height='259' rx='16' ry='16' fill='none' stroke='%2346A7F0' stroke-width='3' stroke-dasharray='8 5' stroke-linecap='round' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
}

.onboarding-upload-icon {
  width: 44px;
  height: 44px;
  color: #333;
}

.onboarding-preview {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  max-height: 280px;
  overflow: hidden;
  border-radius: var(--radius-md);
  width: 100%;
  margin-top: 8px;
}

.onboarding-preview-loading {
  font-size: 13px;
  color: var(--color-ink-tertiary);
}

.onboarding-preview-canvas {
  width: 80%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.onboarding-upload-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-ink);
  line-height: 1.3;
}

.onboarding-upload-filetypes {
  font-size: 14px;
  color: var(--color-ink-tertiary);
  font-style: italic;
}

.onboarding-upload.file-accepted {
  background: #46A7F0;
  position: relative;
  height: 360px;
  padding: 16px;
  justify-content: stretch;
  cursor: default;
}

.onboarding-upload.file-accepted::before {
  display: none;
}

.onboarding-upload.file-accepted .onboarding-preview {
  margin-top: 0;
  overflow: visible;
  max-height: none;
}

.onboarding-upload.file-accepted .onboarding-preview-canvas {
  display: block;
  height: 268px;
  width: auto;
  max-height: 268px;
}

.onboarding-upload.file-accepted:hover {
  background: #46A7F0;
}

.onboarding-remove-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--color-border-subtle);
  z-index: 1;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s var(--ease-smooth),
              color 0.3s var(--ease-smooth);
  animation: bounce-in 0.4s var(--ease-spring) both;
}

.onboarding-remove-btn:hover {
  background: #ccc;
  color: #333;
}

@keyframes bounce-in {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes bounce-out {
  0% { transform: scale(1); opacity: 1; }
  40% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(0); opacity: 0; }
}

@keyframes breathing {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.99); }
}

.onboarding-upload.parsing {
  user-select: none;
  cursor: default;
}

.onboarding-upload.parsing .onboarding-preview {
  animation: breathing 2.4s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
}

.onboarding-upload.parsing .onboarding-upload-title {
  animation: breathing 2.4s cubic-bezier(0.45, 0.05, 0.55, 0.95) 0.2s infinite;
}

.onboarding-upload.parsing #onboarding-filetypes-text {
  animation: breathing 2.4s cubic-bezier(0.45, 0.05, 0.55, 0.95) 0.4s infinite;
}

.onboarding-upload .btn {
  margin-top: 12px; /* 12px gap + 12px margin = 24px total */
}

.onboarding-upload .btn:hover:not(:disabled) {
  background: #333;
}


.onboarding-upload .btn.btn-disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

#onboarding-analyze-btn {
  margin-top: auto;
  align-self: flex-end;
}

/* ── Consent Checkbox ── */
.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  padding: 0 120px;
  user-select: none;
}

.consent-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  min-width: 22px;
  margin-top: 3px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.25s var(--ease-smooth),
              border-color 0.25s var(--ease-smooth),
              transform 0.2s var(--ease-smooth);
  position: relative;
  flex-shrink: 0;
}

.consent-checkbox:active {
  transform: scale(0.9);
}

.consent-checkbox:checked {
  background: var(--color-accent-blue);
  border-color: var(--color-accent-blue);
}

.consent-checkbox:disabled {
  opacity: 0.4;
  cursor: default;
  transition: none;
  pointer-events: none;
}

.consent-row.disabled {
  pointer-events: none;
  cursor: default;
}

.consent-row.disabled .consent-text {
  opacity: 0.4;
}

.consent-checkbox::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%) scale(0);
  opacity: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  transition: transform 0.2s var(--ease-smooth),
              opacity 0.2s var(--ease-smooth);
}

.consent-checkbox:checked::after {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.consent-text {
  font-size: 13px;
  color: var(--color-ink-secondary);
  line-height: 1.5;
}

.ticket-id-col {
  display: flex;
  gap: 24px;
  align-items: center;
}

.ticket-id {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-border);
  font-family: var(--font-ui);
  white-space: nowrap;
  height: 120px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── Print / PDF styles ── */
@media print {
  body { background: none; }
  .sidebar { display: none; }
  .main-top { display: none; }
  .preview-container { padding: 0; overflow: visible; }
  .resume { gap: 0; }
  .resume-page { box-shadow: none; height: auto; min-height: 11in; }
  .resume-page + .resume-page { page-break-before: always; }
  .exp-entry { break-inside: avoid; }
}

/* ── Sidebar Auth ── */
.sidebar-auth {
  padding: 0 0 4px;
}

.sidebar-ticket-display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0 16px;
  font-size: 0.8rem;
  color: var(--color-ink-secondary);
  border-bottom: 2px solid var(--color-ink);
  margin: 0 12px 8px;
}

.sidebar-auth-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
}

.sidebar-auth-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-accent-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.sidebar-auth-info {
  overflow: hidden;
  flex: 1;
}

.sidebar-auth-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-auth-email {
  font-size: var(--text-xs);
  color: var(--color-ink-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-auth-provider {
  background: none;
  border: none;
}

.sidebar-auth-provider svg {
  width: 18px;
  height: 18px;
}

/* ── Settings Page ── */
.settings-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-10);
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Profile card (reused from account) */
.account-profile-card {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
}

.account-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-accent-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  flex-shrink: 0;
}

.account-profile-info {
  flex: 1;
  min-width: 0;
}

.account-name {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-ink);
  line-height: 1.2;
  margin-bottom: 2px;
}

.account-email {
  font-size: var(--text-sm);
  color: var(--color-ink-secondary);
  margin-bottom: var(--space-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-xs);
  color: var(--color-ink-tertiary);
}

.account-provider {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.account-member-since {
  position: relative;
  padding-left: var(--space-4);
}

.account-member-since::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--color-ink-tertiary);
}

/* Subscription card */
.settings-subscription-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
}

.settings-plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.settings-plan-name {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: 2px;
}

.settings-plan-desc {
  font-size: var(--text-sm);
  color: var(--color-ink-secondary);
}

.settings-upgrade-btn {
  white-space: nowrap;
}

.btn-primary {
  padding: 12px 32px;
  min-width: 120px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-ink);
  color: #fff;
  font-size: 15px;
  font-family: var(--font-ui);
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-primary:hover { opacity: 0.85; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
  padding: 12px 32px;
  min-width: 120px;
  border: none;
  border-radius: var(--radius-md);
  background: #e8e8e8;
  color: var(--color-ink);
  font-size: 15px;
  font-family: var(--font-ui);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-secondary:hover {
  background: #ddd;
}

/* Danger zone */
.settings-danger-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  border: 1px solid var(--color-error-bg);
}

.settings-danger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.settings-danger-label {
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--color-ink);
  margin-bottom: 2px;
}

.settings-danger-desc {
  font-size: var(--text-sm);
  color: var(--color-ink-secondary);
}

.settings-danger-divider {
  height: 1px;
  background: var(--color-border-subtle);
  margin: var(--space-4) 0;
}

.btn-danger {
  padding: 12px 32px;
  min-width: 120px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-error-bg);
  color: var(--color-error);
  font-size: 15px;
  font-family: var(--font-ui);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.btn-danger:hover {
  background: var(--color-error);
  color: #fff;
}

.sidebar-sign-in-btn,
.sidebar-sign-out-btn {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-ink);
  font-size: var(--text-sm);
  font-family: var(--font-ui);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.sidebar-sign-in-btn:hover,
.sidebar-sign-out-btn:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border-strong);
}

.sidebar-sign-out-btn {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-ink-secondary);
}

/* ── Confirm Modal ── */
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm-modal[hidden] { display: none; }

.confirm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  animation: confirmFadeIn 0.25s ease both;
}

.confirm-modal-content {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  width: 100%;
  max-width: 360px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  text-align: center;
  animation: confirmBounceIn 0.35s var(--ease-spring) both;
}

@keyframes confirmFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes confirmBounceIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes confirmFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes confirmBounceOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.9); }
}

.confirm-modal-message {
  font-size: var(--text-md);
  font-weight: 500;
  color: var(--color-ink);
  margin-bottom: var(--space-6);
  line-height: 1.4;
}

.confirm-modal-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
}

/* ── Auth Modal ── */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-modal[hidden] { display: none; }

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
}

.auth-modal-content {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-10) var(--space-8);
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.auth-modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--color-border-subtle);
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s var(--ease-smooth),
              color 0.3s var(--ease-smooth);
}

.auth-modal-close:hover {
  background: #ccc;
  color: #333;
}

.auth-modal-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: 10px;
}

.auth-modal-subtitle {
  font-size: 15px;
  font-weight: 400;
  color: var(--color-ink-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-6);
}

.auth-oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.auth-oauth-buttons[hidden] { display: none; }

.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-3);
  border: 3px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  font-size: var(--text-base);
  font-family: var(--font-ui);
  font-weight: 500;
  color: var(--color-ink);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.oauth-btn:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border-strong);
}

.auth-divider {
  width: 120px;
  margin: var(--space-5) auto;
  height: 3px;
  background: var(--color-ink);
  border: none;
  border-radius: 2px;
}
.auth-divider[hidden] { display: none; }

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.auth-form[hidden] { display: none; }

.auth-input {
  padding: var(--space-3);
  border: 3px solid var(--color-border);
  border-radius: var(--radius-xl);
  font-size: var(--text-base);
  font-family: var(--font-ui);
  color: var(--color-ink);
  background: var(--color-surface);
  outline: none;
  transition: border-color 0.15s;
}

.auth-input:focus {
  border-color: var(--color-accent-blue);
}

.auth-field {
  position: relative;
}
.auth-field .auth-input {
  width: 100%;
}

.auth-field-tooltip {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) scale(0.85);
  transform-origin: top center;
  width: 260px;
  height: 88px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 24px 4px;
  text-align: center;
  color: #fff;
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1.4;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-spring), transform 0.25s var(--ease-spring);
}

.auth-field-tooltip::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 260 88'%3E%3Cpath fill='%231d1d1f' d='M15,18h103.5c1.7,0,3.3-0.7,4.5-1.9l5-5c1.3-1.3,3.5-1.3,4.8,0l5,5c1.2,1.2,2.8,1.9,4.5,1.9H245c7.5,0,13.5,6,13.5,13.5v42c0,7.5-6,13.5-13.5,13.5H15C7.5,87,1.5,81,1.5,73.5v-42C1.5,24,7.5,18,15,18z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15));
}

.auth-field-tooltip.visible {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  pointer-events: auto;
}

.auth-input-wrap {
  position: relative;
}
.auth-input-wrap[hidden] { display: none; }
.auth-input-wrap .auth-input {
  width: 100%;
  padding-right: 40px;
}
.auth-eye {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--color-ink-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-eye:hover { color: var(--color-ink-secondary); }
.auth-eye .eye-open,
.auth-eye .eye-closed {
  position: absolute;
  transition: opacity 0.2s var(--ease-spring), transform 0.3s var(--ease-spring);
}
.auth-eye .eye-open {
  opacity: 1;
  transform: scale(1);
}
.auth-eye .eye-closed {
  opacity: 0;
  transform: scale(0.6);
}
.auth-eye.revealed .eye-open {
  opacity: 0;
  transform: scale(0.6);
}
.auth-eye.revealed .eye-closed {
  opacity: 1;
  transform: scale(1);
}

.auth-submit {
  padding: 12px 32px;
  min-width: 120px;
  width: auto;
  align-self: center;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-ink);
  color: #fff;
  font-size: 15px;
  font-family: var(--font-ui);
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}

.auth-submit:hover { opacity: 0.85; }
.auth-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-toggle {
  margin-top: var(--space-4);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-ink-secondary);
}
.auth-toggle[hidden] { display: none; }

.auth-toggle-btn {
  background: none;
  border: none;
  color: var(--color-accent-blue);
  font-size: var(--text-sm);
  font-family: var(--font-ui);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-left: var(--space-1);
}

.auth-toggle-btn:hover { text-decoration: underline; }

.auth-error {
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-error-bg);
  color: var(--color-error);
  font-size: var(--text-xs);
  text-align: center;
}

.auth-error[hidden] { display: none; }

/* Password strength rules */
.auth-password-rules {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-1) var(--space-2);
  padding: 0 var(--space-1);
}
.auth-password-rules[hidden] { display: none; }
.auth-password-rules .rule {
  font-size: 11px;
  color: var(--color-ink-tertiary);
  transition: color 0.15s;
}
.auth-password-rules .rule.pass {
  color: var(--color-green);
}

/* OTP verification step */
.auth-otp-step[hidden] { display: none; }
.auth-otp-message {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-ink-secondary);
  margin-bottom: var(--space-4);
  line-height: 1.5;
}
.auth-otp-inputs {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  margin-bottom: var(--space-3);
}
.auth-otp-digit {
  width: 44px;
  height: 52px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-ui);
  border: 3px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-ink);
  outline: none;
  transition: border-color 0.15s;
}
.auth-otp-digit:focus {
  border-color: var(--color-accent-blue);
}
.auth-otp-resend {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-ink-tertiary);
  margin-top: var(--space-3);
}

/* Auth success state */
.auth-success[hidden] { display: none; }
.auth-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-6) 0;
  animation: authSuccessFadeIn 0.3s ease;
}
.auth-success-check {
  width: 52px;
  height: 52px;
  color: #16a34a;
}
.auth-success-check circle {
  stroke-dasharray: 157;
  stroke-dashoffset: 157;
  animation: authCircleDraw 0.4s ease forwards;
}
.auth-success-tick {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: authTickDraw 0.3s ease 0.35s forwards;
}
.auth-success-text {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-ink);
}
@keyframes authSuccessFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes authCircleDraw {
  to { stroke-dashoffset: 0; }
}
@keyframes authTickDraw {
  to { stroke-dashoffset: 0; }
}

/* ── Usage Dashboard ── */

.usage-overview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 8px;
}

.usage-table-wrap {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.usage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.usage-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-ink-secondary);
  border-bottom: 1px solid var(--color-border-subtle);
}

.usage-table td {
  padding: 8px 16px;
  color: var(--color-ink-body);
  border-bottom: 1px solid #f0f0f2;
}

.usage-table tr:last-child td {
  border-bottom: none;
}

.usage-table code {
  font-size: 12px;
  background: var(--color-surface-subtle);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

/* ══════════════════════════════════════════════════
   Responsive — Hamburger & Sidebar Overlay (base)
   ══════════════════════════════════════════════════ */
.hamburger-btn {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 110;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
}

.hamburger-line {
  display: block;
  width: 22px;
  height: 2.5px;
  background: var(--color-ink);
  border-radius: 2px;
  transition: transform 0.3s var(--ease-smooth), opacity 0.3s var(--ease-smooth);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s var(--ease-smooth);
  pointer-events: none;
}

.sidebar-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ══════════════════════════════════════════════════
   Tablet Breakpoint — max-width: 1140px
   ══════════════════════════════════════════════════ */
@media (max-width: 1140px) {
  .hamburger-btn {
    display: flex;
  }

  .sidebar-overlay {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s var(--ease-smooth);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
  }

  .sidebar.sidebar-open {
    transform: translateX(0);
  }

  .step-indicator {
    max-width: 100%;
    padding: 48px 24px 32px;
  }

  .main-top {
    max-width: 100%;
    padding: 0 24px;
  }

  .preview-container {
    padding: 40px 24px;
  }

  .consent-row {
    padding: 0 40px;
  }

  .page-inner {
    max-width: 100%;
    padding: 40px 24px;
  }

  .score-brief {
    max-width: calc(100% - 160px);
  }

}

/* ══════════════════════════════════════════════════
   Phone Breakpoint — max-width: 640px
   ══════════════════════════════════════════════════ */
@media (max-width: 640px) {

  /* Layout Foundation */
  .step-indicator {
    padding: 60px 24px 24px;
  }

  .step-dot {
    width: 24px;
    height: 24px;
  }

  .step.active .step-dot {
    width: 30px;
    height: 30px;
  }

  .step-dot-inner {
    width: 12px;
    height: 12px;
  }

  .step.active .step-dot-inner {
    width: 18px;
    height: 18px;
  }

  .step:not(:last-child)::after {
    top: 15px;
    left: calc(50% + 18px);
    right: calc(-50% + 18px);
  }

  .step-label {
    font-size: 11px;
  }

  .main-top {
    padding: 0 24px;
    gap: 24px;
  }

  .preview-container {
    padding: 24px 16px;
  }

  #resume-toolbar {
    padding: 24px 24px 20px;
    --scallop-tile: 32px;
    --scallop-offset: 0px;
  }

  #resume-toolbar.toolbar-expanded {
    padding: 24px 24px 20px;
  }

  /* Phase 1 — Onboarding (single column) */
  .onboarding-hstack {
    flex-direction: column;
    align-items: center;
  }

  .onboarding-right-stack {
    flex: 0 0 auto;
    text-align: center;
    align-items: center;
    padding-top: 0;
  }

  .onboarding-upload {
    width: 100%;
  }

  .onboarding-hstack .onboarding-upload,
  .onboarding-hstack .onboarding-upload.file-accepted {
    height: auto;
    min-height: 0;
    max-height: none;
    padding-bottom: 16px;
  }

  .onboarding-heading {
    font-size: 28px;
  }

  .toolbar-file-row {
    flex-wrap: wrap;
    gap: 12px;
  }

  .onboarding-secondary {
    height: auto;
    padding: 20px 24px;
  }

  .onboarding-bottom-row {
    flex-direction: column;
    gap: 16px;
  }

  .onboarding-consent-row {
    max-width: 100%;
  }

  .consent-row {
    padding: 0;
  }

  .ticket-id {
    writing-mode: horizontal-tb;
    height: auto;
  }

  .ticket-id-col {
    justify-content: center;
  }

  .onboarding-subheading {
    padding: 0;
  }

  .toolbar-onboarding-slot .onboarding-upload {
    width: 100%;
    min-height: 310px;
    flex: 0 0 auto;
  }

  .toolbar-onboarding-slot .onboarding-upload.file-accepted {
    width: 100%;
    height: auto;
    flex: 0 0 auto;
  }

  .toolbar-onboarding-slot #onboarding-analyze-btn {
    align-self: center;
  }

  .toolbar-file-row {
    flex-wrap: wrap;
  }

  .toolbar-file-row:has(.resume-action-block) .resume-file-block {
    display: none;
  }

  .toolbar-file-row .analyze-btn-wrapper {
    margin: 16px auto;
  }

  .toolbar-file-row .resume-action-block {
    width: 100%;
    margin-left: 0;
    align-items: center;
  }

  /* Phase 2A — Job Posting */
  .job-input-group {
    margin: 0;
    width: 100%;
  }

  .job-textarea {
    height: 180px;
    padding: 16px;
  }

  /* Phase 2B — Analysis Results */
  .analysis-hero {
    flex-direction: column;
    align-items: center;
  }

  .score-badge-wrap {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    order: -1;
    width: 90px;
    height: 90px;
  }

  .score-meta {
    padding-top: 0;
    text-align: center;
  }

  .analysis-hero {
    position: relative;
  }

  .score-brief-row {
    flex-direction: column;
    align-items: center;
  }

  .score-out-of {
    position: absolute;
    top: 72px;
    left: calc(50% + 42px);
  }

  .score-brief {
    max-width: 100%;
    text-align: center;
  }

  /* Phase 3 — Questions */
  .questions-container {
    padding: 24px;
  }

  .question-card {
    padding: 16px;
  }

  .questions-actions .btn {
    width: auto;
  }

  .toggle-row {
    flex-wrap: wrap;
    justify-content: center;
  }

  /* Phase 5 — Results */
  .results-controls {
    flex-direction: column;
    gap: 16px;
    padding: 20px 24px;
  }

  .results-controls {
    -webkit-mask-image: none;
    mask-image: none;
  }

  .resume-view-toggle {
    width: 100%;
    justify-content: center;
  }

  /* Resume preview — scale handled by JS updateResumeScale() */
  .resume-page {
    transform-origin: top center;
  }

  /* Misc */
  .auth-modal-content {
    max-width: calc(100% - 32px);
    padding: 24px;
  }

  .auth-otp-digit {
    width: 38px;
    height: 46px;
    font-size: 18px;
  }

  .history-overview {
    grid-template-columns: 1fr;
  }

  .analysis-card {
    margin-left: 0;
    margin-right: 0;
    width: 100%;
    padding: 24px;
  }

  .usage-overview {
    grid-template-columns: 1fr;
  }

  .account-profile-card {
    flex-direction: column;
    text-align: center;
  }

  .account-meta {
    justify-content: center;
    flex-wrap: wrap;
  }

  .settings-plan-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .settings-danger-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .landing-title { font-size: 40px; }
  .landing-tagline { font-size: var(--text-lg); }

  .ticket-packs { flex-direction: column; }
  .purchase-modal-content { max-width: calc(100% - 32px); padding: 24px; }
  .settings-ticket-row { flex-direction: column; align-items: flex-start; gap: var(--space-3); }
}

/* ── Purchase Modal ── */
.purchase-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
}

.purchase-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  animation: confirmFadeIn 0.25s ease both;
}

.purchase-modal-content {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: confirmBounceIn 0.35s var(--ease-spring) both;
}

.purchase-modal-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: 4px;
}

.purchase-modal-subtitle {
  font-size: 14px;
  color: var(--color-ink-secondary);
  margin-bottom: var(--space-6);
  line-height: 1.5;
}

.ticket-packs {
  display: flex;
  gap: var(--space-3);
}

.ticket-pack {
  flex: 1;
  background: var(--color-surface-subtle);
  border: 2px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  position: relative;
  transition: border-color 0.15s;
}

.ticket-pack:hover {
  border-color: var(--color-accent-blue);
}

.ticket-pack-popular {
  border-color: var(--color-accent-blue);
}

.ticket-pack-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-accent-blue);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
}

.ticket-pack-amount {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--color-ink);
}

.ticket-pack-price {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-ink);
}

.ticket-pack-per {
  font-size: var(--text-xs);
  color: var(--color-ink-tertiary);
}

.ticket-buy-btn {
  margin-top: auto;
  padding: 8px 16px;
  min-width: 0;
  font-size: 13px;
}

.ticket-divider {
  width: 100%;
  height: 2px;
  background: var(--color-border-subtle);
  margin: var(--space-5) 0;
}

.pro-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
  border: 2px solid var(--color-accent-blue);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.pro-card-name {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--color-ink);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.pro-badge {
  display: inline-block;
  background: var(--color-accent-blue);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.pro-card-price {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-ink);
}

.pro-card-period {
  font-size: var(--text-sm);
  font-weight: 400;
  color: var(--color-ink-secondary);
}

.pro-card-desc {
  font-size: var(--text-xs);
  color: var(--color-ink-tertiary);
}

.pro-subscribe-btn {
  white-space: nowrap;
}

/* ── Gated Button + Pro Badge ── */
.download-report.gated {
  color: var(--color-ink-tertiary);
  cursor: pointer;
  opacity: 0.7;
}

.pro-badge-sm {
  display: inline-block;
  background: var(--color-accent-blue);
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

.gated-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-ink);
  color: #fff;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
}

.gated-tooltip.visible {
  display: block;
  animation: confirmFadeIn 0.2s ease;
}

.toggle-row {
  position: relative;
}

/* ── Settings: Ticket Row ── */
.settings-ticket-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border-subtle);
}

.settings-ticket-count {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-ink);
}

.settings-ticket-breakdown {
  font-size: var(--text-xs);
  color: var(--color-ink-tertiary);
  margin-top: 2px;
}

.settings-cancel-notice {
  margin-top: var(--space-3);
  padding: var(--space-3);
  background: var(--color-error-bg);
  color: var(--color-error);
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
}

/* ── Landing Footer ── */
.landing-footer {
  position: absolute;
  bottom: 32px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: var(--text-sm);
}

.landing-footer a {
  color: var(--color-ink-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.landing-footer a:hover {
  color: var(--color-ink);
}

.landing-footer-dot {
  color: var(--color-ink-tertiary);
  margin: 0 8px;
}

/* ── Legal Pages ── */
.legal-page {
  max-width: 680px;
}

.legal-title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: 4px;
}

.legal-updated {
  font-size: var(--text-sm);
  color: var(--color-ink-secondary);
  margin-bottom: var(--space-8);
}

.legal-body h2 {
  font-size: var(--text-md);
  font-weight: 600;
  color: var(--color-ink);
  margin: var(--space-6) 0 var(--space-2);
}

.legal-body p {
  font-size: var(--text-base);
  color: var(--color-ink-body);
  line-height: 1.7;
  margin-bottom: var(--space-3);
}

.legal-body ul {
  padding-left: var(--space-6);
  margin-bottom: var(--space-3);
}

.legal-body li {
  font-size: var(--text-base);
  color: var(--color-ink-body);
  line-height: 1.7;
  margin-bottom: var(--space-1);
}

.legal-body a {
  color: var(--color-accent-blue);
  text-decoration: none;
}

.legal-body a:hover {
  text-decoration: underline;
}

/* ── Insights Page ── */
.insights-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.insights-filter {
  margin-bottom: var(--space-2);
}

.insights-filter select {
  padding: 8px 12px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-family: var(--font-ui);
  background: var(--color-surface);
  color: var(--color-ink);
  cursor: pointer;
}

.insights-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Score trend chart */
.score-trend-chart {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  min-height: 200px;
}

.score-trend-svg {
  width: 100%;
  height: 180px;
}

.score-dot {
  cursor: pointer;
  transition: r 0.15s ease;
}

.score-dot:hover {
  r: 6;
}

/* Bar charts (gaps/strengths) */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
}

.bar-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.bar-label {
  flex: 0 0 180px;
  font-size: var(--text-sm);
  color: var(--color-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  flex: 1;
  height: 20px;
  background: var(--color-surface-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: var(--radius-sm);
  transition: width 0.4s var(--ease-smooth);
}

.bar-fill-gap { background: #d3003f33; }
.bar-fill-strength { background: #5ad49933; }

.bar-count {
  flex: 0 0 30px;
  font-size: var(--text-sm);
  color: var(--color-ink-secondary);
  text-align: right;
}

/* Stat rings */
.stat-rings {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.stat-ring-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.stat-ring-label {
  font-size: var(--text-sm);
  color: var(--color-ink-secondary);
}

.stat-ring-value {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-ink);
}

/* Question patterns table */
.patterns-table-wrap {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  overflow-x: auto;
}

.patterns-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.patterns-table th {
  text-align: left;
  padding: var(--space-2) var(--space-3);
  border-bottom: 2px solid var(--color-border);
  font-weight: 600;
  color: var(--color-ink-secondary);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.patterns-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--color-border-subtle);
  color: var(--color-ink);
}

@media (max-width: 768px) {
  .stat-rings { grid-template-columns: 1fr; }
  .bar-label { flex: 0 0 120px; }
}
