/* ============================================================
   SwissJobFinder — feuille de style
   Direction : « précision helvétique ». Un poste de pilotage de
   recherche d'emploi : papier froid, encre dense, un seul rouge
   (le rouge fédéral) réservé aux actions qui comptent, et une
   signature typographique — petites capitales espacées — commune
   à l'interface ET aux documents Word générés.
   ============================================================ */

:root {
  --paper: #f2f3f1;          /* fond général, papier froid */
  --surface: #ffffff;        /* cartes et panneaux */
  --ink: #171b21;            /* texte principal */
  --muted: #5d646e;          /* texte secondaire */
  --line: #e1e3df;           /* filets */
  --line-strong: #c9ccc6;
  --red: #d8232a;            /* rouge : réservé aux états d'erreur/manque, pas à la marque */
  --red-deep: #b51d23;
  --brand: #1d5fa8;           /* bleu marine : actions primaires, accents de marque */
  --brand-deep: #154a86;
  --steel: #3d5a80;          /* liens et informations */
  --green: #1d7a4f;
  --amber: #b07a18;
  --navy: #1f3a5f;
  --navy-deep: #0e1726;      /* barre latérale */
  --navy-soft: #16243a;
  --radius: 10px;
  --shadow-1: 0 1px 2px rgba(20, 24, 30, .05);
  --shadow-2: 0 6px 24px -8px rgba(20, 24, 30, .18);
  --speed: 160ms;
}

* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(1100px 520px at 88% -12%, rgba(31, 122, 140, .07), transparent 62%),
    radial-gradient(900px 460px at -10% 108%, rgba(31, 58, 95, .06), transparent 58%),
    linear-gradient(180deg, #f4f5f3, var(--paper) 320px);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--steel); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
code { font-family: "SF Mono", Consolas, "Liberation Mono", monospace; font-size: .9em; }

::selection { background: rgba(29, 95, 168, .16); }

:focus-visible {
  outline: 2px solid var(--steel);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.hidden { display: none !important; }

/* ---------------- Coquille : barre latérale + contenu ---------------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(178deg, var(--navy-soft), var(--navy-deep) 70%);
  color: #e8edf5;
  padding: 22px 16px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; align-items: baseline; gap: 9px; padding: 0 8px 20px; }
.brand-mark {
  width: 12px; height: 12px;
  background: var(--brand);
  border-radius: 3px;
  align-self: center;
  box-shadow: 0 0 0 4px rgba(29, 95, 168, .18);
}
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: .015em; color: #fff; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-group + .nav-group { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .08); }
.nav-group-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: rgba(255, 255, 255, .38); padding: 0 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  border: none;
  background: transparent;
  color: #aebacd;
  font: inherit;
  font-size: 14px;
  text-align: left;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--speed), color var(--speed);
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active {
  background: rgba(255, 255, 255, .1);
  color: #fff;
  box-shadow: inset 2.5px 0 0 var(--brand);
}
.nav-ico { width: 18px; text-align: center; opacity: .85; }
.nav-badge {
  margin-left: auto;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 99px;
  padding: 1px 8px;
}
.nav-spin, .spin {
  width: 12px; height: 12px;
  margin-left: auto;
  border: 2px solid rgba(29, 95, 168, .3);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: rotate .8s linear infinite;
  display: inline-block;
}
.spin { margin: 0 6px 0 0; vertical-align: -1px; }
@keyframes rotate { to { transform: rotate(360deg); } }

.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 13px; }

.tuto-step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.tuto-step-num {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px;
}
.tuto-step-head h2 { margin: 0; }
.tuto-step-head h2::before { content: none; } /* pas de puce, le rond numéroté suffit */
.tuto-sub { font-size: 13.5px; color: var(--ink); margin: 10px 0 4px; font-weight: 700; }
.tuto-list { margin: 4px 0 0; padding-left: 20px; font-size: 13.5px; color: var(--muted); line-height: 1.7; }
.tuto-list li { margin-bottom: 2px; }
.tuto-list b { color: var(--ink); }
.tuto-chip-demo { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600;
  border-radius: 10px; padding: 3px 10px; border: 1px solid var(--line); margin: 2px 4px 2px 0; }
.tuto-chip-demo.ok { border-color: #bfe4d2; background: #f2faf6; color: var(--green); }
.tuto-chip-demo.tuto-empty { color: var(--muted); }
.tuto-chip-demo.locked { border-color: #ddd3f0; background: #faf8fd; color: #6b4fa8; }

.account-block {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  display: flex; align-items: center; gap: 9px;
}
.account-photo {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  object-fit: cover; background: rgba(255, 255, 255, .1);
}
.account-photo-fallback {
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, .5); font-size: 16px;
}
.account-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.account-name {
  font-size: 12.5px; font-weight: 700; color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.account-email {
  font-size: 11px; color: rgba(255, 255, 255, .5);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.account-connected {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  background: rgba(29, 122, 79, .16); color: #6fd9a6;
  border: 1px solid rgba(29, 122, 79, .4);
}
.account-connected:hover { background: rgba(29, 122, 79, .28); }
.account-dot { width: 7px; height: 7px; border-radius: 50%; background: #3fcf8e; flex: none; }

.auth-screen {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--navy-soft), var(--navy-deep) 75%);
}
.auth-card {
  width: 100%; max-width: 380px;
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  padding: 32px 28px;
  display: flex; flex-direction: column;
}
.ollama-block { padding: 4px 6px; }
.ollama-line { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: #e6edf6; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot-ok { background: #3ecf8e; box-shadow: 0 0 0 3px rgba(62, 207, 142, .18); }
.dot-warn { background: #f0b13a; box-shadow: 0 0 0 3px rgba(240, 177, 58, .18); }
.dot-err { background: #ff6b70; box-shadow: 0 0 0 3px rgba(255, 107, 112, .18); }
.dot-unknown { background: #8a97a8; }
.ollama-label {
  display: block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #93a5c0;
  margin-bottom: 4px;
}
#model-select {
  width: 100%;
  background: var(--navy-deep);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 7px;
  padding: 7px 8px;
  font: inherit;
  font-size: 13px;
}
#model-select:focus-visible { outline-color: #7da3d8; }
.ollama-hint { margin: 8px 0 0; font-size: 12px; color: #f0b13a; line-height: 1.45; }
.bench-btn {
  width: 100%;
  margin-top: 9px;
  background: transparent;
  color: #aebacd;
  border: 1px solid rgba(255, 255, 255, .22);
}
.bench-btn:hover:not(:disabled) { color: #fff; border-color: rgba(255, 255, 255, .5); }
.bench-btn:disabled { opacity: .55; cursor: wait; }

/* ---------------------------- Contenu ---------------------------- */

.content {
  flex: 1;
  min-width: 0;
  padding: 30px 38px 60px;
  max-width: 1140px;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: appear .22s ease; }
@keyframes appear { from { opacity: 0; transform: translateY(4px); } }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.page-head h1 { margin: 2px 0 0; font-size: 25px; font-weight: 700; letter-spacing: -.012em; }
.page-desc { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); max-width: 480px; }
.page-head { border-bottom: 1px solid var(--line); padding-bottom: 14px; }

/* Signature typographique : petites capitales espacées (comme dans les
   documents Word générés) */
.eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--brand);
}

.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------------------------- Boutons ---------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 15px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--speed), border-color var(--speed), color var(--speed), transform var(--speed);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
a.btn:hover { text-decoration: none; }

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-deep); }

.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover:not(:disabled) { border-color: var(--ink); }

.btn-danger-ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn-danger-ghost:hover { color: var(--red); border-color: rgba(216, 35, 42, .35); background: rgba(216, 35, 42, .04); }

.btn-small { padding: 5px 11px; font-size: 12.5px; border-radius: 7px; }

.btn-applied { background: #e7f5ee; color: var(--green); border: 1px solid #bfe4d2; }
.btn-applied:hover { background: #d8eee2; }

/* ------------------------- Champs de saisie ----------------------- */

input[type="text"], input[type="url"], input[type="file"], select, textarea {
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px 11px;
  transition: border-color var(--speed), box-shadow var(--speed);
}
textarea { width: 100%; resize: vertical; min-height: 110px; }
input[type="text"]:focus, input[type="url"]:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--steel);
  box-shadow: 0 0 0 3px rgba(61, 90, 128, .14);
}
input::placeholder { color: #9aa1ab; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.row input[type="text"], .row input[type="url"] { flex: 1; min-width: 200px; }
.row .field-col input[type="text"] { flex: none; min-width: 0; width: 100%; }

.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.check input { accent-color: var(--brand); width: 15px; height: 15px; }

.select-inline { min-width: 220px; }

/* --------------------------- Panneaux ----------------------------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 20px 22px;
  margin-bottom: 18px;
}
.panel h2 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.panel-head-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 4px; }
.panel-head-row h2 { margin: 0; }
.panel h2::before {
  content: "";
  display: inline-block;
  width: 16px; height: 3px;
  background: var(--brand);
  border-radius: 2px;
  margin-right: 9px;
  vertical-align: 3px;
}
.hint { color: var(--muted); font-size: 13px; margin: 4px 0 10px; }
.hint-block { color: var(--muted); font-size: 13px; background: var(--paper); border-radius: 8px; padding: 10px 13px; }

/* ----------------------------- Cartes ----------------------------- */

.cards { display: flex; flex-direction: column; gap: 12px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 16px 18px;
  transition: border-color var(--speed), box-shadow var(--speed), transform var(--speed);
}
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2), inset 3px 0 0 var(--steel); transform: translateY(-1px); }
.card { background: linear-gradient(180deg, #fff, #fdfdfc); }
.card.favorite { border-left: 3px solid var(--amber); }

.card-title { margin: 0 0 3px; font-size: 15.5px; font-weight: 700; line-height: 1.35; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--steel); }
.card-meta { font-size: 12.5px; color: var(--muted); }
.card-desc { font-size: 13px; color: var(--muted); margin-top: 9px; line-height: 1.5; }
.card-actions { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin-top: 11px; }

.tagrow { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--navy);
  background: #e9eef6;
  border-radius: 5px;
  padding: 2px 8px;
}

/* Tampon de score : élément signature */
.score-stamp {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--ink);
  border-bottom: 3px solid var(--brand);
  padding: 0 2px 1px;
  line-height: 1.1;
}
.score-stamp small { font-size: 11.5px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.seen-badge {
  font-size: 11px; font-weight: 700;
  color: var(--amber); background: #fdf4e3;
  border: 1px solid #f0dcae;
  border-radius: 99px; padding: 3px 10px;
}

/* Statistiques au-dessus des listes */
.stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 18px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  box-shadow: var(--shadow-1);
}
.stat b { font-size: 21px; font-weight: 800; letter-spacing: -.02em; color: var(--navy); }
.stat:first-child b { color: var(--brand); }
.stat span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }

/* États des tâches */
.job-state { display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.job-state.running, .job-state.pending { color: var(--steel); }
.job-state.error { color: var(--red); }

.st-done { color: var(--green); }
.st-error { color: var(--red); }
.st-running { color: var(--steel); }

/* Badges */
.applied-badge {
  display: inline-block;
  margin-top: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  background: #e7f5ee;
  border: 1px solid #bfe4d2;
  border-radius: 6px;
  padding: 2px 9px;
}
.doc-badge {
  display: inline-block;
  vertical-align: 2px;
  margin-right: 7px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--navy);
  background: #e9eef6;
  border: 1px solid #cdd8e8;
  border-radius: 5px;
  padding: 1px 7px;
}
.doc-badge.letter { color: #7a4f1d; background: #f7efe2; border-color: #e6d4b8; }

/* Filtres segmentés */
.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 7px 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--speed), color var(--speed);
}
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn.active { background: var(--ink); color: #fff; }
.seg-btn:hover:not(.active) { color: var(--ink); }

/* --------------------------- Sources ------------------------------ */

.sources { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.source-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 15px;
  background: var(--surface);
  flex-wrap: wrap;
}
.source-item.disabled { opacity: .55; }
.source-info .name { font-weight: 700; font-size: 14px; }
.source-info .url { font-size: 12.5px; color: var(--steel); word-break: break-all; }
.source-info .st { font-size: 12px; color: var(--muted); margin-top: 2px; }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; }

/* ------------------------ Photo / divers --------------------------- */

.photo-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.photo-preview {
  width: 80px; height: 80px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-1);
}
.photo-none { font-size: 13px; color: var(--muted); }

.status { font-size: 13px; padding: 10px 13px; border-radius: 8px; background: var(--paper); margin-top: 10px; }
.status.err { background: #fdecec; color: var(--red); }
.status.ok { background: #e7f5ee; color: var(--green); }

.empty {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  padding: 46px 20px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .45));
}
.empty::before {
  content: "···";
  display: block;
  font-size: 26px;
  letter-spacing: .35em;
  color: var(--line-strong);
  margin-bottom: 6px;
}

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 99px; padding: 3px 11px; }
.chip.match { background: #e7f5ee; border-color: #bfe4d2; color: var(--green); font-weight: 600; }
.chip.miss { background: #fdecec; border-color: #f2c6c8; color: var(--red); font-weight: 600; }
.plain-list { margin: 6px 0; padding-left: 20px; }
.plain-list li { margin: 3px 0; }

/* -------------------------- Analyses (modale) ---------------------- */

.analysis-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.analysis-title { font-size: 17px; font-weight: 700; margin: 0; }
.analysis-score { font-size: 34px; font-weight: 800; letter-spacing: -.03em; border-bottom: 4px solid var(--brand); line-height: 1.05; }
.analysis-section { margin: 16px 0 6px; }
.analysis-section h4 {
  margin: 0 0 7px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--navy);
}
.summary-block { background: var(--paper); border-radius: 8px; padding: 11px 14px; font-size: 13.5px; }

/* ----------------------------- Modale ------------------------------ */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(14, 23, 38, .5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 20px;
  z-index: 50;
}
.modal-box {
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 24px 80px -16px rgba(10, 16, 26, .45);
  max-width: 680px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  padding: 26px 28px;
  position: relative;
  animation: modal-in .18s ease;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.99); } }
.modal-close {
  position: absolute;
  top: 12px; right: 14px;
  border: none;
  background: var(--paper);
  width: 30px; height: 30px;
  border-radius: 8px;
  font-size: 17px;
  cursor: pointer;
  color: var(--muted);
}
.modal-close:hover { color: var(--ink); }
.modal-title { margin: 0 0 4px; font-size: 19px; }
.modal-sub {
  margin: 18px 0 6px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--navy);
}
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.modal-desc { font-size: 13.5px; white-space: pre-wrap; color: #343a42; line-height: 1.6; }

/* ------------------------- Contacts RH ----------------------------- */

.contacts-loading { display: flex; align-items: center; font-size: 13px; color: var(--muted); padding: 12px 0; }
.contacts-box { background: var(--paper); border-radius: 10px; padding: 13px 16px; margin: 8px 0 4px; }
.contacts-box h4 {
  margin: 10px 0 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .11em;
  color: var(--navy);
}
.contacts-box h4:first-child { margin-top: 0; }
.contact-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 4px 0; font-size: 13.5px; }
.contact-src { font-size: 11.5px; color: var(--muted); }
.contacts-notice { font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); margin: 12px 0 0; padding-top: 9px; }

/* -------------------------- Paramètres ----------------------------- */

.setting-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 9px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-of-type { border-bottom: none; }
.field-col { display: flex; flex-direction: column; gap: 6px; }
.setting-label { min-width: 220px; font-weight: 600; font-size: 13.5px; }

.swatches { display: flex; gap: 9px; flex-wrap: wrap; }
.swatch {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 2px solid transparent;
  background: var(--swatch);
  cursor: pointer;
  transition: transform var(--speed), box-shadow var(--speed);
}
.swatch:hover { transform: scale(1.08); }
.swatch.active { box-shadow: 0 0 0 2.5px var(--surface), 0 0 0 5px var(--swatch); }

.deps { display: flex; flex-direction: column; gap: 8px; }
.dep { display: flex; align-items: center; gap: 11px; font-size: 13.5px; padding: 8px 11px; border-radius: 8px; background: var(--paper); flex-wrap: wrap; }
.dep-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dep.ok .dep-dot { background: var(--green); }
.dep.ko .dep-dot { background: var(--red); }
.dep-state { margin-left: auto; color: var(--green); font-weight: 600; font-size: 12.5px; }
.dep-fix { margin-left: auto; background: #fdecec; color: var(--red); border-radius: 6px; padding: 2px 9px; font-size: 12px; }

/* ----------------------------- Toasts ------------------------------ */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-size: 13.5px;
  border-radius: 10px;
  padding: 11px 18px;
  box-shadow: var(--shadow-2);
  z-index: 99;
  max-width: min(560px, 90vw);
  animation: toast-in .2s ease;
}
.toast.err { background: var(--red-deep); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* --------------------------- Responsive ---------------------------- */

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; padding: 14px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-item { width: auto; }
  .sidebar-foot { display: none; }
  .content { padding: 20px 16px 50px; }
  .setting-label { min-width: 100%; }
}

.model-note { font-size: 11.5px; color: #8fa0ba; margin: 8px 0 0; line-height: 1.45; }

.deps-banner {
  margin: 12px 6px 0;
  background: rgba(216, 35, 42, .14);
  border: 1px solid rgba(216, 35, 42, .45);
  color: #ffd9da;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 8px;
  padding: 9px 11px;
}
.deps-banner code { color: #fff; font-size: 11px; }

/* -------------------------- Préparation ------------------------- */

.prep-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 760px) { .prep-grid { grid-template-columns: 1fr; } }

.prep-skill { margin-bottom: 11px; }
.prep-skill-head { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 4px; }
.prep-skill-head b { color: var(--red); }
.prep-bar { height: 7px; background: var(--paper); border-radius: 99px; overflow: hidden; }
.prep-bar-fill { display: block; height: 100%; border-radius: 99px; }
.prep-bar-fill.miss { background: linear-gradient(90deg, #e8757a, var(--red)); }

.prep-actions { margin: 6px 0 0; padding-left: 20px; }
.prep-actions li { margin: 7px 0; font-size: 13.5px; line-height: 1.5; }

.prep-targets { display: flex; flex-direction: column; gap: 9px; }
.prep-target { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: linear-gradient(180deg, #fff, #fdfdfc); }
.prep-target-score { width: 44px; height: 44px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 800; border-radius: 10px; }
.prep-target-score.fort { background: #e7f5ee; color: var(--green); }
.prep-target-score.moyen { background: #fdf4e3; color: var(--amber); }
.prep-target-score.faible { background: #fdecec; color: var(--red); }
.prep-target-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.prep-target-info b { font-size: 14px; }
.prep-target-info span { font-size: 12.5px; color: var(--muted); }

/* --------------------- Recherche unifiée ------------------------ */

.platform-status {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin: 14px 0 4px;
}
.pf-chip {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
  min-width: 0;
}
a.pf-chip { cursor: pointer; transition: border-color var(--speed), box-shadow var(--speed), transform var(--speed); }
a.pf-chip:hover { border-color: var(--steel); box-shadow: var(--shadow-1); transform: translateY(-1px); }
.pf-chip-name {
  font-size: 12.5px; font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pf-chip-state { font-size: 11px; font-weight: 600; display: flex; align-items: center; gap: 5px; color: var(--muted); }
.pf-chip-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: currentColor; }

.pf-chip.ok { border-color: #bfe4d2; background: #f2faf6; }
.pf-chip.ok .pf-chip-state { color: var(--green); }
.pf-chip.pf-empty .pf-chip-state { color: var(--line-strong); }
.pf-chip.locked { border-color: #ddd3f0; background: #faf8fd; }
.pf-chip.locked .pf-chip-state { color: #6b4fa8; }
.pf-chip.err { border-color: #f2c6c8; background: #fdf5f5; }
.pf-chip.err .pf-chip-state { color: var(--red); }

.deep-links { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.deep-links-label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .07em; }
.deep-link {
  font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 4px 11px;
  background: var(--surface); color: var(--steel);
  transition: border-color var(--speed);
}
.deep-link:hover { border-color: var(--steel); text-decoration: none; }

/* --------------------- Pipeline de candidature ------------------- */

.pipeline-select {
  font: inherit; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--line-strong); border-radius: 7px;
  padding: 4px 8px; background: var(--surface); color: var(--muted);
  cursor: pointer;
}
.pipeline-select.has-status { border-color: var(--steel); color: var(--ink); }

.applied-badge.pl-relance { color: var(--amber); background: #fdf4e3; border-color: #eeddb5; }
.applied-badge.pl-entretien { color: var(--steel); background: #e9eef6; border-color: #cdd8e8; }
.applied-badge.pl-offre { color: var(--green); background: #e7f5ee; border-color: #bfe4d2; }
.applied-badge.pl-refuse { color: var(--muted); background: var(--paper); border-color: var(--line); }
.applied-badge.pl-due { color: var(--red); background: #fdecec; border-color: #f2c6c8; }

.stat-due b { color: var(--red) !important; }
.stat-due { border-color: #f2c6c8; }