:root {
  color-scheme: light;
  --ink: #14343c;
  --muted: #4d6a72;
  --paper: #e7f3f5;
  --card: #ffffff;
  --line: #c5dbe1;
  --teal: #0e7490;
  --teal-deep: #0b5568;
  --cross: #d4524a;
  --amber: #c9842a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  line-height: 1.45;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .55), transparent 280px),
    var(--paper);
}

.sheet {
  width: min(1040px, calc(100% - 2rem));
  margin: 1.4rem auto 3rem;
}

.topbar {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.15rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(14, 116, 144, .08);
}

.marks { display: flex; align-items: center; gap: .65rem; flex: none; }
.logo-g1 { width: 76px; height: 76px; }
.badge { width: 48px; height: 48px; }
.mark {
  margin: 0;
  color: var(--teal);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
h1, h2, h3 { font-weight: 700; letter-spacing: -.02em; }
h1 { margin: .1rem 0; font-size: 2rem; }
.lede { margin: .2rem 0 0; max-width: 40rem; color: var(--muted); }
.kicker {
  margin: 0 0 .25rem;
  color: var(--teal);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.hall {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: stretch;
  margin-top: 1rem;
}
.hall-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
.parcours { min-width: 0; }

@media (min-width: 801px) {
  .parcours { display: flex; flex-direction: column; }
  .parcours-copy { flex: 1; display: flex; flex-direction: column; }
  .parcours ol { flex: 1; display: flex; flex-direction: column; }
  .parcours li { flex: 1; }
}

.dossier {
  margin-top: 1rem;
}

.accueil, .parcours, .plan, .notice, .dossier, .info {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.accueil, .parcours-copy, .plan, .chart, .info { padding: 1.15rem 1.2rem 1.25rem; }
.accueil h2, .parcours h2, .dossier h2 { margin: 0 0 .7rem; }
label { display: block; margin-bottom: .45rem; font-weight: 700; }
.row { display: flex; flex-wrap: wrap; gap: .6rem; }
input, button { font: inherit; }
input {
  flex: 1;
  min-width: 0;
  padding: .8rem .9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fcfd;
  color: inherit;
}
button {
  padding: .8rem 1.1rem;
  border: 0;
  border-radius: 12px;
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
button:hover { background: var(--teal-deep); }

figure { margin: 0; }
.facade, .ward {
  overflow: hidden;
  background: #f3fafb;
}
.facade { border-radius: 18px; border: 1px solid var(--line); }
.facade img, .ward img { display: block; width: 100%; height: auto; }
.ward {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .65rem 1.25rem;
  background: #e7f4f6;
}
.ward img {
  width: min(100%, 820px);
  max-height: 150px;
  object-fit: contain;
  object-position: center;
}
.facade figcaption {
  padding: .55rem .8rem .7rem;
  color: var(--teal-deep);
  font-size: .86rem;
  font-weight: 700;
}

.parcours ol, .wards { margin: 0; padding: 0; list-style: none; }
.parcours li {
  position: relative;
  display: grid;
  grid-template-columns: 3.25rem 1fr;
  column-gap: .85rem;
  align-items: center;
  padding: .4rem 0;
}
.parcours li::before {
  content: "";
  position: absolute;
  left: calc(1.625rem - 3px);
  top: 0;
  bottom: 0;
  width: 6px;
  background: #9fd0da;
  z-index: 0;
}
.parcours li:first-child::before { top: 50%; }
.parcours li:last-child::before { bottom: 50%; }
.step-icon {
  position: relative;
  z-index: 1;
  width: 3.25rem;
  height: 3.25rem;
  display: block;
}
.parcours li span { display: block; font-weight: 700; }
.parcours li small { color: var(--muted); }
.parcours li.is-current span { color: var(--cross); }

.plan { margin-top: 1rem; }
.wards { display: flex; flex-wrap: wrap; gap: .5rem; }
.wards li {
  padding: .4rem .7rem;
  border-radius: 999px;
  background: #f3fafb;
  border: 1px solid var(--line);
  font-size: .92rem;
}
.wards li.is-current { background: #e5f6f4; border-color: var(--teal); color: var(--teal-deep); font-weight: 700; }

.notice { margin: 0; padding: 1rem 1.15rem; color: #7a3418; background: #fff6f1; }
.notice-ok { color: var(--teal-deep); background: #e5f6f4; }

.dossier { overflow: hidden; padding: 0; }
.ward { border-bottom: 1px solid var(--line); }
.chart h2 { margin: .15rem 0 .35rem; font-size: 1.8rem; }
.salle {
  margin: 0;
  color: var(--teal-deep);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.resume { font-size: 1.05rem; }

.constantes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem 1rem;
  margin: 1rem 0;
}
.constantes div { margin: 0; padding: .55rem .65rem; background: #f4fbfb; border-radius: 12px; }
.constantes dt { color: var(--muted); font-size: .78rem; }
.constantes dd { margin: .12rem 0 0; }
.key { overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; }

.meter {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: #e5eef1;
  overflow: hidden;
}
.fill {
  display: block;
  width: calc(var(--pct) * 1%);
  height: 100%;
  background: #d4524a;
}
.tone-court .fill { background: #d4524a; }
.tone-juste .fill { background: #e08a1e; }
.tone-large .fill { background: #1f8a62; }
.seuil {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--mark) * 1%);
  width: 2px;
  background: #14343c;
}
.raw, .note { color: var(--muted); font-size: .88rem; }

.bilan {
  margin-top: 1.1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f4fbfb;
}
.bilan summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .8rem .95rem;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}
.bilan summary::-webkit-details-marker { display: none; }
.bilan summary::after {
  content: "";
  flex: none;
  width: .5rem;
  height: .5rem;
  border-right: 2px solid var(--teal);
  border-bottom: 2px solid var(--teal);
  transform: rotate(45deg);
}
.bilan[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.bilan table, .bilan p { margin: 0 .9rem .85rem; }

table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .5rem .3rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
.delai { white-space: nowrap; }

.ordonnance {
  margin-top: 1rem;
  padding: .9rem 1rem 1rem;
  background:
    repeating-linear-gradient(180deg, transparent, transparent 1.7rem, #e7f1f3 1.72rem),
    #fffdf8;
  border: 1px dashed #d7c7a2;
  border-radius: 14px;
}
.ordonnance h3 { display: flex; gap: .5rem; align-items: center; margin: 0; }
.rx {
  display: inline-grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: var(--cross);
  color: #fff;
  font-size: .85rem;
}
.ordonnance ol { margin: .7rem 0 0; padding-left: 1.2rem; }
.ordonnance li + li { margin-top: .4rem; }

.room-convalescence { box-shadow: inset 0 5px 0 var(--amber); }
.room-urgences { box-shadow: inset 0 5px 0 var(--cross); }
.room-pret, .room-membre { box-shadow: inset 0 5px 0 #1f8a62; }
.room-admissions { box-shadow: inset 0 5px 0 #2f6f9a; }
.room-archives { box-shadow: inset 0 5px 0 #6d675f; }

.footer {
  margin-top: 1.4rem;
  color: var(--muted);
  font-size: .82rem;
  text-align: center;
}
.footer p { margin: 0; }

.info { margin-top: 1rem; }
.info p + p { margin: .45rem 0 0; color: var(--muted); }
.info a { color: var(--teal-deep); }

@media (max-width: 800px) {
  .hall { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; }
}

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; }
  .row, .constantes { display: block; }
  button { width: 100%; margin-top: .6rem; }
  .constantes div + div { margin-top: .55rem; }
}
