:root {
  color-scheme: light;
  --bg: #f5f8fb;
  --surface: #ffffff;
  --surface-strong: #eef5fb;
  --text: #10243e;
  --muted: #667085;
  --border: #d9e3ec;
  --deep: #0b2d57;
  --blue: #1769e0;
  --blue-soft: #e8f1ff;
  --green: #16845f;
  --green-soft: #e8f7f0;
  --red: #c82626;
  --red-soft: #fff0f0;
  --amber: #b66a00;
  --shadow: 0 18px 45px rgba(16, 36, 62, 0.11);
  --shadow-soft: 0 10px 25px rgba(16, 36, 62, 0.08);
  --radius: 8px;
  --nav-height: 74px;
  --focus: 0 0 0 4px rgba(23, 105, 224, 0.18);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #09131f;
  --surface: #101f2d;
  --surface-strong: #152c3f;
  --text: #eef6ff;
  --muted: #aec1d2;
  --border: #264258;
  --deep: #8ec5ff;
  --blue: #74a9ff;
  --blue-soft: #14314e;
  --green: #54d29d;
  --green-soft: #113526;
  --red: #ff7777;
  --red-soft: #3b171c;
  --amber: #ffc46b;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
  --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(22, 132, 95, 0.11), transparent 34rem),
    linear-gradient(180deg, var(--surface-strong), var(--bg) 18rem);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

svg {
  width: 1.2em;
  height: 1.2em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.icon-sprite {
  display: none;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 1000;
  transform: translateY(-150%);
  background: var(--deep);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
}

.skip-link:focus {
  transform: translateY(0);
  outline: none;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 3vw, 2rem);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  text-align: left;
}

.brand strong {
  display: block;
  font-size: 1rem;
  line-height: 1.1;
  letter-spacing: 0;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 0.12rem;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.55rem;
  height: 2.55rem;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--deep), var(--green));
  color: #fff;
  font-weight: 850;
  letter-spacing: 0;
  box-shadow: var(--shadow-soft);
}

.top-actions,
.section-actions,
.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 2.55rem;
  height: 2.55rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--deep);
  box-shadow: var(--shadow-soft);
}

.icon-button:hover,
.icon-button:focus-visible,
.button:hover,
.button:focus-visible,
.quick-card:hover,
.quick-card:focus-visible,
.bottom-nav button:hover,
.bottom-nav button:focus-visible {
  transform: translateY(-1px);
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.emergency-mini {
  color: var(--red);
}

.main-content {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem) 0 1.5rem;
}

.view {
  display: none;
  animation: viewIn 0.28s ease both;
}

.view.active {
  display: block;
}

@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(290px, 0.8fr);
  gap: clamp(1rem, 4vw, 2rem);
  align-items: stretch;
  min-height: min(680px, calc(100vh - 11rem));
}

.hero-copy,
.hero-panel,
.card,
.quick-card {
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.hero-copy {
  padding: clamp(1.35rem, 5vw, 3rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero h1,
.section-heading h2 {
  margin: 0;
  color: var(--deep);
  letter-spacing: 0;
}

.hero h1 {
  font-size: clamp(2.7rem, 8vw, 5.7rem);
  line-height: 0.95;
}

.hero-subtitle {
  font-size: clamp(1.05rem, 2.1vw, 1.45rem);
  line-height: 1.45;
  max-width: 50rem;
  margin: 1rem 0 1.2rem;
  color: var(--text);
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--green);
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.warning-banner,
.notice {
  display: grid;
  gap: 0.25rem;
  border: 1px solid color-mix(in srgb, var(--red) 28%, transparent);
  background: var(--red-soft);
  color: var(--text);
  padding: 1rem;
  border-radius: var(--radius);
  line-height: 1.45;
}

.notice.success {
  border-color: color-mix(in srgb, var(--green) 32%, transparent);
  background: var(--green-soft);
}

.hero-actions {
  margin-top: 1.3rem;
}

.button,
.call-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--deep);
  color: #fff;
  min-height: 2.8rem;
  padding: 0.75rem 1rem;
  font-weight: 750;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  box-shadow: var(--shadow-soft);
}

.button.secondary {
  background: var(--green);
}

.button.ghost {
  background: var(--surface);
  color: var(--deep);
  border-color: var(--border);
}

.button.danger {
  background: var(--red);
}

.button.compact {
  min-height: 2.45rem;
  padding: 0.62rem 0.8rem;
  font-size: 0.91rem;
}

.button.full {
  width: 100%;
}

.button-list {
  display: grid;
  gap: 0.7rem;
}

.hero-panel {
  position: relative;
  display: grid;
  align-content: center;
  gap: 1rem;
  padding: clamp(1.2rem, 4vw, 2rem);
  overflow: hidden;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(23, 105, 224, 0.13), transparent 42%),
    linear-gradient(315deg, rgba(22, 132, 95, 0.14), transparent 48%);
  pointer-events: none;
}

.hero-panel > * {
  position: relative;
}

.pulse-card,
.metric-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem;
}

.pulse-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(22, 132, 95, 0.42);
  animation: pulse 1.7s infinite;
}

@keyframes pulse {
  70% {
    box-shadow: 0 0 0 10px rgba(22, 132, 95, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(22, 132, 95, 0);
  }
}

.metric-row {
  justify-content: space-between;
}

.metric-row div {
  display: grid;
  gap: 0.15rem;
}

.metric-row strong {
  font-size: 2rem;
  color: var(--deep);
}

.metric-row span,
.subtle {
  color: var(--muted);
  font-size: 0.9rem;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.quick-card {
  min-height: 6rem;
  display: grid;
  gap: 0.75rem;
  align-content: center;
  justify-items: start;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 1rem;
  text-align: left;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.quick-card svg {
  color: var(--blue);
  width: 1.4rem;
  height: 1.4rem;
}

.quick-card span {
  font-weight: 800;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-heading h2 {
  font-size: clamp(1.9rem, 4vw, 3.4rem);
  line-height: 1.05;
}

.section-heading p:not(.eyebrow) {
  margin: 0.55rem 0 0;
  color: var(--muted);
  max-width: 48rem;
  line-height: 1.5;
}

.emergency-heading h2 {
  color: var(--red);
}

.call-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.call-button {
  min-height: 4.4rem;
  font-size: 1.35rem;
}

.call-15 {
  background: var(--red);
}

.call-112 {
  background: var(--deep);
}

.card {
  padding: clamp(1rem, 3vw, 1.35rem);
  margin-bottom: 1rem;
}

.card h3 {
  margin: 0 0 0.75rem;
  color: var(--deep);
  letter-spacing: 0;
}

.card p {
  line-height: 1.55;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.info-card,
.tip-card {
  margin-bottom: 0;
}

.sign-grid,
.check-grid,
.chip-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.sign-grid span,
.check-grid label,
.chip-grid label,
.trigger-item {
  border: 1px solid var(--border);
  background: var(--surface-strong);
  border-radius: var(--radius);
  padding: 0.75rem;
  line-height: 1.35;
}

.sign-grid span {
  color: var(--red);
  font-weight: 800;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.15fr);
  gap: 1rem;
  align-items: start;
}

.stack {
  display: grid;
  gap: 1rem;
}

.stack .card {
  margin-bottom: 0;
}

.form-card,
.inline-form {
  display: grid;
  gap: 1rem;
}

.form-grid {
  display: grid;
  gap: 0.85rem;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label,
fieldset {
  display: grid;
  gap: 0.52rem;
  color: var(--text);
  font-weight: 720;
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

legend {
  margin-bottom: 0.5rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 0.8rem 0.85rem;
}

textarea {
  resize: vertical;
}

input[type="checkbox"] {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--blue);
  padding: 0;
}

input[type="range"] {
  accent-color: var(--blue);
}

.range-label {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem;
}

.check-grid label,
.chip-grid label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 650;
}

.inline-form {
  grid-template-columns: minmax(200px, 1.2fr) minmax(160px, 0.6fr) auto;
  align-items: end;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.card-title-row h3 {
  margin: 0;
}

canvas {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 10rem;
}

.history-list,
.document-list,
.trigger-list {
  display: grid;
  gap: 0.75rem;
}

.history-item,
.document-item,
.trigger-item {
  display: grid;
  gap: 0.55rem;
}

.history-item {
  border: 1px solid var(--border);
  background: var(--surface-strong);
  border-radius: var(--radius);
  padding: 0.85rem;
}

.item-head,
.item-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.badge-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.28rem 0.55rem;
  font-size: 0.82rem;
  color: var(--text);
}

.badge.danger {
  background: var(--red-soft);
  border-color: color-mix(in srgb, var(--red) 25%, var(--border));
  color: var(--red);
}

.badge.success {
  background: var(--green-soft);
  border-color: color-mix(in srgb, var(--green) 25%, var(--border));
  color: var(--green);
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--deep);
  padding: 0.45rem 0.65rem;
  font-weight: 750;
}

.text-button.danger {
  color: var(--red);
}

.trigger-category {
  margin-bottom: 1rem;
}

.trigger-category h3 {
  margin: 0 0 0.6rem;
  color: var(--deep);
}

.trigger-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.trigger-item {
  background: var(--surface);
}

.trigger-item label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-weight: 800;
}

.trigger-meta,
.medical-note {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.summary-block {
  display: grid;
  gap: 0.85rem;
}

.summary-block dl,
.center-fields {
  display: grid;
  grid-template-columns: minmax(9rem, 0.35fr) minmax(0, 1fr);
  gap: 0.45rem 0.8rem;
  margin: 0;
}

.summary-block dt,
.center-fields dt {
  color: var(--muted);
  font-weight: 800;
}

.summary-block dd,
.center-fields dd {
  margin: 0;
  min-width: 0;
}

.summary-block ul {
  margin: 0.25rem 0 0;
  padding-left: 1.2rem;
  line-height: 1.55;
}

.print-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.85rem;
  margin-bottom: 0.85rem;
}

.print-header h3,
.print-header p {
  margin: 0;
}

.print-header p {
  color: var(--muted);
  margin-top: 0.15rem;
}

.settings-card {
  display: grid;
  gap: 1rem;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  padding: 0.35rem;
  border-radius: 12px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
}

.segmented button {
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  min-height: 2.4rem;
  font-weight: 800;
}

.segmented button.active {
  background: var(--surface);
  color: var(--deep);
  box-shadow: var(--shadow-soft);
}

.danger-zone {
  border-color: color-mix(in srgb, var(--red) 25%, var(--border));
}

.document-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-strong);
  padding: 0.85rem;
}

.bottom-nav {
  position: fixed;
  z-index: 60;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  padding: 0.35rem max(0.6rem, env(safe-area-inset-left)) calc(0.35rem + env(safe-area-inset-bottom)) max(0.6rem, env(safe-area-inset-right));
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.bottom-nav-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(4.6rem, 1fr);
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.bottom-nav-scroll::-webkit-scrollbar {
  display: none;
}

.bottom-nav button {
  display: grid;
  place-items: center;
  gap: 0.2rem;
  min-height: 3.75rem;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.bottom-nav svg {
  width: 1.25rem;
  height: 1.25rem;
}

.bottom-nav button[aria-current="page"] {
  background: var(--blue-soft);
  color: var(--deep);
}

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: calc(var(--nav-height) + 1rem + env(safe-area-inset-bottom));
  transform: translate(-50%, 1rem);
  opacity: 0;
  pointer-events: none;
  max-width: min(92vw, 36rem);
  border-radius: 999px;
  background: var(--deep);
  color: #fff;
  padding: 0.8rem 1rem;
  box-shadow: var(--shadow);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.pdf-stage {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 794px;
  background: #fff;
  color: #152033;
  pointer-events: none;
}

.pdf-document {
  width: 794px;
  min-height: 1123px;
  background: #fff;
  color: #152033;
  padding: 42px 44px 58px;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.38;
}

.pdf-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  border-bottom: 2px solid #dce7f0;
  padding-bottom: 18px;
  margin-bottom: 22px;
}

.pdf-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pdf-logo {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #0b2d57;
  color: #fff;
  font-weight: 800;
}

.pdf-document h1 {
  margin: 0;
  color: #0b2d57;
  font-size: 26px;
}

.pdf-document h2 {
  margin: 22px 0 10px;
  color: #0b2d57;
  font-size: 17px;
  border-left: 4px solid #16845f;
  padding-left: 10px;
}

.pdf-document h3 {
  margin: 14px 0 8px;
  color: #0b2d57;
  font-size: 14px;
}

.pdf-meta {
  text-align: right;
  color: #546371;
  font-size: 12px;
}

.pdf-warning {
  margin-top: 20px;
  border: 1px solid #f0c3c3;
  background: #fff4f4;
  color: #5f1515;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
}

.pdf-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 16px;
  font-size: 12px;
}

.pdf-table th,
.pdf-table td {
  border: 1px solid #dce7f0;
  padding: 8px;
  vertical-align: top;
}

.pdf-table th {
  background: #eef5fb;
  color: #0b2d57;
  text-align: left;
}

.pdf-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 6px 12px;
  font-size: 13px;
}

.pdf-grid dt {
  color: #546371;
  font-weight: 700;
}

.pdf-grid dd {
  margin: 0;
}

.pdf-section {
  break-inside: avoid;
}

.pdf-list {
  margin: 6px 0 12px;
  padding-left: 20px;
}

.pdf-list li {
  margin: 3px 0;
}

@media (min-width: 1180px) {
  .bottom-nav {
    left: 50%;
    transform: translateX(-50%);
    width: min(1120px, calc(100% - 2rem));
    bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
  }

  .bottom-nav-scroll {
    grid-auto-columns: minmax(5.3rem, 1fr);
  }
}

@media (max-width: 960px) {
  .hero,
  .split-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .quick-grid,
  .content-grid,
  .trigger-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-heading {
    display: grid;
  }
}

@media (max-width: 680px) {
  .main-content {
    width: min(100% - 1rem, 1180px);
    padding-top: 0.7rem;
  }

  .topbar {
    padding: 0.7rem 0.75rem;
  }

  .brand small {
    display: none;
  }

  .hero-copy {
    padding: 1.1rem;
  }

  .hero h1 {
    font-size: 3.1rem;
  }

  .hero-actions,
  .section-actions,
  .call-panel,
  .form-grid.two,
  .inline-form,
  .quick-grid,
  .content-grid,
  .sign-grid,
  .check-grid,
  .chip-grid,
  .trigger-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .section-actions {
    align-items: stretch;
  }

  .button,
  .call-button {
    width: 100%;
  }

  .call-button {
    min-height: 3.8rem;
  }

  .summary-block dl,
  .center-fields {
    grid-template-columns: 1fr;
  }

  .quick-card {
    min-height: 4.7rem;
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  .toast {
    border-radius: 14px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .topbar,
  .bottom-nav,
  .section-heading,
  .call-panel,
  .toast,
  .skip-link,
  form,
  .quick-grid,
  .hero,
  .content-grid,
  .danger-zone {
    display: none !important;
  }

  .app-shell {
    padding: 0;
  }

  .main-content {
    width: 100%;
    padding: 0;
  }

  .view {
    display: block !important;
    animation: none;
  }

  .view:not(.print-target-view) {
    display: none !important;
  }

  .card.printable {
    display: block !important;
    border: 0;
    box-shadow: none;
    margin: 0;
    padding: 0;
  }
}

/* Base documentaire et PDF */
.doc-actions { margin-bottom: 1rem; }
.inline-list { display:flex; flex-wrap:wrap; gap:.75rem; }
.document-card { line-height: 1.65; }
.document-card h3 { color: var(--ink); margin-bottom:.6rem; }
.personal-principle { border-left: 4px solid var(--accent); background: rgba(29, 111, 230, .08); padding: 1rem; border-radius: 14px; margin-top: 1rem; }
.clean-list { padding-left:1.2rem; line-height:1.7; }
.pdf-guide-card { display:flex; flex-direction:column; gap:.75rem; }
.pdf-guide-card .button { margin-top:auto; }
.source-card { margin-top: 1rem; border:1px solid rgba(35, 91, 166, .18); }
.pdf-stage .pdf-section p { line-height:1.55; }
.pdf-stage .pdf-list li { margin-bottom:4px; }
@media (max-width:720px){ .inline-list .button{width:100%; justify-content:center;} }


/* Prévisualisation PDF intégrée */
body.preview-open { overflow: hidden; }
.guide-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; margin-top: auto; }
.guide-actions .button { margin-top: 0; }
.link-button { background: transparent; color: var(--accent); border: 1px solid rgba(29,111,230,.25); }
.danger-soft { background: rgba(214, 61, 61, .12); color: #9d1f1f; border-color: rgba(214, 61, 61, .25); }
.pdf-preview-modal { position: fixed; inset: 0; z-index: 250; display: none; }
.pdf-preview-modal.open { display: block; }
.pdf-preview-backdrop { position: absolute; inset: 0; background: rgba(8, 19, 35, .72); backdrop-filter: blur(8px); }
.pdf-preview-panel { position: absolute; inset: clamp(.4rem, 2vw, 1.2rem); display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(255,255,255,.16); border-radius: 28px; background: var(--panel); box-shadow: var(--shadow-strong); }
.pdf-preview-header { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 1rem; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(235,244,255,.9)); }
[data-theme="dark"] .pdf-preview-header { background: linear-gradient(135deg, rgba(18, 28, 45, .98), rgba(12, 38, 71, .94)); }
.pdf-preview-header h2 { margin: .1rem 0 0; font-size: clamp(1.05rem, 2vw, 1.45rem); }
.pdf-preview-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.pdf-preview-image-wrap { flex: 1; overflow: auto; padding: 1rem; background: #eef3f8; text-align: center; }
.pdf-preview-image-wrap img { display: block; width: min(100%, 860px); height: auto; margin: 0 auto; border: 1px solid rgba(12, 31, 51, .14); border-radius: 10px; background: #fff; box-shadow: 0 18px 40px rgba(13, 31, 53, .12); }
.pdf-preview-frame { flex: 1; width: 100%; height: 100%; border: 0; background: #f7f8fb; }
@media (max-width: 760px) {
  .guide-actions { grid-template-columns: 1fr; }
  .pdf-preview-panel { inset: 0; border-radius: 0; }
  .pdf-preview-header { align-items: flex-start; flex-direction: column; }
  .pdf-preview-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .pdf-preview-actions .button, .pdf-preview-actions a.button { width: 100%; justify-content: center; }
}


/* Contributions / évolution SAMA Care */
.contribution-card textarea { min-height: 130px; }
.checkline { display:flex; align-items:flex-start; gap:.7rem; font-weight:600; }
.checkline input { width:auto; margin-top:.25rem; }
.form-status { min-height:1.4rem; font-weight:700; color:var(--primary); }
.hp-field { display: none !important; }
.status-steps { display:grid; gap:.55rem; margin:1rem 0; }
.status-steps span { padding:.7rem .85rem; border-radius:16px; background:rgba(11,45,87,.08); border:1px solid rgba(11,45,87,.08); font-weight:800; }
.contribution-list { display:grid; gap:1rem; }
.contribution-item { padding:1rem; border-radius:20px; background:rgba(255,255,255,.7); border:1px solid rgba(11,45,87,.12); }
.dark .contribution-item { background:rgba(255,255,255,.06); border-color:rgba(255,255,255,.12); }
.pill { display:inline-flex; align-items:center; border-radius:999px; padding:.25rem .65rem; font-size:.78rem; font-weight:900; background:rgba(19,110,93,.12); color:var(--success); }
.empty-state { padding:1rem; border-radius:18px; background:rgba(11,45,87,.06); color:var(--muted); }
.admin-shell { max-width:1180px; margin:0 auto; padding:24px; }
.admin-top { display:flex; justify-content:space-between; gap:1rem; align-items:center; margin-bottom:1rem; }
.admin-table-wrap { overflow:auto; border-radius:24px; border:1px solid rgba(11,45,87,.12); background:#fff; }
.admin-table { width:100%; border-collapse:collapse; min-width:980px; }
.admin-table th,.admin-table td { padding:.9rem; border-bottom:1px solid rgba(11,45,87,.1); vertical-align:top; text-align:left; }
.admin-table th { background:rgba(11,45,87,.08); font-size:.82rem; text-transform:uppercase; letter-spacing:.04em; }
.admin-actions { display:flex; gap:.45rem; flex-wrap:wrap; }
.admin-actions button { border:0; border-radius:12px; padding:.55rem .75rem; font-weight:900; cursor:pointer; }
.admin-actions .approve { background:#dff7ef; color:#136e5d; }
.admin-actions .reject { background:#ffe5e5; color:#9d1f2f; }
.admin-actions .archive { background:#eef2f7; color:#334155; }
.login-box { max-width:440px; margin:8vh auto; }

/* Centres spécialisés CEREMAST */
.centers-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.center-card {
  position: relative;
  overflow: hidden;
}
.center-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .75rem;
}
.center-city,
.center-badge,
.mini-stats span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: .35rem .65rem;
  font-size: .78rem;
  font-weight: 800;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  color: var(--deep);
}
.center-badge {
  color: var(--accent);
}
.center-tools label {
  display: grid;
  gap: .5rem;
  font-weight: 800;
}
.center-tools input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  font: inherit;
  background: var(--surface-strong);
  color: var(--text);
}
.mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .8rem;
}
.source-note {
  color: var(--muted);
  font-size: .92rem;
}
@media (max-width: 900px) {
  .centers-grid { grid-template-columns: 1fr; }
}

/* Navigation mobile ergonomique : 5 onglets rapides + menu Plus */
.mobile-more-button,
.mobile-nav-modal {
  display: none;
}

@media (max-width: 760px) {
  :root { --nav-height: 70px; }

  .bottom-nav {
    padding: 0.32rem max(0.5rem, env(safe-area-inset-left)) calc(0.32rem + env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-right));
  }

  .bottom-nav-scroll {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-flow: initial;
    grid-auto-columns: initial;
    overflow-x: visible;
    gap: 0.18rem;
  }

  .bottom-nav [data-route]:not([data-mobile-main="true"]) {
    display: none;
  }

  .bottom-nav .mobile-more-button {
    display: grid;
    place-items: center;
    gap: 0.18rem;
    min-height: 3.55rem;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 900;
  }

  .bottom-nav button {
    min-height: 3.55rem;
    font-size: 0.68rem;
    border-radius: 14px;
  }

  .bottom-nav svg {
    width: 1.18rem;
    height: 1.18rem;
  }

  .mobile-nav-modal[aria-hidden="false"] {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 95;
  }

  .mobile-nav-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 18, 34, 0.52);
    backdrop-filter: blur(8px);
  }

  .mobile-nav-sheet {
    position: absolute;
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(var(--nav-height) + 0.65rem + env(safe-area-inset-bottom));
    max-height: min(72vh, 620px);
    overflow: auto;
    background: color-mix(in srgb, var(--surface) 97%, transparent);
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: 0 24px 70px rgba(7, 30, 58, 0.28);
    padding: 1rem;
  }

  .mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.85rem;
  }

  .mobile-nav-header h2 {
    margin: 0;
    font-size: 1.35rem;
  }

  .mobile-nav-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  .mobile-nav-grid button {
    min-height: 5.2rem;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface-strong);
    color: var(--ink);
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 0.38rem;
    text-align: center;
    font-weight: 900;
    padding: 0.8rem 0.5rem;
    box-shadow: var(--shadow-soft);
  }

  .mobile-nav-grid svg {
    width: 1.35rem;
    height: 1.35rem;
    color: var(--blue);
  }

  .mobile-nav-grid [aria-current="page"] {
    background: var(--blue-soft);
    color: var(--deep);
    border-color: color-mix(in srgb, var(--blue) 28%, var(--border));
  }
}

@media (min-width: 761px) {
  .mobile-more-button,
  .mobile-nav-modal {
    display: none !important;
  }
}

/* Ajustement accueil : version PC en une seule page + mobile plus compact */
@media (min-width: 961px) {
  .app-shell {
    padding-bottom: calc(58px + env(safe-area-inset-bottom));
  }

  .main-content {
    padding-top: clamp(0.75rem, 1.8vw, 1.35rem);
  }

  .hero {
    min-height: auto;
    height: clamp(375px, 56vh, 535px);
    grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
    gap: clamp(1.15rem, 2.4vw, 1.85rem);
  }

  .hero-copy {
    padding: clamp(1.8rem, 3.4vw, 2.7rem);
  }

  .hero h1 {
    font-size: clamp(4rem, 6.1vw, 5.55rem);
  }

  .hero-subtitle {
    font-size: clamp(1.08rem, 1.7vw, 1.45rem);
    margin: 0.85rem 0 1.05rem;
  }

  .warning-banner,
  .notice {
    padding: 0.88rem 1rem;
  }

  .hero-actions {
    margin-top: 1rem;
  }

  .hero-panel {
    padding: clamp(1.2rem, 2.35vw, 1.75rem);
    gap: 0.75rem;
  }

  .pulse-card,
  .metric-row {
    padding: 0.85rem;
  }

  .metric-row strong {
    font-size: 1.85rem;
  }

  #homeMiniChart {
    max-height: 145px;
  }

  .quick-grid {
    margin-top: 0.9rem;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.65rem;
  }

  .quick-card {
    min-height: 5.55rem;
    padding: 0.9rem 0.95rem;
    gap: 0.45rem;
  }

  .quick-card svg {
    width: 1.25rem;
    height: 1.25rem;
  }

  .quick-card span {
    font-size: 0.96rem;
    line-height: 1.15;
  }

  .bottom-nav {
    min-height: 58px;
    padding-top: 0.25rem;
    padding-bottom: calc(0.25rem + env(safe-area-inset-bottom));
  }

  .bottom-nav button {
    min-height: 2.95rem;
    font-size: 0.66rem;
    gap: 0.12rem;
  }

  .bottom-nav svg {
    width: 1.05rem;
    height: 1.05rem;
  }
}

@media (min-width: 961px) and (max-height: 820px) {
  .hero {
    height: clamp(335px, 51vh, 440px);
  }

  .hero h1 {
    font-size: clamp(3.45rem, 5.45vw, 4.8rem);
  }

  .hero-subtitle {
    font-size: 1.12rem;
    line-height: 1.35;
  }

  .eyebrow {
    margin-bottom: 0.45rem;
    font-size: 0.68rem;
  }

  .quick-card {
    min-height: 4.95rem;
  }

  .hero-panel canvas {
    max-height: 105px;
  }
}

@media (max-width: 680px) {
  .hero {
    gap: 0.8rem;
  }

  .hero-copy {
    min-height: auto;
  }

  .hero h1 {
    font-size: clamp(2.45rem, 14vw, 3.25rem);
  }

  .hero-subtitle {
    font-size: 1rem;
    margin: 0.65rem 0 0.85rem;
  }

  .warning-banner,
  .notice {
    padding: 0.8rem;
  }

  .hero-panel {
    min-height: auto;
    padding: 0.9rem;
  }

  #homeMiniChart {
    max-height: 95px;
  }

  .quick-grid {
    gap: 0.55rem;
  }

  .quick-card {
    min-height: 4.15rem;
    padding: 0.8rem;
  }
}

/* --- CEREMAST additions: appointment workflow + interactive map --- */
.step-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: grid;
  gap: .85rem;
}
.step-list li {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: .75rem;
  align-items: start;
  padding: .9rem;
  border: 1px solid var(--border, #dfe7ef);
  border-radius: 1rem;
  background: rgba(255,255,255,.72);
}
.step-list li::before {
  content: counter(list-item);
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--primary, #0b2d57);
  color: #fff;
  font-weight: 800;
}
.step-list strong,
.step-list span { grid-column: 2; }
.step-list span { color: var(--muted, #65748b); }
.large-tags { gap: .55rem; }
.large-tags span {
  display: inline-flex;
  padding: .5rem .75rem;
  border-radius: 999px;
  background: rgba(37, 99, 235, .08);
  border: 1px solid rgba(37, 99, 235, .16);
  color: var(--primary, #0b2d57);
  font-weight: 700;
  font-size: .9rem;
}
.pathway {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .65rem;
  margin: 1rem 0;
}
.pathway span {
  position: relative;
  padding: .75rem .65rem;
  border-radius: .85rem;
  text-align: center;
  background: linear-gradient(135deg, rgba(11,45,87,.08), rgba(48,144,104,.08));
  border: 1px solid rgba(11,45,87,.12);
  font-weight: 800;
  font-size: .88rem;
}
.rdv-checklist label {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin: .45rem 0;
  color: var(--text, #12233d);
}
.rdv-checklist input { width: 1.05rem; height: 1.05rem; }
.map-card { overflow: hidden; }
.map-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}
.france-map {
  position: relative;
  min-height: 520px;
  border-radius: 1.4rem;
  overflow: hidden;
  border: 1px solid rgba(11,45,87,.12);
  background:
    radial-gradient(circle at 50% 45%, rgba(48,144,104,.16), transparent 28%),
    radial-gradient(circle at 45% 40%, rgba(11,45,87,.12), transparent 36%),
    linear-gradient(135deg, #f8fbff, #edf7f2);
}
.france-map::before {
  content: "";
  position: absolute;
  inset: 7% 20% 8% 22%;
  background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(255,255,255,.55));
  clip-path: polygon(48% 0, 64% 7%, 76% 20%, 87% 34%, 81% 51%, 90% 68%, 75% 82%, 59% 98%, 42% 89%, 30% 76%, 13% 73%, 20% 55%, 9% 38%, 24% 26%, 32% 10%);
  border: 1px solid rgba(11,45,87,.10);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.45), 0 18px 50px rgba(12, 35, 64, .10);
}
.france-map::after {
  content: "Carte indicative — vérifiez toujours les informations auprès du centre";
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  font-size: .8rem;
  color: var(--muted, #65748b);
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(8px);
  padding: .45rem .65rem;
  border-radius: 999px;
  border: 1px solid rgba(11,45,87,.10);
}
.map-pin {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  z-index: 2;
  border: 0;
  border-radius: 999px;
  padding: .42rem .62rem .42rem 1.4rem;
  background: #fff;
  color: #0b2d57;
  font-size: .78rem;
  font-weight: 900;
  box-shadow: 0 10px 28px rgba(11,45,87,.18);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.map-pin::before {
  content: "";
  position: absolute;
  left: .48rem;
  top: 50%;
  width: .55rem;
  height: .55rem;
  border-radius: 999px;
  background: #e11d48;
  transform: translateY(-50%);
  box-shadow: 0 0 0 4px rgba(225,29,72,.14);
}
.map-pin:hover,
.map-pin.active {
  transform: translate(-50%, -50%) scale(1.06);
  background: #0b2d57;
  color: #fff;
  box-shadow: 0 16px 40px rgba(11,45,87,.28);
}
.map-pin.active::before { background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.18); }
.center-card { transition: transform .18s ease, box-shadow .18s ease; }
.center-card:hover { transform: translateY(-2px); }
@media (max-width: 900px) {
  .pathway { grid-template-columns: 1fr; }
  .map-header { flex-direction: column; }
  .france-map { min-height: 430px; }
  .map-pin { font-size: .7rem; padding: .36rem .5rem .36rem 1.15rem; }
}
@media (max-width: 560px) {
  .france-map { min-height: 390px; }
  .map-pin { max-width: 105px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}


/* Correctif final accueil desktop/tablette : évite le chevauchement sur navigateurs/zooms différents */
@media (min-width: 961px) {
  .view[data-page="home"].active {
    display: grid;
    grid-template-rows: auto auto;
    gap: 0.85rem;
  }

  .hero {
    height: auto !important;
    min-height: auto !important;
    align-items: stretch;
    margin-bottom: 0;
  }

  .hero-copy,
  .hero-panel {
    min-height: clamp(380px, 47vh, 535px);
  }

  .hero-copy {
    justify-content: center;
    overflow: visible;
  }

  .quick-grid {
    position: relative;
    z-index: 3;
    margin-top: 0;
    align-items: stretch;
  }
}

@media (min-width: 961px) and (max-height: 860px) {
  .main-content {
    padding-top: 0.85rem;
  }

  .hero {
    gap: clamp(0.85rem, 1.6vw, 1.25rem);
  }

  .hero-copy,
  .hero-panel {
    min-height: 0;
  }

  .hero-copy {
    padding: clamp(1.3rem, 2.45vw, 2.15rem);
  }

  .hero h1 {
    font-size: clamp(3.75rem, 5.65vw, 5rem);
  }

  .hero-subtitle {
    font-size: clamp(1.02rem, 1.45vw, 1.28rem);
    margin: 0.7rem 0 0.85rem;
  }

  .warning-banner,
  .notice {
    padding: 0.78rem 0.9rem;
  }

  .hero-actions {
    margin-top: 0.8rem;
  }

  .quick-card {
    min-height: 5rem;
  }
}

@media (min-width: 961px) and (max-height: 730px) {
  .hero h1 {
    font-size: clamp(3.25rem, 5vw, 4.35rem);
  }

  .hero-copy {
    padding: 1.2rem 1.55rem;
  }

  .hero-panel {
    padding: 1.05rem 1.25rem;
  }

  .warning-banner,
  .notice {
    font-size: 0.92rem;
    line-height: 1.35;
  }

  .button,
  .call-button {
    min-height: 2.45rem;
    padding: 0.62rem 0.85rem;
  }

  .quick-card {
    min-height: 4.55rem;
    padding: 0.72rem 0.78rem;
  }

  .quick-card span {
    font-size: 0.9rem;
  }

  #homeMiniChart {
    max-height: 95px;
  }
}

@media (min-width: 761px) and (max-width: 1180px) {
  .bottom-nav-scroll {
    grid-auto-columns: minmax(5.8rem, 1fr);
  }

  .bottom-nav button {
    white-space: normal;
  }
}

/* Sécurité générale : aucun bloc ne doit passer sous la barre de navigation */
.main-content {
  padding-bottom: calc(var(--nav-height) + 1.5rem + env(safe-area-inset-bottom));
}


/* LANCEMENT COMPLET — correctifs robustes accueil/navigation/recherche */
.topbar {
  gap: 1rem;
}
.top-search {
  position: relative;
  flex: 1 1 34rem;
  max-width: 38rem;
  min-width: 15rem;
  display: flex;
  align-items: center;
  gap: .55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  padding: .55rem .85rem;
  box-shadow: 0 8px 24px rgba(11,45,87,.06);
}
.top-search svg {
  width: 1.05rem;
  height: 1.05rem;
  color: var(--muted);
  flex: 0 0 auto;
}
.top-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: .92rem;
}
.search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + .45rem);
  z-index: 80;
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 22px 50px rgba(11,45,87,.18);
  overflow: hidden;
}
.search-results.open { display: grid; }
.search-results button,
.search-empty {
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: .85rem 1rem;
  display: grid;
  gap: .18rem;
  cursor: pointer;
}
.search-results button:hover { background: color-mix(in srgb, var(--blue) 9%, transparent); }
.search-results span,
.search-empty { color: var(--muted); font-size: .84rem; }

.home-insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin-top: .85rem;
}
.insight-card {
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 4px);
  box-shadow: var(--shadow-soft);
  padding: .9rem 1rem;
  display: grid;
  gap: .25rem;
  min-height: 5.2rem;
}
.insight-card span { color: var(--muted); font-size: .82rem; font-weight: 800; }
.insight-card strong { color: var(--deep); font-size: 1.15rem; }
.insight-card small { color: var(--muted); line-height: 1.35; }
.support-card { align-self: start; }
.compact-list { padding-left: 1.1rem; margin: .5rem 0; display: grid; gap: .35rem; }
.emergency-helper { margin-bottom: 1rem; }

@media (min-width: 961px) {
  .view[data-page="home"].active {
    display: block !important;
  }
  .hero {
    min-height: 0 !important;
    height: auto !important;
    grid-template-columns: minmax(0, 1.12fr) minmax(280px, .88fr);
    align-items: stretch;
    gap: clamp(.85rem, 1.7vw, 1.4rem);
  }
  .hero-copy,
  .hero-panel {
    min-height: clamp(310px, 42vh, 485px) !important;
  }
  .hero-copy { padding: clamp(1.55rem, 3.2vw, 2.55rem); }
  .hero h1 { font-size: clamp(4.1rem, 6.25vw, 5.9rem); }
  .hero-subtitle { font-size: clamp(1.08rem, 1.6vw, 1.34rem); margin: .85rem 0 1rem; }
  .quick-grid {
    position: relative !important;
    z-index: 2;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-top: .85rem !important;
    gap: .75rem;
  }
  .quick-card { min-height: 5.05rem !important; padding: .8rem .9rem; }
}
@media (min-width: 961px) and (max-height: 760px) {
  .topbar { min-height: 3.8rem; }
  .main-content { padding-top: .7rem; }
  .hero-copy,
  .hero-panel { min-height: 0 !important; }
  .hero-copy { padding: 1.15rem 1.45rem; }
  .hero h1 { font-size: clamp(3.45rem, 5.4vw, 4.7rem); }
  .hero-subtitle { font-size: 1.03rem; margin: .55rem 0 .7rem; }
  .warning-banner { padding: .7rem .85rem; font-size: .9rem; }
  .hero-actions { margin-top: .7rem; }
  .button { min-height: 2.35rem; padding: .55rem .8rem; }
  .home-insights { margin-top: .65rem; gap: .55rem; }
  .insight-card { min-height: 4.15rem; padding: .62rem .75rem; }
  .insight-card small { display: none; }
  .quick-grid { margin-top: .65rem !important; gap: .55rem; }
  .quick-card { min-height: 4.05rem !important; padding: .6rem .7rem; gap: .3rem; }
  .quick-card svg { width: 1.1rem; height: 1.1rem; }
  .quick-card span { font-size: .83rem; line-height: 1.15; }
  #homeMiniChart { max-height: 72px; }
}
@media (max-width: 960px) {
  .top-search { order: 3; flex-basis: 100%; max-width: none; }
  .topbar { flex-wrap: wrap; }
  .home-insights { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .top-search { display: none; }
  .hero-copy, .hero-panel { min-height: 0 !important; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-card { min-height: 4.5rem; }
}
@media (max-width: 480px) {
  .quick-grid { grid-template-columns: 1fr; }
}

/* === SAMA Care v17 — introduction immersive conservée et correctifs premium === */
body.intro-open {
  overflow: hidden;
}

.intro-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 3vw, 2rem);
  background:
    radial-gradient(circle at 18% 18%, rgba(22, 132, 95, 0.22), transparent 32rem),
    radial-gradient(circle at 85% 12%, rgba(23, 105, 224, 0.20), transparent 30rem),
    linear-gradient(145deg, #f8fcff 0%, #eef7f5 45%, #f8fbff 100%);
  color: #10243e;
  overflow: hidden;
  transition: opacity .45s ease, visibility .45s ease;
}

.intro-gate.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(12px);
  opacity: .75;
  animation: introFloat 9s ease-in-out infinite alternate;
}

.intro-orb-one {
  width: 23rem;
  height: 23rem;
  left: -6rem;
  bottom: 8%;
  background: rgba(22, 132, 95, .16);
}

.intro-orb-two {
  width: 18rem;
  height: 18rem;
  right: -4rem;
  top: 10%;
  background: rgba(23, 105, 224, .14);
  animation-delay: -2s;
}

@keyframes introFloat {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(1.5rem, -1rem, 0) scale(1.06); }
}

.intro-card {
  position: relative;
  width: min(960px, 100%);
  max-height: min(92vh, 940px);
  overflow: auto;
  padding: clamp(1.25rem, 5vw, 3.4rem);
  border: 1px solid rgba(217, 227, 236, .86);
  border-radius: 32px;
  background: rgba(255, 255, 255, .84);
  box-shadow: 0 34px 90px rgba(11, 45, 87, .16);
  backdrop-filter: blur(20px);
  text-align: center;
  animation: introCardIn .75s ease both;
}

@keyframes introCardIn {
  from { opacity: 0; transform: translateY(18px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.intro-logo {
  display: inline-grid;
  place-items: center;
  width: 4.2rem;
  height: 4.2rem;
  margin-bottom: 1.2rem;
  border-radius: 20px;
  background: linear-gradient(135deg, #0b2d57, #16845f);
  color: #fff;
  font-weight: 950;
  letter-spacing: -.04em;
  box-shadow: 0 20px 40px rgba(11, 45, 87, .22);
}

.intro-card h1 {
  margin: 0;
  color: #0b2d57;
  font-size: clamp(3.2rem, 10vw, 6.8rem);
  line-height: .9;
  letter-spacing: -.065em;
}

.intro-lead {
  margin: 1rem auto 1.2rem;
  max-width: 760px;
  color: #10243e;
  font-size: clamp(1.25rem, 2.5vw, 1.8rem);
  line-height: 1.35;
  font-weight: 700;
}

.intro-story {
  display: grid;
  gap: .75rem;
  max-width: 780px;
  margin: 0 auto;
  color: #34465f;
  font-size: clamp(1rem, 1.5vw, 1.14rem);
  line-height: 1.65;
}

.intro-story p {
  margin: 0;
}

.intro-card blockquote {
  margin: 1.4rem auto 0;
  max-width: 760px;
  padding: 1.15rem 1.25rem;
  border: 1px solid rgba(22, 132, 95, .24);
  border-radius: 22px;
  background: rgba(232, 247, 240, .72);
  color: #0b2d57;
  font-size: clamp(1.08rem, 2vw, 1.45rem);
  line-height: 1.45;
  font-weight: 800;
}


.intro-option {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  width: min(100%, 640px);
  margin: .4rem auto 1.1rem;
  padding: .85rem 1rem;
  border-radius: 18px;
  background: rgba(255,255,255,.68);
  border: 1px solid rgba(44, 90, 140, .15);
  color: #31506f;
  font-size: .92rem;
  line-height: 1.35;
  text-align: left;
}
.intro-option input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: .08rem;
}
.brand { cursor: pointer; }

.intro-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .8rem;
  margin-top: 1.5rem;
}

.intro-skip {
  margin-top: 1rem;
  border: 0;
  background: transparent;
  color: #667085;
  font-weight: 800;
  text-decoration: underline;
}

.home-human {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
  gap: 1rem;
  margin-top: 1rem;
  padding: clamp(1.1rem, 3vw, 2rem);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--green-soft) 74%, transparent), color-mix(in srgb, var(--blue-soft) 48%, transparent)),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

.human-copy h2 {
  margin: 0 0 .6rem;
  color: var(--deep);
  font-size: clamp(1.7rem, 3.4vw, 3rem);
  line-height: 1;
}

.human-copy p {
  margin: .55rem 0 0;
  color: var(--text);
  line-height: 1.55;
}

.human-points {
  display: grid;
  gap: .65rem;
}

.human-points article {
  display: grid;
  gap: .18rem;
  padding: .95rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
}

.human-points strong {
  color: var(--deep);
}

.human-points span {
  color: var(--muted);
  line-height: 1.35;
  font-size: .94rem;
}

.checkbox-grid,
.chip-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)) !important;
}

.checkbox-chip,
.symptom-chip,
.trigger-chip,
.check-card,
label.choice-card {
  min-height: 72px;
  align-items: center;
  line-height: 1.2;
  overflow: visible;
}

.checkbox-chip span,
.symptom-chip span,
.trigger-chip span,
.check-card span,
label.choice-card span {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.checkbox-chip input,
.symptom-chip input,
.trigger-chip input,
.check-card input,
label.choice-card input {
  flex-shrink: 0;
}

@media (min-width: 1100px) {
  .hero {
    min-height: auto;
  }
  .home-human,
  .home-insights,
  .quick-grid {
    max-width: 100%;
  }
}

@media (max-width: 980px) {
  .home-human {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .intro-card {
    border-radius: 24px;
    padding: 1.15rem;
    text-align: left;
  }
  .intro-logo,
  
.intro-option {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  width: min(100%, 640px);
  margin: .4rem auto 1.1rem;
  padding: .85rem 1rem;
  border-radius: 18px;
  background: rgba(255,255,255,.68);
  border: 1px solid rgba(44, 90, 140, .15);
  color: #31506f;
  font-size: .92rem;
  line-height: 1.35;
  text-align: left;
}
.intro-option input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: .08rem;
}
.brand { cursor: pointer; }

.intro-actions {
    margin-left: auto;
    margin-right: auto;
  }
  .intro-card h1,
  .intro-card .eyebrow,
  .intro-lead,
  .intro-card blockquote {
    text-align: center;
  }
  .intro-actions .button {
    width: 100%;
  }
  .home-human {
    padding: 1rem;
  }
  .human-points {
    grid-template-columns: 1fr;
  }
  .checkbox-grid,
  .chip-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-orb,
  .intro-card,
  .pulse-dot {
    animation: none !important;
  }
}

.external-protocol-card .card-title-row {
  gap: .75rem;
}
.source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: .35rem .65rem;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--deep);
  font-size: .78rem;
  font-weight: 850;
}
.protocol-image-preview {
  margin-top: 1rem;
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-strong);
}
.protocol-image-preview img {
  display: block;
  width: 100%;
  height: auto;
}
@media (max-width: 760px) {
  .source-pill { border-radius: 14px; }
  .protocol-image-preview { max-height: 420px; }
}

/* v17: navigation plus lisible, sans retirer les sections existantes */
.bottom-nav [data-route]:not([data-mobile-main="true"]) {
  display: none !important;
}

.bottom-nav .mobile-more-button {
  display: grid !important;
  place-items: center;
  gap: 0.2rem;
}

@media (min-width: 761px) {
  .bottom-nav {
    width: min(760px, calc(100% - 2rem));
  }

  .bottom-nav-scroll {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-flow: initial;
    grid-auto-columns: initial;
    overflow-x: visible;
  }

  .mobile-nav-modal[aria-hidden="false"] {
    display: block !important;
    position: fixed;
    inset: 0;
    z-index: 95;
  }

  .mobile-nav-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 18, 34, 0.48);
    backdrop-filter: blur(8px);
  }

  .mobile-nav-sheet {
    position: absolute;
    left: 50%;
    bottom: calc(var(--nav-height) + 1.5rem + env(safe-area-inset-bottom));
    width: min(560px, calc(100vw - 2rem));
    max-height: min(76vh, 620px);
    overflow: auto;
    transform: translateX(-50%);
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 1rem;
  }

  .mobile-nav-header,
  .mobile-nav-grid {
    display: grid;
    gap: 0.75rem;
  }

  .mobile-nav-header {
    grid-template-columns: 1fr auto;
    align-items: center;
    margin-bottom: 0.9rem;
  }

  .mobile-nav-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-nav-grid button {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-strong);
    color: var(--ink);
    padding: 0.8rem;
    font-weight: 850;
    text-align: left;
  }

  .mobile-nav-grid svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--primary);
  }

  .mobile-nav-grid [aria-current="page"] {
    border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
    background: var(--blue-soft);
  }
}
