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

    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    .ui-icon {
      width: 1em;
      height: 1em;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      vertical-align: -0.125em;
      color: currentColor;
    }

    .ui-icon svg {
      width: 100%;
      height: 100%;
      display: block;
    }

    .ui-icon-lg {
      width: 18px;
      height: 18px;
    }

    .ui-icon-spin svg {
      animation: uiIconSpin 0.85s linear infinite;
    }

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

    a:focus-visible,
    button:focus-visible,
    input:focus-visible,
    textarea:focus-visible,
    select:focus-visible,
    summary:focus-visible,
    [tabindex]:focus-visible {
      outline: 3px solid #FBBF24;
      outline-offset: 3px;
    }

    :root {
      /* ── Brand ───────────────────────────────────────────────── */
      --brand: #6366F1;
      --brand-dark: #4F46E5;
      --brand-glow: rgba(99, 102, 241, 0.28);

      /* ── Dark surface palette ────────────────────────────────── */
      --bg: #0D0F18;
      --surface: #151722;
      --surface2: #1C1F2E;
      --border: rgba(255, 255, 255, 0.07);
      --border2: rgba(255, 255, 255, 0.13);

      /* ── Typography ──────────────────────────────────────────── */
      --text: #E4E7F0;
      --text2: #8892B0;
      --muted: #50577A;
      --label: #50577A;

      /* ── Status colors ───────────────────────────────────────── */
      --green: #10B981;
      --green-light: rgba(16, 185, 129, 0.14);
      --red: #F87171;
      --red-light: rgba(248, 113, 113, 0.14);
      --amber: #FBBF24;
      --amber-light: rgba(251, 191, 36, 0.14);

      /* ── Shadows ─────────────────────────────────────────────── */
      --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.5);
      --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255,255,255,0.04);
      --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.04);

      /* ── Aliases ─────────────────────────────────────────────── */
      --blue: #6366F1;
      --blue-dark: #4F46E5;
      --blue-light: rgba(99, 102, 241, 0.15);
      --dark: var(--bg);
      --dark2: var(--surface);
      --dark3: var(--border2);
      --white: #E4E7F0;
      --fg: var(--text);
      --input-bg: var(--surface2);
      --card-bg: var(--surface2);
      --sidebar-width: 220px;
      --right-sidebar-min: 260px;
      --right-sidebar-max: 320px;
      --topbar-h: 52px;
      --objectivebar-h: 36px;
      --workflow-strip-h: 36px;
      --app-header-offset: calc(var(--topbar-h) + var(--objectivebar-h));
      --header-stack-h: var(--app-header-offset);
      --resume-scroll-top-safe-space: calc(var(--objectivebar-h) + var(--workflow-strip-h) + 48px);
      --fixed-bottom-safe-space: 96px;
      --mobile-fixed-bottom-safe-space: 168px;
      --z-base: 1;
      --z-sidebar: 20;
      --z-objective-bar: 29;
      --z-topbar: 30;
      --z-guide-sheet: 40;
      --z-chat: 50;
      --z-modal: 1000;
    }

    /* ── Light theme overrides ──────────────────────────────── */
    [data-theme="light"] {
      --bg: #F5F7FF;
      --surface: #FFFFFF;
      --surface2: #EEF0FA;
      --border: rgba(0, 0, 0, 0.08);
      --border2: rgba(0, 0, 0, 0.14);
      --text: #1A1E2E;
      --text2: #4B5563;
      --muted: #9CA3AF;
      --label: #9CA3AF;
      --shadow-xs: 0 1px 3px rgba(0, 0, 0, 0.08);
      --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0,0,0,0.04);
      --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0,0,0,0.05);
      --card-bg: #FFFFFF;
      --input-bg: #FFFFFF;
      --brand-glow: rgba(99, 102, 241, 0.18);
      --green-light: rgba(16, 185, 129, 0.1);
      --red-light: rgba(248, 113, 113, 0.1);
      --amber-light: rgba(251, 191, 36, 0.1);
      --blue-light: rgba(99, 102, 241, 0.1);
    }

    /* Theme toggle button */
    #themeToggle {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 32px;
      height: 32px;
      border-radius: 8px;
      border: 1px solid var(--border);
      background: var(--surface2);
      cursor: pointer;
      color: var(--text2);
      transition: all 0.15s;
      flex-shrink: 0;
    }
    #themeToggle:hover {
      border-color: var(--brand);
      color: var(--brand);
      background: var(--blue-light);
    }

    html,
    body {
      height: 100%;
      font-family: 'Inter', sans-serif;
      background: var(--bg);
      color: var(--text);
      font-size: 14px;
    }

    /* ── LAYOUT ─────────────────────────────────────────── */
    .app {
      display: flex;
      flex-direction: column;
      height: 100dvh;
      min-height: 100dvh;
      overflow: hidden;
    }

    .topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0 20px;
      height: var(--topbar-h);
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      flex-shrink: 0;
      box-shadow: var(--shadow-xs);
      position: relative;
    }

    .logo {
      font-weight: 800;
      font-size: 16px;
      color: var(--brand);
      letter-spacing: -0.3px;
    }

    .logo span {
      color: var(--text);
    }

    .topbar-right {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .api-badge {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      color: var(--text2);
      cursor: pointer;
      padding: 6px 12px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: var(--surface);
      transition: all 0.15s;
      font-weight: 500;
    }

    .api-badge:hover {
      border-color: var(--border2);
      background: var(--surface2);
    }

    .api-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--red);
    }

    .api-dot.connected {
      background: var(--green);
    }

    /* ── MAIN: single-column centered flow ───────────────── */
    .main {
      display: flex;
      flex-direction: column;
      align-items: center;
      flex: 1;
      height: auto;
      min-height: 0;
      max-height: calc(100dvh - var(--header-stack-h));
      overflow-y: auto;
      overflow-x: hidden;
      background: var(--bg);
      padding: 20px 20px 48px;
    }

    /* ── INPUT PANEL (was "left panel") ──────────────────── */
    .left-panel {
      width: 100%;
      max-width: 800px;
      display: flex;
      flex-direction: column;
      background: transparent;
      flex-shrink: 0;
    }

    /* Each section is a floating card */
    .panel-section {
      background: var(--surface);
      border-radius: 14px;
      padding: 20px 24px;
      margin-bottom: 10px;
      box-shadow: var(--shadow-sm);
      border: 1px solid var(--border);
    }

    .panel-section:last-child {
      margin-bottom: 0;
    }

    /* Section labels — small, uppercase, muted — pure guides not content */
    .panel-label {
      font-size: 11px;
      font-weight: 600;
      letter-spacing: 0.6px;
      text-transform: uppercase;
      color: var(--label);
      margin-bottom: 14px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .panel-label .num {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      background: var(--brand);
      color: white;
      font-size: 11px;
      font-weight: 700;
      flex-shrink: 0;
    }

    .setup-step-row.done .panel-label .num {
      background: var(--green);
    }

    /* Inputs: large, high-contrast, shadow-based focus (no border reliance) */
    textarea,
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="tel"],
    input[type="url"] {
      width: 100%;
      background: var(--surface2);
      border: 1.5px solid var(--border);
      border-radius: 10px;
      color: var(--text);
      font-family: 'Inter', sans-serif;
      font-size: 14px;
      line-height: 1.7;
      padding: 11px 14px;
      resize: vertical;
      transition: all 0.15s;
      outline: none;
    }

    textarea:focus,
    input:focus {
      border-color: var(--brand);
      background: rgba(99, 102, 241, 0.05);
      box-shadow: 0 0 0 3px var(--brand-glow);
    }

    textarea::placeholder,
    input::placeholder {
      color: var(--muted);
      font-size: 13px;
    }

    .char-count {
      text-align: right;
      font-size: 11px;
      color: var(--muted);
      margin-top: 6px;
    }

    /* ── Job Capture Confirmation Banner ─────────────────────────────────── */
    .jcc-card {
      display: flex;
      align-items: flex-start;
      gap: 12px;
      padding: 14px 16px;
      background: rgba(99, 102, 241, 0.10);
      border: 1.5px solid rgba(99, 102, 241, 0.30);
      border-radius: 12px;
      margin-bottom: 10px;
    }

    .jcc-icon {
      font-size: 20px;
      line-height: 1;
      flex-shrink: 0;
      margin-top: 1px;
    }

    .jcc-body {
      flex: 1;
      min-width: 0;
    }

    .jcc-title {
      font-size: 13px;
      font-weight: 600;
      color: var(--brand);
      margin-bottom: 4px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .jcc-sub {
      font-size: 12px;
      color: var(--text2);
      line-height: 1.4;
    }

    .jcc-dismiss {
      flex-shrink: 0;
      background: none;
      border: none;
      color: var(--text2);
      cursor: pointer;
      font-size: 14px;
      line-height: 1;
      padding: 0;
      opacity: 0.6;
      transition: opacity 0.15s;
    }

    .jcc-dismiss:hover { opacity: 1; }

    .jcc-actions {
      display: flex;
      gap: 8px;
      margin-bottom: 16px;
    }

    .jcc-btn-primary {
      flex: 1;
      padding: 9px 10px;
      background: var(--brand);
      color: #fff;
      border: none;
      border-radius: 8px;
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      transition: background 0.15s;
    }

    .jcc-btn-primary:hover { background: var(--brand-dark); }

    .jcc-btn-secondary {
      flex: 1;
      padding: 9px 10px;
      background: var(--surface2);
      color: var(--text);
      border: 1px solid var(--border2);
      border-radius: 8px;
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      transition: background 0.15s;
    }

    .jcc-btn-secondary:hover { background: var(--border); }

    .jcc-btn-ghost {
      padding: 9px 10px;
      background: none;
      color: var(--text2);
      border: none;
      border-radius: 8px;
      font-size: 12px;
      font-weight: 500;
      cursor: pointer;
      transition: color 0.15s;
    }

    .jcc-btn-ghost:hover { color: var(--text); }

    .jcc-ext-hint {
      margin: 8px 0 0;
      font-size: 11px;
      color: var(--muted);
      text-align: center;
    }

    .jcc-ext-hint-link {
      color: var(--brand);
      text-decoration: none;
      font-weight: 500;
    }

    .jcc-ext-hint-link:hover { text-decoration: underline; }

    /* File upload */
    .file-drop {
      border: 2px dashed var(--border);
      border-radius: 12px;
      padding: 24px 16px;
      text-align: center;
      cursor: pointer;
      transition: all 0.15s;
      background: var(--surface2);
    }

    .file-drop:hover,
    .file-drop.drag-over {
      border-color: var(--brand);
      background: rgba(99, 102, 241, 0.08);
    }

    .file-drop input {
      display: none;
    }

    .file-drop-icon {
      font-size: 28px;
      margin-bottom: 8px;
    }

    .file-drop p {
      font-size: 13px;
      color: var(--text2);
    }

    .file-drop strong {
      color: var(--brand);
    }

    .file-loaded {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      background: var(--green-light);
      border: 1px solid rgba(16,185,129,0.25);
      border-radius: 8px;
      margin-top: 8px;
    }

    .file-loaded span {
      font-size: 12px;
      color: var(--green);
      font-weight: 500;
      flex: 1;
    }

    .file-loaded button {
      font-size: 11px;
      color: var(--green);
      background: none;
      border: none;
      cursor: pointer;
      opacity: 0.7;
    }
    .file-loaded button:hover { opacity: 1; }

    .or-divider {
      text-align: center;
      font-size: 12px;
      color: var(--muted);
      margin: 14px 0;
    }

    /* Output mode toggle (Resume Only / + Cover Letter) */
    .tier-select {
      display: flex;
      background: var(--surface2);
      border: 1.5px solid var(--border);
      border-radius: 10px;
      padding: 4px;
      gap: 4px;
    }

    .tier-btn {
      flex: 1;
      padding: 8px 12px;
      border-radius: 10px;
      border: none;
      cursor: pointer;
      font-family: 'Inter', sans-serif;
      font-size: 13px;
      font-weight: 600;
      color: var(--muted);
      background: transparent;
      transition: all 0.15s;
      text-align: center;
    }

    .tier-btn .tier-features,
    .tier-btn .tier-badge {
      display: none;
    }

    .tier-btn strong {
      font-size: 13px;
      font-weight: 600;
      color: inherit;
      display: inline;
    }

    .tier-btn.active {
      background: var(--surface);
      color: var(--text);
      box-shadow: var(--shadow-sm);
    }

    .tier-btn.active strong {
      color: var(--text);
    }

    .tier-btn.complete-tier.active {
      background: var(--surface);
      color: var(--brand);
    }

    .tier-btn:hover:not(.active) {
      color: var(--text2);
    }

    /* Run section card — same padding as panel-section */
    .run-section {
      /* padding inherited from .panel-section */
    }

    .btn-run {
      width: 100%;
      padding: 16px;
      border-radius: 14px;
      background: linear-gradient(135deg, #4338CA 0%, #6366F1 100%);
      color: white;
      font-weight: 700;
      font-size: 16px;
      border: none;
      cursor: pointer;
      font-family: 'Inter', sans-serif;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      transition: all 0.2s;
      box-shadow: 0 4px 20px rgba(67, 56, 202, 0.4), 0 1px 0 rgba(255, 255, 255, 0.1) inset;
      letter-spacing: 0.2px;
    }

    .btn-run:hover:not(:disabled) {
      background: linear-gradient(135deg, #3730A3 0%, #4F46E5 100%);
      transform: translateY(-2px);
      box-shadow: 0 8px 28px rgba(67, 56, 202, 0.5), 0 1px 0 rgba(255, 255, 255, 0.1) inset;
    }

    .btn-run:active:not(:disabled) {
      transform: translateY(0);
      box-shadow: 0 2px 10px rgba(67, 56, 202, 0.35);
    }

    .btn-run:disabled {
      opacity: 0.4;
      cursor: not-allowed;
      transform: none;
      box-shadow: none;
    }

    .btn-run svg {
      animation: none;
    }

    .btn-run.spinning svg {
      animation: spin 1s linear infinite;
    }

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

    @keyframes pulse-cta {
      0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.55); }
      50%       { box-shadow: 0 0 0 10px rgba(99,102,241,0); }
    }
    .btn-run.pulse-cta {
      animation: pulse-cta 0.9s ease-out 3;
    }

    /* ── RESULTS PANEL (was "right panel") ──────────────── */
    /* Flows naturally below the input panel in the same centered column */
    .right-panel {
      width: 100%;
      max-width: 720px;
      display: flex;
      flex-direction: column;
      margin-top: 12px;
    }

    /* Empty state */
    .empty-state {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      padding: 64px 40px;
      background: #1e1e2e;
      border: 1px solid #334155;
      border-radius: 12px;
      box-shadow: 0 16px 42px rgba(0,0,0,0.16);
    }

    .empty-icon {
      font-size: 48px;
      margin-bottom: 16px;
      opacity: 0.3;
    }

    .empty-state h2,
    .empty-state-title {
      font-size: 20px;
      font-weight: 700;
      color: var(--text);
      line-height: 1.25;
      margin: 0 0 8px;
    }

    .empty-state-title {
      font-size: 16px;
      font-weight: 750;
    }

    .empty-state p,
    .empty-state-text {
      font-size: 14px;
      color: #94a3b8;
      max-width: 420px;
      line-height: 1.6;
      margin: 0;
    }

    .empty-state-actions {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      flex-wrap: wrap;
      margin-top: 16px;
    }

    .empty-state-button {
      min-height: 36px;
      padding: 9px 15px;
      border-radius: 8px;
      border: 1px solid rgba(99,102,241,0.45);
      background: rgba(99,102,241,0.14);
      color: var(--brand);
      font-family: 'Inter', sans-serif;
      font-size: 12.5px;
      font-weight: 750;
      cursor: pointer;
    }

    .empty-state-secondary-button {
      border-color: var(--border);
      background: var(--surface2);
      color: var(--text2);
    }

    [data-theme="light"] .empty-state {
      background: #ffffff;
      border-color: #e2e8f0;
      box-shadow: 0 20px 45px rgba(15,23,42,0.10);
    }

    [data-theme="light"] .empty-state p,
    [data-theme="light"] .empty-state-text {
      color: #475569;
    }

    @media (max-width: 640px) {
      .empty-state {
        padding: 28px 18px;
      }

      .empty-state-actions {
        align-items: stretch;
        width: 100%;
      }

      .empty-state-button {
        flex: 1 1 100%;
      }
    }

    .empty-state h2 {
      margin-bottom: 8px;
    }

    .empty-state p {
      max-width: 360px;
    }

    /* Progress */
    .progress-panel {
      display: none;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 48px 40px;
      background: var(--surface);
      border-radius: 16px;
      box-shadow: var(--shadow-sm);
    }

    .progress-panel.visible {
      display: flex;
    }

    .progress-title {
      font-size: 18px;
      font-weight: 700;
      margin-bottom: 32px;
      color: var(--text);
    }

    .steps {
      display: flex;
      flex-direction: column;
      gap: 0;
      width: 100%;
      max-width: 400px;
    }

    .step-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px 16px;
      border-radius: 10px;
      border: 1.5px solid var(--border);
      background: var(--surface2);
      transition: all 0.3s;
      position: relative;
      margin-bottom: 0;
    }

    .step-item+.step-item {
      margin-top: 3px;
    }

    .step-item:not(:last-child)::after {
      content: '';
      position: absolute;
      left: 27px;
      bottom: -10px;
      width: 2px;
      height: 10px;
      background: var(--border);
      z-index: 1;
    }

    .step-item.done:not(:last-child)::after {
      background: var(--green);
      opacity: 0.5;
    }

    .step-item.active:not(:last-child)::after {
      background: var(--brand);
      opacity: 0.5;
    }

    .step-item.active {
      border-color: var(--brand);
      background: rgba(99, 102, 241, 0.1);
    }

    .step-item.done {
      border-color: var(--green);
      background: var(--green-light);
    }

    .step-item.error {
      border-color: var(--red);
      background: var(--red-light);
    }

    .step-icon {
      width: 32px;
      height: 32px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 14px;
      flex-shrink: 0;
    }

    .step-item .step-icon {
      background: var(--border);
    }

    .step-item.active .step-icon {
      background: var(--brand);
      color: white;
    }

    .step-item.done .step-icon {
      background: var(--green);
      color: white;
    }

    .step-item.error .step-icon {
      background: var(--red);
      color: white;
    }

    .step-text strong {
      display: block;
      font-size: 13px;
      font-weight: 600;
      color: var(--text);
    }

    .step-text span {
      font-size: 12px;
      color: var(--muted);
    }

    .step-item.active .step-text span {
      color: var(--brand);
    }

    .step-item.done .step-text span {
      color: var(--green);
    }

    /* ── Result Action Bar ── */
    #resultActionBar {
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      padding: 10px 16px;
      background: var(--surface2);
      border-bottom: 1px solid var(--border);
      position: sticky;
      top: 0;
      z-index: 20;
    }

    .rab-label {
      font-size: 12px;
      font-weight: 600;
      color: var(--text2);
      margin-right: 4px;
      white-space: nowrap;
    }

    .rab-btn {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 6px 13px;
      border-radius: 20px;
      border: 1.5px solid var(--border);
      background: var(--surface);
      color: var(--text);
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      font-family: 'Inter', sans-serif;
      transition: border-color 0.15s, background 0.15s;
      white-space: nowrap;
    }

    .rab-btn:hover {
      border-color: var(--brand);
      color: var(--brand);
    }

    .rab-btn-primary {
      background: var(--brand);
      border-color: var(--brand);
      color: #fff;
    }

    .rab-btn-primary:hover {
      background: #4338CA;
      border-color: #4338CA;
      color: #fff;
    }

    .rab-btn-cover {
      background: rgba(99,102,241,0.08);
      border-color: var(--brand);
      color: var(--brand);
      font-weight: 600;
    }

    .rab-btn-cover:hover {
      background: var(--brand);
      color: #fff;
    }

    #clNudge {
      align-items: center;
      gap: 8px;
      padding: 10px 16px;
      background: rgba(99,102,241,0.06);
      border-bottom: 1px solid rgba(99,102,241,0.15);
      font-size: 13px;
      color: var(--text2);
    }

    #clNudge span { line-height: 1.4; }

    /* ── Pricing status card (below Generate button) ── */
    .pricing-status-card {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      padding: 10px 13px;
      border-radius: 10px;
      border: 1px solid var(--border);
      background: var(--surface2);
    }

    .pricing-status-free { border-color: rgba(99,102,241,0.25); background: rgba(99,102,241,0.04); }
    .pricing-status-active { border-color: rgba(16,185,129,0.3); background: rgba(16,185,129,0.04); }

    .pscard-left { flex: 1; min-width: 0; }

    .pscard-label {
      font-size: 11.5px;
      font-weight: 700;
      color: var(--text2);
      margin-bottom: 1px;
    }

    .pscard-label-active { color: var(--green); }

    .pscard-desc {
      font-size: 11px;
      color: var(--muted);
    }

    .pscard-expiring { color: #F59E0B; font-weight: 600; }

    .pscard-cta {
      flex-shrink: 0;
      padding: 6px 12px;
      background: linear-gradient(135deg,#4F46E5,#6366F1);
      color: white;
      border: none;
      border-radius: 7px;
      font-size: 11.5px;
      font-weight: 700;
      cursor: pointer;
      white-space: nowrap;
      font-family: inherit;
    }

    .pscard-cta:hover { opacity: 0.88; }
    .pscard-cta-renew { background: linear-gradient(135deg,#D97706,#F59E0B); }

    /* ── Vault lock gate ── */
    .vault-lock-gate {
      position: relative;
      margin-top: 4px;
    }

    .vault-lock-blurred {
      filter: blur(3px);
      pointer-events: none;
      user-select: none;
      opacity: 0.6;
    }

    .vault-card-locked {
      pointer-events: none;
    }

    .vault-lock-overlay {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      background: rgba(var(--surface-rgb, 255,255,255), 0.7);
      backdrop-filter: blur(2px);
      border-radius: 12px;
      padding: 20px;
    }

    #clNudgeBtn {
      background: none;
      border: none;
      color: var(--brand);
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      padding: 0;
      font-family: inherit;
    }

    #clNudgeBtn:hover { text-decoration: underline; }

    /* Results card */
    .results-panel {
      display: none;
      flex-direction: column;
      background: var(--surface);
      border-radius: 16px;
      box-shadow: var(--shadow-sm);
      overflow: hidden;
    }

    .results-panel.visible {
      display: flex;
    }

    .results-topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 16px 24px;
      border-bottom: 1px solid var(--border);
      flex-shrink: 0;
      background: var(--surface);
    }

    .match-score-badge {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 6px 14px;
      border-radius: 100px;
      font-size: 13px;
      font-weight: 700;
    }

    .match-score-badge.good {
      background: var(--green-light);
      color: var(--green);
    }

    .match-score-badge.ok {
      background: var(--amber-light);
      color: var(--amber);
    }

    .match-score-badge.bad {
      background: rgba(239, 68, 68, 0.1);
      color: #EF4444;
    }

    .topbar-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    .btn-sm {
      padding: 7px 14px;
      border-radius: 8px;
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      border: 1.5px solid var(--border);
      font-family: 'Inter', sans-serif;
      transition: all 0.15s;
      background: var(--surface);
    }

    .btn-sm-outline {
      color: var(--text2);
    }

    .btn-sm-outline:hover {
      border-color: var(--border2);
      background: var(--surface2);
    }

    .btn-sm-primary {
      background: var(--brand);
      color: white;
      border-color: var(--brand);
    }

    .btn-sm-primary:hover {
      background: var(--brand-dark);
    }

    .tabs {
      display: flex;
      padding: 0 24px;
      border-bottom: 1px solid var(--border);
      flex-shrink: 0;
      background: var(--surface);
    }

    .tab-btn {
      padding: 12px 14px;
      font-size: 13px;
      font-weight: 500;
      color: var(--muted);
      border: none;
      background: none;
      cursor: pointer;
      border-bottom: 2px solid transparent;
      margin-bottom: -1px;
      font-family: 'Inter', sans-serif;
      transition: all 0.15s;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .tab-btn:hover {
      color: var(--text2);
    }

    .tab-btn.active {
      color: var(--brand);
      border-bottom-color: var(--brand);
    }

    .tab-badge {
      font-size: 10px;
      font-weight: 700;
      padding: 1px 6px;
      border-radius: 100px;
    }

    .tab-badge.green {
      background: var(--green-light);
      color: var(--green);
    }

    .tab-badge.red {
      background: var(--red-light);
      color: #991B1B;
    }

    .tab-content {
      overflow-y: auto;
      padding: 28px 24px;
    }

    .tab-pane {
      display: none;
    }

    .tab-pane.active {
      display: block;
    }

    /* Resume output — large, easy-to-read */
    .resume-output {
      background: var(--surface2);
      border-radius: 12px;
      padding: 28px;
      font-size: 15px;
      line-height: 1.85;
      white-space: pre-wrap;
      font-family: 'Inter', sans-serif;
      color: var(--text);
      min-height: 200px;
    }

    .resume-output.streaming::after {
      content: "▋";
      animation: blink 0.7s infinite;
      color: var(--brand);
    }

    @keyframes blink {

      0%,
      100% {
        opacity: 1;
      }

      50% {
        opacity: 0;
      }
    }

    .btn-positioning {
      width: 100%;
      margin-top: 10px;
      padding: 10px 14px;
      border: 1.5px solid rgba(99, 102, 241, 0.35);
      border-radius: 8px;
      background: rgba(99, 102, 241, 0.07);
      color: var(--brand);
      font-family: 'Inter', sans-serif;
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
      transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
    }

    .btn-positioning:hover:not(:disabled) {
      background: rgba(99, 102, 241, 0.12);
      border-color: rgba(99, 102, 241, 0.55);
    }

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

    .btn-positioning-compact {
      width: auto;
      margin-top: 0;
      flex-shrink: 0;
      white-space: nowrap;
    }

    .positioning-brief-actions {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-shrink: 0;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    .positioning-inline-status {
      min-height: 16px;
      margin-top: 6px;
      text-align: center;
      font-size: 11px;
      line-height: 1.4;
      color: var(--muted);
    }

    .positioning-helper {
      margin: 7px 0 0;
      color: var(--muted);
      font-size: 11px;
      line-height: 1.45;
      text-align: center;
    }

    .positioning-active-badge {
      align-items: center;
      justify-content: center;
      gap: 8px;
      margin-top: 8px;
      padding: 7px 10px;
      border: 1px solid rgba(16, 185, 129, 0.28);
      border-radius: 8px;
      background: rgba(16, 185, 129, 0.08);
      color: var(--green);
      font-size: 11px;
      font-weight: 700;
      line-height: 1.35;
      flex-wrap: wrap;
    }

    .positioning-active-badge button {
      border: none;
      background: transparent;
      color: var(--text2);
      cursor: pointer;
      font-family: 'Inter', sans-serif;
      font-size: 11px;
      font-weight: 700;
      padding: 0;
      text-decoration: underline;
      text-underline-offset: 2px;
    }

    .positioning-active-badge button:hover {
      color: var(--text);
    }

    .positioning-brief-card {
      margin: 14px 16px 0;
      padding: 16px;
      background: var(--card-bg);
      border: 1px solid rgba(99, 102, 241, 0.24);
      border-radius: 12px;
    }

    .positioning-brief-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 14px;
      margin-bottom: 12px;
    }

    .positioning-eyebrow {
      margin-bottom: 4px;
      color: var(--brand);
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    .positioning-brief-header h3 {
      margin: 0;
      color: var(--text);
      font-size: 16px;
      font-weight: 800;
      letter-spacing: 0;
    }

    .positioning-brief-header p {
      max-width: 620px;
      margin: 5px 0 0;
      color: var(--text2);
      font-size: 12px;
      line-height: 1.5;
    }

    .positioning-brief-header .positioning-education {
      max-width: 640px;
      color: var(--muted);
      font-size: 11px;
    }

    .positioning-brief-status {
      display: none;
      margin-bottom: 12px;
      padding: 9px 11px;
      border-radius: 8px;
      background: rgba(99, 102, 241, 0.08);
      color: var(--text2);
      font-size: 12px;
      line-height: 1.5;
    }

    .positioning-section {
      padding: 13px 0;
      border-top: 1px solid var(--border);
    }

    .positioning-section:first-child {
      border-top: none;
      padding-top: 0;
    }

    .positioning-section h4 {
      margin: 0 0 8px;
      color: var(--text);
      font-size: 12px;
      font-weight: 800;
      letter-spacing: 0;
    }

    .positioning-section p,
    .positioning-section li {
      color: var(--text2);
      font-size: 13px;
      line-height: 1.55;
    }

    .positioning-section p {
      margin: 0;
    }

    .positioning-section ul {
      margin: 0;
      padding-left: 18px;
    }

    .positioning-rewrite {
      display: grid;
      gap: 6px;
      margin-top: 8px;
      padding: 10px;
      border-radius: 8px;
      background: var(--surface2);
    }

    .positioning-rewrite strong {
      color: var(--text);
      font-size: 12px;
    }

    .positioning-raw-text {
      margin-top: 8px;
      padding: 12px;
      border-radius: 8px;
      background: var(--surface2);
      color: var(--text2);
      font-size: 13px;
      line-height: 1.6;
      white-space: pre-wrap;
    }

    .saved-positioning-brief {
      margin-top: 12px;
      padding: 12px;
      border: 1px solid rgba(99, 102, 241, 0.22);
      border-radius: 8px;
      background: rgba(99, 102, 241, 0.05);
    }

    .saved-positioning-brief summary {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
      color: var(--brand);
      cursor: pointer;
      font-size: 12px;
      font-weight: 800;
      letter-spacing: 0;
    }

    .positioning-used-pill {
      display: inline-flex;
      align-items: center;
      padding: 2px 7px;
      border-radius: 999px;
      background: rgba(16, 185, 129, 0.1);
      color: var(--green);
      font-size: 10px;
      font-weight: 800;
      line-height: 1.4;
    }

    @media (max-width: 768px) {
      .positioning-brief-header {
        flex-direction: column;
      }

      .btn-positioning-compact {
        width: 100%;
      }

      .positioning-brief-actions {
        width: 100%;
      }
    }

    /* Keyword pills */
    .kw-section {
      margin-bottom: 24px;
    }

    .kw-section h3 {
      font-size: 12px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--label);
      margin-bottom: 10px;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .kw-pills {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }

    .kw-pill {
      padding: 5px 11px;
      border-radius: 100px;
      font-size: 12px;
      font-weight: 500;
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .kw-pill.match {
      background: var(--green-light);
      color: var(--green);
    }

    .kw-pill.gap-required {
      background: var(--red-light);
      color: #991B1B;
    }

    .kw-pill.gap-preferred {
      background: var(--amber-light);
      color: #78350F;
    }

    /* Changes list */
    .change-item {
      padding: 14px 16px;
      border-radius: 10px;
      margin-bottom: 8px;
      background: var(--surface2);
      border: none;
      font-size: 14px;
      line-height: 1.6;
      color: var(--text2);
    }

    .change-item strong {
      color: var(--brand);
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      display: block;
      margin-bottom: 4px;
    }

    /* Score rings */
    .score-rings {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 24px;
      margin-bottom: 24px;
      background: var(--surface2);
      border-radius: 16px;
      padding: 28px 20px 24px;
    }

    .score-ring-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
    }

    .ring-svg {
      transform: rotate(-90deg);
      display: block;
    }

    .ring-track {
      fill: none;
      stroke: var(--border);
      stroke-width: 8;
    }

    .ring-fill {
      fill: none;
      stroke-width: 8;
      stroke-linecap: round;
      stroke-dasharray: 251.33;
      transition: stroke-dashoffset 1.1s cubic-bezier(.4, 0, .2, 1);
    }

    .ring-fill.before-fill {
      stroke: var(--border2);
    }

    .ring-fill.score-high {
      stroke: #059669;
    }

    .ring-fill.score-mid {
      stroke: var(--amber);
    }

    .ring-fill.score-low {
      stroke: var(--red);
    }

    .ring-center-label {
      text-align: center;
    }

    .ring-center-val {
      font-weight: 800;
      line-height: 1.1;
      color: var(--text);
    }

    .ring-center-sub {
      font-size: 11px;
      color: var(--muted);
      margin-top: 2px;
    }

    .score-ring-arrow {
      font-size: 22px;
      color: var(--border2);
      margin-bottom: 20px;
    }

    .score-ring-delta {
      font-size: 11px;
      font-weight: 700;
      padding: 2px 8px;
      border-radius: 100px;
      background: var(--green-light);
      color: var(--green);
      border: 1px solid rgba(5, 150, 105, 0.25);
    }

    /* Error */
    .error-box {
      background: var(--red-light);
      border: 1px solid #FECACA;
      border-radius: 10px;
      padding: 16px 18px;
      color: #991B1B;
      font-size: 14px;
      line-height: 1.6;
    }

    /* Modal */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.5);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      display: none;
      backdrop-filter: blur(2px);
      overflow-y: auto;
      padding: 24px;
    }

    .modal-overlay.visible {
      display: flex;
    }

    .modal {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 32px;
      width: 440px;
      max-width: 100%;
      box-shadow: var(--shadow-md);
      max-height: 90vh;
      overflow-y: auto;
      margin: auto;
    }

    .modal h2 {
      font-size: 18px;
      font-weight: 700;
      margin-bottom: 6px;
      color: var(--text);
    }

    .modal p {
      font-size: 14px;
      color: var(--text2);
      margin-bottom: 20px;
      line-height: 1.6;
    }

    .modal-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 16px;
      padding: 0 0 16px;
    }

    .modal-header h3 {
      min-width: 0;
      line-height: 1.35;
    }

    .modal-close {
      width: 32px;
      height: 32px;
      border: 1px solid transparent;
      border-radius: 8px;
      background: transparent;
      color: var(--muted);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      flex: 0 0 auto;
      padding: 0;
      transition: background 0.15s, border-color 0.15s, color 0.15s;
    }

    .modal-close:hover {
      background: var(--surface2);
      border-color: var(--border);
      color: var(--text);
    }

    .modal label {
      display: block;
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--label);
      margin-bottom: 6px;
      margin-top: 16px;
    }

    .modal-btns {
      display: flex;
      gap: 8px;
      margin-top: 20px;
      justify-content: flex-end;
    }

    .btn-modal-cancel {
      padding: 9px 18px;
      border-radius: 8px;
      border: 1.5px solid var(--border);
      background: none;
      color: var(--text2);
      cursor: pointer;
      font-family: 'Inter', sans-serif;
      font-size: 13px;
      font-weight: 500;
    }

    .btn-modal-cancel:hover {
      background: var(--surface2);
    }

    .btn-modal-save {
      padding: 9px 18px;
      border-radius: 8px;
      background: var(--brand);
      border: none;
      color: white;
      cursor: pointer;
      font-family: 'Inter', sans-serif;
      font-size: 13px;
      font-weight: 600;
    }

    .btn-modal-save:hover {
      background: var(--brand-dark);
    }

    /* Toast */
    .toast {
      position: fixed;
      bottom: 28px;
      left: 50%;
      transform: translateX(-50%);
      background: var(--text);
      border: none;
      padding: 11px 20px;
      border-radius: 100px;
      font-size: 13px;
      font-weight: 600;
      color: white;
      display: none;
      z-index: 2000;
      white-space: nowrap;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
      align-items: center;
      gap: 10px;
    }

    .toast.visible {
      display: flex;
      animation: slideUp 0.2s ease;
    }

    .toast.success {
      background: var(--green);
    }

    .toast.error {
      background: #991B1B;
    }

    .toast.warning {
      background: #78350F;
    }

    .toast-undo {
      font-size: 12px;
      font-weight: 700;
      cursor: pointer;
      text-decoration: underline;
      opacity: 0.85;
      flex-shrink: 0;
      color: inherit;
      padding: 1px 4px;
      border-radius: 4px;
      transition: opacity 0.15s;
    }

    .toast-undo:hover {
      opacity: 1;
    }

    .toast-divider {
      opacity: 0.35;
      font-weight: 300;
    }

    @keyframes slideUp {
      from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
      }

      to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
      }
    }

    /* ── TABLET (≤ 768px) ──────────────────────────────────── */
    @media (max-width: 768px) {

      /* ── Prevent horizontal overflow on all mobile ── */
      html, body { overflow-x: hidden; }

      /* Already single-column; just tighten the padding */
      .main {
        padding: 24px 16px 160px; /* extra bottom room for quick bar + bottom nav */
      }

      /* ── resumeGrid: full-width single column ── */
      #resumeGrid {
        padding: 0;
        gap: 8px;
      }

      .panel-section {
        padding: 24px 20px;
      }

      /* ── Tabs: scrollable, no wrap, large tap targets ── */
      .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
        padding: 0 12px;
        gap: 0;
      }
      .tabs::-webkit-scrollbar { display: none; }

      .tab-btn {
        flex-shrink: 0;
        min-height: 48px;
        padding: 12px 16px;
        font-size: 13px;
        white-space: nowrap;
      }

      .tab-content {
        padding: 16px 14px;
      }

      /* ── Resume output: readable on small screens ── */
      .resume-output {
        font-size: 13px;
        line-height: 1.7;
        padding: 16px;
        border-radius: 10px;
      }

      /* ── Results topbar: stack badge + scrollable actions ── */
      .results-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px 14px;
      }

      .topbar-actions {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap;
        justify-content: flex-start;
        padding-bottom: 2px;
        gap: 6px;
      }
      .topbar-actions::-webkit-scrollbar { display: none; }

      /* ── All small buttons: minimum 44px tap height ── */
      .btn-sm {
        min-height: 44px;
        padding: 10px 14px;
        flex-shrink: 0;
        font-size: 12px;
      }

      /* ── Run CTA: full width, taller ── */
      .btn-run {
        min-height: 54px;
        font-size: 15px;
      }

      /* ── Tier buttons: 44px ── */
      .tier-btn {
        min-height: 44px;
      }

      /* ── File drop: tighter on mobile ── */
      .file-drop {
        padding: 16px 12px;
      }

      /* ── Skill gap card: stack columns vertically ── */
      #skillGapCard [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
      }
    }

    @media (max-width: 480px) {
      .hide-mobile {
        display: none;
      }
    }

    /* ── MOBILE (≤ 640px) ──────────────────────────────────── */
    @media (max-width: 640px) {

      /* ── Topbar: 2-row layout ───────────────────────────── */
      .topbar {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 14px 0;
        gap: 0;
        align-items: center;
      }

      .logo {
        order: 1;
        font-size: 15px;
      }

      .topbar-right {
        order: 2;
        gap: 6px;
        margin-left: auto;
      }

      /* Upgrade button — compact on mobile */
      /* Account badge — shorter */
      .api-badge {
        padding: 4px 8px;
        font-size: 11px;
      }

      /* Nav tabs row — full width, horizontally scrollable */
      .mode-toggle {
        order: 3;
        width: calc(100% + 28px);
        margin-left: -14px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        border-top: 1px solid var(--border);
        margin-top: 10px;
        padding: 6px 14px 7px;
        border-radius: 0;
        background: transparent;
        border-left: none;
        border-right: none;
        border-bottom: none;
        gap: 4px;
        flex-shrink: 0;
      }

      .mode-toggle::-webkit-scrollbar {
        display: none;
      }

      .mode-btn {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 6px 10px;
        font-size: 11px;
        min-height: 34px;
      }

      /* ── Panels ─────────────────────────────────────────── */
      .main {
        padding: 16px 12px 48px;
        overflow: visible;
      }

      .left-panel {
        width: 100%;
        min-width: unset;
      }

      .right-panel {
        min-height: 0;
      }

      .panel-section {
        padding: 20px 18px;
        border-radius: 12px;
      }

      /* Full-width panels (tracker, tailored, linkedin) */
      .tracker-panel {
        overflow-y: visible;
      }

      /* ── All modals: full-width, scrollable ──────────────── */
      .modal-overlay {
        padding: 0 !important;
        align-items: flex-end !important;
      }

      .modal {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        max-height: 92vh !important;
        overflow-y: auto !important;
        padding: 20px 16px 32px !important;
      }

      /* Apply modal (uses its own class) */
      .apply-modal-overlay {
        padding: 0;
        align-items: flex-end;
      }

      .apply-modal {
        width: 100%;
        border-radius: 20px 20px 0 0;
        max-height: 90vh;
        overflow-y: auto;
        padding: 20px 16px 32px;
      }

      .apply-modal-btns {
        flex-direction: column;
      }

      .apply-modal-btns button {
        width: 100%;
        justify-content: center;
      }

      /* ── Upgrade modal: stack the 3 plan columns ─────────── */
      #pricingGrid {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
      }

      /* Hide flow hint bar on mobile — welcome modal covers it anyway */
      #flowHint {
        display: none !important;
      }

      /* Push chat widget above bottom nav so it's never hidden behind it */
      #chat-widget-container,
      [id*="leadconnector"],
      [class*="chat-widget"],
      iframe[src*="leadconnector"],
      iframe[src*="widgets.leadconnectorhq"] {
        bottom: 80px !important;
      }

      /* ── Welcome modal — full screen on mobile ───────────── */
      .welcome-overlay {
        align-items: flex-end !important;
        background: rgba(0, 0, 0, 0.5) !important;
      }

      .welcome-modal {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 24px 24px 0 0 !important;
        padding: 28px 20px calc(32px + env(safe-area-inset-bottom)) !important;
        max-height: 92vh;
        overflow-y: auto;
        border-bottom: none !important;
      }

      /* Drag handle pill */
      .welcome-modal::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: var(--border2);
        border-radius: 100px;
        margin: 0 auto 20px;
      }

      /* Hide the steps flow row on mobile — too cramped */
      .welcome-steps-row {
        display: none !important;
      }

      .welcome-steps {
        grid-template-columns: 1fr !important;
        gap: 8px;
      }

      .welcome-step {
        display: flex;
        align-items: center;
        gap: 12px;
        text-align: left;
      }

      .welcome-step-icon {
        font-size: 22px;
        flex-shrink: 0;
      }

      .welcome-step-title {
        font-size: 13px;
      }

      .welcome-step-desc {
        font-size: 12px;
      }

      /* ── Profile modal grid ──────────────────────────────── */
      .profile-grid {
        grid-template-columns: 1fr !important;
      }

      .profile-grid .full {
        grid-column: 1 !important;
      }

      /* ── Job search ──────────────────────────────────────── */
      .job-card {
        padding: 12px;
      }

      .job-card-footer {
        flex-wrap: wrap;
        gap: 6px;
      }

      .btn-tailor-job,
      .btn-applied-check {
        flex: 1;
        min-width: 0;
        font-size: 11px;
        text-align: center;
        min-height: 36px;
      }

      /* ── Job search left panel: resume sync area ─────────── */
      .js-resume-sync {
        flex-direction: column;
        gap: 6px;
      }

      /* ── Tracker (Applications) ──────────────────────────── */
      .tracker-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
      }

      .tracker-header-actions {
        width: 100%;
        justify-content: flex-end;
      }

      .app-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
      }

      .app-row-right {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
        flex-wrap: wrap;
      }

      /* ── Tailored history cards ───────────────────────────── */
      .tailor-card {
        flex-direction: column;
        gap: 10px;
      }

      .tailor-card>div:last-child {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
      }

      .tailor-card-actions {
        gap: 6px;
      }

      .btn-tailor-dl {
        font-size: 11px;
        padding: 6px 10px;
      }

      /* ── Tier buttons (Resume / Resume + Cover Letter) ───── */
      .tier-select {
        gap: 6px;
      }

      .tier-btn {
        font-size: 11px;
        padding: 6px 10px;
        min-height: 36px;
      }

      /* ── Match score badge / results topbar ──────────────── */
      .results-topbar {
        flex-wrap: wrap;
        gap: 6px;
      }

      .topbar-actions {
        flex-wrap: wrap;
        gap: 6px;
      }

      /* ── Setup steps (hero) ──────────────────────────────── */
      .setup-step-row {
        gap: 8px;
      }

      .setup-step-action {
        font-size: 11px;
        white-space: nowrap;
      }

      /* ── Toast ───────────────────────────────────────────── */
      .toast {
        width: calc(100% - 32px);
        left: 16px;
        right: 16px;
        bottom: 20px;
      }

      /* ── Footer ──────────────────────────────────────────── */
      #appFooter {
        flex-wrap: wrap !important;
        gap: 10px !important;
        padding: 12px 14px !important;
        justify-content: center !important;
      }

      /* ── Hero: collapse value-prop on smallest screens so
         upload → JD → CTA are visible without scrolling ── */
      .hero-left {
        padding: 14px 16px !important;
      }

      .hero-title {
        font-size: 20px !important;
        margin-bottom: 6px !important;
      }

      .hero-subtitle {
        display: none;
      }

      .hero-trust-list {
        display: none;
      }

      .hero-left > p:last-child {
        display: none;
      }

      .hero-ai-badge {
        margin-bottom: 8px;
      }

      /* Inputs area slightly more compact */
      .hero-right {
        padding: 14px 16px !important;
        gap: 8px !important;
      }

      .hero-input-label {
        font-size: 10px !important;
        margin-bottom: 4px !important;
      }

      /* JD textarea shorter on mobile */
      #jobText {
        min-height: 80px !important;
      }

      /* ── Mode nav buttons: 44px hit area ── */
      .mode-btn {
        min-height: 44px;
      }

      /* ── Toast: above quick bar ── */
      .toast {
        bottom: calc(120px + env(safe-area-inset-bottom));
      }
    }

    /* ── Mobile Quick Actions Bar ──────────────────────────── */
    #mobileQuickBar {
      display: none;
      position: fixed;
      bottom: calc(56px + env(safe-area-inset-bottom));
      left: 0;
      right: 0;
      background: var(--surface);
      border-top: 1px solid var(--border);
      padding: 8px 12px;
      gap: 8px;
      z-index: 190;
      box-shadow: 0 -4px 16px rgba(0,0,0,0.15);
      align-items: center;
    }
    @media (max-width: 768px) {
      #mobileQuickBar.visible { display: flex; }
    }

    /* ── Chrome Extension Promo (mobile only) ──────────────── */
    .mobile-ext-promo {
      display: none;
      align-items: flex-start;
      gap: 10px;
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 12px 14px;
      margin: 0 0 12px;
      position: relative;
    }
    @media (max-width: 768px) {
      .mobile-ext-promo { display: flex; }
    }
    .mobile-ext-promo-icon {
      font-size: 20px;
      flex-shrink: 0;
      margin-top: 1px;
    }
    .mobile-ext-promo-body {
      flex: 1;
      min-width: 0;
    }
    .mobile-ext-promo-text {
      font-size: 12px;
      color: var(--text2);
      line-height: 1.5;
      margin: 0 0 6px;
    }
    .mobile-ext-promo-link {
      font-size: 12px;
      font-weight: 600;
      color: var(--brand);
      text-decoration: none;
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }
    .mobile-ext-promo-dismiss {
      background: none;
      border: none;
      color: var(--muted);
      font-size: 18px;
      cursor: pointer;
      padding: 0;
      line-height: 1;
      flex-shrink: 0;
      align-self: flex-start;
    }

    /* ── MODE TOGGLE (nav tabs in topbar) ────────────────── */
    .mode-toggle {
      display: flex;
      gap: 2px;
      background: var(--surface2);
      border: 1.5px solid var(--border);
      border-radius: 10px;
      padding: 3px;
    }

    .mode-btn {
      padding: 6px 13px;
      border-radius: 7px;
      font-size: 12px;
      font-weight: 600;
      border: none;
      cursor: pointer;
      font-family: 'Inter', sans-serif;
      color: var(--muted);
      background: transparent;
      transition: all 0.15s;
      display: flex;
      align-items: center;
      gap: 5px;
    }

    .mode-btn.active {
      background: var(--surface);
      color: var(--text);
      box-shadow: var(--shadow-xs);
    }

    .mode-btn:hover:not(.active) {
      color: var(--text2);
    }

    /* More dropdown */
    .mode-more {
      position: relative;
    }

    .mode-more-menu {
      display: none;
      position: absolute;
      top: calc(100% + 8px);
      left: 0;
      z-index: 500;
      background: var(--surface);
      border: 1.5px solid var(--border);
      border-radius: 12px;
      padding: 6px;
      min-width: 175px;
      box-shadow: var(--shadow-md);
    }

    .mode-more-menu.open {
      display: block;
    }

    .mode-more-item {
      display: flex;
      align-items: center;
      gap: 8px;
      width: 100%;
      padding: 9px 12px;
      border-radius: 8px;
      border: none;
      background: transparent;
      color: var(--text2);
      font-family: 'Inter', sans-serif;
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      text-align: left;
      transition: all 0.12s;
    }

    .mode-more-item:hover {
      background: var(--surface2);
      color: var(--text);
    }

    .mode-more-item.active {
      background: rgba(99, 102, 241, 0.12);
      color: var(--brand);
    }

    /* Lock badge on Cover Letter tier */
    .tier-lock {
      font-size: 10px;
      opacity: 0.7;
      margin-left: 2px;
    }

    /* ── Full-screen panels: stretch out of centered column ── */
    /* Job search, tracker, tailored history etc. need full width */
    .js-panel,
    .tracker-panel,
    .tailored-panel,
    #linkedinPanel,
    #bulkApplyPanel {
      align-self: stretch;
    }

    .tailor-history-empty {
      text-align: center;
      padding: 64px 20px;
      color: var(--muted);
      font-size: 14px;
    }

    .tailor-history-empty .empty-icon {
      font-size: 48px;
      margin-bottom: 12px;
      opacity: 0.4;
    }

    .tailor-card {
      background: var(--surface);
      border: 1.5px solid var(--border);
      border-radius: 14px;
      padding: 20px 22px;
      margin-bottom: 10px;
      display: flex;
      align-items: flex-start;
      gap: 16px;
      box-shadow: var(--shadow-xs);
      transition: box-shadow 0.15s;
    }

    .tailor-card:hover {
      box-shadow: var(--shadow-sm);
      border-color: var(--border2);
    }

    .tailor-card-info {
      flex: 1;
      min-width: 0;
    }

    .tailor-card-title {
      font-size: 15px;
      font-weight: 700;
      color: var(--text);
      margin-bottom: 3px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .tailor-card-meta {
      font-size: 13px;
      color: var(--text2);
      margin-bottom: 12px;
    }

    .tailor-card-actions {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .tailor-card-date {
      font-size: 11px;
      color: var(--muted);
      white-space: nowrap;
      margin-top: 3px;
    }

    .btn-tailor-dl {
      padding: 6px 13px;
      border-radius: 7px;
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      border: 1.5px solid var(--border);
      background: var(--surface2);
      color: var(--text2);
      font-family: 'Inter', sans-serif;
      transition: all 0.15s;
    }

    .btn-tailor-dl:hover {
      background: var(--border);
      color: var(--text);
    }

    .btn-tailor-dl.primary {
      background: rgba(99, 102, 241, 0.12);
      border-color: rgba(99, 102, 241, 0.35);
      color: var(--brand);
    }

    .btn-tailor-dl.primary:hover {
      background: #E0E7FF;
    }

    .btn-tailor-dl.apply-now {
      background: var(--green-light);
      border-color: rgba(5, 150, 105, 0.3);
      color: var(--green);
    }

    .btn-tailor-dl.apply-now:hover {
      background: var(--green-light);
    }

    .btn-tailor-applied-badge {
      display: inline-flex;
      align-items: center;
      padding: 5px 11px;
      border-radius: 7px;
      font-size: 12px;
      font-weight: 600;
      background: var(--green-light);
      color: var(--green);
      border: 1.5px solid rgba(5, 150, 105, 0.3);
    }

    .btn-tailor-delete {
      background: none;
      border: none;
      color: var(--muted);
      cursor: pointer;
      font-size: 16px;
      padding: 4px;
      flex-shrink: 0;
      line-height: 1;
    }

    .btn-tailor-delete:hover {
      color: var(--red);
    }

    /* ── JOB TRACKER — Pipeline & Status ─────────────────── */
    .pipeline-section { margin-bottom: 24px; }

    .pipeline-section-header {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 11px;
      font-weight: 700;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.6px;
      margin-bottom: 10px;
      padding-bottom: 8px;
      border-bottom: 1px solid var(--border);
    }

    .pipeline-count {
      background: var(--surface2);
      color: var(--muted);
      border-radius: 100px;
      padding: 1px 7px;
      font-size: 10px;
      font-weight: 700;
    }

    .pipeline-count.active {
      background: rgba(99,102,241,0.12);
      color: var(--brand);
    }

    .status-select {
      appearance: none;
      -webkit-appearance: none;
      padding: 4px 22px 4px 9px;
      border-radius: 20px;
      border: 1.5px solid var(--border);
      background-color: var(--surface2);
      background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2394A3B8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 7px center;
      font-size: 11px;
      font-weight: 600;
      font-family: 'Inter', sans-serif;
      color: var(--text2);
      cursor: pointer;
      transition: border-color 0.15s, background-color 0.15s;
      flex-shrink: 0;
    }

    .status-select:focus { outline: none; border-color: var(--brand); }

    .status-select.s-not_applied  { color: var(--muted); }
    .status-select.s-applied      { border-color: rgba(59,130,246,0.5); color: #3B82F6; background-color: rgba(59,130,246,0.08); }
    .status-select.s-interviewing { border-color: rgba(139,92,246,0.5); color: #8B5CF6; background-color: rgba(139,92,246,0.08); }
    .status-select.s-offer        { border-color: rgba(16,185,129,0.45); color: var(--green); background-color: rgba(16,185,129,0.08); }
    .status-select.s-rejected     { border-color: rgba(239,68,68,0.35); color: var(--red); background-color: rgba(239,68,68,0.05); }

    .tailor-card.status-offer    { border-color: rgba(16,185,129,0.35); background: rgba(16,185,129,0.025); }
    .tailor-card.status-rejected { opacity: 0.6; }

    .followup-badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px 8px;
      border-radius: 20px;
      font-size: 11px;
      font-weight: 600;
      background: #FFFBEB;
      border: 1px solid #FDE68A;
      color: #92400E;
      margin-left: 6px;
      vertical-align: middle;
    }

    .next-action-hint {
      font-size: 11px;
      color: var(--muted);
      margin-top: 5px;
      margin-bottom: 10px;
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .next-action-hint b { color: var(--brand); font-weight: 700; }

    .match-label {
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.3px;
      margin-left: 2px;
    }

    .tailor-card-notes {
      width: 100%;
      margin-top: 10px;
      padding: 7px 10px;
      background: rgba(255,255,255,0.04);
      border: 1px solid var(--border);
      border-radius: 6px;
      color: var(--text);
      font-size: 12px;
      font-family: 'Inter', sans-serif;
      resize: vertical;
      min-height: 38px;
      max-height: 120px;
      box-sizing: border-box;
      transition: border-color 0.15s;
    }
    .tailor-card-notes::placeholder { color: var(--muted); }
    .tailor-card-notes:focus { outline: none; border-color: var(--brand); }

    /* ── JOB SEARCH PANEL ────────────────────────────────── */
    .js-panel {
      display: none;
    }

    .js-panel.visible {
      display: flex;
    }

    /* Location input row */
    .location-row {
      display: flex;
      gap: 8px;
    }

    .location-row input {
      flex: 1;
    }

    .btn-locate {
      padding: 0 14px;
      border-radius: 10px;
      background: var(--surface2);
      border: 1.5px solid var(--border);
      color: var(--text2);
      cursor: pointer;
      font-size: 16px;
      transition: all 0.15s;
      flex-shrink: 0;
    }

    .btn-locate:hover {
      border-color: var(--brand);
      color: var(--brand);
    }

    /* Radius selector */
    .radius-options {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
    }

    .radius-btn {
      padding: 5px 12px;
      border-radius: 100px;
      font-size: 12px;
      font-weight: 600;
      border: 1.5px solid var(--border);
      background: var(--surface);
      color: var(--muted);
      cursor: pointer;
      font-family: 'Inter', sans-serif;
      transition: all 0.15s;
    }

    .radius-btn.active {
      border-color: var(--brand);
      background: rgba(99, 102, 241, 0.12);
      color: var(--brand);
    }

    .radius-btn:hover:not(.active) {
      border-color: var(--border2);
      color: var(--text2);
    }

    /* Job type filter */
    .jtype-options {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
    }

    .jtype-btn {
      padding: 5px 10px;
      border-radius: 8px;
      font-size: 11px;
      font-weight: 600;
      border: 1.5px solid var(--border);
      background: var(--surface);
      color: var(--muted);
      cursor: pointer;
      font-family: 'Inter', sans-serif;
      transition: all 0.15s;
    }

    .jtype-btn.active {
      border-color: var(--green);
      background: var(--green-light);
      color: var(--green);
    }

    .jtype-btn:hover:not(.active) {
      border-color: var(--border2);
      color: var(--text2);
    }

    /* Job results */
    .job-results-panel {
      flex: 1;
      display: none;
      flex-direction: column;
      overflow: hidden;
    }

    .job-results-panel.visible {
      display: flex;
    }

    .job-results-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 14px 20px;
      border-bottom: 1px solid var(--border);
      flex-shrink: 0;
      background: var(--surface);
    }

    .job-results-header h3 {
      font-size: 14px;
      font-weight: 700;
      color: var(--text);
    }

    .job-results-header span {
      font-size: 12px;
      color: var(--muted);
    }

    .job-list {
      flex: 1;
      overflow-y: auto;
      padding: 16px 20px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      background: var(--bg);
    }

    /* Job card */
    .job-card {
      background: var(--surface);
      border: 1.5px solid var(--border);
      border-radius: 14px;
      padding: 18px;
      cursor: pointer;
      transition: all 0.15s;
      box-shadow: var(--shadow-xs);
    }

    .job-card:hover {
      border-color: var(--brand);
      transform: translateY(-1px);
      box-shadow: var(--shadow-sm);
    }

    @keyframes tailorPulse {

      0%,
      100% {
        box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.25), 0 0 18px rgba(217, 119, 6, 0.15);
      }

      50% {
        box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.45), 0 0 28px rgba(217, 119, 6, 0.25);
      }
    }

    .job-card.tailored {
      border-color: var(--amber) !important;
      animation: tailorPulse 2s ease-in-out 3;
    }

    .job-card.tailored .job-title::after {
      content: ' ✍️';
      font-size: 12px;
      opacity: 0.8;
    }

    .job-card-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 8px;
    }

    .job-title {
      font-size: 15px;
      font-weight: 700;
      color: var(--text);
      line-height: 1.3;
    }

    .job-company {
      font-size: 13px;
      color: var(--brand);
      font-weight: 600;
      margin-top: 3px;
    }

    .job-distance-badge {
      flex-shrink: 0;
      padding: 3px 9px;
      border-radius: 100px;
      font-size: 11px;
      font-weight: 700;
      background: rgba(99, 102, 241, 0.12);
      color: var(--brand);
      white-space: nowrap;
    }

    .job-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-bottom: 10px;
    }

    .job-meta-pill {
      padding: 3px 9px;
      border-radius: 6px;
      font-size: 11px;
      font-weight: 500;
      background: var(--surface2);
      color: var(--text2);
      border: 1px solid var(--border);
    }

    .job-meta-pill.salary {
      color: var(--green);
      border-color: rgba(5, 150, 105, 0.25);
      background: var(--green-light);
    }

    .job-meta-pill.remote {
      color: var(--brand);
      border-color: rgba(67, 56, 202, 0.25);
      background: rgba(99, 102, 241, 0.12);
    }

    .job-desc {
      font-size: 13px;
      color: var(--text2);
      line-height: 1.6;
      margin-bottom: 12px;
      display: -webkit-box;
      -webkit-line-clamp: 3;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    .job-card-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }

    .job-date {
      font-size: 11px;
      color: var(--muted);
    }

    .btn-tailor-job {
      padding: 7px 14px;
      border-radius: 8px;
      font-size: 12px;
      font-weight: 600;
      background: var(--brand);
      color: white;
      border: none;
      cursor: pointer;
      font-family: 'Inter', sans-serif;
      transition: all 0.15s;
    }

    .btn-tailor-job:hover {
      background: var(--brand-dark);
    }

    .btn-view-job {
      padding: 7px 12px;
      border-radius: 8px;
      font-size: 12px;
      font-weight: 600;
      background: var(--surface2);
      color: var(--text2);
      border: 1.5px solid var(--border);
      cursor: pointer;
      font-family: 'Inter', sans-serif;
      transition: all 0.15s;
      text-decoration: none;
    }

    .btn-view-job:hover {
      border-color: var(--border2);
      color: var(--text);
    }

    /* Job search loading */
    .job-loading {
      flex: 1;
      display: none;
      align-items: center;
      justify-content: center;
      flex-direction: column;
      gap: 16px;
      padding: 40px;
    }

    .job-loading.visible {
      display: flex;
    }

    .job-loading-spinner {
      width: 40px;
      height: 40px;
      border: 3px solid var(--border);
      border-top-color: var(--brand);
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
    }

    .job-loading p {
      font-size: 14px;
      color: var(--muted);
    }

    /* Job search empty */
    .job-search-empty {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      padding: 48px;
    }

    .job-search-empty .empty-icon {
      font-size: 48px;
      margin-bottom: 12px;
      opacity: 0.35;
    }

    .job-search-empty h2 {
      font-size: 18px;
      font-weight: 700;
      margin-bottom: 8px;
      color: var(--text);
    }

    .job-search-empty p {
      font-size: 14px;
      color: var(--muted);
      max-width: 320px;
      line-height: 1.6;
    }

    /* Quick search links */
    .quick-links {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin-top: 16px;
      justify-content: center;
    }

    .quick-link-btn {
      padding: 7px 14px;
      border-radius: 8px;
      font-size: 12px;
      font-weight: 600;
      border: 1.5px solid var(--border);
      background: var(--surface);
      color: var(--text2);
      text-decoration: none;
      cursor: pointer;
      transition: all 0.15s;
    }

    .quick-link-btn:hover {
      border-color: var(--border2);
      color: var(--text);
    }

    /* Job search upload row */
    .js-upload-row {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 2px;
    }

    .btn-js-upload {
      padding: 7px 14px;
      border-radius: 8px;
      border: 1.5px solid var(--border);
      background: var(--surface);
      color: var(--text2);
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      font-family: 'Inter', sans-serif;
      transition: all 0.15s;
      display: flex;
      align-items: center;
      gap: 5px;
      white-space: nowrap;
    }

    .btn-js-upload:hover {
      border-color: var(--brand);
      color: var(--brand);
      background: rgba(99, 102, 241, 0.12);
    }

    .js-upload-hint {
      font-size: 11px;
      color: var(--muted);
    }

    /* Analyze resume button */
    .btn-analyze-resume {
      width: 100%;
      margin-top: 12px;
      padding: 12px 14px;
      border-radius: 10px;
      background: rgba(99, 102, 241, 0.12);
      border: 1.5px solid rgba(67, 56, 202, 0.3);
      color: var(--brand);
      font-size: 13px;
      font-weight: 700;
      cursor: pointer;
      font-family: 'Inter', sans-serif;
      transition: all 0.15s;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
    }

    .btn-analyze-resume:hover:not(:disabled) {
      background: #E0E7FF;
      border-color: var(--brand);
      transform: translateY(-1px);
    }

    .btn-analyze-resume:disabled {
      opacity: 0.5;
      cursor: not-allowed;
      transform: none;
    }

    .btn-analyze-resume.spinning #autoDetectBtnIcon {
      display: inline-block;
      animation: spin 0.8s linear infinite;
    }

    /* Role filter tabs */
    .role-tabs {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }

    .role-tab {
      padding: 5px 12px;
      border-radius: 100px;
      font-size: 12px;
      font-weight: 600;
      background: var(--surface);
      border: 1.5px solid var(--border);
      color: var(--muted);
      cursor: pointer;
      font-family: 'Inter', sans-serif;
      transition: all 0.15s;
      white-space: nowrap;
      display: flex;
      align-items: center;
      gap: 5px;
    }

    .role-tab:hover:not(.active) {
      border-color: var(--border2);
      color: var(--text2);
    }

    .role-tab.active {
      background: rgba(99, 102, 241, 0.12);
      border-color: var(--brand);
      color: var(--brand);
    }

    .role-tab-count {
      font-size: 10px;
      font-weight: 700;
      background: rgba(0, 0, 0, 0.06);
      padding: 1px 5px;
      border-radius: 100px;
      color: inherit;
    }

    .role-tab.active .role-tab-count {
      background: rgba(67, 56, 202, 0.15);
    }

    /* Resume source notice */
    .resume-source-notice {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 9px 13px;
      background: var(--green-light);
      border: 1px solid rgba(5, 150, 105, 0.25);
      border-radius: 8px;
      font-size: 12px;
      color: var(--green);
      font-weight: 500;
    }

    /* Salary badge */
    .job-salary-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 5px 12px;
      border-radius: 8px;
      font-size: 13px;
      font-weight: 700;
      background: var(--green-light);
      color: var(--green);
      border: 1px solid rgba(5, 150, 105, 0.25);
      margin-bottom: 8px;
    }

    .job-salary-badge::before {
      content: '💰';
    }

    .job-salary-badge.estimated {
      background: var(--amber-light);
      color: var(--amber);
      border-color: rgba(217, 119, 6, 0.25);
    }

    .job-salary-badge.unknown {
      background: var(--surface2);
      color: var(--muted);
      border-color: var(--border);
      font-weight: 400;
      font-size: 12px;
    }

    .job-salary-badge.unknown::before {
      content: '';
    }

    /* No-results box */
    .no-jobs-box {
      background: var(--surface);
      border: 1.5px solid var(--border);
      border-radius: 14px;
      padding: 32px;
      text-align: center;
      box-shadow: var(--shadow-xs);
    }

    .no-jobs-box p {
      color: var(--text2);
      font-size: 14px;
      margin-bottom: 12px;
    }

    /* ── APPLICATION TRACKER ─────────────────────────────── */
    .tracker-panel {
      flex: 1;
      display: none;
      flex-direction: column;
      overflow: hidden;
    }

    .tracker-panel.visible {
      display: flex;
    }

    .tracker-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 20px 28px;
      border-bottom: 1px solid var(--border);
      flex-shrink: 0;
      background: var(--surface);
    }

    .tracker-header h2 {
      font-size: 17px;
      font-weight: 700;
      color: var(--text);
    }

    .tracker-header-actions {
      display: flex;
      gap: 8px;
      align-items: center;
    }

    .tracker-count {
      font-size: 12px;
      color: var(--muted);
    }

    .tracker-body {
      flex: 1;
      overflow-y: auto;
      padding: 24px 28px;
      background: var(--bg);
    }

    /* Application row */
    .app-row {
      background: var(--surface);
      border: 1.5px solid var(--border);
      border-radius: 12px;
      padding: 16px 18px;
      margin-bottom: 10px;
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 10px;
      transition: all 0.15s;
      box-shadow: var(--shadow-xs);
    }

    .app-row:hover {
      border-color: var(--brand);
      box-shadow: var(--shadow-sm);
    }

    .app-row-left {
      min-width: 0;
    }

    .app-row-title {
      font-size: 15px;
      font-weight: 700;
      color: var(--text);
      margin-bottom: 2px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .app-row-company {
      font-size: 13px;
      color: var(--brand);
      font-weight: 600;
      margin-bottom: 8px;
    }

    .app-row-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      align-items: center;
    }

    .app-row-right {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 6px;
      flex-shrink: 0;
    }

    /* Status badge */
    .status-badge {
      padding: 4px 11px;
      border-radius: 100px;
      font-size: 11px;
      font-weight: 700;
      cursor: pointer;
      border: none;
      font-family: 'Inter', sans-serif;
      white-space: nowrap;
    }

    .status-badge option {
      background: var(--surface);
      color: var(--text);
      font-weight: 600;
      font-size: 12px;
    }

    .status-tailored {
      background: rgba(139, 92, 246, 0.1);
      color: #7C3AED;
    }

    .tailored-nudge {
      display: flex;
      align-items: center;
      gap: 5px;
      margin-top: 6px;
      font-size: 11px;
      color: var(--text2);
      font-style: italic;
    }

    .status-applied {
      background: rgba(99, 102, 241, 0.12);
      color: var(--brand);
    }

    .status-screening {
      background: var(--amber-light);
      color: var(--amber);
    }

    .status-interview {
      background: #F5F3FF;
      color: #6D28D9;
    }

    .status-offer {
      background: var(--green-light);
      color: var(--green);
    }

    .status-rejected {
      background: var(--red-light);
      color: var(--red);
    }

    /* Auto-apply result log */
    .result-log {
      margin-top: 6px;
      padding: 8px 11px;
      border-radius: 7px;
      font-size: 11px;
      line-height: 1.6;
      border: 1.5px solid transparent;
    }

    .result-log.success {
      background: var(--green-light);
      border-color: rgba(5, 150, 105, 0.25);
      color: var(--green);
    }

    .result-log.warning {
      background: var(--amber-light);
      border-color: rgba(217, 119, 6, 0.25);
      color: var(--amber);
    }

    .result-log.error {
      background: var(--red-light);
      border-color: rgba(220, 38, 38, 0.25);
      color: var(--red);
    }

    /* Follow-up date */
    .followup-badge {
      font-size: 11px;
      padding: 3px 8px;
      border-radius: 6px;
      background: var(--surface2);
      border: 1px solid var(--border);
      color: var(--muted);
    }

    .followup-badge.overdue {
      background: var(--red-light);
      border-color: rgba(220, 38, 38, 0.25);
      color: var(--red);
    }

    .followup-badge.soon {
      background: var(--amber-light);
      border-color: rgba(217, 119, 6, 0.25);
      color: var(--amber);
    }

    /* Apply modal */
    .apply-modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.5);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      backdrop-filter: blur(2px);
    }

    .apply-modal-overlay.visible {
      display: flex;
    }

    .apply-modal {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 28px;
      width: 480px;
      max-width: 92vw;
      box-shadow: var(--shadow-md);
    }

    .apply-modal h2 {
      font-size: 17px;
      font-weight: 700;
      margin-bottom: 4px;
      color: var(--text);
    }

    .apply-modal .job-ref {
      font-size: 13px;
      color: var(--muted);
      margin-bottom: 18px;
    }

    .apply-modal label {
      display: block;
      font-size: 11px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--label);
      margin-bottom: 5px;
      margin-top: 14px;
    }

    .apply-modal input,
    .apply-modal textarea,
    .apply-modal select {
      width: 100%;
      background: var(--surface2);
      border: 1.5px solid transparent;
      border-radius: 9px;
      color: var(--text);
      font-family: 'Inter', sans-serif;
      font-size: 14px;
      padding: 10px 13px;
      outline: none;
      transition: all 0.15s;
    }

    .apply-modal input:focus,
    .apply-modal textarea:focus {
      border-color: var(--brand);
      background: var(--surface);
      box-shadow: 0 0 0 3px var(--brand-glow);
    }

    .apply-modal-btns {
      display: flex;
      gap: 8px;
      margin-top: 20px;
      justify-content: flex-end;
    }

    /* Tracker empty */
    .tracker-empty {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      text-align: center;
      padding: 48px;
    }

    .tracker-empty .empty-icon {
      font-size: 48px;
      margin-bottom: 12px;
      opacity: 0.35;
    }

    .tracker-empty h2 {
      font-size: 19px;
      font-weight: 700;
      margin-bottom: 8px;
      color: var(--text);
    }

    .tracker-empty p {
      font-size: 14px;
      color: var(--muted);
      max-width: 320px;
      line-height: 1.6;
    }

    /* Resume choice options in modal */
    .resume-choice-btn {
      width: 100%;
      text-align: left;
      padding: 14px 16px;
      border-radius: 10px;
      background: var(--surface2);
      border: 1.5px solid var(--border);
      color: var(--text);
      cursor: pointer;
      font-family: 'Inter', sans-serif;
      font-size: 13px;
      transition: all 0.15s;
      line-height: 1.5;
    }

    .resume-choice-btn:hover {
      border-color: var(--brand);
      background: rgba(99, 102, 241, 0.12);
    }

    .resume-choice-btn strong {
      display: block;
      font-size: 14px;
      font-weight: 700;
      margin-bottom: 2px;
      color: var(--text);
    }

    .resume-choice-btn span {
      font-size: 13px;
      color: var(--text2);
    }

    .resume-choice-btn.recommended {
      border-color: var(--green);
    }

    .resume-choice-btn.recommended strong::after {
      content: ' ✓ Recommended';
      color: var(--green);
      font-size: 11px;
      font-weight: 600;
    }

    .resume-choice-btn.warn {
      border-color: rgba(217, 119, 6, 0.4);
    }

    .resume-choice-btn.warn strong::after {
      content: ' ⚠ Not tailored';
      color: var(--amber);
      font-size: 11px;
      font-weight: 600;
    }

    /* Resume source chip in tracker rows */
    .resume-chip {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      font-size: 11px;
      font-weight: 600;
      padding: 2px 7px;
      border-radius: 100px;
      border: 1px solid transparent;
      margin-top: 4px;
    }

    .resume-chip.tailored {
      color: #6EE7B7;
      border-color: rgba(14, 159, 110, 0.3);
      background: rgba(14, 159, 110, 0.07);
    }

    .resume-chip.tailored-other {
      color: #FCD34D;
      border-color: rgba(245, 158, 11, 0.3);
      background: rgba(245, 158, 11, 0.07);
    }

    .resume-chip.base {
      color: var(--muted);
      border-color: var(--border);
      background: transparent;
    }

    .resume-chip.none {
      color: #FCA5A5;
      border-color: rgba(239, 68, 68, 0.3);
      background: rgba(239, 68, 68, 0.07);
    }

    /* Indeed apply button */
    .btn-indeed {
      padding: 6px 11px;
      border-radius: 6px;
      font-size: 12px;
      font-weight: 700;
      background: #2164F3;
      color: white;
      border: none;
      cursor: pointer;
      font-family: 'Inter', sans-serif;
      transition: all 0.15s;
      white-space: nowrap;
      text-decoration: none;
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }

    .btn-indeed:hover {
      background: #1a52d4;
      transform: translateY(-1px);
    }

    .btn-indeed.easy {
      background: linear-gradient(135deg, #2164F3, #00A4AC);
    }


    /* Profile modal */
    .profile-section {
      padding: 20px;
      border-bottom: 1px solid var(--border);
    }

    .profile-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 14px 10px;
    }

    .profile-grid .full {
      grid-column: 1 / -1;
    }

    .profile-grid input {
      width: 100%;
      min-width: 0;
    }

    /* Freshness badge */

    /* ── WELCOME MODAL ──────────────────────────────────────────── */
    .welcome-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.75);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 9998;
      display: none;
      /* below 9999 paywall but above everything else */
    }

    .welcome-overlay.visible {
      display: flex;
    }

    .welcome-modal {
      background: var(--dark2);
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 36px 32px;
      width: 500px;
      max-width: 94vw;
      text-align: center;
    }

    .welcome-logo {
      font-size: 22px;
      font-weight: 800;
      color: var(--brand);
      margin-bottom: 6px;
      letter-spacing: -0.5px;
    }

    .welcome-logo span {
      color: var(--text);
    }

    .welcome-tagline {
      font-size: 13px;
      color: var(--muted);
      margin-bottom: 28px;
    }

    .welcome-steps {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 12px;
      margin-bottom: 28px;
    }

    .welcome-step {
      background: var(--surface2);
      border: 1.5px solid var(--border);
      border-radius: 12px;
      padding: 18px 10px;
      text-align: center;
    }

    .welcome-step-icon {
      font-size: 28px;
      margin-bottom: 8px;
    }

    .welcome-step-title {
      font-size: 12px;
      font-weight: 700;
      color: var(--text);
      margin-bottom: 4px;
    }

    .welcome-step-desc {
      font-size: 11px;
      color: var(--text2);
      line-height: 1.5;
    }

    .welcome-step-arrow {
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--muted);
      font-size: 18px;
      padding-top: 18px;
    }

    .welcome-steps-row {
      display: flex;
      align-items: flex-start;
      gap: 0;
      margin-bottom: 28px;
    }

    .btn-welcome-start {
      width: 100%;
      padding: 15px;
      border-radius: 12px;
      background: linear-gradient(135deg, #4338CA, #6366F1);
      color: white;
      font-weight: 700;
      font-size: 15px;
      border: none;
      cursor: pointer;
      font-family: 'Inter', sans-serif;
      transition: all 0.2s;
      box-shadow: 0 4px 20px rgba(67, 56, 202, 0.4);
      margin-bottom: 10px;
    }

    .btn-welcome-start:hover {
      transform: translateY(-1px);
      box-shadow: 0 8px 28px rgba(67, 56, 202, 0.5);
    }

    .welcome-skip {
      font-size: 12px;
      color: var(--muted);
      cursor: pointer;
    }

    .welcome-skip:hover {
      color: var(--text2);
    }

    /* Two-path onboarding grid — stack vertically on phones */
    .welcome-path-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin-top: 4px;
    }

    @media (max-width: 480px) {

      /* Stack path cards vertically, make them bigger/tappable */
      .welcome-path-grid {
        grid-template-columns: 1fr;
        gap: 10px;
      }

      .welcome-path-grid button {
        padding: 16px !important;
        font-size: 14px !important;
        border-radius: 14px !important;
      }

      /* Feature chips: 2-col grid */
      #welcomeChips {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 7px !important;
      }

      #welcomeChips span {
        text-align: center;
        justify-content: center;
        display: flex !important;
        align-items: center;
        gap: 4px;
      }

      /* Tighten headline */
      #welcomeOverlay h2 {
        font-size: 20px !important;
      }

      /* Tighten paragraph */
      #welcomeOverlay>div>p {
        font-size: 12px !important;
        margin-bottom: 14px !important;
      }
    }

    /* ── FEEDBACK WIDGET ─────────────────────────────────────────── */
    .btn-feedback {
      display: flex;
      align-items: center;
      gap: 5px;
      padding: 6px 12px;
      border-radius: 8px;
      font-size: 12px;
      font-weight: 600;
      border: 1.5px solid var(--border);
      background: var(--surface);
      color: var(--text2);
      cursor: pointer;
      font-family: 'Inter', sans-serif;
      transition: all 0.15s;
    }

    .btn-feedback:hover {
      border-color: var(--amber);
      color: var(--amber);
      background: var(--amber-light);
    }

    .feedback-modal {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 32px;
      width: 420px;
      max-width: 92vw;
      box-shadow: var(--shadow-md);
    }

    .feedback-modal h2 {
      font-size: 18px;
      font-weight: 700;
      margin-bottom: 6px;
      color: var(--text);
    }

    .feedback-modal .subtitle {
      font-size: 14px;
      color: var(--text2);
      margin-bottom: 20px;
      line-height: 1.5;
    }

    /* Star rating row */
    .star-row {
      display: flex;
      gap: 6px;
      justify-content: center;
      margin-bottom: 20px;
    }

    .star-btn {
      font-size: 30px;
      cursor: pointer;
      color: rgba(251, 191, 36, 0.16);
      text-shadow:
        0 0 0 #FBBF24,
        0 0 10px rgba(251, 191, 36, 0.22);
      transition: color 0.12s, transform 0.12s, text-shadow 0.12s;
      border: none;
      background: none;
      padding: 2px;
    }

    .star-btn.lit {
      color: #FBBF24;
      text-shadow: 0 0 12px rgba(251, 191, 36, 0.42);
      transform: scale(1.12);
    }

    .star-btn:hover {
      color: #FCD34D;
      text-shadow: 0 0 14px rgba(252, 211, 77, 0.48);
    }

    [data-theme="light"] .star-btn {
      color: rgba(146, 64, 14, 0.20);
      text-shadow: 0 0 0 #D97706;
    }

    [data-theme="light"] .star-btn.lit,
    [data-theme="light"] .star-btn:hover {
      color: #D97706;
      text-shadow: 0 0 8px rgba(217, 119, 6, 0.25);
    }

    /* Review platform buttons */
    .review-platforms {
      display: flex;
      flex-direction: column;
      gap: 8px;
      margin-bottom: 20px;
    }

    .btn-review-platform {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 13px 16px;
      border-radius: 10px;
      border: 1.5px solid var(--border);
      background: var(--surface2);
      color: var(--text);
      cursor: pointer;
      font-family: 'Inter', sans-serif;
      font-size: 13px;
      font-weight: 600;
      text-decoration: none;
      transition: all 0.15s;
    }

    .btn-review-platform:hover {
      border-color: var(--brand);
      background: rgba(99, 102, 241, 0.12);
    }

    .google-review-platform {
      border-color: rgba(66, 133, 244, 0.35);
    }

    .google-review-platform:hover {
      border-color: #4285F4;
      background: rgba(66, 133, 244, 0.14);
    }

    .btn-review-platform .platform-icon {
      font-size: 20px;
      flex-shrink: 0;
    }

    .current-objective-bar {
      position: sticky;
      top: 0;
      z-index: 90;
      display: flex;
      align-items: center;
      min-height: 36px;
      padding: 7px 20px;
      border-bottom: 1px solid #334155;
      background: #1e1e2e;
      box-shadow: 0 10px 28px rgba(0,0,0,0.12);
      color: #94a3b8;
      font-size: 12.5px;
      font-weight: 650;
      line-height: 1.35;
    }

    .current-objective-bar span {
      display: block;
      min-width: 0;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .whats-next-card {
      width: 100%;
      max-width: none;
      display: flex;
      flex-direction: column;
      align-items: stretch;
      justify-content: flex-start;
      gap: 12px;
      margin: 0 0 12px;
      padding: 14px;
      border: 1px solid #334155;
      border-radius: 12px;
      background: #1e1e2e;
      box-shadow: 0 16px 42px rgba(0,0,0,0.20);
      position: relative;
      z-index: 20;
    }

    .whats-next-card.is-hidden {
      display: none;
    }

    .whats-next-copy {
      min-width: 0;
      flex: 1;
    }

    .whats-next-eyebrow {
      margin-bottom: 4px;
      color: var(--brand);
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    .whats-next-card h2 {
      margin: 0;
      color: var(--text);
      font-size: 14px;
      line-height: 1.25;
      font-weight: 750;
    }

    .whats-next-card p {
      margin: 4px 0 0;
      color: #94a3b8;
      font-size: 12.5px;
      line-height: 1.45;
    }

    .whats-next-progress {
      display: flex;
      gap: 4px;
      margin-top: 9px;
    }

    .whats-next-progress span {
      flex: 1;
      min-width: 18px;
      height: 4px;
      border-radius: 999px;
      background: rgba(148,163,184,0.22);
    }

    .whats-next-progress span.is-complete {
      background: var(--brand);
    }

    .whats-next-actions {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: 8px;
      flex-wrap: wrap;
    }

    .whats-next-btn {
      min-height: 34px;
      padding: 8px 13px;
      border-radius: 8px;
      font-family: 'Inter', sans-serif;
      font-size: 12.5px;
      font-weight: 750;
      cursor: pointer;
      transition: transform 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
      white-space: nowrap;
    }

    .whats-next-btn:hover {
      transform: translateY(-1px);
    }

    .whats-next-btn-primary {
      border: 1px solid rgba(99,102,241,0.45);
      background: rgba(99,102,241,0.14);
      color: var(--brand);
    }

    .whats-next-btn-secondary {
      border: 1px solid var(--border);
      background: var(--surface2);
      color: var(--text2);
    }

    .whats-next-dismiss,
    .whats-next-restore button {
      border: none;
      background: transparent;
      color: #94a3b8;
      font-family: 'Inter', sans-serif;
      font-size: 11.5px;
      font-weight: 650;
      cursor: pointer;
      padding: 6px 4px;
      white-space: nowrap;
    }

    .whats-next-dismiss:hover,
    .whats-next-restore button:hover {
      color: var(--brand);
    }

    .whats-next-restore {
      width: 100%;
      margin: 0 0 10px;
      text-align: left;
    }

    .application-checklist-card {
      width: 100%;
      margin: 0 0 12px;
      padding: 14px;
      border: 1px solid #334155;
      border-radius: 12px;
      background: #1e1e2e;
      box-shadow: 0 16px 42px rgba(0,0,0,0.16);
    }

    .application-checklist-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 10px;
    }

    .application-checklist-eyebrow {
      color: var(--brand);
      font-size: 10px;
      font-weight: 800;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      margin-bottom: 4px;
    }

    .application-checklist-card h2 {
      margin: 0;
      color: var(--text);
      font-size: 14px;
      line-height: 1.25;
      font-weight: 750;
    }

    .application-checklist-count {
      flex-shrink: 0;
      min-width: 42px;
      padding: 3px 8px;
      border-radius: 999px;
      background: rgba(99,102,241,0.14);
      color: var(--brand);
      font-size: 11px;
      font-weight: 800;
      text-align: center;
    }

    .application-checklist-progress {
      height: 5px;
      border-radius: 999px;
      background: rgba(148,163,184,0.22);
      overflow: hidden;
      margin-bottom: 10px;
    }

    .application-checklist-progress span {
      display: block;
      height: 100%;
      width: 0%;
      border-radius: inherit;
      background: linear-gradient(90deg, var(--brand), #10B981);
      transition: width 0.2s ease;
    }

    .application-checklist-items {
      display: flex;
      flex-direction: column;
      gap: 7px;
    }

    .application-checklist-item {
      display: grid;
      grid-template-columns: 18px minmax(0, 1fr);
      gap: 8px;
      align-items: start;
      color: #94a3b8;
      font-size: 12px;
      line-height: 1.35;
    }

    .application-checklist-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 18px;
      height: 18px;
      border-radius: 999px;
      background: rgba(148,163,184,0.16);
      color: #94a3b8;
      font-size: 11px;
      font-weight: 900;
    }

    .application-checklist-check {
      width: 12px;
      height: 12px;
    }

    .application-checklist-item.is-complete {
      color: var(--text);
    }

    .application-checklist-item.is-complete .application-checklist-icon {
      background: rgba(16,185,129,0.18);
      color: #10B981;
    }

    .application-checklist-item.is-current .application-checklist-icon {
      background: rgba(99,102,241,0.18);
      color: var(--brand);
    }

    .application-checklist-label {
      font-weight: 700;
    }

    .application-checklist-label em {
      color: #94a3b8;
      font-size: 10px;
      font-style: normal;
      font-weight: 700;
      margin-left: 4px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }

    .application-checklist-hint {
      display: block;
      margin-top: 1px;
      color: #94a3b8;
      font-size: 11px;
      font-weight: 500;
    }

    .application-checklist-complete {
      display: flex;
      flex-direction: column;
      gap: 4px;
      margin-top: 4px;
      padding: 10px;
      border-radius: 10px;
      background: rgba(16,185,129,0.10);
      border: 1px solid rgba(16,185,129,0.22);
      color: #94a3b8;
      font-size: 11.5px;
      line-height: 1.45;
    }

    .application-checklist-complete strong {
      color: var(--text);
      font-size: 12px;
    }

    .disabled-reason,
    .smart-action-reason {
      display: none;
      margin: 8px 0 0;
      color: #94a3b8;
      font-size: 11.5px;
      line-height: 1.45;
      text-align: center;
    }

    .disabled-reason.is-visible,
    .smart-action-reason.is-visible {
      display: block;
    }

    [data-theme="light"] .whats-next-card {
      background: #ffffff;
      border-color: #e2e8f0;
      box-shadow: 0 20px 45px rgba(15,23,42,0.13);
    }

    [data-theme="light"] .current-objective-bar {
      background: #ffffff;
      border-color: #e2e8f0;
      box-shadow: 0 10px 24px rgba(15,23,42,0.08);
      color: #475569;
    }

    [data-theme="light"] .application-checklist-card {
      background: #ffffff;
      border-color: #e2e8f0;
      box-shadow: 0 20px 45px rgba(15,23,42,0.11);
    }

    [data-theme="light"] .whats-next-card p,
    [data-theme="light"] .whats-next-dismiss,
    [data-theme="light"] .whats-next-restore button,
    [data-theme="light"] .application-checklist-item,
    [data-theme="light"] .application-checklist-hint,
    [data-theme="light"] .application-checklist-label em,
    [data-theme="light"] .application-checklist-complete,
    [data-theme="light"] .disabled-reason,
    [data-theme="light"] .smart-action-reason {
      color: #475569;
    }

    [data-theme="light"] .application-checklist-complete {
      background: rgba(16,185,129,0.08);
      border-color: rgba(16,185,129,0.20);
    }

    [data-theme="light"] .whats-next-progress span {
      background: #e2e8f0;
    }

    @media (max-width: 899px) {
      .current-objective-bar {
        min-height: 34px;
        padding: 7px 14px;
        font-size: 12px;
      }

      .whats-next-card {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(68px + env(safe-area-inset-bottom));
        width: auto;
        max-width: none;
        margin: 0;
        padding: 14px;
        border-radius: 16px 16px 14px 14px;
        z-index: 650;
      }

      .whats-next-actions {
        justify-content: flex-start;
      }

      .whats-next-btn {
        white-space: normal;
      }

      .whats-next-restore {
        position: fixed;
        right: 14px;
        bottom: calc(68px + env(safe-area-inset-bottom));
        width: auto;
        margin: 0;
        z-index: 650;
      }
    }

    .google-review-platform .platform-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 20px;
      height: 20px;
      border-radius: 999px;
      background: #FFFFFF;
      color: #4285F4;
      font-size: 13px;
      font-weight: 800;
      line-height: 1;
      box-shadow: inset 0 0 0 1px rgba(66, 133, 244, 0.24);
    }

    [data-theme="light"] .google-review-platform {
      border-color: rgba(66, 133, 244, 0.4);
      background: #F8FBFF;
    }

    [data-theme="light"] .google-review-platform:hover {
      border-color: #4285F4;
      background: #EEF6FF;
    }

    .btn-review-platform .platform-text {
      flex: 1;
      text-align: left;
    }

    .btn-review-platform .platform-text span {
      display: block;
      font-size: 11px;
      color: var(--muted);
      font-weight: 400;
      margin-top: 1px;
    }

    .btn-review-platform .platform-arrow {
      color: var(--muted);
      font-size: 14px;
    }

    /* Quick feedback textarea */
    .feedback-divider {
      text-align: center;
      font-size: 11px;
      color: var(--muted);
      margin: 4px 0 14px;
    }

    .feedback-sent {
      display: none;
      text-align: center;
      padding: 16px;
    }

    .feedback-sent .sent-icon {
      font-size: 36px;
      margin-bottom: 8px;
    }

    .feedback-sent p {
      font-size: 13px;
      color: var(--text2);
    }

    /* ── PROFILE AUTO-FILL BANNER ────────────────────────────────── */
    .autofill-banner {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px 16px;
      border-radius: 12px;
      margin-bottom: 20px;
      background: rgba(99, 102, 241, 0.12);
      border: 1.5px solid rgba(67, 56, 202, 0.25);
    }

    .autofill-banner p {
      font-size: 13px;
      color: var(--text2);
      flex: 1;
      line-height: 1.5;
      margin: 0;
    }

    .btn-autofill {
      padding: 8px 16px;
      border-radius: 8px;
      font-size: 13px;
      font-weight: 700;
      background: var(--brand);
      color: white;
      border: none;
      cursor: pointer;
      font-family: 'Inter', sans-serif;
      white-space: nowrap;
      flex-shrink: 0;
      transition: all 0.15s;
    }

    .btn-autofill:hover:not(:disabled) {
      background: var(--brand-dark);
    }

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

    /* ── PROFILE COMPLETENESS BAR ────────────────────────────────── */
    .profile-completeness {
      margin-bottom: 18px;
      padding: 12px 16px;
      border-radius: 10px;
      background: var(--surface2);
      border: 1.5px solid var(--border);
    }

    .profile-completeness-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 7px;
    }

    .profile-completeness-label {
      font-size: 11px;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--label);
      font-weight: 600;
    }

    .profile-completeness-pct {
      font-size: 12px;
      font-weight: 700;
    }

    .profile-completeness-pct.full {
      color: var(--green);
    }

    .profile-completeness-pct.partial {
      color: var(--amber);
    }

    .profile-progress-track {
      height: 5px;
      background: var(--border);
      border-radius: 100px;
    }

    .profile-progress-fill {
      height: 100%;
      border-radius: 100px;
      transition: width 0.4s ease;
    }

    .profile-progress-fill.full {
      background: var(--green);
    }

    .profile-progress-fill.partial {
      background: var(--amber);
    }

    /* ── POST-TAILOR NEXT STEPS BANNER ───────────────────────────── */
    .next-steps-banner {
      display: none;
      margin: 0 0 12px;
      padding: 14px 18px;
      background: var(--green-light);
      border: 1.5px solid rgba(5, 150, 105, 0.25);
      border-radius: 12px;
      flex-shrink: 0;
    }

    .next-steps-banner.visible {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .next-steps-banner p {
      font-size: 13px;
      color: var(--text2);
      flex: 1;
      margin: 0;
      line-height: 1.5;
    }

    .next-steps-banner p strong {
      color: var(--green);
    }

    .next-steps-actions {
      display: flex;
      gap: 6px;
      flex-shrink: 0;
    }

    /* ── SETUP PROMPT in empty state ─────────────────────────────── */
    .setup-steps {
      margin-top: 28px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      max-width: 380px;
      width: 100%;
      text-align: left;
    }

    .setup-step-row {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px 16px;
      border-radius: 10px;
      background: var(--surface2);
      border: 1.5px solid var(--border);
    }

    .setup-step-row.done {
      border-color: rgba(5, 150, 105, 0.35);
      background: var(--green-light);
    }

    .setup-step-num {
      width: 22px;
      height: 22px;
      border-radius: 50%;
      flex-shrink: 0;
      background: var(--border2);
      color: white;
      font-size: 11px;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .setup-step-row.done .setup-step-num {
      background: var(--green);
    }

    .setup-step-text {
      font-size: 13px;
      flex: 1;
      line-height: 1.4;
    }

    .setup-step-text strong {
      display: block;
      color: var(--text);
      margin-bottom: 1px;
    }

    .setup-step-text span {
      color: var(--text2);
    }

    .setup-step-action {
      font-size: 12px;
      font-weight: 700;
      color: var(--brand);
      cursor: pointer;
      flex-shrink: 0;
    }

    .setup-step-action:hover {
      text-decoration: underline;
    }

    /* Mark applied button on job cards */
    .btn-applied-check {
      padding: 7px 12px;
      border-radius: 8px;
      font-size: 12px;
      font-weight: 600;
      background: var(--surface2);
      color: var(--text2);
      border: 1.5px solid var(--border);
      cursor: pointer;
      font-family: 'Inter', sans-serif;
      transition: all 0.15s;
    }

    .btn-applied-check:hover {
      border-color: var(--green);
      color: var(--green);
      background: var(--green-light);
    }

    .btn-applied-check.is-applied {
      background: var(--green-light);
      border-color: rgba(5, 150, 105, 0.35);
      color: var(--green);
    }

    /* ── MOBILE BOTTOM NAV ───────────────────────────────────────────────── */
    .mobile-bottom-nav {
      display: none;
    }

    @media (max-width: 768px) {
      .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--surface);
        border-top: 1px solid var(--border);
        padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
        z-index: 200;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
      }

      .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 4px 0;
        cursor: pointer;
        background: none;
        border: none;
        font-family: 'Inter', sans-serif;
        color: var(--muted);
        font-size: 10px;
        font-weight: 600;
        letter-spacing: 0.2px;
        transition: color 0.15s;
        position: relative;
      }

      .mobile-nav-item.active {
        color: var(--brand);
      }

      .mobile-nav-item svg {
        width: 22px;
        height: 22px;
      }

      .mobile-nav-badge {
        position: absolute;
        top: 2px;
        right: calc(50% - 18px);
        background: var(--brand);
        color: white;
        border-radius: 100px;
        font-size: 9px;
        font-weight: 700;
        padding: 1px 5px;
        min-width: 16px;
        text-align: center;
      }

      /* Hide the topbar mode-toggle on mobile */
      .mode-toggle {
        display: none !important;
      }

      /* Add bottom padding to main content so it's not hidden behind nav */
      .main {
        padding-bottom: 90px !important;
      }

      /* Simplify topbar on mobile */
      .topbar {
        padding: 0 16px;
      }

      .api-badge .hide-mobile,
      .topbar-right .hide-mobile {
        display: none;
      }
    }

    /* ── DESKTOP TWO-COLUMN LAYOUT ───────────────────────────────────────── */
    @media (min-width: 1024px) {
      .main {
        flex-direction: row !important;
        align-items: flex-start !important;
        justify-content: center !important;
        gap: 24px !important;
        padding: 32px 24px 64px !important;
      }

      .left-panel {
        max-width: 480px !important;
        width: 100% !important;
        flex-shrink: 0 !important;
      }

      .right-panel {
        flex: 1 !important;
        min-width: 0 !important;
        max-width: 600px !important;
        margin-top: 0 !important;
      }
    }

    /* ── TOPBAR ICON-ONLY BUTTONS ────────────────────────────────────────── */
    .topbar-right .api-badge .badge-label,
    .topbar-right .btn-feedback .badge-label {
      display: none;
    }

    .topbar-right .api-badge {
      position: relative;
    }

    .topbar-right .api-badge:hover::after {
      content: attr(title);
      position: absolute;
      bottom: -28px;
      left: 50%;
      transform: translateX(-50%);
      background: var(--text);
      color: white;
      font-size: 11px;
      padding: 3px 8px;
      border-radius: 5px;
      white-space: nowrap;
      pointer-events: none;
      z-index: 100;
    }

    /* ── RESUME SOURCE HERO CARDS ────────────────────────────────────────── */
    .resume-source-cards {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-bottom: 12px;
    }

    .resume-source-card {
      display: flex;
      align-items: center;
      gap: 14px;
      padding: 16px 18px;
      border-radius: 14px;
      border: 2px solid var(--border);
      background: var(--surface);
      cursor: pointer;
      transition: all 0.15s;
      box-shadow: var(--shadow-xs);
    }

    .resume-source-card.active {
      border-color: var(--brand);
      background: rgba(99, 102, 241, 0.12);
      box-shadow: 0 0 0 3px var(--brand-glow);
    }

    .resume-source-card:hover:not(.active) {
      border-color: var(--border2);
      box-shadow: var(--shadow-sm);
    }

    .resume-source-icon {
      width: 40px;
      height: 40px;
      border-radius: 10px;
      background: var(--surface2);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      font-size: 20px;
    }

    .resume-source-card.active .resume-source-icon {
      background: rgba(67, 56, 202, 0.12);
    }

    .resume-source-text {
      flex: 1;
    }

    .resume-source-text strong {
      display: block;
      font-size: 14px;
      font-weight: 700;
      color: var(--text);
      margin-bottom: 2px;
    }

    .resume-source-text span {
      font-size: 12px;
      color: var(--text2);
      line-height: 1.4;
    }

    .resume-source-check {
      width: 20px;
      height: 20px;
      border-radius: 50%;
      border: 2px solid var(--border2);
      flex-shrink: 0;
      transition: all 0.15s;
    }

    .resume-source-card.active .resume-source-check {
      background: var(--brand);
      border-color: var(--brand);
      background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 6l3 3 5-5' stroke='white' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
      background-size: 12px;
      background-repeat: no-repeat;
      background-position: center;
    }

    /* ── FEATURE HIGHLIGHTS GRID ─────────────────────────────────────────── */
    .feature-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin-top: 8px;
    }

    .feature-tile {
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 8px;
      padding: 14px;
      border-radius: 12px;
      background: var(--surface);
      border: 1.5px solid var(--border);
      box-shadow: var(--shadow-xs);
      transition: all 0.15s;
    }

    .feature-tile:hover {
      border-color: var(--brand);
      box-shadow: var(--shadow-sm);
      transform: translateY(-1px);
    }

    .feature-tile-icon {
      width: 36px;
      height: 36px;
      border-radius: 9px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 18px;
    }

    .feature-tile-label {
      font-size: 12px;
      font-weight: 600;
      color: var(--text);
      line-height: 1.3;
    }

    /* ── APP SIDEBAR (desktop only) ──────────────────────────────────────── */
    #appSidebar { display: none; }

    @media (min-width: 769px) {
      #appSidebar {
        display: flex;
        flex-direction: column;
        position: fixed;
        left: 0;
        top: var(--topbar-h);
        bottom: 0;
        width: 220px;
        background: var(--surface);
        border-right: 1px solid var(--border);
        z-index: 100;
        padding: 10px 0 0;
        overflow-y: auto;
      }
      /* Push all main content right to clear sidebar */
      .main, #heroSection, #flowHint {
        margin-left: 220px;
      }
      /* Tighten top padding on desktop */
      .main { padding-top: 20px; }
      /* Sidebar hides the topbar tab strip — sidebar is the nav now */
      .mode-toggle { display: none !important; }
      /* Tighten topbar on desktop now that tabs are gone */
      .topbar { padding: 0 20px; }

      .sb-logo {
        padding: 4px 16px 14px;
        font-weight: 800;
        font-size: 15px;
        color: var(--brand);
        letter-spacing: -0.3px;
        border-bottom: 1px solid var(--border);
        margin-bottom: 6px;
      }
      .sb-logo span { color: var(--text); }

      .sb-section { flex: 1; padding: 4px 8px; }

      .sb-item {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        padding: 9px 12px;
        background: none;
        border: none;
        border-radius: 8px;
        color: var(--text2);
        font-family: 'Inter', sans-serif;
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        text-align: left;
        transition: all 0.12s;
        position: relative;
        margin-bottom: 2px;
      }
      .sb-item svg { flex-shrink: 0; opacity: 0.7; }
      .sb-item:hover { background: var(--surface2); color: var(--text); }
      .sb-item:hover svg { opacity: 1; }
      .sb-item.active {
        background: rgba(67,56,202,0.14);
        color: var(--brand-mid);
        font-weight: 600;
      }
      .sb-item.active svg { opacity: 1; stroke: var(--brand-mid); }
      .sb-item.active::before {
        content: '';
        position: absolute;
        left: -8px;
        top: 50%;
        transform: translateY(-50%);
        width: 3px;
        height: 20px;
        background: var(--brand);
        border-radius: 0 3px 3px 0;
      }
      .sb-badge {
        margin-left: auto;
        background: var(--brand);
        color: #fff;
        font-size: 10px;
        font-weight: 700;
        padding: 1px 6px;
        border-radius: 100px;
        min-width: 18px;
        text-align: center;
        line-height: 16px;
      }
      .sb-divider {
        height: 1px;
        background: var(--border);
        margin: 8px 16px;
      }
      .sb-footer {
        border-top: 1px solid var(--border);
        padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
      }
    }

    /* ═══════════════════════════════════════════════════════════
       REDESIGN 2.0 — DARK SAAS DASHBOARD
    ══════════════════════════════════════════════════════════════ */

    /* ── Topbar: 3-column logo | title | actions ── */
    .topbar-center {
      position: absolute;
      left: 50%;
      transform: translateX(-50%);
      font-size: 13px;
      font-weight: 600;
      color: var(--text2);
      letter-spacing: 0.1px;
      pointer-events: none;
    }
    .topbar-upgrade {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 6px 14px;
      background: linear-gradient(135deg, #6366F1, #8B5CF6);
      color: #fff;
      font-size: 12px;
      font-weight: 700;
      border: none;
      border-radius: 8px;
      cursor: pointer;
      font-family: 'Inter', sans-serif;
      transition: all 0.18s;
      box-shadow: 0 2px 10px rgba(99,102,241,0.45);
      letter-spacing: 0.2px;
    }
    .topbar-upgrade:hover {
      transform: translateY(-1px);
      box-shadow: 0 4px 16px rgba(99,102,241,0.55);
    }
    .topbar-avatar {
      width: 30px;
      height: 30px;
      border-radius: 50%;
      background: var(--surface2);
      border: 1.5px solid var(--border2);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 13px;
      cursor: pointer;
      transition: all 0.15s;
      flex-shrink: 0;
    }
    .topbar-avatar:hover {
      border-color: var(--brand);
    }

    /* ── Hero action panel: 2-column card ── */
    .hero-action-panel {
      display: grid;
      grid-template-columns: 1fr 1.2fr;
      gap: 0;
      background: var(--surface);
      border-radius: 16px;
      border: 1px solid var(--border);
      box-shadow: var(--shadow-md);
      overflow: hidden;
      margin-bottom: 10px;
      animation: fadeScaleIn 0.35s ease both;
    }
    .hero-left {
      padding: 28px 28px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      background: linear-gradient(145deg, rgba(99,102,241,0.06) 0%, rgba(139,92,246,0.04) 100%);
      border-right: 1px solid var(--border);
    }
    .hero-ai-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 4px 10px;
      background: rgba(99,102,241,0.15);
      border: 1px solid rgba(99,102,241,0.3);
      border-radius: 100px;
      font-size: 11px;
      font-weight: 600;
      color: #A5B4FC;
      letter-spacing: 0.3px;
      margin-bottom: 14px;
      width: fit-content;
    }
    .hero-title {
      font-size: 22px;
      font-weight: 800;
      color: var(--text);
      line-height: 1.25;
      letter-spacing: -0.5px;
      margin-bottom: 10px;
    }
    .hero-subtitle {
      font-size: 13px;
      color: var(--text2);
      line-height: 1.6;
      margin-bottom: 20px;
    }
    .hero-trust-list {
      display: flex;
      flex-direction: column;
      gap: 7px;
    }
    .hero-trust-item {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 12px;
      color: var(--text2);
    }
    .hero-trust-item svg {
      flex-shrink: 0;
      color: var(--green);
    }
    .hero-right {
      padding: 20px 22px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      background: var(--surface);
    }
    .hero-input-label {
      font-size: 11px;
      font-weight: 600;
      letter-spacing: 0.5px;
      text-transform: uppercase;
      color: var(--label);
      margin-bottom: 6px;
    }

    /* ── Quick Actions Sidebar ── */
    .resume-dashboard-wrap {
      display: grid;
      grid-template-columns: 1fr 220px;
      gap: 14px;
      width: 100%;
      max-width: 1060px;
      align-items: start;
    }
    .resume-main-col {
      display: flex;
      flex-direction: column;
      min-width: 0;
    }
    .quick-actions-sidebar {
      position: sticky;
      top: 16px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .qs-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 16px;
      box-shadow: var(--shadow-sm);
      animation: fadeScaleIn 0.3s ease both;
    }
    .qs-title {
      font-size: 11px;
      font-weight: 700;
      letter-spacing: 0.5px;
      text-transform: uppercase;
      color: var(--muted);
      margin-bottom: 10px;
    }
    .qs-btn {
      display: flex;
      align-items: center;
      gap: 8px;
      width: 100%;
      padding: 9px 12px;
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: 9px;
      color: var(--text2);
      font-size: 12px;
      font-weight: 500;
      font-family: 'Inter', sans-serif;
      cursor: pointer;
      transition: all 0.15s;
      text-align: left;
      margin-bottom: 6px;
    }
    .qs-btn:last-child { margin-bottom: 0; }
    .qs-btn:hover:not(:disabled) {
      background: rgba(99,102,241,0.1);
      border-color: rgba(99,102,241,0.3);
      color: var(--text);
    }
    .qs-btn:disabled {
      opacity: 0.4;
      cursor: not-allowed;
    }
    .qs-btn .qs-icon {
      width: 22px;
      height: 22px;
      border-radius: 6px;
      background: rgba(255,255,255,0.06);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      flex-shrink: 0;
    }
    .qs-btn-primary {
      background: linear-gradient(135deg, #4F46E5, #6366F1);
      border-color: transparent;
      color: #fff;
      font-weight: 600;
    }
    .qs-btn-primary:hover:not(:disabled) {
      background: linear-gradient(135deg, #4338CA, #4F46E5);
      border-color: transparent;
      color: #fff;
    }
    .qs-coming-soon {
      font-size: 10px;
      color: var(--muted);
      background: var(--surface2);
      border-radius: 4px;
      padding: 1px 5px;
      margin-left: auto;
      flex-shrink: 0;
    }
    .qs-stat-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 8px 0;
      border-bottom: 1px solid var(--border);
      font-size: 12px;
    }
    .qs-stat-row:last-child { border-bottom: none; }
    .qs-stat-label { color: var(--text2); }
    .qs-stat-value { color: var(--text); font-weight: 600; }
    .qs-streak-value { color: var(--brand); }
    .qs-streak-value.streak-hot { color: #10B981; }

    /* ── Trust pill badges ── */
    .trust-pill-row {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      margin-top: 10px;
    }
    .trust-pill {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 3px 10px;
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: 100px;
      font-size: 11px;
      color: var(--text2);
      font-weight: 500;
    }
    .trust-pill svg { flex-shrink: 0; opacity: 0.7; }

    /* ── Match Score + Insights (3-col) ── */
    .insights-grid {
      display: grid;
      grid-template-columns: 160px 1fr 1fr;
      gap: 10px;
      margin-bottom: 10px;
      animation: fadeScaleIn 0.3s ease both;
    }
    .insight-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 14px;
      padding: 16px;
      box-shadow: var(--shadow-sm);
    }
    .insight-card-title {
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: var(--muted);
      margin-bottom: 10px;
    }
    .match-ring-wrap {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
    }
    .match-ring {
      position: relative;
      width: 80px;
      height: 80px;
    }
    .match-ring svg {
      transform: rotate(-90deg);
    }
    .match-ring-track {
      fill: none;
      stroke: var(--border2);
      stroke-width: 7;
    }
    .match-ring-fill {
      fill: none;
      stroke-width: 7;
      stroke-linecap: round;
      transition: stroke-dashoffset 0.8s cubic-bezier(0.4,0,0.2,1);
    }
    .match-ring-fill.green { stroke: var(--green); }
    .match-ring-fill.amber { stroke: var(--amber); }
    .match-ring-fill.red { stroke: var(--red); }
    .match-ring-label {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
    }
    .match-ring-pct {
      font-size: 17px;
      font-weight: 800;
      color: var(--text);
      line-height: 1;
    }
    .match-ring-sub {
      font-size: 9px;
      color: var(--muted);
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }
    .insight-kw-list {
      display: flex;
      flex-direction: column;
      gap: 5px;
    }
    .insight-kw-item {
      display: flex;
      align-items: center;
      gap: 7px;
      font-size: 12px;
      color: var(--text2);
      padding: 4px 0;
    }
    .insight-kw-dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      flex-shrink: 0;
    }
    .insight-kw-dot.missing { background: var(--red); }
    .insight-kw-dot.strength { background: var(--green); }

    /* ── Skeleton loaders ── */
    .skeleton {
      background: linear-gradient(90deg, var(--surface2) 25%, rgba(255,255,255,0.04) 50%, var(--surface2) 75%);
      background-size: 200% 100%;
      animation: shimmer 1.4s ease-in-out infinite;
      border-radius: 6px;
    }
    @keyframes shimmer {
      0% { background-position: 200% 0; }
      100% { background-position: -200% 0; }
    }
    .skeleton-line {
      height: 12px;
      margin-bottom: 8px;
      border-radius: 6px;
    }
    .skeleton-line.wide { width: 85%; }
    .skeleton-line.med  { width: 60%; }
    .skeleton-line.short { width: 40%; }
    .skeleton-block {
      height: 80px;
      border-radius: 10px;
      margin-bottom: 10px;
    }

    /* ── Extension ready pulse — highlights Generate button after job capture ── */
    @keyframes extReadyPulse {
      0%, 100% { box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.35), 0 4px 20px rgba(99, 102, 241, 0.2); }
      50%       { box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.5), 0 4px 32px rgba(99, 102, 241, 0.4); }
    }
    .ext-ready-pulse { animation: extReadyPulse 0.8s ease-in-out 3; }

    /* ── Animations ── */
    @keyframes fadeScaleIn {
      from { opacity: 0; transform: translateY(8px) scale(0.99); }
      to   { opacity: 1; transform: translateY(0) scale(1); }
    }
    @keyframes fadeIn {
      from { opacity: 0; }
      to   { opacity: 1; }
    }
    .fade-in { animation: fadeIn 0.25s ease both; }

    /* ── Run button tweak for compact hero ── */
    .btn-run-compact {
      width: 100%;
      padding: 13px;
      border-radius: 12px;
      background: linear-gradient(135deg, #4F46E5 0%, #6366F1 100%);
      color: white;
      font-weight: 700;
      font-size: 14px;
      border: none;
      cursor: pointer;
      font-family: 'Inter', sans-serif;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      transition: all 0.2s;
      box-shadow: 0 4px 18px rgba(99,102,241,0.45), 0 1px 0 rgba(255,255,255,0.08) inset;
      letter-spacing: 0.2px;
    }
    .btn-run-compact:hover:not(:disabled) {
      transform: translateY(-1px);
      box-shadow: 0 7px 24px rgba(99,102,241,0.55);
    }

    /* ── Resume Grid: 12-col dashboard layout ── */
    #resumeGrid {
      width: 100%;
      max-width: 1100px;
      display: grid; /* hidden via JS when switching to other modes */
      grid-template-columns: 1fr;
      gap: 16px;
      align-items: start;
      align-self: flex-start;
    }
    @media (min-width: 900px) {
      #resumeGrid {
        grid-template-columns: minmax(0, 1fr) 220px;
      }
    }
    #resumeMainCol {
      display: flex;
      flex-direction: column;
      gap: 12px;
      min-width: 0;
    }
    #resumeMainCol .left-panel,
    #resumeMainCol .right-panel {
      width: 100% !important;
      max-width: 100% !important;
    }

    /* ── Quick Sidebar: sticky in grid column ── */
    #quickSidebar {
      display: flex;
      flex-direction: column;
      gap: 10px;
      position: sticky;
      top: 16px;
      max-height: calc(100dvh - var(--header-stack-h) - 32px);
      overflow-y: auto;
      padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    }
    @media (max-width: 899px) {
      #quickSidebar {
        display: block;
        position: static;
        max-height: none;
        overflow: visible;
      }
      #quickSidebar > :not(#whatsNextCard):not(#whatsNextRestoreWrap):not(#applicationChecklistCard) {
        display: none;
      }
    }

    /* ── Topbar desktop override ── */
    @media (min-width: 769px) {
      .hero-action-panel { max-width: 100%; }
    }

    /* ── Mobile: stack hero columns ── */
    @media (max-width: 768px) {
      .hero-action-panel {
        grid-template-columns: 1fr;
      }
      .hero-left {
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding: 20px 18px;
      }
      .hero-right { padding: 16px 18px; }
      .resume-dashboard-wrap {
        grid-template-columns: 1fr;
      }
      .quick-actions-sidebar { display: none; }
      .insights-grid {
        grid-template-columns: 1fr 1fr;
      }
      .insights-grid .insight-card:first-child {
        grid-column: 1 / -1;
      }
    }

    /* -- Layout collision guardrails --------------------------------------- */
    .debug-layout * {
      outline: 1px solid rgba(99, 102, 241, 0.35);
    }

    .app,
    .main,
    #resumeGrid,
    #resumeMainCol,
    #quickSidebar,
    .left-panel,
    .right-panel,
    .tailored-panel,
    .tracker-panel,
    .modal-content {
      min-width: 0;
    }

    .topbar {
      z-index: var(--z-topbar);
    }

    .current-objective-bar {
      z-index: var(--z-objective-bar);
      overflow-wrap: anywhere;
      word-break: normal;
    }

    #currentObjectiveText {
      display: block;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .main {
      width: 100%;
      min-width: 0;
      min-height: 0;
      max-height: calc(100dvh - var(--header-stack-h));
      flex-direction: column !important;
      align-items: stretch !important;
      justify-content: flex-start !important;
      padding-top: 24px !important;
      padding-bottom: calc(64px + var(--fixed-bottom-safe-space) + env(safe-area-inset-bottom, 0px)) !important;
      scroll-padding-top: var(--resume-scroll-top-safe-space);
      scroll-padding-bottom: calc(var(--fixed-bottom-safe-space) + env(safe-area-inset-bottom, 0px));
    }

    .hero-action-panel {
      align-items: start;
      overflow: visible;
    }

    .hero-left,
    .hero-right {
      align-self: start;
      min-height: 0;
    }

    .hero-left {
      justify-content: flex-start;
    }

    #fileDrop,
    #fileLoaded,
    #jobText,
    #runBtn,
    #resumeChoiceCard {
      scroll-margin-top: var(--resume-scroll-top-safe-space);
    }

    #resumeGrid {
      min-width: 0;
      box-sizing: border-box;
      margin: 16px auto 0;
    }

    #quickSidebar,
    #whatsNextCard,
    #applicationChecklistCard,
    .empty-state,
    .disabled-reason,
    .smart-action-reason {
      max-width: 100%;
      overflow-wrap: anywhere;
      word-break: normal;
    }

    #whatsNextCard *,
    #applicationChecklistCard *,
    .empty-state * {
      min-width: 0;
    }

    .application-checklist-item {
      min-width: 0;
    }

    .application-checklist-label {
      min-width: 0;
      overflow-wrap: anywhere;
    }

    @media (min-width: 769px) {
      #appSidebar {
        width: var(--sidebar-width);
        z-index: var(--z-sidebar);
      }

      .main,
      #heroSection,
      #flowHint,
      #currentObjectiveBar {
        width: calc(100% - var(--sidebar-width));
        margin-left: var(--sidebar-width);
      }
    }

    @media (min-width: 1180px) {
      #resumeGrid {
        max-width: 1280px;
        grid-template-columns: minmax(640px, 1fr) minmax(var(--right-sidebar-min), var(--right-sidebar-max));
      }

      #quickSidebar {
        top: calc(var(--header-stack-h) + 16px);
        max-height: calc(100dvh - var(--header-stack-h) - 32px);
      }
    }

    @media (min-width: 900px) and (max-width: 1179px) {
      #resumeGrid {
        grid-template-columns: minmax(0, 1fr);
      }

      #quickSidebar {
        position: static;
        max-height: none;
        overflow: visible;
      }
    }

    @media (max-width: 899px) {
      .main {
        padding-bottom: calc(var(--mobile-fixed-bottom-safe-space) + env(safe-area-inset-bottom, 0px)) !important;
      }

      #resumeGrid,
      #quickSidebar,
      #whatsNextCard,
      #applicationChecklistCard {
        max-width: calc(100vw - 24px);
      }

      .whats-next-card {
        bottom: calc(132px + env(safe-area-inset-bottom, 0px));
        max-height: min(52vh, 360px);
        overflow-y: auto;
        z-index: var(--z-guide-sheet);
      }

      .whats-next-restore {
        bottom: calc(132px + env(safe-area-inset-bottom, 0px));
        z-index: var(--z-guide-sheet);
      }
    }

    @media (max-width: 768px) {
      #mobileQuickBar {
        z-index: calc(var(--z-guide-sheet) - 2);
      }

      .mobile-bottom-nav {
        z-index: calc(var(--z-guide-sheet) - 3);
      }
    }

    @media (max-width: 640px) {
      .main {
        padding-bottom: calc(var(--mobile-fixed-bottom-safe-space) + 40px + env(safe-area-inset-bottom, 0px)) !important;
      }
    }

    /* ── Phase 3: hover utilities (replace onmouseenter/onmouseleave) */
    .hover-surface2:hover { background: var(--surface2) !important; }
    .hover-indigo-muted:hover { background: rgba(99,102,241,0.08) !important; color: #818CF8 !important; }
    .hover-indigo-pill:hover { background: rgba(99,102,241,0.25) !important; }
    .hover-green-pill:hover { background: rgba(16,185,129,0.12) !important; }
    .hover-linkedin:hover { background: rgba(0,119,181,0.2) !important; }
    .hover-indigo-border:hover { border-color: rgba(99,102,241,0.7) !important; }
    .hover-indigo-btn:hover { background: #3730a3 !important; }
    .hover-feedback:hover { border-color: var(--brand) !important; color: var(--brand) !important; }
