/* 4sur4 — identité : trois flèches de couleur qui convergent vers un point ; logotype manuscrit monochrome en Kalam (assets/wordmark.svg). */
:root {
  --ink: #1E1B4B;
  --coral: #FF6B4A;
  --teal: #14B8A6;
  --violet: #6D5DF6;
  --primary: #5847D8;
  --primary-dark: #4636BF;
  --primary-soft: #EEEBFF;
  --bg: #F7F6FB;
  --card: #ffffff;
  --text: #1E1B4B;
  --muted: #6B6A85;
  --line: #E4E2EF;
  --ok: #0E8F7E;
  --ok-soft: #E2F6F3;
  --warn: #C2570C;
  --warn-soft: #FFF1E8;
  --danger: #C8341C;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(30, 27, 75, .05), 0 2px 8px rgba(30, 27, 75, .06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
body.busy { cursor: progress; }
a { color: var(--primary); }
h1 { font-size: 1.6rem; margin: 0 0 .3rem; line-height: 1.25; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 0 0 .8rem; }
h3 { font-size: 1rem; margin: 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 20px 16px 40px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); font-weight: 600; }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }
.inline { display: flex; gap: 8px; align-items: center; }
.inline input { flex: 1; min-width: 0; }
.full { width: 100%; }

/* ---- logotype (SVG monochrome) */
.wordmark { display: inline-block; height: 26px; width: auto; vertical-align: middle; }
.wordmark.small { height: 20px; }
.hero-lockup { display: block; height: clamp(72px, 13vw, 116px); width: auto; margin: 0 auto; }
.slogan { font-size: clamp(1.25rem, 3vw, 1.6rem); font-weight: 700; color: var(--ink); margin: 14px 0 6px; letter-spacing: -.01em; }

/* ---- bandeau */
.topbar { position: sticky; top: 0; z-index: 1000; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 16px; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand .wordmark { height: 28px; }
.topbar-trip { flex: 1; min-width: 0; }
.trip-name { font-weight: 600; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.topbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.whoami { font-size: .9rem; white-space: nowrap; }
.deadline { font-size: .82rem; padding: 4px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); white-space: nowrap; }
.deadline.late { background: #FDECEA; color: var(--danger); font-weight: 700; }
.deadline.done { background: var(--ok-soft); color: var(--ok); }
.footer { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: center; color: var(--muted); font-size: .85rem; padding-bottom: 30px; }

/* ---- composants */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px; min-width: 0; }
.card.narrow { max-width: 680px; margin-left: auto; margin-right: auto; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: .8rem; }
.card-head h2 { margin: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: #C9C5DD; background: #FBFAFE; }
.btn:disabled { opacity: .4; cursor: default; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--danger); }
.btn-small { padding: 5px 10px; font-size: .85rem; }
.btn-tiny { padding: 1px 7px; font-size: .8rem; }
.btn-lg { padding: 12px 20px; font-size: 1.02rem; }
.btn.on { background: var(--primary-soft); border-color: var(--primary); }
.link { font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .74rem; font-weight: 700; background: #EFEEF5; color: #4B4A66; vertical-align: middle; }
.badge.org { background: #FFF1D6; color: #8A5300; }
.badge.new { background: var(--primary-soft); color: var(--primary-dark); }
.badge.stale { background: #EEEDF2; color: #75738C; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.tag { display: inline-block; padding: 0 8px; border-radius: 999px; font-size: .75rem; background: #F1F0F6; color: #4B4A66; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 12px; font: inherit; font-size: .85rem; cursor: pointer; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.banner { border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; }
.banner ul { margin: 6px 0; padding-left: 20px; }
.banner.warn { background: var(--warn-soft); border: 1px solid #F7C4A3; color: #7A3A06; }
.banner.ok, .banner.info { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.banner.ok { background: var(--ok-soft); border: 1px solid #A6DDD5; }
.banner.info { background: var(--primary-soft); border: 1px solid #D3CCFF; }
.hint { background: var(--primary-soft); padding: 10px 12px; border-radius: 10px; font-size: .9rem; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 3000; max-width: min(560px, calc(100vw - 32px)); padding: 10px 16px; border-radius: 12px; background: var(--ink); color: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.2); }
.toast.error { background: var(--danger); }
.toast.ok { background: var(--ok); }
.error-page { max-width: 560px; margin: 40px auto; text-align: center; }

/* ---- formulaires */
.form { display: flex; flex-direction: column; gap: 14px; }
.form label, .city-field > label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .9rem; }
input, select, textarea { font: inherit; color: inherit; }
.form input:not([type=checkbox]), .form select, .deadlines input, .modal input, .modal textarea, .quick-add input, .share input {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-weight: 400; width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 3px solid var(--primary-soft); border-color: var(--primary); }
textarea { resize: vertical; line-height: 1.45; }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0; min-width: 0; }
legend { font-weight: 700; font-size: .9rem; padding: 0 4px; }
.row2, .row3 { display: grid; gap: 10px; }
.row2 { grid-template-columns: 1fr 1fr; }
.row3 { grid-template-columns: repeat(3, 1fr); }
.form label.check, label.check { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; cursor: pointer; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.suffix { position: relative; }
.suffix span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 400; }
.dl-details summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.dl-details[open] summary { margin-bottom: 6px; }

/* ---- sélecteur de période */
.rp-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.rp-summary { text-align: center; font-size: .9rem; }
.rp-months { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.month-name { text-align: center; font-weight: 700; text-transform: capitalize; margin-bottom: 4px; font-size: .9rem; }
.dow, .days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.dow span { font-size: .72rem; color: var(--muted); font-weight: 700; }
.day { border: 0; background: none; font: inherit; font-size: .85rem; padding: 7px 0; border-radius: 8px; cursor: pointer; color: var(--text); }
.day:hover:not(:disabled) { background: var(--primary-soft); }
.day.past { color: #C4C2D4; cursor: default; }
.day.today { font-weight: 800; text-decoration: underline; }
.day.in { background: var(--primary-soft); border-radius: 0; }
.day.edge { background: var(--primary); color: #fff; font-weight: 700; }

/* ---- accueil */
.hero { text-align: center; padding: 34px 0 18px; }
.hero-title { margin: 0 0 .4rem; }
.hero .lead { font-size: 1.1rem; color: var(--muted); max-width: 640px; margin: 0 auto 1.2rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 40px; margin: 28px auto 0; }
.stats div { display: flex; flex-direction: column; align-items: center; }
.stats b { font-size: 1.7rem; color: var(--ink); line-height: 1.1; }
.stats span { font-size: .85rem; color: var(--muted); }
.how { padding: 20px 0 10px; }
.how h2 { text-align: center; font-size: 1.4rem; margin-bottom: 18px; }
.how-steps { list-style: none; padding: 0; margin: 0 0 26px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.how-steps li { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 18px 18px; box-shadow: var(--shadow); }
.how-icon svg { width: 52px; height: 52px; display: block; margin-bottom: 8px; }
.how-num { position: absolute; top: 14px; right: 16px; font-size: 2rem; font-weight: 800; color: #E4E1F5; line-height: 1; }
.how-steps h3 { margin-bottom: 6px; font-size: 1.05rem; }
.how-steps p { margin: 0; color: var(--muted); font-size: .92rem; }

/* ---- séjour */
.trip-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.share { display: flex; flex-direction: column; gap: 2px; min-width: 0; width: min(420px, 100%); }
.share input { border-style: dashed; font-size: .8rem; padding: 6px 8px; }
.grid2 { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.people { list-style: none; margin: 0 0 12px; padding: 0; }
.person { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.person.me { background: linear-gradient(90deg, var(--primary-soft), transparent 70%); border-radius: 10px; padding-left: 6px; }
.person-main { display: flex; gap: 10px; align-items: center; min-width: 0; }
.person-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; text-transform: uppercase; }
.quick-add { margin-top: 4px; }
.deadlines { margin-top: 14px; }
.deadlines h3 { margin-bottom: 2px; }
.deadlines p { margin: 0 0 8px; }
.deadlines label { display: flex; flex-direction: column; font-size: .82rem; font-weight: 600; gap: 4px; }
.deadlines .btn { margin-top: 8px; }
.dl { display: flex; flex-direction: column; font-size: .85rem; }
.dl.late b { color: var(--danger); }

/* ---- étapes */
.stepper-card { padding: 14px 18px; }
.stepper { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; counter-reset: s; }
.stepper li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: #FBFAFE; }
.stepper li div { display: flex; flex-direction: column; min-width: 0; }
.stepper .dot { flex: none; width: 30px; height: 30px; border-radius: 50%; background: #D7D4E6; color: #fff; display: grid; place-items: center; font-weight: 800; }
.stepper li.done .dot { background: var(--teal); }
.stepper li.current { border-color: var(--primary); background: var(--primary-soft); }
.stepper li.current .dot { background: var(--primary); }
.stepper li.late .small { color: var(--danger); font-weight: 700; }
.step-help { margin: 10px 0 0; }
.step-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }

/* ---- cartes */
.map { height: 300px; border-radius: 12px; border: 1px solid var(--line); background: #ECEAF4; z-index: 0; }
.map-lg { height: 420px; margin-bottom: 16px; }
.map-off { padding: 20px; text-align: center; }
.pin { display: grid; place-items: center; border-radius: 50%; font-weight: 800; font-size: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.35); border: 2px solid #fff; }
.pin span { line-height: 1; text-transform: uppercase; }
.pin-person { background: var(--ink); color: #fff; }
.pin-option { background: var(--primary); color: #fff; }
.pin-option.stale { background: #A3A1B8; }
.legend { background: rgba(255,255,255,.94); padding: 6px 8px; border-radius: 8px; font-size: 12px; display: flex; flex-wrap: wrap; gap: 4px 10px; max-width: 280px; }
.legend i { display: inline-block; width: 14px; height: 4px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }

/* ---- destinations */
.sort { display: flex; align-items: center; gap: 6px; font-size: .9rem; flex-wrap: wrap; }
.options { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 500px), 1fr)); gap: 16px; }
.option { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: #fff; display: flex; flex-direction: column; gap: 10px; min-width: 0; transition: box-shadow .15s; }
.option:hover { box-shadow: 0 4px 18px rgba(30,27,75,.1); }
.option.stale { opacity: .7; background: #FAFAFC; }
.option.chosen { border: 2px solid var(--teal); }
.option header { display: flex; align-items: center; gap: 12px; }
.num { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-weight: 800; }
.option.stale .num { background: #A3A1B8; }
.opt-title { flex: 1; min-width: 0; }
.opt-title .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.grade { text-align: right; line-height: 1; white-space: nowrap; }
.grade b { font-size: 2.2rem; color: var(--primary); }
.grade span { color: var(--muted); font-weight: 600; }
.grade.dim b { color: #A3A1B8; }
.stale-reason { margin: 0; font-size: .85rem; color: #5B5A73; background: #F1F0F6; padding: 6px 10px; border-radius: 8px; }
.opt-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .85rem; color: #3A3958; }
.votes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.votes .count { font-weight: 700; }
.vote-btns { margin-left: auto; display: flex; gap: 6px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .02em; color: var(--muted); }
tr.compromise td { color: var(--warn); background: var(--warn-soft); white-space: normal; font-size: .8rem; }
.mode { border-left: 4px solid var(--c); padding-left: 6px; }
.legs summary, .stale-box summary { cursor: pointer; font-weight: 600; color: var(--primary-dark); font-size: .9rem; }
.legs[open] summary { margin-bottom: 8px; }
.leg { margin-bottom: 10px; }
.leg-head { margin-bottom: 2px; }
.leg-table tr.picked td { background: var(--ok-soft); }
.opt-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.options-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.stale-box { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 12px; }
.stale-box .options { margin-top: 10px; }

/* ---- fenêtres */
.overlay { position: fixed; inset: 0; background: rgba(20, 18, 50, .4); z-index: 1500; }
.overlay.top { z-index: 2500; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(540px, 100vw); background: #fff; z-index: 1600; overflow-y: auto; padding: 18px; box-shadow: -8px 0 30px rgba(0,0,0,.15); }
.modal { position: fixed; z-index: 1600; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow-y: auto; background: #fff; border-radius: 18px; padding: 20px; box-shadow: 0 20px 60px rgba(20,18,50,.3); }
.modal.top { z-index: 2600; }
.modal-wide { width: min(640px, calc(100vw - 24px)); }
.modal h2 { margin-bottom: 4px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.modal-head h2 { margin: 0; }
.modal label { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; }
.who-list { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.who-item { display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; cursor: pointer; }
.who-item:hover, .who-item.on { border-color: var(--primary); background: var(--primary-soft); }
.who-new { border-top: 1px solid var(--line); padding-top: 12px; }
.who-new label { display: block; margin: 0 0 6px; }
.city-field { position: relative; display: flex; flex-direction: column; gap: 4px; }
.suggest { position: absolute; top: 100%; left: 0; right: 0; z-index: 10; list-style: none; margin: 2px 0 0; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); font-weight: 400; max-height: 300px; overflow-y: auto; }
.suggest li { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; }
.suggest li:hover { background: var(--primary-soft); }
.suggest li.src { cursor: default; background: none; }
.mzones { display: flex; flex-direction: column; gap: 8px; }
.mzone { border-radius: 12px; padding: 8px 10px 10px; border: 1px solid var(--line); }
.mzone.z-prefer { background: #E8F7F4; border-color: #A6DDD5; }
.mzone.z-ok { background: #FFF6E6; border-color: #F5D9A6; }
.mzone.z-no { background: #F3F2F7; border-color: #E0DEEA; }
.mzone-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin-bottom: 6px; }
.mzone-head .small { color: var(--muted); }
.z-prefer .mzone-head b { color: var(--ok); }
.z-ok .mzone-head b { color: #9A5B00; }
.z-no .mzone-head b { color: #5B5A73; }
.mzone-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-height: 42px; border-radius: 10px; }
.mzone.over { box-shadow: 0 0 0 2px var(--primary) inset; }
.mzone.drop-end .mzone-list::after, .dzone.drop-end::after { content: ""; display: block; height: 3px; border-radius: 2px; background: var(--primary); }
.mzone-empty { list-style: none; padding: 10px; text-align: center; font-size: .85rem; color: var(--muted); border: 1px dashed #C9C5DD; border-radius: 10px; }
.z-no .mchip { opacity: .75; }
.ditem { touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.ditem.placeholder { opacity: .35; }
.ditem.drop-before { box-shadow: 0 -3px 0 var(--primary); }
.ditem.ghost { position: fixed; z-index: 4000; pointer-events: none; box-shadow: 0 10px 30px rgba(20,18,50,.25); transform: rotate(1.5deg); background: #fff; cursor: grabbing; list-style: none; }
.mchip { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.mchip .crit, .sortable .crit { flex: 1; font-weight: 500; }
.sortable { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sortable li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.sortable .grip { cursor: grab; color: #A3A1B8; user-select: none; }
.sortable .rank, .mchip .rank { width: 22px; height: 22px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-dark); display: grid; place-items: center; font-weight: 800; font-size: .8rem; }
.updown { display: flex; gap: 4px; }

/* ---- réservations */
.plan-head { display: grid; grid-template-columns: 1fr 1.3fr; gap: 18px; align-items: center; }
.plan-head h1 { font-size: 2rem; }
.section-title { margin: 6px 0 12px; font-size: 1.25rem; }
.offer { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.offer-icon { font-size: 1.8rem; }
.plan-table select { padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; max-width: 340px; }
.tips { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: .9rem; }

/* ---- responsive */
@media (max-width: 900px) {
  .grid2, .grid3, .plan-head, .how-steps { grid-template-columns: 1fr; }
  .stepper { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  h1 { font-size: 1.4rem; }
  .row2, .row3, .rp-months { grid-template-columns: 1fr; }
  .rp-months .month:nth-child(2) { display: none; }
  .map-lg { height: 300px; }
  .topbar { padding: 6px 12px; }
  .brand .wordmark { height: 24px; }
  .topbar-right { width: 100%; justify-content: space-between; }
  .vote-btns { margin-left: 0; }
  .grade b { font-size: 1.8rem; }
  .stats { gap: 14px 24px; }
}
.fs-help { margin: 0 0 8px; }
.brand-inline { display: inline-flex; align-items: center; gap: 6px; }
