/* À charger après terrain-assistant.css et les styles du site V4. */
#sm-guide {
  --guide-blue: #205be6;
  --guide-ink: #13223c;
  position: fixed;
  right: 26px;
  bottom: 22px;
  z-index: 80;
  color: var(--guide-ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.65;
  text-align: left;
}
#sm-guide[hidden], #sm-guide [hidden] { display: none !important; }
#sm-guide .guide-launcher {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 52px;
  padding: 8px 17px 8px 9px;
  border: 1px solid #dbe3ef;
  border-radius: 40px;
  background: #fff;
  color: var(--guide-ink);
  box-shadow: 0 9px 28px #182b4920;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
}
#sm-guide .guide-launcher img {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex: none;
}
#sm-guide .guide-launcher-arrow { margin-left: 4px; color: var(--guide-blue); font-size: 17px; }
#sm-guide .guide-launcher:hover { border-color: #90afea; background: #fff; }
#sm-guide .guide-panel {
  position: absolute;
  right: 0;
  bottom: 66px;
  display: flex;
  flex-direction: column;
  width: 370px;
  max-width: calc(100vw - 32px);
  max-height: min(680px, calc(100dvh - 115px));
  overflow: hidden;
  border: 1px solid #cfdced;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 22px 70px #1023412b;
}
#sm-guide .guide-head {
  position: static;
  display: flex;
  flex: none;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border: 0;
  background: #132b53;
  color: #fff;
}
#sm-guide .guide-head h2 {
  margin: 0;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
}
#sm-guide .guide-head p {
  display: block;
  margin: 4px 0 0;
  color: #bdcee9;
  font-size: 12px;
  line-height: 1.6;
}
#sm-guide .guide-close {
  flex: none;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #fff;
  font-size: 25px;
  line-height: 1;
}
#sm-guide .guide-close:hover { background: #ffffff18; }
#sm-guide .guide-content { min-height: 0; padding: 21px; overflow: auto; overscroll-behavior: contain; }
#sm-guide .guide-title {
  margin: 0 0 12px;
  color: var(--guide-ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0;
}
#sm-guide .guide-answer { margin: 0 0 18px; color: #4e5f78; font-size: 14px; line-height: 1.75; }
#sm-guide .guide-options { display: grid; gap: 7px; }
#sm-guide .guide-option {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 12px 13px;
  border: 1px solid #dce5f4;
  border-radius: 7px;
  background: #f7faff;
  color: var(--guide-ink);
  text-align: left;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}
#sm-guide .guide-option:hover { background: #eaf1ff; border-color: #a9c2f3; color: var(--guide-ink); }
#sm-guide .guide-primary { text-align: center; background: var(--guide-blue); border-color: var(--guide-blue); color: #fff; font-weight: 650; }
#sm-guide .guide-primary:hover { background: #1947ce; border-color: #1947ce; color: #fff; }
#sm-guide .guide-secondary { min-height: 44px; padding: 10px 2px; background: transparent; border: 0; color: #2457b6; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
#sm-guide .guide-secondary:hover { background: transparent; }
#sm-guide .guide-selected { margin: 0 0 14px; padding: 10px 12px; border-radius: 7px; background: #edf3ff; color: #2457b6; font-size: 14px; font-weight: 650; line-height: 1.5; }
#sm-guide .guide-example { margin: 0 0 18px; padding: 12px; border-left: 3px solid #91b0e1; border-radius: 0 7px 7px 0; background: #f5f8fd; color: #324c71; font-size: 14px; line-height: 1.75; }
#sm-guide .guide-note-label { display: block; margin: 0 0 8px; color: var(--guide-ink); font-size: 14px; line-height: 1.5; font-weight: 650; }
#sm-guide .guide-note, #sm-guide .guide-search { width: 100%; margin: 0 0 12px; padding: 12px; border: 1px solid #bacce7; border-radius: 7px; background: #fff; color: var(--guide-ink); font-size: 14px; line-height: 1.6; }
#sm-guide .guide-note { min-height: 100px; max-height: 180px; resize: vertical; }
#sm-guide .guide-search { min-height: 46px; }
#sm-guide .guide-hint { margin: 0 0 16px; color: #52637a; font-size: 12px; line-height: 1.65; }
#sm-guide .guide-footer { position: static; flex: none; padding: 10px 20px 14px; border-top: 1px solid #e1e8f3; background: #f5f8fc; }
#sm-guide .guide-navigation { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
#sm-guide .guide-back, #sm-guide .guide-home { min-height: 44px; padding: 8px 0; border: 0; background: none; color: #4d6387; font-size: 14px; line-height: 1.45; text-decoration: underline; text-underline-offset: 3px; }
#sm-guide .guide-footer p { margin: 9px 0 0; color: #52637a; font-size: 12px; line-height: 1.65; white-space: pre-line; }
#sm-guide :is(button, a, textarea, input):focus-visible { outline: 3px solid #e6b845; outline-offset: 3px; }
#sm-guide .guide-content:focus { outline: none; }

@media (max-width: 700px) {
  #sm-guide { right: 16px; bottom: 16px; }
  #sm-guide .guide-launcher { min-height: 48px; padding: 7px 13px 7px 7px; gap: 8px; }
  #sm-guide .guide-launcher img { width: 30px; height: 30px; }
  #sm-guide .guide-panel { width: calc(100vw - 32px); bottom: 62px; max-height: calc(100dvh - 96px); }
  #sm-guide .guide-head { padding: 17px 19px; }
  #sm-guide .guide-content { padding: 19px; }
  #sm-guide .guide-footer { padding-inline: 19px; }
  /* Évite le zoom de saisie automatique d’iOS tout en gardant le corps en 14 px. */
  #sm-guide .guide-note, #sm-guide .guide-search { font-size: 16px; }
}
@media (max-height: 480px) {
  #sm-guide .guide-panel { bottom: 58px; max-height: calc(100dvh - 82px); }
  #sm-guide .guide-head { padding: 10px 16px; }
  #sm-guide .guide-head p { display: none; }
  #sm-guide .guide-footer { padding: 6px 16px; }
  #sm-guide .guide-footer p { display: none; }
}
