/* Guide 2D : les commandes et étapes restent hors du dessin, même sur mobile. */
:root {
  --green: #028090;
  --border: #d4e2e0;
  --paper: #f8f8f3;
  font-family: Lato, Arial, sans-serif;
  color: #203b42;
  font-size: 15px;
}
body {
  background: #f7f8f5;
}
#app {
  height: auto;
  min-height: 100dvh;
  overflow: visible;
  background: none;
  padding: 0 20px;
  max-width: 1600px;
  margin: auto;
}
.topbar {
  position: relative;
  inset: auto;
  min-height: 86px;
  gap: 18px;
  padding: 12px 0;
}
.brand-mark,
.loading-brand {
  background: #028090;
}
.brand strong {
  color: #176674;
}
.brand small {
  color: #53696a;
}
.language-label {
  font-size: 10px;
  color: #50666a;
  display: grid;
  gap: 3px;
}
.language-label > span {
  display: block;
}
#language {
  font: inherit;
  font-size: 13px;
  padding: 9px;
  background: white;
  border: 1px solid #bdced0;
  border-radius: 8px;
  min-height: 42px;
}
.workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
#controls {
  max-height: 690px;
  overflow-y: auto;
  padding: 1px;
}
.search-panel,
.route-panel,
.detail-panel {
  position: relative;
  inset: auto;
  width: 100%;
  max-height: none;
  box-shadow: none;
  margin-bottom: 12px;
  background: #fff;
  padding: 18px;
}
.search-panel > label {
  font-size: 11px;
  line-height: 1.5;
  color: #46616a;
  letter-spacing: 0.8px;
}
.search-box input {
  font-size: 15px;
}
.suggestion {
  display: block;
  min-height: 48px;
}
.suggestion strong {
  font-size: 14px;
  display: block;
}
.suggestion small {
  font-size: 12px;
  display: block;
  margin-top: 3px;
}
.quick-nav {
  flex-wrap: wrap;
}
.quick-nav button {
  font-size: 11px;
  min-height: 40px;
  padding: 7px 5px;
}
.route-panel h2,
.detail-panel h2.poi-title {
  font-size: 23px;
  line-height: 1.3;
}
.route-panel h2 {
  padding-right: 15px;
}
.route-panel p,
.detail-panel p {
  font-size: 14px;
  line-height: 1.5;
}
.note {
  font-size: 12px !important;
  color: #526867;
}
.detail-panel h3 {
  color: #49606a;
  font-size: 11px;
}
.nearby {
  font-size: 12px;
}
.detail-close {
  color: #34525a;
  min-width: 36px;
  min-height: 36px;
}
.district-toggle {
  font-size: 12px;
  padding-bottom: 3px;
}
.route-open,
.route-panel .primary,
.route-card-actions .primary {
  background: var(--green);
  min-height: 44px;
}
.route-buttons {
  flex-wrap: wrap;
}
.route-buttons button {
  min-height: 40px;
}
.route-panel summary {
  font-size: 13px;
}
.route-b {
  border-radius: 3px;
  background: #104aac;
}
.route-a {
  background: #203e38;
}
#map-frame {
  position: relative;
  height: clamp(510px, 73dvh, 720px);
  background: #edf1e7;
  border: 1px solid #c3d4cc;
  border-radius: 14px;
  overflow: hidden;
  isolation: isolate;
}
#map-frame #flat-host,
#map-frame #stage,
#map-frame #scene-labels {
  position: absolute;
  inset: 0;
  border-radius: 0;
}
.view-switch {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 9;
}
.map-tools {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: auto;
  gap: 8px;
}
.map-tools button {
  background: white;
  min-height: 42px;
  min-width: 42px;
}
#gesture-help {
  position: absolute;
  bottom: 32px;
  left: 10px;
  font-size: 10px;
  background: #ffffffe6;
  border-radius: 4px;
  padding: 5px;
  pointer-events: none;
  margin: 0;
  z-index: 8;
}
#map-legend {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 7px;
  margin: 0;
  background: #fffffff2;
  padding: 5px 7px;
  font-size: 10px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 8;
}
.bottom-bar {
  position: relative;
  inset: auto;
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 12px 0;
  align-items: center;
}
.bottom-bar p {
  font-size: 13px;
  margin: 0;
  max-width: 42%;
}
.export-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.export-tools button {
  padding: 12px 15px;
  border: 1px solid #bdced0;
  background: white;
  border-radius: 8px;
  font-size: 13px;
  min-height: 44px;
}
.export-tools .primary {
  background: #028090;
  border-color: #028090;
  color: white;
}
.export-tools button:hover {
  filter: brightness(0.95);
}
#route-instructions {
  max-width: 1000px;
  margin: 0 auto 32px;
  padding: 22px 26px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
}
.steps-heading h2 {
  font:
    26px Georgia,
    serif;
  color: #116676;
  margin: 0 0 8px;
}
.steps-heading p,
#route-legend,
#route-access-note {
  font-size: 13px;
  line-height: 1.5;
  color: #4c6269;
}
#route-directions {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: grid;
  gap: 12px;
}
#route-directions li {
  margin: 0;
}
.step-button {
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  width: 100%;
  text-align: left;
  border: 1px solid #cedad8;
  background: #fbfcfa;
  border-radius: 10px;
  padding: 16px;
  line-height: 1.6;
  font-size: 15px;
}
.step-button:hover {
  border-color: #257687;
  background: #f0f7f7;
}
.step-button[aria-pressed="true"] {
  border: 2px solid #104aac;
  background: #edf4ff;
  padding: 15px;
}
.step-number {
  border-radius: 50%;
  background: #123d5a;
  color: white;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  font-weight: 700;
}
.step-text {
  display: block;
}
.step-meta {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #295c67;
  margin-top: 8px;
}
.step-access {
  display: block;
  font-size: 12px;
  margin-top: 6px;
  color: #5c4b32;
}
.credits {
  position: relative;
  inset: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 5px;
  font-size: 9px;
  padding: 5px 0 18px;
  color: #4e6267;
}
.toast {
  position: fixed;
  bottom: 20px;
  z-index: 50;
  max-width: 90vw;
}
.loading {
  position: fixed;
  z-index: 100;
}
.dialog-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.dialog-actions > * {
  padding: 12px;
  border: 1px solid #c3d5d4;
  border-radius: 8px;
  min-height: 44px;
}
#image-dialog {
  max-width: 900px;
}
#export-preview {
  max-height: 62dvh;
  object-fit: contain;
  background: #f3f4ed;
}
#route-access-note:empty {
  display: none;
}
#print-route {
  display: none;
}
@media (max-width: 800px) {
  #app {
    padding: 0 10px;
  }
  .topbar {
    gap: 8px;
    min-height: 76px;
  }
  .brand {
    gap: 7px;
  }
  .brand strong {
    font-size: 9px;
    letter-spacing: 0.8px;
  }
  .brand small {
    font-size: 10px;
    max-width: 140px;
  }
  .brand-mark {
    width: 34px;
    height: 39px;
    font-size: 29px;
  }
  .language-label {
    font-size: 8px;
  }
  #language {
    font-size: 12px;
    max-width: 120px;
  }
  .icon-button {
    display: none;
  }
  .workspace {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  #controls {
    display: contents;
  }
  .search-panel,
  .route-panel {
    order: 0;
    margin: 0;
    padding: 12px 14px;
  }
  .search-panel > label {
    margin-bottom: 5px;
  }
  .search-panel .quick-nav {
    margin-top: 5px;
  }
  .quick-nav button {
    min-height: 34px;
  }
  .district-toggle {
    display: inline-block;
    width: 45%;
    padding: 10px 0;
    font-size: 11px;
  }
  .route-open {
    display: inline-block;
    width: 54%;
    margin: 5px 0 0;
    font-size: 12px;
  }
  .route-panel input:not([type="checkbox"]) {
    font-size: 16px;
  }
  #map-frame {
    order: 1;
    width: 100%;
    height: clamp(380px, 58dvh, 620px);
    min-height: 380px;
  }
  .detail-panel {
    order: 2;
    padding: 15px;
    margin: 0;
  }
  .detail-panel .address {
    font-size: 34px;
  }
  .detail-panel .detail-separator {
    margin: 8px;
  }
  .detail-panel .home-name {
    display: inline-block;
    margin: 0 10px;
  }
  .detail-panel .district-name {
    margin-bottom: 8px;
  }
  .map-tools {
    top: 10px;
    right: 8px;
  }
  .view-switch {
    top: 10px;
    left: 8px;
  }
  .view-switch button {
    font-size: 11px;
    padding: 9px 11px;
  }
  .bottom-bar {
    display: block;
    padding: 10px 0;
  }
  .bottom-bar p {
    max-width: none;
    margin: 0 0 7px;
    font-size: 12px;
  }
  .export-tools {
    display: grid;
    grid-template-columns: 1fr 1.35fr auto auto;
    gap: 4px;
  }
  .export-tools button {
    font-size: 12px;
    padding: 10px 7px;
  }
  .steps-heading h2 {
    font-size: 22px;
  }
  #route-instructions {
    padding: 16px 12px;
    margin-bottom: 15px;
  }
  .step-button {
    font-size: 14px;
    padding: 12px;
    gap: 8px;
    grid-template-columns: 28px 1fr;
  }
  .step-button[aria-pressed="true"] {
    padding: 11px;
  }
  .step-number {
    width: 26px;
    height: 26px;
  }
  .route-panel h2 {
    font-size: 20px;
    margin: 0 24px 5px 0;
  }
  .credits {
    font-size: 8px;
  }
  .map-tools .tool-label {
    padding: 4px;
  }
  .map-tools button {
    min-width: 36px;
    min-height: 38px;
  }
  #map-legend {
    font-size: 9px;
  }
  #gesture-help {
    font-size: 9px;
    bottom: 38px;
  }
  .detail-actions button,
  .route-card-actions button {
    min-height: 42px;
  }
}
@media print {
  #app {
    padding: 0;
    height: auto;
  }
  .topbar,
  #controls,
  .map-tools,
  .view-switch,
  .bottom-bar,
  .toast,
  .loading,
  #gesture-help {
    display: none !important;
  }
  .workspace {
    display: block;
  }
  #map-frame {
    height: 145mm;
    break-inside: avoid;
    border: 1px solid #555;
  }
  #map-frame #flat-host {
    display: block !important;
    inset: 0;
  }
  #route-instructions {
    border: 0;
    padding: 8px 0;
  }
  #route-directions {
    gap: 5px;
  }
  .step-button {
    break-inside: avoid;
    border-color: #888;
    color: #111;
    font-size: 11px;
    padding: 8px;
  }
  .step-meta,
  .step-access {
    font-size: 10px;
    color: #222;
  }
  .step-number {
    background: #111;
  }
  #print-route {
    display: block;
  }
  #route-instructions .steps-heading p {
    display: none;
  }
  .credits {
    font-size: 7px;
  }
}

.view-switch button[aria-pressed="true"] {
  background: #028090;
}
.detail-panel .address {
  color: #028090;
}
.language-label {
  font-size: 0;
}
.language-label select {
  font-size: 13px;
}
@font-face {
  font-family: Lato;
  src: url("vendor/lato-latin.woff2") format("woff2");
  font-display: swap;
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: Spinnaker;
  src: url("vendor/spinnaker-latin.woff2") format("woff2");
  font-display: swap;
  font-weight: 400;
  font-style: normal;
}
.steps-heading h2,
.route-panel h2,
.detail-panel h2.poi-title {
  font-family: Spinnaker, Arial, sans-serif;
  font-weight: 400;
}
.brand strong {
  font-family: Spinnaker, Arial, sans-serif;
}

/* Suggestions accessibles pour les deux extrémités, y compris sans accents. */
.route-suggestions {
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #bfcfc9;
  border-radius: 8px;
  margin: 4px 0 10px;
}
.route-suggestions .suggestion {
  width: 100%;
  text-align: left;
}
