/* ============================================================
   找工作神器 — Design System v2
   Calm efficiency tool aesthetic
   Inter + Noto Sans TC + JetBrains Mono
   ============================================================ */

:root {
  /* Surfaces — warm paper tones */
  --paper:   oklch(98.5% 0.004 75);
  --paper-2: oklch(96.5% 0.005 75);
  --paper-3: oklch(94%   0.006 75);

  /* Ink — near-black with warm tint */
  --ink:   oklch(22% 0.01 250);
  --ink-2: oklch(38% 0.01 250);
  --ink-3: oklch(58% 0.01 250);
  --ink-4: oklch(75% 0.008 250);

  /* Lines */
  --line:   oklch(90% 0.005 75);
  --line-2: oklch(85% 0.006 75);

  /* Moss — decision / progress accent */
  --moss:      oklch(48% 0.09 155);
  --moss-soft: oklch(94% 0.03 155);
  --moss-edge: oklch(85% 0.05 155);
  --moss-dark: oklch(42% 0.09 155);

  /* Amber — alert / reappear accent */
  --amber:      oklch(72% 0.13 65);
  --amber-soft: oklch(96% 0.04 65);

  /* Rust — rejection / warning */
  --rust:      oklch(52% 0.13 35);
  --rust-soft: oklch(95% 0.04 35);

  /* Source palette */
  --src-linkedin: oklch(45% 0.12 245);
  --src-cake:     oklch(55% 0.14 155);
  --src-remote:   oklch(55% 0.13 175);
  --src-104:      oklch(60% 0.15 50);
  --src-manual:   oklch(55% 0.01 250);

  /* Backward-compat aliases — app.js inline styles use these */
  --primary:        var(--moss);
  --primary-dark:   var(--moss-dark);
  --primary-light:  var(--moss-soft);
  --surface:        var(--paper);
  --bg:             var(--paper-2);
  --sidebar-bg:     var(--paper-2);
  --sidebar-text:   var(--ink-2);
  --sidebar-active: var(--moss);
  --border:         var(--line);
  --text:           var(--ink);
  --text-muted:     var(--ink-3);
  --text-secondary: var(--ink-2);
  --danger:         var(--rust);
  --success:        oklch(50% 0.12 145);
  --warning:        var(--amber);

  --radius:    10px;
  --shadow:    0 1px 3px oklch(22% 0.01 250 / 0.05), 0 1px 2px oklch(22% 0.01 250 / 0.03);
  --shadow-md: 0 4px 12px -4px oklch(22% 0.01 250 / 0.1), 0 2px 4px oklch(22% 0.01 250 / 0.04);
  --shadow-lg: 0 12px 32px -8px oklch(22% 0.01 250 / 0.15);
  --sidebar-w: 232px;
}

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

html, body {
  font-family: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  background: var(--paper-2);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.mono { font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace; }

/* ============================================================ Sidebar */
#sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--paper-2);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 100;
  padding: 20px 14px 16px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.brand-mark {
  width: 28px; height: 28px;
  border-radius: 7px;
  background: var(--ink);
  color: var(--paper);
  display: grid; place-items: center;
  flex-shrink: 0;
  position: relative;
}

.brand-mark::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 9px;
  border: 1px solid var(--moss);
  opacity: 0.35;
  pointer-events: none;
}

.brand-name {
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.2;
}

.brand-sub {
  display: block;
  font-size: 10px;
  color: var(--ink-3);
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* Hide old brand elements if present */
.brand-icon, .brand-text { display: none; }

/* ⌘K search trigger */
.sidebar-search {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink-3);
  font-size: 12px;
  margin-bottom: 12px;
  cursor: default;
  user-select: none;
}
.sidebar-search svg { flex-shrink: 0; width: 13px; height: 13px; }

kbd {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  padding: 1px 5px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: var(--paper-2);
  color: var(--ink-3);
}

.nav-group-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  padding: 6px 10px 5px;
  font-weight: 500;
}

nav { flex: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: background 0.12s, color 0.12s;
  border-left: 2.5px solid transparent;
  margin-bottom: 1px;
}

.nav-item:hover {
  background: var(--paper-3);
  color: var(--ink);
}

.nav-item.active {
  background: var(--paper);
  color: var(--ink);
  border-left-color: var(--moss);
  box-shadow: 0 1px 3px oklch(22% 0.01 250 / 0.04);
}

.nav-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
  color: var(--ink-3);
  transition: color 0.12s;
}

.nav-item.active .nav-icon,
.nav-item:hover .nav-icon { color: var(--ink); }

.nav-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', monospace;
}

/* Sidebar weekly progress */
.sidebar-progress {
  padding: 10px 10px 4px;
  margin-top: 4px;
}

.sidebar-progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-3);
  margin-bottom: 7px;
}

.sidebar-progress-row .mono {
  font-weight: 600;
  color: var(--ink-2);
}

.bar-track {
  height: 4px;
  background: var(--paper-3);
  border-radius: 2px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--moss);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* Sidebar footer */
.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.gear-wrap { position: relative; }
.gear-btn {
  background: none; border: none; cursor: pointer;
  color: var(--ink-3); display: flex; align-items: center;
  justify-content: center; padding: 4px; border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.gear-btn:hover { color: var(--ink-1); background: var(--paper-3); }
.settings-dropdown {
  position: absolute; bottom: 32px; right: 0;
  background: var(--paper); border: 1px solid var(--line-2);
  border-radius: 10px; box-shadow: 0 4px 16px -4px oklch(22% 0.01 250 / 0.15);
  min-width: 160px; overflow: hidden; z-index: 100;
}
.settings-menu-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; font-size: 13px; color: var(--ink-2);
  text-decoration: none; cursor: pointer;
  transition: background 0.1s;
  background: none; border: none; width: 100%; text-align: left;
}
.settings-menu-item:hover { background: var(--paper-2); color: var(--ink-1); }

.user-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  margin-bottom: 6px;
}

.user-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--moss);
  color: white;
  display: grid; place-items: center;
  font-weight: 600;
  font-size: 11px;
  flex-shrink: 0;
}

.user-name { font-size: 12px; font-weight: 500; color: var(--ink); }

#user-email {
  font-size: 11px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 148px;
}

/* ============================================================ Main */
#content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 28px 32px;
}

.tab-section { display: none; }
.tab-section.active { display: block; }

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.page-eyebrow {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  font-weight: 500;
  margin-bottom: 4px;
}

.page-header h1 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.2;
}

.page-header .subtitle { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
.header-actions { display: flex; gap: 8px; align-items: center; }

/* ============================================================ Cards */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-2);
}

.card-header h2 { font-size: 13px; font-weight: 600; letter-spacing: -0.005em; color: var(--ink); }
.card-header h3 { font-size: 13px; font-weight: 600; color: var(--ink); }
.card > *:not(.card-header) { padding: 16px; }

.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.ml-8  { margin-left: 8px; }

/* ============================================================ Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  transition: all 0.12s;
  white-space: nowrap;
  font-family: inherit;
  text-decoration: none;
}

.btn-primary {
  background: var(--moss);
  color: white;
  border-color: var(--moss);
}
.btn-primary:hover { background: var(--moss-dark); border-color: var(--moss-dark); }

.btn-ghost {
  border-color: var(--line-2);
  background: var(--paper);
  color: var(--ink);
}
.btn-ghost:hover { background: var(--paper-2); }

.btn-danger {
  background: var(--rust);
  color: white;
  border-color: var(--rust);
}
.btn-danger:hover { background: oklch(46% 0.13 35); }

.btn-sm  { padding: 5px 10px; font-size: 12px; }
.btn-danger-ghost {
  border-color: oklch(85% 0.05 35);
  background: var(--paper);
  color: var(--rust);
}
.btn-danger-ghost:hover { background: var(--rust-soft, oklch(95% 0.04 35)); }
.btn-lg  { padding: 10px 20px; font-size: 14px; }
.btn-block { width: 100%; justify-content: center; }
.btn-group  { display: flex; gap: 6px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ============================================================ Forms */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.input-field, .select-field, .textarea-field {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink);
  background: var(--paper);
  transition: border-color 0.12s, box-shadow 0.12s;
  font-family: inherit;
  line-height: 1.5;
}

.input-field:focus, .select-field:focus, .textarea-field:focus {
  outline: none;
  border-color: var(--moss);
  box-shadow: 0 0 0 3px var(--moss-soft);
}

.textarea-field { resize: vertical; line-height: 1.65; }
.hint-text { color: var(--ink-3); font-size: 12px; margin-bottom: 8px; line-height: 1.5; }

/* ============================================================ Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 0;
}

.stat-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', 'Inter', monospace;
}

.stat-label { font-size: 11px; color: var(--ink-3); margin-top: 2px; font-weight: 500; }

.stat-card.blue  .stat-value { color: var(--moss); }
.stat-card.green .stat-value { color: oklch(50% 0.12 145); }
.stat-card.amber .stat-value { color: var(--amber); }
.stat-card.red   .stat-value { color: var(--rust); }

/* ============================================================ Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid transparent;
}

[data-status="待確認"]  { background: var(--paper-2);  color: var(--ink-3);               border-color: var(--line); }
[data-status="已申請"]  { background: var(--moss-soft); color: var(--moss);                border-color: var(--moss-edge); }
[data-status="面試中"]  { background: var(--amber-soft);color: oklch(40% 0.1 65);          border-color: oklch(85% 0.06 65); }
[data-status="收到Offer"]{ background: oklch(95% 0.04 145); color: oklch(38% 0.1 145);    border-color: oklch(85% 0.06 145); }
[data-status="不合適"]  { background: var(--rust-soft); color: var(--rust);                border-color: oklch(85% 0.05 35); }

/* Source badges — colored monogram dot */
.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px 2px 4px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--paper-2);
  border: 1px solid var(--line);
}

.source-badge::before {
  content: '';
  width: 16px; height: 16px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 700;
  color: white;
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.02em;
}

.badge-linkedin::before   { content: 'Li'; background: var(--src-linkedin); }
.badge-cake::before       { content: 'Cr'; background: var(--src-cake); }
.badge-remoteok::before   { content: 'Rk'; background: var(--src-remote); }
.badge-104::before        { content: '104'; background: var(--src-104); font-size: 7.5px; width: 20px; }
.badge-manual::before     { content: 'M'; background: var(--src-manual); }

/* ============================================================ Star Rating */
.star-rating { display: flex; gap: 3px; }
.star {
  font-size: 16px;
  cursor: pointer;
  color: var(--line-2);
  transition: color 0.1s;
  line-height: 1;
}
.star.active { color: var(--amber); }
.star:hover  { color: var(--amber); }

/* ============================================================ Spinner */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--moss);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Pulse animation for live indicators */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
.pulse-dot { animation: pulse-dot 1.8s infinite; }

/* ============================================================ Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: oklch(22% 0.01 250 / 0.35);
  backdrop-filter: blur(3px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-xl { max-width: 960px; }

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 1;
}

.modal-header h2 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.modal-subtitle   { font-size: 13px; color: var(--ink-3); margin-top: 3px; }

.modal-close {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--ink-3);
  padding: 3px 7px;
  border-radius: 6px;
  flex-shrink: 0;
  line-height: 1;
  transition: background 0.12s, color 0.12s;
}
.modal-close:hover { background: var(--paper-2); color: var(--ink); }

.modal-body   { padding: 22px; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ============================================================ Job Detail */
.detail-grid { display: grid; grid-template-columns: 1fr 260px; gap: 20px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; align-items: center; }

.jd-content {
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink-2);
  max-height: 400px;
  overflow-y: auto;
}
.jd-empty { color: var(--ink-3); font-style: italic; font-size: 13px; }

.cl-tabs { display: flex; gap: 3px; margin-bottom: 12px; }
.cl-tab {
  padding: 5px 14px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: var(--paper);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  transition: all 0.12s;
}
.cl-tab.active       { background: var(--moss); color: white; border-color: var(--moss); }
.cl-tab:hover:not(.active) { background: var(--paper-2); color: var(--ink); }

.cl-content {
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.75;
  min-height: 200px;
  color: var(--ink);
  font-family: Georgia, serif;
}
.cl-loading { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 13px; padding: 20px 0; }

.cl-wordpad {
  width: 100%; flex: 1; min-height: 280px;
  padding: 14px 16px;
  font-size: 13.5px; line-height: 1.75;
  font-family: 'Noto Sans TC', 'Noto Sans', sans-serif;
  color: var(--ink-1);
  background: oklch(99.2% 0.002 75);
  border: 1px solid var(--line-2);
  border-radius: 8px;
  resize: vertical;
  box-sizing: border-box;
  white-space: pre-wrap;
}

/* ============================================================ Job List */
.job-list { display: flex; flex-direction: column; gap: 10px; }

/* ── Bulk select bar ─────────────────────────────────────── */
.bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 9px 14px;
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
}
.bulk-count {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
}
.bulk-actions {
  display: flex;
  gap: 8px;
}

/* ── Job card checkbox ───────────────────────────────────── */
.job-select {
  display: flex;
  align-items: center;
  padding: 2px 4px;
  flex-shrink: 0;
  cursor: pointer;
}
.job-cb {
  width: 15px;
  height: 15px;
  accent-color: var(--moss);
  cursor: pointer;
}

.job-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.12s, border-color 0.12s, transform 0.12s;
  cursor: pointer;
}
.job-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--line-2);
  transform: translateY(-1px);
}
.job-card.reappeared          { border-left: 3px solid var(--amber); }
.job-card.src-linkedin        { border-left: 3px solid var(--src-linkedin); }
.job-card.src-cake            { border-left: 3px solid var(--src-cake); }
.job-card.src-104             { border-left: 3px solid var(--src-104); }
.job-card.src-manual          { border-left: 3px solid var(--line-2); }

.job-card-header {
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.job-card-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin-bottom: 3px;
}
.job-card-company { font-size: 12px; color: var(--ink-3); }

.job-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 9px 16px;
  border-top: 1px solid var(--line);
  background: var(--paper-2);
}
.job-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.reappeared-tag {
  font-size: 10px;
  background: var(--amber-soft);
  color: oklch(40% 0.1 65);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  border: 1px solid oklch(85% 0.06 65);
  margin-left: 6px;
}
.jd-indicator { font-size: 11px; color: var(--ink-3); }

/* ============================================================ Swipe Cards */
.swipe-counter {
  font-size: 11px;
  color: var(--ink-3);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 2px 10px;
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
}

.swipe-area {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.swipe-stack-wrap {
  position: relative;
  height: 420px;
}

#swipe-stack { position: absolute; inset: 0; }

.swipe-card {
  position: absolute;
  inset: 0;
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: bottom center;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
              opacity  0.28s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.28s;
  will-change: transform, opacity;
  user-select: none;
}
.swipe-card[data-pos="0"] { z-index: 3; transform: translateY(0) scale(1);    opacity: 1;    box-shadow: var(--shadow-lg); }
.swipe-card[data-pos="1"] { z-index: 2; transform: translateY(10px) scale(0.97); opacity: 1; box-shadow: var(--shadow-md); }
.swipe-card[data-pos="2"] { z-index: 1; transform: translateY(20px) scale(0.94); opacity: 0.85; box-shadow: var(--shadow); }

.swipe-card.swiping-out {
  transform: translateX(-120%) rotate(-12deg) !important;
  opacity: 0 !important;
  transition: transform 0.38s cubic-bezier(0.4, 0, 1, 1),
              opacity  0.28s ease !important;
  z-index: 10 !important;
  pointer-events: none;
}

.swipe-card-top {
  padding: 18px 20px 14px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
}

.swipe-card-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 4px;
}
.swipe-card-company { font-size: 13px; color: var(--ink-3); margin-bottom: 10px; }

.swipe-card-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.swipe-loc { font-size: 12px; color: var(--ink-3); }

.swipe-card-jd {
  flex: 1;
  overflow-y: auto;
  padding: 14px 20px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink-2);
  white-space: pre-wrap;
}
.swipe-card-jd::-webkit-scrollbar { width: 4px; }
.swipe-card-jd::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 2px; }

.swipe-card-footer {
  flex-shrink: 0;
  padding: 11px 18px;
  border-top: 1px solid var(--line);
  background: var(--paper-2);
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Swipe action buttons */
.swipe-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.swipe-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 11px 24px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.15s;
  min-width: 88px;
  background: var(--paper);
}
.swipe-btn-icon { font-size: 20px; line-height: 1; }

.swipe-action-btn.reject { border-color: oklch(85% 0.05 35); color: var(--rust); }
.swipe-action-btn.reject:hover { background: var(--rust-soft); border-color: var(--rust); transform: scale(1.04); }

.swipe-action-btn.hold { border-color: var(--line-2); color: var(--ink-3); }
.swipe-action-btn.hold:hover { background: var(--paper-2); border-color: var(--ink-3); transform: scale(1.04); }

.swipe-action-btn.apply { border-color: var(--moss-edge); color: var(--moss); }
.swipe-action-btn.apply:hover { background: var(--moss-soft); border-color: var(--moss); transform: scale(1.04); }

.swipe-action-btn:active { transform: scale(0.97) !important; }

.swipe-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  font-size: 14px;
}
.empty-icon { font-size: 36px; margin-bottom: 12px; }

/* ============================================================ Swipe Hints */
.swipe-hint {
  position: absolute;
  top: 18px;
  padding: 5px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  border: 2px solid;
  transition: opacity 0.08s;
  letter-spacing: 0.02em;
}
.swipe-hint-reject {
  left: 18px;
  color: var(--rust);
  border-color: var(--rust);
  background: var(--rust-soft);
  transform: rotate(-12deg);
}
.swipe-hint-apply {
  right: 18px;
  color: var(--moss-dark);
  border-color: var(--moss);
  background: var(--moss-soft);
  transform: rotate(12deg);
}

/* ============================================================ Empty States */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--ink-3);
}

.empty-state-full {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 24px;
  text-align: center;
  gap: 0;
}
.empty-state-illus {
  width: 80px; height: 80px;
  color: var(--line-2);
  margin-bottom: 20px;
}
.empty-state-illus svg { width: 100%; height: 100%; }
.empty-state-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.empty-state-desc {
  font-size: 13px;
  color: var(--ink-3);
  line-height: 1.65;
  margin-bottom: 20px;
}

/* ============================================================ Filter Bar */
.filter-bar { padding: 14px 16px !important; }
.filter-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 10px;
  align-items: center;
}
.filter-stats { margin-top: 8px; font-size: 12px; color: var(--ink-3); }

/* ============================================================ Search Log */
.search-log {
  max-height: 280px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 11.5px;
  line-height: 1.85;
  color: var(--ink-3);
  background: var(--paper-2);
  padding: 12px 14px;
}
.search-log .log-line { padding: 0; }
.search-log .log-line.new-job { color: var(--moss); font-weight: 500; }
.search-log .log-line.error   { color: var(--rust); }
.search-log .log-line.done    { color: var(--moss); font-weight: 600; }
.search-log .log-line.dim     { color: var(--ink-4); }

.search-summary {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--moss-soft);
  border: 1px solid var(--moss-edge);
  border-radius: 8px;
  color: var(--moss-dark);
  font-weight: 500;
  font-size: 13px;
}

.search-preview-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.search-preview-item:last-child { border-bottom: none; }
.preview-new  { color: var(--moss); font-size: 11px; font-weight: 600; }
.preview-seen { color: var(--ink-3); font-size: 11px; }

/* ============================================================ Profile */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.profile-grid .full-width { grid-column: 1 / -1; }
.save-status { font-size: 12px; color: var(--moss); }

/* ── Profile Entry (experience / projects / skills) ── */
.profile-entry {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}
.profile-entry:last-child { border-bottom: none; }

.profile-entry-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}
.profile-entry-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}
.profile-entry-fields .input-field { flex: 1; min-width: 140px; }
.input-period { max-width: 180px; flex: 0 0 auto !important; }

.btn-entry-remove {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line-2);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink-4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
  margin-top: 1px;
}
.btn-entry-remove:hover { border-color: var(--rust); color: var(--rust); background: oklch(97% 0.01 20); }

/* Bullet rows */
.bullet-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.bullet-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.bullet-dot { color: var(--ink-3); font-size: 14px; flex-shrink: 0; width: 12px; text-align: center; }
.bullet-input { flex: 1; font-size: 13px; }
.btn-icon-remove {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: none;
  background: none;
  color: var(--ink-4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.12s;
}
.btn-icon-remove:hover { color: var(--rust); background: oklch(97% 0.01 20); }

.btn-add-bullet {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: var(--moss);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  font-family: inherit;
  transition: color 0.12s;
}
.btn-add-bullet:hover { color: var(--moss-dark); }

.input-error { border-color: var(--rust) !important; }

/* ── Skills ── */
.skill-entry { padding: 14px 16px; }
.skill-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  padding: 3px 8px 3px 10px;
  transition: border-color 0.12s;
}
.skill-tag:focus-within { border-color: var(--moss-edge); }
.skill-tag-input {
  border: none;
  background: transparent;
  font-size: 12px;
  font-family: inherit;
  color: var(--ink-1);
  width: 80px;
  outline: none;
  padding: 0;
}
.skill-tag-remove {
  width: 14px;
  height: 14px;
  border: none;
  background: none;
  color: var(--ink-4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  transition: all 0.12s;
}
.skill-tag-remove:hover { color: var(--rust); }
.skill-tag-add {
  width: 24px;
  height: 24px;
  border: 1.5px dashed var(--line-2);
  border-radius: 50%;
  background: none;
  color: var(--ink-4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}
.skill-tag-add:hover { border-color: var(--moss); color: var(--moss); }

/* ============================================================ Recent Jobs */
.recent-job-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.recent-job-row:last-child { border-bottom: none; }
.recent-job-info  { flex: 1; min-width: 0; }
.recent-job-title { font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-job-company { font-size: 12px; color: var(--ink-3); }

/* ============================================================ Location & WorkType */
.location-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 6px;
  padding: 8px 0 4px;
}
.loc-check {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.12s;
  background: var(--paper);
  user-select: none;
}
.loc-check:hover { border-color: var(--moss); background: var(--moss-soft); }
.loc-check input[type="checkbox"] { width: 13px; height: 13px; cursor: pointer; accent-color: var(--moss); }
.loc-check.checked { border-color: var(--moss); background: var(--moss-soft); color: var(--moss); font-weight: 500; }
.loc-special { border-style: dashed; }

.worktype-grid { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 0; }
.wt-check {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.12s;
  background: var(--paper);
  user-select: none;
}
.wt-check:hover { border-color: var(--moss); background: var(--moss-soft); }
.wt-check input[type="checkbox"] { width: 13px; height: 13px; cursor: pointer; accent-color: var(--moss); }
.wt-check.checked { border-color: var(--moss); background: var(--moss-soft); color: var(--moss); font-weight: 500; }

/* ============================================================ Alert Banner */
.alert-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  line-height: 1.5;
}
.alert-warning {
  background: var(--amber-soft);
  border: 1px solid oklch(85% 0.06 65);
  color: oklch(35% 0.1 65);
}
.alert-warning a { color: var(--moss); cursor: pointer; text-decoration: underline; }

/* ============================================================ Toast */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  min-width: 260px;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.22s, transform 0.22s;
  border: 1px solid transparent;
}
.toast.toast-show { opacity: 1; transform: translateY(0); }
.toast-success { background: var(--moss-soft);  border-color: var(--moss-edge);           color: var(--moss-dark); }
.toast-error   { background: var(--rust-soft);  border-color: oklch(85% 0.05 35);         color: var(--rust); }
.toast-warning { background: var(--amber-soft); border-color: oklch(85% 0.06 65);         color: oklch(38% 0.1 65); }
.toast-info    { background: var(--paper-2);    border-color: var(--line-2);              color: var(--ink-2); }
.toast-icon  { font-size: 14px; flex-shrink: 0; }
.toast-msg   { flex: 1; line-height: 1.4; }
.toast-close {
  background: none; border: none; cursor: pointer;
  font-size: 14px; color: inherit; opacity: 0.5;
  padding: 0 2px; flex-shrink: 0;
}
.toast-close:hover { opacity: 1; }

/* ============================================================ LinkedIn Section */
.li-connected-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--moss-soft);
  border: 1px solid var(--moss-edge);
  border-radius: 9px;
}
.li-connected-label { font-size: 13px; font-weight: 500; color: var(--moss-dark); flex: 1; }

.li-login-option { padding: 12px 0; }
.li-option-label { font-size: 13px; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }

.li-local-tag {
  font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 99px;
  background: var(--moss-soft); color: var(--moss); border: 1px solid var(--moss-edge);
}
.li-remote-tag {
  font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 99px;
  background: oklch(95% 0.04 275); color: oklch(45% 0.12 275); border: 1px solid oklch(85% 0.06 275);
}

.li-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 4px 0; color: var(--ink-3); font-size: 12px;
}
.li-divider::before, .li-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.li-optional-tag {
  font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 99px;
  background: var(--paper-2); color: var(--ink-3); border: 1px solid var(--line);
  vertical-align: middle; margin-left: 6px;
}
.li-info-box {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px;
}
.li-info-row { display: flex; gap: 10px; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.li-info-icon { font-size: 14px; flex-shrink: 0; margin-top: 2px; }
.li-expired-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 8px; margin-bottom: 14px;
  background: var(--rust-soft); border: 1px solid oklch(85% 0.05 35); color: var(--rust);
  font-size: 13px; font-weight: 500;
}

/* ============================================================ Source Selector (Find Jobs) */
.source-selector { display: flex; gap: 16px; padding: 4px 0; flex-wrap: wrap; }
.checkbox-label {
  display: flex; align-items: center; gap: 7px;
  cursor: pointer; user-select: none;
  font-size: 13px; color: var(--ink-2); font-weight: 500;
}
.checkbox-label input[type="checkbox"] { width: 14px; height: 14px; cursor: pointer; accent-color: var(--moss); }

/* Search controls wrapper */
#ext-search-controls {
  transition: opacity 0.2s;
}

/* ============================================================ Tab Fade Transition */
@keyframes tab-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tab-section.active {
  animation: tab-fade-in 0.18s ease forwards;
}

/* ============================================================ Visibility helpers */
.desktop-only { display: block; }
.mobile-only  { display: none; }

/* ============================================================ Mobile Bottom Nav */
#bottom-nav { display: none; }

/* ============================================================ Mobile Responsive */
@media (max-width: 768px) {
  .desktop-only { display: none !important; }
  .mobile-only  { display: block !important; }

  /* Hide sidebar, show bottom nav */
  #sidebar     { display: none; }
  #bottom-nav  { display: flex; }

  /* Full-width content with bottom padding for nav */
  #content {
    margin-left: 0;
    padding: 16px 14px 80px;
  }

  /* Page header — stack on small screens */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-bottom: 14px;
    margin-bottom: 16px;
  }
  .page-header h1 { font-size: 20px; }
  .header-actions { width: 100%; }
  .header-actions .btn { flex: 1; justify-content: center; }

  /* Stats grid: 2 columns */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* Filter bar: stack */
  .filter-row { grid-template-columns: 1fr; }
  .filter-bar  { padding: 12px !important; }

  /* Profile grid: single column */
  .profile-grid { grid-template-columns: 1fr; }

  /* Swipe area: tighter */
  .swipe-stack-wrap { height: 360px; }

  /* Modals — sheet style from bottom */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .modal {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
  }
  .modal-xl {
    max-width: 100%;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
  }

  /* Job detail: single column, status first */
  .detail-grid { grid-template-columns: 1fr; }
  .detail-side { order: -1; }

  /* Form rows: stack */
  .form-row { grid-template-columns: 1fr; }
}

/* ── Bottom Nav ─────────────────────────────────────────── */
#bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: var(--paper);
  border-top: 1px solid var(--line);
  z-index: 100;
  justify-content: space-around;
  align-items: stretch;
  padding: 0 4px;
  box-shadow: 0 -2px 12px oklch(22% 0.01 250 / 0.06);
}

.bottom-nav-item {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  padding: 6px 2px;
  border-radius: 0;
  border-left: none !important;
  margin-bottom: 0;
  font-size: 9.5px;
  color: var(--ink-3);
  text-decoration: none;
  transition: color 0.12s;
}
.bottom-nav-item svg {
  width: 18px; height: 18px;
  color: var(--ink-3);
  transition: color 0.12s;
}
.bottom-nav-item span { font-weight: 500; }
.bottom-nav-item:hover,
.bottom-nav-item.active {
  color: var(--moss);
  background: transparent !important;
  box-shadow: none !important;
}
.bottom-nav-item.active svg,
.bottom-nav-item:hover svg { color: var(--moss); }

/* ============================================================ Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-4); background-clip: padding-box; }

/* ============================================================ Policy (reused in account tab) */
.policy-section { margin-bottom: 12px; }
.policy-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.policy-section p {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.65;
}

/* ============================================================ Plan / Account Tab */
.plan-status-loading { font-size:13px; color:var(--ink-3); }

.plan-status-active {
  display: flex;
  align-items: center;
  gap: 10px;
}

.plan-free-bar {
  height: 6px;
  background: var(--line-2);
  border-radius: 3px;
  overflow: hidden;
}
.plan-free-bar-fill {
  height: 100%;
  background: var(--moss);
  border-radius: 3px;
  transition: width 0.3s;
}

.plan-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1.5px solid var(--line-2);
  border-radius: 10px;
  background: var(--paper);
  position: relative;
}
.plan-option-featured {
  border-color: var(--moss);
  background: var(--moss-soft);
}
.plan-option-badge {
  position: absolute;
  top: -9px;
  left: 12px;
  font-size: 10px;
  font-weight: 600;
  background: var(--moss);
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.plan-option-info { display:flex; flex-direction:column; gap:2px; }
.plan-option-name { font-size:13px; font-weight:600; color:var(--ink-1); }
.plan-option-desc { font-size:11px; color:var(--ink-3); }
.plan-price {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--moss-dark);
  font-family: 'JetBrains Mono', monospace;
}

/* ============================================================ Emphasis Chips */
.cl-emphasis-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.cl-emphasis-chips:empty { display: none; }
.cl-chip {
  font-size: 11px;
  font-family: inherit;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid var(--line-2);
  background: var(--paper-2);
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.12s;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cl-chip:hover {
  border-color: var(--moss-edge);
  background: var(--moss-soft);
  color: var(--moss-dark);
}

/* ============================================================ Onboarding Tutorial */
.modal-onboarding {
  max-width: 480px;
  width: 90%;
  display: flex;
  flex-direction: column;
  padding: 0;
}

.onboarding-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.onboarding-dots { display: flex; gap: 6px; align-items: center; }

.ob-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--line-2);
  transition: background 0.2s, width 0.2s, border-radius 0.2s;
}

.ob-dot.active {
  background: var(--moss);
  width: 20px;
  border-radius: 3px;
}

.onboarding-body {
  padding: 32px 28px 24px;
  min-height: 180px;
}

.ob-eyebrow {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  font-weight: 500;
  margin-bottom: 10px;
}

.ob-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 14px;
  line-height: 1.25;
}

.ob-text {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.7;
}

.onboarding-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px 20px;
  border-top: 1px solid var(--line);
}
