/* ==========================================================================
   Sama · NYC Job Search — Pink theme
   Every color / size / spacing value is a named variable below.
   ========================================================================== */

/* ---- Self-hosted fonts ---- */
@font-face { font-family: "Vazirmatn"; font-weight: 400; font-display: swap; src: url("/fonts/vazirmatn/vazirmatn-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Vazirmatn"; font-weight: 500; font-display: swap; src: url("/fonts/vazirmatn/vazirmatn-arabic-500-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Vazirmatn"; font-weight: 700; font-display: swap; src: url("/fonts/vazirmatn/vazirmatn-arabic-700-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+200C-200E, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url("/fonts/poppins/poppins-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url("/fonts/poppins/poppins-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url("/fonts/poppins/poppins-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap; src: url("/fonts/poppins/poppins-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Playfair Display"; font-weight: 700; font-style: italic; font-display: swap; src: url("/fonts/playfair/playfair-display-latin-700-italic.woff2") format("woff2"); }

:root {
  /* ---- Palette ---- */
  --pink-50:  #fff6fa;
  --pink-100: #ffe9f2;
  --pink-200: #ffd3e4;
  --pink-300: #ffadc9;
  --pink-400: #ff7fab;
  --pink-500: #f2558f;
  --pink-600: #d93a77;
  --pink-700: #b02a60;
  --plum-900: #4a1f35;     /* main text */
  --plum-600: #8a5571;     /* muted text */
  --plum-400: #b98aa2;     /* faint text */
  --lavender: #c7b3ff;
  --lavender-soft: #efe8ff;
  --peach: #ffd9c7;
  --mint: #bff0dc;
  --gold: #f4b740;
  --white: #ffffff;
  --danger: #e2466b;
  --success: #2fb67e;

  /* Status colors (pastel) */
  --status-wishlist: #d8b4fe;
  --status-applied: #ff8fb8;
  --status-screening: #b4a5ff;
  --status-interview: #ffc46b;
  --status-offer: #6ee0b0;
  --status-accepted: #2fb67e;
  --status-rejected: #c9a3b3;
  --status-withdrawn: #d9cfd4;

  /* ---- Surfaces ---- */
  --bg-base: var(--pink-50);
  --glass-bg: rgba(255, 255, 255, 0.78);
  --glass-strong: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(242, 85, 143, 0.16);
  --glass-blur: 14px;
  --gradient-primary: linear-gradient(135deg, var(--pink-400) 0%, var(--pink-600) 100%);
  --gradient-soft: linear-gradient(135deg, var(--pink-100) 0%, var(--lavender-soft) 100%);
  --gradient-brand: linear-gradient(120deg, var(--pink-500), #b26bff);

  /* ---- Typography ---- */
  --font-fa: "Vazirmatn", "Poppins", system-ui, sans-serif;
  --font-en: "Poppins", "Vazirmatn", system-ui, sans-serif;
  --font-brand: "Playfair Display", Georgia, serif;
  --fs-xs: 11px;
  --fs-sm: 12.5px;
  --fs-base: 14px;
  --fs-md: 15px;
  --fs-h2: 22px;
  --fs-h3: 15px;
  --fs-kpi: 30px;
  --fs-brand: 26px;
  --fs-brand-lg: 40px;

  /* ---- Spacing & radii ---- */
  --space-2xs: 2px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  /* ---- Layout ---- */
  --topbar-height: 68px;
  --bottom-nav-height: 64px;
  --main-max-width: 1440px;
  --main-padding-x: 28px;
  --main-padding-y: 24px;
  --job-card-min-width: 330px;
  --job-grid-gap: 16px;
  --board-column-width: 290px;
  --board-column-gap: 14px;
  --search-card-min-width: 340px;
  --settings-col-min-width: 380px;
  --kpi-min-width: 150px;
  --dash-panel-min-width: 320px;
  --bar-chart-height: 170px;
  --login-card-width: 400px;
  --dialog-width: 820px;
  --dialog-max-height: 92vh;
  --brand-mark-size: 38px;
  --chip-height: 32px;
  --switch-width: 40px;
  --switch-height: 22px;
  --score-ring-size: 46px;
  --blob-size: 520px;

  /* ---- Effects ---- */
  --shadow-sm: 0 2px 8px rgba(217, 58, 119, 0.08);
  --shadow-md: 0 10px 30px rgba(217, 58, 119, 0.12);
  --shadow-lg: 0 24px 60px rgba(176, 42, 96, 0.22);
  --ring: 0 0 0 3px rgba(242, 85, 143, 0.25);
  --t-fast: 140ms ease;
  --t-med: 240ms cubic-bezier(.2, .8, .2, 1);
}

/* ---- Base ---- */
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg-base);
  color: var(--plum-900);
  font-family: var(--font-fa);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
html[lang="en"] body { font-family: var(--font-en); }
[hidden] { display: none !important; }
a { color: var(--pink-600); }
h2 { font-size: var(--fs-h2); margin: 0; }
h3 { font-size: var(--fs-h3); margin: 0 0 var(--space-md); color: var(--plum-600); font-weight: 600; }
.mt { margin-top: var(--space-xl); }
.muted { color: var(--plum-600); margin: 0; }
.hint { color: var(--plum-400); font-size: var(--fs-sm); margin: var(--space-xs) 0 0; }
.error { color: var(--danger); min-height: 1.2em; margin: var(--space-sm) 0 0; }
.spacer { flex: 1; }
.empty { text-align: center; color: var(--plum-600); padding: var(--space-2xl) var(--space-lg); font-size: var(--fs-md); }

/* Decorative background blobs */
.bg-blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-blobs span { position: absolute; width: var(--blob-size); height: var(--blob-size); border-radius: 50%; filter: blur(70px); opacity: .55; }
.bg-blobs span:nth-child(1) { background: var(--pink-200); top: -160px; inset-inline-start: -120px; }
.bg-blobs span:nth-child(2) { background: var(--lavender-soft); top: 30%; inset-inline-end: -180px; }
.bg-blobs span:nth-child(3) { background: var(--peach); bottom: -220px; inset-inline-start: 25%; opacity: .35; }

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs);
  border: 1px solid transparent; border-radius: var(--radius-pill);
  padding: var(--space-sm) var(--space-lg);
  font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn-primary { background: var(--gradient-primary); color: var(--white); box-shadow: 0 6px 18px rgba(242, 85, 143, .35); }
.btn-primary:hover { box-shadow: 0 8px 24px rgba(242, 85, 143, .45); transform: translateY(-1px); }
.btn-soft { background: var(--pink-100); color: var(--pink-700); border-color: var(--pink-200); }
.btn-soft:hover { background: var(--pink-200); }
.btn-ghost { background: transparent; color: var(--pink-700); }
.btn-ghost:hover { background: var(--pink-100); }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(226, 70, 107, .35); }
.btn-danger:hover { background: rgba(226, 70, 107, .08); }
.btn-sm { padding: var(--space-xs) var(--space-md); font-size: var(--fs-sm); }
.btn-lg { padding: var(--space-md) var(--space-xl); font-size: var(--fs-md); }
.btn-block { width: 100%; }
.icon-btn { width: 36px; height: 36px; padding: 0; }
.btn.is-on { background: var(--gradient-primary); color: var(--white); border-color: transparent; }

.lang-btn {
  font: inherit; font-weight: 700; font-size: var(--fs-sm);
  min-width: 42px; height: 34px; border-radius: var(--radius-pill);
  border: 1px solid var(--pink-200); background: var(--white); color: var(--pink-600); cursor: pointer;
}
.lang-btn:hover { background: var(--pink-100); }

/* ---- Inputs ---- */
input, select, textarea {
  width: 100%;
  background: var(--glass-strong);
  color: var(--plum-900);
  border: 1px solid var(--pink-200);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  font: inherit;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pink-400); box-shadow: var(--ring); }
input[type="range"] { padding: 0; border: 0; background: transparent; accent-color: var(--pink-500); box-shadow: none; }
input[type="checkbox"] { width: auto; accent-color: var(--pink-500); }
.field { display: flex; flex-direction: column; gap: var(--space-xs); }
.field > span { color: var(--plum-600); font-size: var(--fs-sm); font-weight: 500; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
.field-wide { grid-column: 1 / -1; }
.field-switch { grid-column: 1 / -1; }

/* Toggle switch */
.switch { display: inline-flex; align-items: center; gap: var(--space-sm); cursor: pointer; font-size: var(--fs-sm); color: var(--plum-600); user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: relative; flex: none; width: var(--switch-width); height: var(--switch-height);
  background: var(--pink-200); border-radius: var(--radius-pill); transition: background var(--t-fast);
}
.switch .slider::after {
  content: ""; position: absolute; top: 3px; inset-inline-start: 3px;
  width: calc(var(--switch-height) - 6px); height: calc(var(--switch-height) - 6px);
  background: var(--white); border-radius: 50%; box-shadow: var(--shadow-sm); transition: transform var(--t-fast);
}
.switch input:checked + .slider { background: var(--pink-500); }
.switch input:checked + .slider::after { transform: translateX(calc(var(--switch-width) - var(--switch-height))); }
html[dir="rtl"] .switch input:checked + .slider::after { transform: translateX(calc(-1 * (var(--switch-width) - var(--switch-height)))); }
.switch input:focus-visible + .slider { box-shadow: var(--ring); }

/* ---- Brand ---- */
.brand { display: flex; align-items: center; gap: var(--space-sm); direction: ltr; }
.brand-mark {
  width: var(--brand-mark-size); height: var(--brand-mark-size); display: grid; place-items: center;
  background: var(--gradient-primary); color: var(--white); border-radius: 12px;
  font-family: var(--font-brand); font-style: italic; font-weight: 700; font-size: 22px; box-shadow: var(--shadow-sm);
}
.brand-name {
  font-family: var(--font-brand); font-style: italic; font-weight: 700; font-size: var(--fs-brand);
  background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-sub { color: var(--plum-400); font-size: var(--fs-sm); font-family: var(--font-fa); direction: rtl; }
html[lang="en"] .brand-sub { direction: ltr; font-family: var(--font-en); }
.brand-lg .brand-name { font-size: var(--fs-brand-lg); }
.brand-lg .brand-mark { width: 52px; height: 52px; font-size: 30px; }
.sparkle { font-size: 22px; }

/* ---- Login ---- */
.login-view { min-height: 100vh; display: grid; place-items: center; padding: var(--space-lg); }
.login-card {
  position: relative; width: 100%; max-width: var(--login-card-width);
  border-radius: var(--radius-lg); padding: var(--space-2xl) var(--space-xl);
  display: flex; flex-direction: column; gap: var(--space-md); box-shadow: var(--shadow-lg); text-align: center;
}
.login-card .brand { justify-content: center; }
.login-card .field { text-align: start; }
.login-title { margin: var(--space-sm) 0 0; font-size: 20px; }
.login-lang { position: absolute; top: var(--space-md); inset-inline-end: var(--space-md); }

/* ---- Top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-height);
  display: flex; align-items: center; gap: var(--space-xl);
  padding: 0 var(--main-padding-x);
  border-width: 0 0 1px; box-shadow: var(--shadow-sm);
}
.tabs { display: flex; gap: var(--space-xs); }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: var(--space-xs);
  background: transparent; border: 0; color: var(--plum-600);
  padding: var(--space-sm) var(--space-md); border-radius: var(--radius-pill);
  font: inherit; font-weight: 500; cursor: pointer; transition: background var(--t-fast), color var(--t-fast);
}
.tab:hover { background: var(--pink-100); color: var(--pink-700); }
.tab.active { background: var(--gradient-primary); color: var(--white); box-shadow: 0 4px 14px rgba(242, 85, 143, .35); }
.tab-ico { font-size: 15px; }
.topbar-actions { margin-inline-start: auto; display: flex; align-items: center; gap: var(--space-sm); }

.badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  background: var(--pink-600); color: var(--white); border-radius: var(--radius-pill);
  font-size: var(--fs-xs); font-weight: 700; line-height: 1;
}
.tab.active .badge { background: var(--white); color: var(--pink-600); }
.badge.dot { position: absolute; top: 6px; inset-inline-end: 18%; min-width: 16px; height: 16px; font-size: 10px; }

/* ---- Main ---- */
.main {
  max-width: var(--main-max-width); margin: 0 auto;
  padding: var(--main-padding-y) var(--main-padding-x) calc(var(--main-padding-y) * 2);
}
.panel { border-radius: var(--radius-lg); padding: var(--space-xl); box-shadow: var(--shadow-md); }

/* Segmented control */
.segmented {
  display: inline-flex; flex-wrap: wrap; gap: var(--space-xs); padding: var(--space-xs);
  background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm); margin-bottom: var(--space-lg);
}
.segmented button {
  display: inline-flex; align-items: center; gap: var(--space-xs);
  border: 0; background: transparent; color: var(--plum-600); font: inherit; font-weight: 500;
  padding: var(--space-sm) var(--space-lg); border-radius: var(--radius-pill); cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.segmented button:hover { color: var(--pink-700); }
.segmented button.active { background: var(--gradient-primary); color: var(--white); }
.segmented button.active .badge { background: var(--white); color: var(--pink-600); }

/* ---- Search panel ---- */
.search-panel { margin-bottom: var(--space-xl); display: flex; flex-direction: column; gap: var(--space-lg); }
.form-block { display: flex; flex-direction: column; gap: var(--space-sm); }
.block-head { display: flex; align-items: center; gap: var(--space-md); flex-wrap: wrap; }
.block-title { font-weight: 700; font-size: var(--fs-md); }
.block-head .btn { margin-inline-start: auto; }
.options-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-lg) var(--space-xl); }
.opt { display: flex; flex-direction: column; gap: var(--space-xs); font-size: var(--fs-sm); color: var(--plum-600); min-width: 170px; }
.opt select { min-width: 150px; }
.actions-row { display: flex; gap: var(--space-sm); flex-wrap: wrap; align-items: center; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-sm); }
.chip {
  display: inline-flex; align-items: center; gap: var(--space-xs);
  height: var(--chip-height); padding: 0 var(--space-md);
  background: var(--white); color: var(--plum-900); border: 1px solid var(--pink-200);
  border-radius: var(--radius-pill); font: inherit; font-size: var(--fs-sm); cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.chip:hover { border-color: var(--pink-400); transform: translateY(-1px); }
.chip.on { background: var(--gradient-primary); color: var(--white); border-color: transparent; }
.chip.neg { background: var(--lavender-soft); border-color: var(--lavender); color: #5b3fa8; }
.chip .x { border: 0; background: none; color: inherit; cursor: pointer; font-size: 14px; padding: 0; opacity: .8; }
.chip-static { cursor: default; }
.chip-static:hover { transform: none; border-color: var(--pink-200); }
.suggestions .chip { border-style: dashed; }

.chip-input {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs);
  min-height: 46px; padding: var(--space-xs) var(--space-sm);
  background: var(--glass-strong); border: 1px solid var(--pink-200); border-radius: var(--radius-md);
}
.chip-input:focus-within { border-color: var(--pink-400); box-shadow: var(--ring); }
.chip-input input { flex: 1; min-width: 160px; border: 0; background: transparent; box-shadow: none; padding: var(--space-xs); }
.chip-input input:focus { box-shadow: none; }

/* Area picker */
.area-picker { display: flex; flex-direction: column; gap: var(--space-md); }
.area-tools { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.area-tools input { flex: 1; min-width: 180px; }
.area-tools .btn { flex: none; }
.borough-group { background: var(--gradient-soft); border-radius: var(--radius-md); padding: var(--space-md); }
.borough-head { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-sm); font-weight: 700; color: var(--pink-700); }
.borough-head .chip { margin-inline-start: auto; }
.area-selected { display: flex; flex-wrap: wrap; gap: var(--space-xs); }

/* Source status */
.source-status { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.src-pill { font-size: var(--fs-xs); padding: 2px var(--space-sm); border-radius: var(--radius-pill); background: var(--mint); color: #11603f; }
.src-pill.err { background: #ffe0e6; color: var(--danger); }
.src-pill.off { background: #f1e9ee; color: var(--plum-400); }
.deep-links { display: flex; flex-direction: column; gap: var(--space-sm); }
.deep-links a.chip { text-decoration: none; }

/* ---- Feed ---- */
.feed-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-lg); }
.feed-count { font-weight: 700; color: var(--pink-700); margin-inline-end: auto; }
.feed-filter { max-width: 260px; }
.feed-toolbar select { width: auto; }
.loading { text-align: center; padding: var(--space-2xl); color: var(--pink-700); font-weight: 500; }
.heart-spin { display: inline-block; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.3); } }

.job-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--job-card-min-width), 1fr)); gap: var(--job-grid-gap); }
.job-card {
  position: relative; display: flex; flex-direction: column; gap: var(--space-sm);
  background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
  padding: var(--space-lg); box-shadow: var(--shadow-sm);
  transition: transform var(--t-med), box-shadow var(--t-med);
  animation: rise var(--t-med) both;
}
.job-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.job-card.is-new::before {
  content: ""; position: absolute; inset-block-start: 16px; inset-inline-start: 0; width: 4px; height: 28px;
  border-radius: 0 4px 4px 0; background: var(--gradient-primary);
}
html[dir="rtl"] .job-card.is-new::before { border-radius: 4px 0 0 4px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.job-top { display: flex; gap: var(--space-md); align-items: flex-start; }
.job-head { flex: 1; min-width: 0; }
.job-title { margin: 0; font-size: var(--fs-md); font-weight: 700; line-height: 1.35; cursor: pointer; direction: ltr; text-align: start; unicode-bidi: plaintext; }
.job-title:hover { color: var(--pink-600); }
.job-company { color: var(--plum-600); font-size: var(--fs-sm); unicode-bidi: plaintext; }
.score-ring {
  flex: none; width: var(--score-ring-size); height: var(--score-ring-size); border-radius: 50%;
  display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 700; color: var(--pink-700);
  background: var(--pink-100); border: 3px solid var(--pink-200);
}
.score-ring.high { background: var(--pink-500); color: var(--white); border-color: var(--pink-300); }
.score-ring.mid { background: var(--pink-200); border-color: var(--pink-100); }
.job-tags { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.tag { font-size: var(--fs-xs); padding: 2px var(--space-sm); border-radius: var(--radius-pill); background: var(--pink-100); color: var(--pink-700); white-space: nowrap; }
.tag.area { background: var(--lavender-soft); color: #5b3fa8; }
.tag.money { background: #e7f8f0; color: #11603f; }
.tag.time { background: #fff3df; color: #8a5a00; }
.tag.src { background: #f4eef1; color: var(--plum-600); }
.tag.state { background: var(--gradient-primary); color: var(--white); }
.job-snippet { margin: 0; color: var(--plum-600); font-size: var(--fs-sm); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; direction: ltr; text-align: start; unicode-bidi: plaintext; }
.ai-reason { font-size: var(--fs-sm); background: var(--gradient-soft); border-radius: var(--radius-sm); padding: var(--space-xs) var(--space-sm); color: var(--plum-900); }
.job-actions { display: flex; gap: var(--space-xs); flex-wrap: wrap; margin-top: auto; padding-top: var(--space-xs); }
.job-actions .btn { padding: var(--space-xs) var(--space-md); font-size: var(--fs-sm); }
.apply-prompt { display: flex; gap: var(--space-xs); align-items: center; flex-wrap: wrap; background: var(--pink-100); border-radius: var(--radius-sm); padding: var(--space-sm); font-size: var(--fs-sm); }

/* ---- Saved searches ---- */
.section-head { display: flex; gap: var(--space-lg); align-items: flex-start; flex-wrap: wrap; margin-bottom: var(--space-sm); }
.section-head > div:first-child { flex: 1; min-width: 240px; }
.section-actions { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.search-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--search-card-min-width), 1fr)); gap: var(--job-grid-gap); margin-top: var(--space-lg); }
.search-card { display: flex; flex-direction: column; gap: var(--space-sm); border-radius: var(--radius-lg); padding: var(--space-lg); box-shadow: var(--shadow-sm); }
.search-card.inactive { opacity: .6; }
.search-card-head { display: flex; align-items: center; gap: var(--space-sm); }
.search-card-head h4 { margin: 0; font-size: var(--fs-md); flex: 1; }
.search-stats { display: flex; gap: var(--space-sm); flex-wrap: wrap; font-size: var(--fs-sm); color: var(--plum-600); }
.search-card .actions-row .btn { padding: var(--space-xs) var(--space-md); font-size: var(--fs-sm); }

/* ---- Tracker ---- */
.tracker-head { display: flex; gap: var(--space-md); align-items: center; flex-wrap: wrap; margin-bottom: var(--space-sm); }
.tracker-head .segmented { margin-bottom: 0; }
.tracker-head select { width: auto; }
.board {
  display: grid; grid-auto-flow: column; grid-auto-columns: var(--board-column-width);
  gap: var(--board-column-gap); overflow-x: auto; padding: var(--space-sm) 0 var(--space-lg);
  min-height: calc(100vh - var(--topbar-height) - 160px);
}
.column { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); display: flex; flex-direction: column; min-height: 0; }
.column-head { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-md) var(--space-lg); font-weight: 700; }
.column-head .count { margin-inline-start: auto; background: var(--white); color: var(--plum-600); border-radius: var(--radius-pill); padding: 0 var(--space-sm); font-size: var(--fs-xs); }
.column-body { padding: var(--space-sm); display: flex; flex-direction: column; gap: var(--space-sm); flex: 1; min-height: 90px; }
.column.drag-over { border-color: var(--pink-400); box-shadow: var(--ring); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.card {
  background: var(--white); border: 1px solid var(--pink-100); border-radius: var(--radius-md);
  padding: var(--space-md); cursor: grab; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: var(--space-2xs); transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card.dragging { opacity: .5; }
.card-company { font-weight: 700; unicode-bidi: plaintext; }
.card-role { color: var(--plum-600); font-size: var(--fs-sm); unicode-bidi: plaintext; }
.card-meta { display: flex; flex-wrap: wrap; gap: var(--space-sm); font-size: var(--fs-xs); color: var(--plum-400); }
.card-next { font-size: var(--fs-xs); color: var(--pink-700); }
.card-next.overdue { color: var(--danger); font-weight: 700; }
.stars { color: var(--gold); letter-spacing: 1px; }

.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: var(--space-md); text-align: start; border-bottom: 1px solid var(--pink-100); white-space: nowrap; }
.table th { color: var(--plum-600); font-weight: 600; font-size: var(--fs-sm); cursor: pointer; user-select: none; background: var(--pink-50); }
.table th.sorted-asc::after { content: " ▲"; }
.table th.sorted-desc::after { content: " ▼"; }
.table tbody tr { cursor: pointer; transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--pink-50); }
.table-count { padding: var(--space-sm) var(--space-md); }
.pill { display: inline-flex; align-items: center; gap: var(--space-xs); padding: 2px var(--space-sm); border-radius: var(--radius-pill); background: var(--pink-50); font-size: var(--fs-sm); }

/* ---- Dashboard ---- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(var(--kpi-min-width), 1fr)); gap: var(--space-md); margin-bottom: var(--space-lg); }
.kpi { background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); padding: var(--space-lg); box-shadow: var(--shadow-sm); }
.kpi-value { font-size: var(--fs-kpi); font-weight: 700; background: var(--gradient-brand); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1.2; }
.kpi-label { color: var(--plum-600); font-size: var(--fs-sm); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(var(--dash-panel-min-width), 1fr)); gap: var(--space-md); }
.panel-wide { grid-column: span 2; }
.bar-chart { display: flex; align-items: flex-end; gap: var(--space-sm); height: var(--bar-chart-height); direction: ltr; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: var(--space-xs); height: 100%; justify-content: flex-end; }
.bar { width: 100%; background: var(--gradient-primary); border-radius: 8px 8px 3px 3px; min-height: 3px; }
.bar-val { font-size: var(--fs-sm); font-weight: 600; color: var(--pink-700); }
.bar-label { font-size: var(--fs-xs); color: var(--plum-400); white-space: nowrap; }
.pipeline { display: flex; flex-direction: column; gap: var(--space-sm); }
.pipe-row { display: grid; grid-template-columns: 100px 1fr 32px; align-items: center; gap: var(--space-sm); }
.pipe-track { background: var(--pink-100); border-radius: var(--radius-pill); height: 10px; overflow: hidden; }
.pipe-fill { height: 100%; border-radius: var(--radius-pill); }
.upcoming, .sources, .timeline, .sources-list, .companies-list { list-style: none; margin: 0; padding: 0; }
.upcoming li, .sources li { display: flex; gap: var(--space-md); align-items: center; padding: var(--space-sm) 0; border-bottom: 1px dashed var(--pink-200); }
.upcoming li:last-child, .sources li:last-child { border-bottom: 0; }
.upcoming .date { min-width: 100px; font-variant-numeric: tabular-nums; color: var(--plum-600); }
.upcoming .overdue { color: var(--danger); font-weight: 700; }
.upcoming button { all: unset; cursor: pointer; font-weight: 500; unicode-bidi: plaintext; }
.upcoming button:hover { color: var(--pink-600); }
.sources .count { margin-inline-start: auto; color: var(--plum-600); }

/* ---- Settings ---- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(var(--settings-col-min-width), 1fr)); gap: var(--space-lg); }
.settings-grid .segmented { margin-bottom: 0; }
.settings-save { position: sticky; bottom: var(--space-lg); display: flex; justify-content: center; margin-top: var(--space-xl); }
.status-line { margin: var(--space-sm) 0; font-size: var(--fs-sm); font-weight: 500; }
.sources-list li, .companies-list li {
  display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap;
  padding: var(--space-sm) 0; border-bottom: 1px dashed var(--pink-200); font-size: var(--fs-sm);
}
.sources-list li:last-child, .companies-list li:last-child { border-bottom: 0; }
.sources-list .src-name { font-weight: 600; flex: 1; min-width: 180px; }
.companies-list .co-name { font-weight: 600; flex: 1; }
.companies-list code { background: var(--pink-50); padding: 1px 6px; border-radius: 6px; }
.company-add { display: grid; grid-template-columns: 120px 1fr 1fr auto; gap: var(--space-sm); margin-top: var(--space-md); }
.actions-row.wrap { flex-wrap: wrap; }

/* ---- Dialogs ---- */
.dialog {
  width: min(var(--dialog-width), 96vw); max-height: var(--dialog-max-height); padding: 0;
  border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
  background: var(--white); color: var(--plum-900); box-shadow: var(--shadow-lg);
}
.dialog::backdrop { background: rgba(74, 31, 53, .35); backdrop-filter: blur(4px); }
.dialog-body { padding: var(--space-xl); display: flex; flex-direction: column; gap: var(--space-lg); }
.dialog-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-md);
  position: sticky; top: calc(-1 * var(--space-xl)); z-index: 2;
  margin: calc(-1 * var(--space-xl)) calc(-1 * var(--space-xl)) 0;
  padding: var(--space-lg) var(--space-xl); background: var(--gradient-soft); border-bottom: 1px solid var(--pink-100);
}
.dialog-head h2 { font-size: 18px; unicode-bidi: plaintext; }
.dialog-foot { display: flex; gap: var(--space-sm); align-items: center; flex-wrap: wrap; }
.job-meta { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.job-desc { white-space: pre-wrap; line-height: 1.7; font-size: var(--fs-base); color: var(--plum-900); max-height: 50vh; overflow-y: auto; background: var(--pink-50); border-radius: var(--radius-md); padding: var(--space-lg); unicode-bidi: plaintext; }

.timeline-section h3 { margin-bottom: var(--space-sm); }
.timeline-add { display: grid; grid-template-columns: 130px 150px 1fr auto; gap: var(--space-sm); margin-bottom: var(--space-md); }
.timeline li { display: grid; grid-template-columns: 90px 80px 1fr auto; gap: var(--space-sm); padding: var(--space-sm) 0; border-bottom: 1px dashed var(--pink-200); align-items: start; }
.timeline .ev-type { color: var(--pink-600); font-size: var(--fs-sm); }
.timeline .ev-body { white-space: pre-wrap; word-break: break-word; unicode-bidi: plaintext; }
.timeline .ev-del { all: unset; cursor: pointer; color: var(--plum-400); padding: 0 var(--space-xs); }
.timeline .ev-del:hover { color: var(--danger); }

/* ---- Toast ---- */
.toast {
  position: fixed; bottom: calc(var(--space-xl) + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  background: var(--plum-900); color: var(--white); padding: var(--space-sm) var(--space-xl);
  border-radius: var(--radius-pill); box-shadow: var(--shadow-lg); z-index: 100; font-weight: 500;
}

/* ---- Status color classes (CSP-safe: no inline styles) ---- */
.s-wishlist  { background: var(--status-wishlist); }
.s-applied   { background: var(--status-applied); }
.s-screening { background: var(--status-screening); }
.s-interview { background: var(--status-interview); }
.s-offer     { background: var(--status-offer); }
.s-accepted  { background: var(--status-accepted); }
.s-rejected  { background: var(--status-rejected); }
.s-withdrawn { background: var(--status-withdrawn); }

/* ---- Bottom nav (mobile) ---- */
.bottom-nav { display: none; }

@media (max-width: 900px) {
  .tabs { display: none; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    border-width: 1px 0 0; box-shadow: 0 -6px 24px rgba(217, 58, 119, .1);
  }
  .bottom-nav button {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    border: 0; background: none; font: inherit; color: var(--plum-600); cursor: pointer; font-size: 18px;
  }
  .bottom-nav small { font-size: 10px; }
  .bottom-nav button.active { color: var(--pink-600); }
  .bottom-nav button.active small { font-weight: 700; }
  .main { padding: var(--space-lg) var(--space-md) calc(var(--bottom-nav-height) + var(--space-2xl)); }
  .topbar { padding: 0 var(--space-md); gap: var(--space-sm); }
  .toast { bottom: calc(var(--bottom-nav-height) + var(--space-lg)); }
  .settings-save { bottom: calc(var(--bottom-nav-height) + var(--space-md)); }
}

@media (max-width: 640px) {
  :root { --job-card-min-width: 100%; --search-card-min-width: 100%; --settings-col-min-width: 100%; --dash-panel-min-width: 100%; }
  .brand-sub { display: none; }
  #add-btn { padding: var(--space-xs) var(--space-md); font-size: var(--fs-sm); }
  .panel { padding: var(--space-lg); }
  .form-grid { grid-template-columns: 1fr; }
  .panel-wide { grid-column: auto; }
  .segmented { display: flex; overflow-x: auto; flex-wrap: nowrap; border-radius: var(--radius-md); }
  .segmented button { padding: var(--space-sm) var(--space-md); white-space: nowrap; }
  .feed-filter { max-width: none; flex: 1; }
  .timeline-add { grid-template-columns: 1fr 1fr; }
  .timeline-add #event-body { grid-column: 1 / -1; }
  .timeline li { grid-template-columns: 80px 1fr auto; }
  .timeline .ev-type { display: none; }
  .company-add { grid-template-columns: 1fr 1fr; }
  .dialog-body { padding: var(--space-lg); }
  .dialog-head { margin: calc(-1 * var(--space-lg)) calc(-1 * var(--space-lg)) 0; padding: var(--space-md) var(--space-lg); top: calc(-1 * var(--space-lg)); }
  .opt { min-width: 140px; flex: 1; }
}

/* ---- Diagnostics & warnings ---- */
.mt-sm { margin-top: var(--space-md); }
.diag-input { max-width: 200px; }
.diag-sample { width: 100%; color: var(--plum-600); font-size: var(--fs-xs); direction: ltr; text-align: start; }
.warn-line { background: #fff3df; color: #8a5a00; border-radius: var(--radius-sm); padding: var(--space-xs) var(--space-sm); font-size: var(--fs-sm); }

/* ---- Entry-level categories ---- */
.tag.cat-A { background: #dcf7ea; color: #0f6a43; font-weight: 700; }
.tag.cat-B { background: #fff1d6; color: #8a5a00; font-weight: 700; }
.tag.cat-C { background: #fde2e8; color: #a3264a; font-weight: 700; }
.tag.train { background: var(--gradient-soft); color: var(--pink-700); font-weight: 600; }
.tag.warn { background: #fde2e8; color: var(--danger); }
.ready-queries { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-sm); }
.ready-q { display: flex; flex-direction: column; gap: var(--space-xs); background: var(--gradient-soft); border-radius: var(--radius-md); padding: var(--space-sm) var(--space-md); }
.ready-q b { direction: ltr; text-align: start; unicode-bidi: plaintext; font-size: var(--fs-sm); }
.ready-q .chips a { text-decoration: none; height: 26px; font-size: var(--fs-xs); }
#feed-cat { width: auto; }
.switch.mt-sm { margin-top: var(--space-md); }
