:root {
  color-scheme: light;
  --ink: #2b2b2b;
  --muted: #666666;
  --paper: #969596;
  --card: #f7f7f7;
  --line: #c8c8c8;
  --pine: #2b2b2b;
  --pine-dark: #1f1f1f;
  --pine-pale: #f7f7f7;
  --amber: #d4b559;
  --amber-pale: #d4b559;
  --danger: #b84c3d;
  --danger-pale: #fae8e4;
  --shadow: 0 18px 55px rgba(24, 24, 24, .14);
  font-family: Cambria, Georgia, "Times New Roman", serif;
  font-synthesis: none;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/JetBrainsMono-Medium.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: #5c5c5c; }
button, input, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }

#app { width: min(100%, 520px); min-height: 100dvh; margin: 0 auto; background: var(--card); position: relative; box-shadow: var(--shadow); }
.topbar { min-height: 82px; padding: max(13px, env(safe-area-inset-top)) 18px 12px; display: grid; place-items: center; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .94); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(14px); }
.topbar h1 { margin: 2px 0 0; text-align: center; font-size: 17px; font-weight: 500; }
.header-back { width: 42px; height: 42px; position: absolute; left: 15px; top: max(13px, env(safe-area-inset-top)); display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.header-back[hidden] { display: none !important; }
.header-back:hover { background: var(--pine-pale); }
.header-back img { width: 15px; height: 15px; }
.eyebrow { margin: 0; text-align: center; color: var(--muted); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.icon-button { width: 42px; height: 42px; border: 0; border-radius: 50%; color: var(--ink); background: transparent; font-size: 22px; cursor: pointer; }
.icon-button:hover { background: var(--pine-pale); }
.progress-track { height: 4px; background: var(--line); position: sticky; top: 82px; z-index: 11; }
#global-progress { width: 20%; height: 100%; background: var(--amber); transition: width .25s ease; }

#screen { min-height: calc(100dvh - 168px); padding: 24px 20px 112px; outline: none; }
.screen-section { animation: enter .22s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
h2 { margin: 8px 0 10px; font-family: inherit; font-size: clamp(28px, 8vw, 36px); line-height: 1.05; font-weight: 500; }
h3 { margin: 0; font-size: 17px; font-weight: 500; }
p { line-height: 1.5; }
.lead { margin: 0; color: var(--muted); font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }

.hero-visual { height: 230px; border-radius: 24px; margin-bottom: 18px; overflow: hidden; position: relative; background: linear-gradient(155deg, #eeeeee 0 43%, #bdbdbd 43% 59%, #555555 59%); }
.demo-chip { position: absolute; z-index: 3; top: 14px; left: 14px; padding: 7px 10px; border-radius: 999px; color: #444444; background: rgba(255,255,255,.9); font-size: 12px; font-weight: 500; }
.mountains::before, .mountains::after { content: ""; position: absolute; width: 230px; height: 230px; bottom: 30px; transform: rotate(45deg); border-radius: 16px; background: #f5f5f5; }
.mountains::before { left: -75px; }
.mountains::after { right: -105px; bottom: 2px; background: #c8c8c8; }
.chalet-shape { width: 190px; height: 80px; position: absolute; left: 50%; bottom: 25px; transform: translateX(-50%); background: #606060; box-shadow: inset 0 -15px rgba(0,0,0,.12); }
.chalet-shape::before { content: ""; width: 135px; height: 135px; position: absolute; top: -68px; left: 28px; transform: rotate(45deg); border-radius: 4px; background: #292929; }
.chalet-shape span { position: absolute; inset: 24px 8px auto; z-index: 2; text-align: center; color: white; font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }

.pill { display: inline-flex; align-items: center; width: fit-content; padding: 7px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.pill-success, .pill-warning { color: #2b2b2b; background: #d4b559; }
.pill-danger { color: #7b3027; background: var(--danger-pale); }

.info-card { margin-top: 16px; padding: 16px; border: 1px solid #9f9e9f; border-radius: 18px; color: #2b2b2b; background: #b3b2b3; }
.arrival-journey { display: grid; gap: 10px; margin-top: 20px; }
.arrival-journey .info-card { margin-top: 0; }
.journey-card { display: flex; align-items: flex-start; gap: 12px; }
.journey-card strong { display: block; font-size: 16px; }
.journey-card p { margin: 3px 0 0; font-size: 13px; }
.journey-number { width: 27px; height: 27px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: #ffffff; background: var(--amber); font-size: 13px; font-weight: 700; }
.reservation-preview { display: flex; gap: 13px; align-items: center; }
.reservation-preview p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.card-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; flex: none; color: #303030; background: #eeeeee; font-size: 21px; }
.card-icon .ui-icon { width: 20px; height: 20px; }
.required-field { color: var(--danger); font-weight: 600; }
.detail-list { margin: 18px 0 0; border: 1px solid var(--line); border-radius: 18px; padding: 4px 16px; }
.detail-row { min-height: 52px; display: flex; justify-content: space-between; align-items: center; gap: 15px; border-bottom: 1px solid var(--line); font-size: 14px; }
.detail-row:last-child { border: 0; }
.detail-row span { color: var(--muted); }
.detail-row strong { text-align: right; font-weight: 500; }

label.field-label { display: block; margin: 18px 0 7px; color: var(--muted); font-size: 13px; }
input[type="text"], input[type="email"], textarea { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px; color: var(--ink); background: white; outline: none; }
input:focus, textarea:focus { border-color: var(--pine); box-shadow: 0 0 0 3px rgba(85,85,85,.18); }
textarea { min-height: 88px; resize: vertical; }
.inline-message { margin-top: 12px; padding: 11px 12px; border-radius: 12px; font-size: 13px; }
.inline-message.success { color: var(--pine); background: var(--pine-pale); }
.inline-message.error { color: #7b3027; background: var(--danger-pale); }
.access-switch { margin: 18px 0 0; text-align: center; font-size: 14px; }
.access-switch a { color: var(--ink); font-weight: 700; text-decoration-color: var(--amber); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.access-switch a:focus-visible { outline: 3px solid rgba(212,181,89,.45); outline-offset: 4px; border-radius: 3px; }

.role-choice-list { display: grid; gap: 13px; margin: 22px 0 18px; }
.role-choice-card { width: 100%; min-height: 112px; display: grid; grid-template-columns: 48px 1fr auto; gap: 13px; align-items: center; border: 1.5px solid #3c3c3c; border-radius: 18px; padding: 17px; color: var(--ink); text-align: left; text-decoration: none; background: #ffffff; cursor: pointer; box-shadow: 0 7px 18px rgba(34,31,28,.06); }
.role-choice-card:hover, .role-choice-card:focus-visible { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(212,181,89,.25); outline: none; }
.role-choice-card > span:nth-child(2) { display: grid; gap: 4px; }
.role-choice-card strong { font-size: 18px; font-weight: 600; }
.role-choice-card small { color: var(--muted); font-size: 13px; line-height: 1.35; }
.role-choice-card > b { color: var(--amber); font-size: 27px; font-weight: 500; }
.role-choice-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; color: #2b2b2b; background: #f7f0d7; font-size: 24px; }

.is-mission-page #screen { padding-top: 54px; padding-bottom: 176px; }
.is-mission-page .screen-section > h2, .is-mission-page .screen-section > .lead { text-align: center; }
.is-mission-page .screen-section > h2 { font-size: clamp(31px, 8vw, 44px); }
.is-mission-page .screen-section > .lead { margin: 14px auto 0; max-width: 470px; color: var(--ink); }
.mission-instruction { max-width: 430px; margin: 28px auto 0; color: var(--muted); font-size: 14px; line-height: 1.45; text-align: center; }
.mission-list { display: grid; gap: 24px; margin-top: 30px; }
.mission-card { min-height: 145px; display: grid; grid-template-columns: 102px 1fr; gap: 22px; align-items: center; padding: 24px 28px; border: 1px solid var(--line); border-radius: 18px; color: #2b2b2b; background: rgba(255,255,255,.66); box-shadow: none; }
.mission-card--ecrin, .mission-card--refuge, .mission-card--attestation { border-color: #454545; color: #2b2b2b; background: #ffffff; }
.mission-icon { width: 88px; height: 88px; display: grid; place-items: center; position: relative; border: 2px solid #3c3c3c; border-radius: 50%; color: #2b2b2b; }
.mission-icon svg { width: 42px; height: 42px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mission-icon-image { width: 45px; height: 45px; object-fit: contain; }
.mission-icon-image[src$="cabine.svg"] { width: 51px; height: 51px; }
.ui-icon { width: 16px; height: 16px; display: inline-block; object-fit: contain; vertical-align: middle; }
.mission-number { width: 38px; height: 38px; position: absolute; top: -10px; left: -10px; z-index: 1; display: grid; place-items: center; border-radius: 50%; color: #ffffff; background: #2b2b2b; font-size: 18px; font-weight: 500; }
.mission-card h3 { margin: 0; font-size: clamp(26px, 7vw, 36px); font-weight: 500; }
.mission-card p { margin: 8px 0 0; color: #2b2b2b; font-size: 16px; }
.mission-card.completed .mission-number { color: #ffffff; background: #2b2b2b; }
.mission-continue { margin: 31px auto 0; max-width: 380px; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.45; text-align: center; }
.guide-client-list { margin-top: 22px; display: grid; gap: 14px; }
.guide-client-card { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #ffffff; box-shadow: var(--shadow); }
.guide-client-photo { position: relative; }
.guide-client-card img { width: 100%; max-height: 245px; display: block; object-fit: cover; }
.guide-expand { width: 42px; height: 42px; position: absolute; right: 11px; bottom: 11px; display: grid; place-items: center; border: 0; border-radius: 9px; color: #ffffff; background: rgba(34,31,28,.88); box-shadow: 0 5px 14px rgba(0,0,0,.22); cursor: pointer; }
.guide-expand .ui-icon { width: 17px; height: 17px; filter: invert(1); }
.guide-client-card > div { padding: 16px; }
.guide-client-card h3 { font-size: 20px; }
.guide-client-card p { margin: 7px 0 0; white-space: pre-line; }
.guide-client-location { color: var(--amber); font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }

.inspection-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.zone-visual { height: 210px; margin: 14px 0; border-radius: 22px; display: flex; align-items: flex-end; padding: 15px; color: white; position: relative; overflow: hidden; background: linear-gradient(135deg, #dddddd, #919191 48%, #4b4b4b); }
.zone-visual::before { content: ""; position: absolute; width: 160px; height: 160px; right: -30px; top: -40px; border: 22px solid rgba(255,255,255,.3); border-radius: 50%; }
.zone-visual.refuge { background: linear-gradient(135deg, #cfcfcf, #777777 48%, #292929); }
.zone-visual span { position: relative; z-index: 1; padding: 8px 10px; border-radius: 11px; background: rgba(24, 24, 24, .76); font-size: 12px; }
.zone-visual.has-photo { height: auto; min-height: 0; padding: 0; display: block; background: #c8c8c8; line-height: 0; }
.zone-visual.has-photo::before { display: none; }
.zone-visual.has-photo img { width: 100%; height: auto; display: block; }
.zone-visual.has-photo > span { position: absolute; left: 13px; bottom: 13px; line-height: 1.2; }
.client-hotspot { width: 34px; height: 34px; position: absolute; z-index: 2; transform: translate(-50%, -50%); border: 3px solid white; border-radius: 50%; color: white; background: var(--amber); box-shadow: 0 5px 15px rgba(0,0,0,.28); cursor: pointer; font-size: 12px; font-weight: 600; }
.client-hotspot.active { outline: 4px solid rgba(255,255,255,.55); }
.photo-carousel { margin: -5px 0 11px; display: grid; grid-template-columns: 42px 1fr 42px; gap: 8px; align-items: center; }
.photo-carousel button { height: 38px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: white; cursor: pointer; }
.photo-carousel button .ui-icon, .zone-navigation button .ui-icon { width: 13px; height: 13px; }
.photo-carousel small { text-align: center; color: var(--muted); }
.photo-guidance { margin-bottom: 13px; padding: 10px 12px; border-left: 3px solid var(--amber); border-radius: 0 11px 11px 0; color: #444444; background: var(--amber-pale); font-size: 12px; line-height: 1.45; }
.zone-navigation { display: grid; grid-template-columns: 44px 1fr 44px; gap: 10px; align-items: center; margin-bottom: 15px; }
.zone-navigation button { height: 42px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: white; cursor: pointer; }
.zone-navigation div { text-align: center; }
.zone-navigation strong { display: block; font-weight: 500; }
.zone-navigation small { color: var(--muted); }
.control-list { display: grid; gap: 10px; }
.control-card { border: 1px solid #9f9e9f; border-radius: 17px; padding: 14px; color: #2b2b2b; background: #b3b2b3; }
.control-card .field-label, .control-card .muted { color: var(--muted); }
.control-title { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.control-title strong { font-size: 14px; font-weight: 500; }
.status-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 11px; }
.status-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid var(--line); border-radius: 11px; padding: 6px 4px; color: var(--ink); background: white; cursor: pointer; font-size: 11px; }
.status-button .ui-icon { width: 13px; height: 13px; }
.status-button.selected[data-status="ok"] { border-color: var(--pine); color: var(--pine); background: var(--pine-pale); }
.status-button.selected[data-status="issue"] { border-color: var(--danger); color: #7b3027; background: var(--danger-pale); }
.status-button.selected[data-status="unknown"] { border-color: var(--amber); color: #444444; background: var(--amber-pale); }
.justification { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.photo-input { width: 100%; font-size: 12px; color: var(--muted); }
.photo-input::file-selector-button { margin-right: 8px; border: 1px solid var(--danger); border-radius: 10px; padding: 8px 10px; color: var(--danger); background: white; }
.quick-action { width: 100%; min-height: 44px; margin: 12px 0; border: 1px dashed var(--pine); border-radius: 13px; color: var(--pine); background: var(--pine-pale); cursor: pointer; }
.quick-action { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; text-decoration: none; }
.all-ok-action { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; color: var(--ink); background: var(--amber); box-shadow: 0 5px 14px rgba(117, 91, 22, .18); font-weight: 600; }
.all-ok-action .ui-icon { width: 15px; height: 15px; filter: invert(1); }
.all-ok-action:hover { background: #c7a743; }
.all-ok-action:active { transform: translateY(1px); }
.error-summary { margin: 12px 0; padding: 12px; border-radius: 13px; color: #7b3027; background: var(--danger-pale); font-size: 13px; }

.summary-block { margin-top: 18px; }
.summary-block h3 { margin-bottom: 9px; }
.summary-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.issue-card { margin-top: 10px; padding: 13px; border-left: 4px solid var(--danger); border-radius: 0 13px 13px 0; background: var(--danger-pale); font-size: 13px; }
.check-row { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; margin: 18px 0; }
.check-row input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--pine); }
.check-row label { font-size: 13px; line-height: 1.45; }
.signature-wrap { margin-top: 16px; }
#signature-pad { width: 100%; height: 145px; border: 1px dashed var(--pine); border-radius: 16px; display: block; background: #fafafa; touch-action: none; }
.signature-actions { display: flex; justify-content: flex-end; margin-top: 7px; }
.text-button { border: 0; padding: 6px; color: var(--pine); background: transparent; cursor: pointer; font-size: 13px; }

.success-mark { width: 96px; height: 96px; margin: 28px auto 20px; border-radius: 50%; display: grid; place-items: center; color: var(--pine); background: var(--pine-pale); font-size: 44px; }
.locked-note { margin-top: 16px; padding: 13px; border-radius: 13px; color: var(--muted); background: #f5f5f5; font-size: 13px; }

.footer-actions { min-height: 86px; padding: 13px 18px max(16px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: minmax(100px, .8fr) 1.7fr; gap: 10px; position: fixed; bottom: 0; left: 50%; z-index: 12; width: min(100%, 520px); transform: translateX(-50%); border-top: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); }
.button { min-height: 50px; border-radius: 14px; padding: 11px 15px; font-weight: 500; cursor: pointer; }
.button-primary { border: 1px solid var(--pine); color: var(--amber); background: var(--pine); }
.button-primary:hover { background: var(--pine-dark); }
.button-secondary { border: 1px solid var(--line); color: var(--ink); background: white; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.footer-actions.mission-footer { gap: 10px; padding: 14px 30px max(18px, env(safe-area-inset-bottom)); grid-template-rows: auto auto; }
.footer-actions.mission-footer .button-primary { order: 1; min-height: 62px; border: 0; border-radius: 999px; color: white; background: linear-gradient(120deg, #2b2b2b, #5a3100); font-size: 18px; }
.footer-actions.mission-footer .button-secondary { order: 2; min-height: 39px; border: 0; color: #4a2a0a; background: transparent; font-size: 18px; }

dialog { width: min(calc(100% - 32px), 430px); border: 1px solid var(--line); border-radius: 22px; padding: 22px; color: var(--ink); background: var(--card); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(24, 24, 24, .58); backdrop-filter: blur(4px); }
dialog h2 { font-size: 27px; }
dialog li { margin: 9px 0; line-height: 1.4; }
.dialog-close { float: right; width: 38px; height: 38px; border: 0; border-radius: 50%; color: var(--ink); background: var(--paper); cursor: pointer; font-size: 22px; }
.guide-image-dialog { width: min(100vw, 900px); height: 100dvh; max-height: none; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); border: 0; border-radius: 0; background: rgba(20,19,17,.98); }
.guide-image-dialog::backdrop { background: rgba(20,19,17,.82); }
.guide-image-dialog > img { width: 100%; height: 100%; display: block; object-fit: contain; }
.guide-image-close { width: 43px; height: 43px; position: fixed; top: max(16px, env(safe-area-inset-top)); right: max(16px, calc((100vw - 900px) / 2 + 16px)); z-index: 2; display: grid; place-items: center; border: 0; border-radius: 9px; background: #ffffff; cursor: pointer; }
.guide-image-close img { width: 16px; height: 16px; }

@media (min-width: 521px) {
  body { padding: 24px 0; }
  #app { min-height: calc(100dvh - 48px); border: 1px solid var(--line); border-radius: 30px; overflow: hidden; }
  .topbar { top: 0; }
  .progress-track { top: 82px; }
  .footer-actions { bottom: 24px; border-radius: 0 0 30px 30px; }
}

/* Charte unifiée — Anétats */
:root { --paper: #ffffff; --card: #ffffff; --line: #3c3c3c; --pine-pale: #f7f7f7; --amber-pale: #f7f0d7; --shadow: 0 10px 24px rgba(24,24,24,.08); }
html, body { background: #ffffff; }
#app { background: #ffffff; box-shadow: none; }
.topbar, .footer-actions { border-color: #d7d7d7; background: rgba(255,255,255,.97); }
.icon-button:hover { background: #f7f0d7; }
.hero-visual { border: 2px solid #3c3c3c; background: #ffffff; box-shadow: none; }
.demo-chip, .pill-success, .pill-warning { border: 1px solid #3c3c3c; color: #2b2b2b; background: #d4b559; }
.info-card, .detail-list, .control-card, .locked-note { border-color: #3c3c3c; color: #2b2b2b; background: #ffffff; box-shadow: none; }
.card-icon { border: 1px solid #3c3c3c; border-radius: 50%; background: #ffffff; }
input[type="text"], input[type="email"], textarea, .photo-carousel button, .zone-navigation button, .status-button { border-color: #3c3c3c; background: #ffffff; }
.photo-guidance { border: 1px solid #3c3c3c; border-left: 5px solid #d4b559; border-radius: 14px; color: #2b2b2b; background: #ffffff; }
.control-card { border-width: 1.5px; }
.status-button.selected[data-status="ok"], .status-button.selected[data-status="unknown"] { border-color: #3c3c3c; color: #2b2b2b; background: #f7f0d7; }
.quick-action { border: 1.5px solid #3c3c3c; color: #2b2b2b; background: #ffffff; }
.all-ok-action { border: 0; background: #d4b559; }
.summary-row { border-color: #3c3c3c; }
#signature-pad { border: 1.5px solid #3c3c3c; background: #ffffff; }
.button { border-radius: 999px; }
.button-primary { border: 0; color: #ffffff; background: linear-gradient(120deg, #2b2b2b, #5a3100); }
.button-secondary { border: 1.5px solid #3c3c3c; }
dialog { border: 1.5px solid #3c3c3c; background: #ffffff; box-shadow: var(--shadow); }

/* Parcours par pièces : on distingue les choix de navigation des contrôles. */
.unit-room-section { margin: 24px -18px 0; padding: 22px 18px; border-top: 7px solid var(--amber); background: rgba(226, 222, 200, .45); }
.unit-room-section + .unit-room-section { margin-top: 28px; border-top-color: #706d64; }
.unit-room-heading { margin-bottom: 14px; }
.unit-room-heading > span { color: var(--amber); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.unit-room-heading h3 { margin: 3px 0; font-size: 29px; }
.unit-room-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.room-card-list { display: grid; gap: 11px; }
.room-card { width: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; padding: 0; color: var(--ink); text-align: left; background: #fff; box-shadow: 0 5px 16px rgba(34,31,28,.06); }
.room-card-photo { height: 190px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #e2dec8; }
.room-card-photo > img, .room-photo-placeholder { width: 100%; height: 100%; display: block; object-fit: cover; background: #e2dec8; }
.room-photo-placeholder { display: grid; place-items: center; }
.room-photo-placeholder .ui-icon { width: 35px; height: 35px; opacity: .65; }
.room-card-body { min-width: 0; display: grid; align-content: center; gap: 7px; padding: 15px 15px 12px; }
.room-card-title strong, .room-card-title small { display: block; }
.room-card-title strong { font-size: 22px; line-height: 1.16; }
.room-card-title small { overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.room-card-details { padding: 12px 15px 0; }
.room-stats { display: flex; flex-wrap: wrap; gap: 5px; }
.room-stats span { border-radius: 999px; padding: 3px 6px; color: #4f4b43; background: #f1efe7; font-size: 10px; }
.room-stats .has-issues { color: #7d3026; background: var(--danger-pale); }
.room-open-button { width: calc(100% - 30px); min-height: 48px; margin: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 9px; color: #fff; background: var(--ink); cursor: pointer; font: inherit; font-weight: 700; }
.room-open-button:hover { background: #3d3c3a; }
.room-open-button .ui-icon { width: 15px; height: 15px; filter: invert(1); }
.room-card.completed { border-color: var(--line); }
.issue-photo-section { margin-top: 10px; }
.issue-photo-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.issue-photo-list figure { width: calc(33.333% - 6px); min-width: 76px; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.issue-photo-list img { width: 100%; aspect-ratio: 1 / .75; display: block; object-fit: cover; }
.issue-photo-list figcaption { display: flex; align-items: center; justify-content: flex-end; gap: 4px; padding: 4px 5px; color: var(--muted); font-size: 9px; }
.issue-photo-list figcaption button { width: 20px; height: 20px; flex: 0 0 auto; border: 0; border-radius: 50%; color: #fff; background: var(--danger); cursor: pointer; font-size: 17px; line-height: 1; }
.pending-photo-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.pending-photo { position: relative; width: calc(33.333% - 6px); min-width: 76px; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.pending-photo-placeholder { display: block; aspect-ratio: 1 / .75; background: linear-gradient(110deg, rgba(235, 228, 202, .22) 20%, rgba(212, 181, 89, .42) 40%, rgba(235, 228, 202, .22) 60%); background-size: 220% 100%; animation: photo-loading 1.1s linear infinite; }
.pending-photo img { position: absolute; inset: 0; width: 100%; height: auto; min-height: 100%; object-fit: cover; opacity: 1; transition: opacity .2s ease; }
.pending-photo.is-loading img { opacity: 0; }
.pending-photo figcaption { display: flex; position: relative; align-items: center; justify-content: space-between; gap: 4px; padding: 4px 5px; color: var(--muted); background: #fff; font-size: 9px; }
.pending-photo figcaption button { width: 20px; height: 20px; flex: 0 0 auto; border: 0; border-radius: 50%; color: #fff; background: var(--danger); cursor: pointer; font-size: 17px; line-height: 1; }
.pending-photo.preview-unavailable::after { position: absolute; inset: 0 0 auto; padding: 8px 5px; color: var(--muted); background: rgba(255,255,255,.75); content: 'Aperçu en préparation'; font-size: 9px; text-align: center; }
@keyframes photo-loading { to { background-position: -220% 0; } }
.remove-issue { width: 100%; margin-top: 10px; border: 1px solid var(--danger); border-radius: 9px; padding: 8px; color: var(--danger); background: #fff; cursor: pointer; font-weight: 600; }
.issue-counter { border-radius: 999px; padding: 4px 7px; color: var(--muted); background: #f1efe7; font-size: 11px; }
.add-issue, .save-new-issue, .add-extra-photo { min-height: 38px; margin-top: 11px; border: 1px solid var(--amber); border-radius: 9px; padding: 8px 10px; color: var(--ink); background: #fff; cursor: pointer; font: inherit; font-weight: 700; }
.add-issue { width: 100%; }
.new-issue-form, .reported-issue { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #f8f7f2; }
.reported-issue { border-left: 4px solid var(--danger); }
.new-issue-form textarea, .reported-issue textarea { min-height: 84px; }
.add-extra-photo { display: inline-flex; align-items: center; }
.add-extra-photo input { width: 0; height: 0; opacity: 0; position: absolute; }
.photo-input-button { min-height: 38px; display: inline-flex; align-items: center; margin-top: 8px; border: 1px solid var(--amber); border-radius: 9px; padding: 8px 10px; color: var(--ink); background: #fff; cursor: pointer; font: inherit; font-weight: 700; }
.photo-input-button input { width: 0; height: 0; opacity: 0; position: absolute; }

/* Robustesse responsive : aucun contenu métier ne doit être tronqué. */
html, body { max-width: 100%; overflow-x: hidden; }
img, svg { max-width: 100%; }
button, input, textarea, select { min-width: 0; }
#app, #screen, .screen-section, .unit-room-section, .room-card, .room-card-body { min-width: 0; }
h1, h2, h3, p, strong, small, span, label, button { overflow-wrap: anywhere; }

/* Les noms réels restent lisibles, même lorsqu'ils sont longs. */
.room-card-title small { overflow: visible; text-overflow: clip; white-space: normal; }
.room-open-button, .button { white-space: normal; text-align: center; }
.footer-actions > * { min-width: 0; }

/* Les images de présentation montrent l'intégralité du cadrage importé. */
.guide-client-card img { max-height: none; aspect-ratio: 4 / 3; object-fit: contain; background: #e2dec8; }
.room-card-photo { height: auto; min-height: 0; aspect-ratio: 4 / 3; display: grid; place-items: center; }
.room-card-photo > img { height: 100%; object-fit: contain; background: #e2dec8; }

@media (max-width: 390px) {
  #screen { padding-right: 16px; padding-left: 16px; }
  .unit-room-section { margin-right: -14px; margin-left: -14px; padding-right: 14px; padding-left: 14px; }
  .footer-actions { padding-right: 12px; padding-left: 12px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .button { padding-right: 9px; padding-left: 9px; font-size: 13px; }
  .role-choice-card { grid-template-columns: 42px minmax(0, 1fr) auto; padding: 14px; }
  .role-choice-icon { width: 40px; height: 40px; }
}

/* Anétats — application de la charte de marque */
:root {
  --ink: #221f1c;
  --muted: #62615c;
  --paper: #f5f3e8;
  --card: #ffffff;
  --line: #d9d5c5;
  --pine: #221f1c;
  --pine-dark: #000000;
  --pine-pale: #e2dec8;
  --amber: #a28b1f;
  --amber-pale: #e2dec8;
  --danger: #9c3c31;
  --danger-pale: #f6e6e0;
  --shadow: 0 14px 35px rgba(34, 31, 28, .10);
}

html, body { background: var(--paper); }
#app { background: var(--paper); }
.topbar, .footer-actions { border-color: var(--line); background: rgba(245, 243, 232, .96); }
.eyebrow { color: var(--amber); font-weight: 600; letter-spacing: .09em; }
.progress-track { background: #e2dec8; }
#global-progress { background: var(--amber); }
.icon-button:hover { background: #e2dec8; }
.lead, .muted { color: var(--muted); }
h2, h3 { color: var(--ink); }

.hero-visual { border: 0; border-radius: 18px; background: #e2dec8; }
.demo-chip { color: var(--ink); background: rgba(245, 243, 232, .92); }
.mountains::before { background: #f5f3e8; }
.mountains::after { background: #d6d0b8; }
.chalet-shape { background: #6d6252; }
.chalet-shape::before { background: var(--ink); }
.pill-success, .pill-warning, .demo-chip { border-color: transparent; }
.pill-success, .pill-warning { color: #ffffff; background: var(--amber); }
.info-card, .detail-list, .control-card, .locked-note { border-color: var(--line); background: #ffffff; }
.card-icon { border-color: var(--amber); color: var(--amber); background: #f5f3e8; }
input[type="text"], input[type="email"], textarea,
.photo-carousel button, .zone-navigation button, .status-button { border-color: var(--line); border-radius: 10px; }
input:focus, textarea:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(162, 139, 31, .16); }
.photo-guidance { border: 0; border-left: 4px solid var(--amber); border-radius: 0; color: var(--ink); background: #e2dec8; }
.control-card { border-radius: 14px; }
.status-button.selected[data-status="ok"], .status-button.selected[data-status="unknown"] { border-color: var(--amber); color: var(--ink); background: #e2dec8; }
.quick-action { border-color: var(--amber); color: var(--ink); background: #ffffff; }
.all-ok-action, .all-ok-action:hover { color: #ffffff; background: var(--amber); box-shadow: none; }
.button { border-radius: 6px; font-weight: 600; }
.button-primary, .footer-actions.mission-footer .button-primary { color: #ffffff; background: var(--ink); }
.button-primary:hover, .footer-actions.mission-footer .button-primary:hover { background: #3d3c3a; }
.button-secondary { border-color: var(--ink); background: transparent; }
.footer-actions.mission-footer .button-secondary { color: var(--ink); }

/* Navigation et actions : un gabarit unique, lisible au pouce. */
.footer-actions { min-height: 84px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px 18px max(14px, env(safe-area-inset-bottom)); }
.footer-actions.mission-footer { grid-template-rows: none; padding: 12px 18px max(14px, env(safe-area-inset-bottom)); }
.footer-actions.mission-footer .button-primary,
.footer-actions.mission-footer .button-secondary,
.button { width: 100%; min-height: 52px; border-radius: 10px; font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 500; }
.footer-actions.mission-footer .button-primary { order: initial; border: 1px solid var(--ink); }
.footer-actions.mission-footer .button-secondary { order: initial; border: 1px solid var(--ink); background: #ffffff; }
.role-choice-card,
.room-open-button,
.add-issue,
.save-new-issue,
.cancel-new-issue,
.add-extra-photo,
.photo-input-button,
.remove-issue,
.text-button,
.photo-carousel button,
.zone-navigation button,
.status-button,
.guide-expand,
.header-back,
.guide-image-close { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }

.room-card-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.unit-room-section { margin-top: 18px; padding-top: 16px; }
.unit-room-heading h3 { margin: 0; color: var(--ink); font-size: 26px; font-weight: 700; }
.room-card { border-radius: 12px; }
.room-card-body { min-height: 68px; padding: 10px; }
.room-card-title strong { font-size: 15px; line-height: 1.2; }
.room-card-photo { aspect-ratio: 4 / 2.45; }
.room-card-details { display: none; }
.room-stats { margin-top: 7px; }
.room-stats span { padding: 2px 5px; font-size: 9px; }
.room-open-button { width: calc(100% - 16px); min-height: 40px; margin: 8px; border-radius: 8px; font-size: 11px; }
.required-photo-note { margin: 8px 0 0; font-size: 12px; }
.photo-input-button { gap: 8px; }
.photo-input-button .ui-icon, .add-extra-photo .ui-icon { width: 18px; height: 18px; }
.issue-form-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 12px; }
.cancel-new-issue { min-height: 38px; border: 1px solid var(--ink); border-radius: 9px; color: var(--ink); background: #ffffff; cursor: pointer; }
.save-new-issue { width: auto; margin-top: 0; color: #ffffff; background: var(--ink); border-color: var(--ink); }
.identity-title { margin: 2px 0 18px; color: var(--ink); font-size: 22px; font-weight: 700; }
.signature-email-note, .signature-lock-warning { margin: 8px 0 0; color: var(--danger); font-size: 13px; font-weight: 600; line-height: 1.45; }
.signature-lock-warning { margin-top: 18px; padding: 12px; border: 1px solid var(--danger); border-radius: 10px; background: var(--danger-pale); }

.is-mission-page #screen { padding-top: 38px; }
.is-mission-page .screen-section > .lead { color: var(--muted); }
.mission-list { gap: 14px; margin-top: 30px; }
.mission-card, .mission-card--ecrin, .mission-card--refuge, .mission-card--attestation {
  min-height: 132px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: rgba(255,255,255,.58);
  box-shadow: none;
}
.mission-card--ecrin { border-left: 5px solid var(--amber); }
.mission-icon { width: 76px; height: 76px; border-color: var(--amber); color: var(--ink); background: #f5f3e8; }
.mission-number { color: #ffffff; background: var(--ink); }
.mission-card h3 { font-size: clamp(24px, 7vw, 32px); }
.mission-card p { color: var(--muted); }

.zone-visual { border-radius: 14px; background: #d6d0b8; }
.zone-visual.refuge { background: #c8c1ae; }
.zone-visual span { background: rgba(34,31,28,.86); }
.client-hotspot { color: #ffffff; background: var(--amber); }
.client-hotspot.active { outline-color: rgba(162,139,31,.34); }
dialog { border-color: var(--line); border-radius: 14px; background: #f5f3e8; }
.dialog-close { color: #ffffff; background: var(--ink); }
