:root {
  --bg: #f1f0ec;
  --surface: #ffffff;
  --ink: #1d1d1b;
  --muted: #8e8e8a;
  --soft: #5f5f5b;
  --line: #e2e1dc;
  --chip: #e6e5e0;
  --accent: #f5a243;
  --radius: 12px;
  --sans: 'Inter Tight', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 140px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; }

/* ── Top bar ── */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .in { max-width: 1120px; margin: auto; padding: 18px 24px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 18px; text-decoration: none; letter-spacing: -.01em; }
.brand-mark { width: 26px; height: 16px; border: 2.5px solid var(--ink); border-radius: 3px; transform: skewX(-18deg); }
.badge { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; background: var(--chip); color: var(--soft); padding: 3px 7px; border-radius: 4px; font-weight: 500; }
.spacer { flex: 1; }

/* ── Sub bar (segmented nav) ── */
.subbar { position: sticky; top: 0; z-index: 10; background: rgba(241,240,236,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.subbar .in { max-width: 1120px; margin: auto; padding: 12px 24px; display: flex; align-items: center; gap: 16px; overflow-x: auto; }
.seg { display: inline-flex; background: var(--chip); border-radius: 10px; padding: 3px; gap: 2px; }
.seg a { text-decoration: none; font-size: 13px; padding: 7px 14px; border-radius: 8px; color: var(--soft); white-space: nowrap; transition: .15s; }
.seg a:hover { color: var(--ink); }
.seg a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06); }

/* ── Type ── */
.eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--soft); }
h1 { font-size: clamp(40px, 6vw, 60px); line-height: 1.02; letter-spacing: -.035em; font-weight: 500; margin: 14px 0 22px; }
h1 .grey, h2 .grey { color: var(--muted); display: block; }
h2 { font-size: 36px; letter-spacing: -.03em; font-weight: 500; margin: 10px 0 8px; line-height: 1.1; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
h3 .count { font-family: var(--mono); font-size: 11px; color: var(--muted); font-weight: 400; }
.lead { color: var(--soft); font-size: 16px; max-width: 520px; }

.wrap { max-width: 1120px; margin: auto; padding: 0 24px; }
.narrow { max-width: 720px; margin: auto; padding: 0 24px; }

.hero { text-align: center; padding: 80px 0 60px; }
.hero .lead { margin: 0 auto; }
.stats { display: inline-flex; gap: 28px; margin-top: 30px; font-family: var(--mono); font-size: 12px; color: var(--soft); }
.stats b { color: var(--ink); font-weight: 500; }

/* ── Directions ── */
.direction { padding: 56px 0; border-top: 1px solid var(--line); }
.direction > .head { margin-bottom: 34px; }
.structure { margin-bottom: 36px; }
.structure p.sdesc { color: var(--soft); margin: -8px 0 14px; font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; text-decoration: none; display: flex; flex-direction: column; gap: 8px; transition: border-color .15s, transform .15s, box-shadow .15s; position: relative; }
.card:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: 0 8px 24px -12px rgba(0,0,0,.18); }
.card .title { font-size: 20px; font-weight: 500; letter-spacing: -.015em; }
.card .desc { color: var(--soft); font-size: 13.5px; flex: 1; }
.card .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.card .arrow { position: absolute; top: 20px; right: 20px; color: var(--muted); transition: .15s; }
.card:hover .arrow { color: var(--ink); transform: translate(2px,-2px); }
.card.filled { opacity: .55; }
.tag { font-family: var(--mono); font-size: 11px; background: var(--bg); padding: 3px 8px; border-radius: 5px; color: var(--soft); }
.tag.ok { background: #fdf0de; color: #a8610f; }
.empty { color: var(--muted); font-size: 14px; padding: 18px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; }

/* ── Buttons & forms ── */
.btn { display: inline-flex; align-items: center; gap: 8px; font: 500 14px var(--sans); padding: 11px 18px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; transition: .15s; }
.btn:hover { border-color: var(--ink); }
.btn.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.dark:hover { background: #000; }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 7px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--soft); }
.btn.ghost:hover { color: var(--ink); }
.btn.danger:hover { border-color: #c0392b; color: #c0392b; }

label { display: block; font-size: 13.5px; font-weight: 500; margin-bottom: 6px; }
label small { color: var(--muted); font-weight: 400; }
input, textarea, select { width: 100%; font: 14px var(--sans); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px; transition: .15s; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(245,162,67,.2); }
textarea { min-height: 110px; resize: vertical; }
.field { margin-bottom: 16px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } }

/* ── Fiche de poste ── */
.back { display: inline-block; margin: 32px 0 0; font-size: 13px; color: var(--soft); text-decoration: none; }
.back:hover { color: var(--ink); }
.job-head { padding: 40px 0 28px; }
.facts { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin: 26px 0 40px; }
.fact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.fact .v { font-size: 16px; font-weight: 500; margin-top: 6px; }
@media (max-width: 640px) { .facts { grid-template-columns: 1fr; } }
.block { margin-bottom: 36px; }
.block .eyebrow { margin-bottom: 12px; }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.list li { display: flex; gap: 12px; align-items: flex-start; }
.list li .n { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #1d1d1b; font: 600 11px var(--sans); display: grid; place-items: center; margin-top: 1px; }
.list.dots li::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); margin-top: 9px; }
.divider { display: flex; align-items: center; gap: 14px; margin: 48px 0 28px; font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.note { border-left: 2px solid var(--accent); padding: 4px 0 4px 16px; color: var(--soft); margin: 18px 0; font-size: 14px; }
.thanks { text-align: center; padding: 40px 10px; }
.thanks .big { font-size: 28px; font-weight: 500; letter-spacing: -.02em; }

footer { text-align: center; padding: 60px 0 40px; font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .08em; }
footer a { color: var(--soft); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); transition: .15s; }
footer a:hover { color: var(--ink); text-decoration-color: var(--accent); }

/* ── Admin ── */
.admin-main { padding: 36px 0 80px; }
.tree-dir { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.tree-dir > .h { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.tree-dir > .h .t { font-weight: 600; font-size: 16px; flex: 1; }
.tree-str { padding: 14px 20px 14px 36px; border-bottom: 1px solid var(--line); }
.tree-str:last-child { border-bottom: 0; }
.tree-str > .h { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.tree-str > .h .t { font-weight: 500; flex: 1; }
.tree-post { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; background: var(--bg); margin-bottom: 6px; font-size: 14px; }
.tree-post .t { flex: 1; }
.inline-form { display: flex; gap: 8px; padding: 12px 20px; background: #fafaf8; }
.inline-form input { padding: 8px 11px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.ouvert { background: #4caf50; } .dot.pourvu { background: var(--muted); } .dot.brouillon { background: var(--accent); }
.flash { background: #fdf0de; border: 1px solid #f7d4a5; color: #8a4f0c; padding: 10px 14px; border-radius: 9px; margin-bottom: 20px; font-size: 14px; }
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
th { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--soft); background: #fafaf8; }
tr.unread td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.login { max-width: 380px; margin: 12vh auto; text-align: center; }
.login form { text-align: left; margin-top: 28px; }

/* ── Glisser-déposer ── */
.handle { cursor: grab; color: var(--muted); font-size: 13px; letter-spacing: -2px; padding: 2px 4px; border-radius: 4px; user-select: none; touch-action: none; }
.handle:hover { color: var(--ink); background: var(--chip); }
.handle:active { cursor: grabbing; }
.dragging { opacity: .45; outline: 2px dashed var(--accent); outline-offset: 2px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: #fff; font-size: 13px; padding: 10px 16px; border-radius: 9px; opacity: 0; transition: .25s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Responsive ── */
img, video { max-width: 100%; height: auto; }
.sub-label { font-size: 14px; color: var(--soft); white-space: nowrap; }
.grid { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.subbar .in { scrollbar-width: none; }
.subbar .in::-webkit-scrollbar { display: none; }
.tree-dir > .h, .tree-str > .h, .tree-post { flex-wrap: wrap; }
input, textarea, select { font-size: 16px; } /* évite le zoom auto sur iPhone */

@media (max-width: 860px) {
  .hero { padding: 56px 0 44px; }
  .direction { padding: 44px 0; }
  h2 { font-size: 30px; }
  .admin-main { padding: 24px 0 60px; }
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  th, td { min-width: 120px; }
}

@media (max-width: 600px) {
  body { font-size: 14.5px; }
  html { scroll-padding-top: 76px; }
  .wrap, .narrow, .topbar .in, .subbar .in { padding-left: 16px; padding-right: 16px; }
  .topbar .in { padding-top: 14px; padding-bottom: 14px; gap: 10px; flex-wrap: wrap; }
  .brand { font-size: 16px; gap: 10px; }
  .brand-mark { width: 22px; height: 14px; }
  .sub-label, .subbar .spacer { display: none; }
  .subbar .in { padding-top: 10px; padding-bottom: 10px; }
  .seg a { padding: 7px 12px; }
  .hero { padding: 44px 0 32px; }
  .lead { font-size: 15px; }
  .stats { gap: 18px; flex-wrap: wrap; justify-content: center; }
  h1 { font-size: clamp(34px, 10vw, 44px); margin: 12px 0 18px; }
  h2 { font-size: 26px; }
  .direction { padding: 36px 0; }
  .direction > .head { margin-bottom: 24px; }
  .card { padding: 18px; }
  .card .title { font-size: 18px; padding-right: 18px; }
  .job-head { padding: 28px 0 18px; }
  .facts { gap: 8px; margin: 18px 0 30px; }
  .fact { padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; }
  .fact .v { margin-top: 0; font-size: 15px; text-align: right; }
  .panel { padding: 18px; }
  .btn.dark[type="submit"], #save-btn { width: 100%; justify-content: center; }
  .divider { margin: 36px 0 22px; }
  footer { padding: 44px 16px 32px; line-height: 2; }
  /* Admin */
  .tree-dir > .h { padding: 12px 14px; }
  .tree-dir > .h .t, .tree-str > .h .t { flex-basis: calc(100% - 40px); }
  .tree-str { padding: 12px 14px 12px 20px; }
  .tree-post { padding: 8px 10px; }
  .tree-post .t { flex-basis: calc(100% - 50px); }
  .login { margin: 8vh auto; padding: 0 16px; }
}

@media (max-width: 380px) {
  .badge { display: none; }
  .card .meta .tag { font-size: 10px; }
}

@media (hover: none) {
  .card:hover { transform: none; box-shadow: none; }
  .handle { padding: 6px 8px; font-size: 15px; }
}
