:root {
  --body-bg: #f6f0e6;
  --body-panel: #ffffff;
  --body-ink: #22343a;
  --body-muted: #6b7478;
  --body-line: #ded4c3;
  --body-accent: #0f6f78;
  --body-soft: #eef7f8;
  --body-ok: #2f6f46;
  --body-warn: #a56a1d;
  --body-danger: #9b2c2c;
}

html, body {
  margin: 0;
  background: var(--body-bg);
  font-family: Arial, sans-serif;
}

body { padding: 20px; }

.gti-body-block { color: var(--body-ink); }

.gti-fiche-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}

.gti-kicker {
  margin: 0 0 4px;
  color: var(--body-accent);
  font-size: 12px;
  font-weight: bold;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.gti-body-title { margin: 0 0 6px; font-size: 22px; }
.gti-body-intro, .gti-note { margin: 0; color: var(--body-muted); font-size: 14px; line-height: 1.45; }
.gti-note { margin-top: 12px; }

.gti-head-badges, .gti-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.gti-head-badges { justify-content: flex-end; }

.gti-status { border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: bold; white-space: nowrap; }
.gti-status.ok { background: #e4f3ea; color: var(--body-ok); }
.gti-status.warn { background: #fff1db; color: var(--body-warn); }
.gti-status.danger { background: #fde8e8; color: var(--body-danger); }
.gti-status.neutral { background: #edf2f3; color: var(--body-muted); }

.gti-quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.gti-quick-item, .gti-info-panel, .gti-context-panel { background: var(--body-panel); border: 1px solid var(--body-line); border-radius: 14px; padding: 12px; }
.gti-quick-item span { display: block; color: var(--body-muted); font-size: 12px; margin-bottom: 4px; }
.gti-quick-item strong { font-size: 14px; }

.gti-cycle { background: var(--body-panel); border: 1px solid var(--body-line); border-radius: 16px; padding: 10px; margin-bottom: 12px; overflow-x: auto; }
.gti-cycle ol { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0; min-width: max-content; }
.gti-cycle li { display: flex; align-items: center; gap: 7px; padding: 8px 10px; border-radius: 999px; color: var(--body-muted); background: #f6f3ed; font-weight: bold; font-size: 12px; }
.gti-cycle li span { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 999px; background: #e5dccb; color: var(--body-ink); }
.gti-cycle li.current { background: var(--body-soft); color: var(--body-accent); }
.gti-cycle li.current span { background: var(--body-accent); color: #fff; }
.gti-cycle li.done { background: #eef6f1; color: var(--body-ok); }

.gti-info-panel { margin-bottom: 12px; }
.gti-info-panel p { margin: 6px 0 0; color: var(--body-muted); font-size: 14px; }
code { font-size: 12px; }

.gti-toggle-stack { display: grid; gap: 10px; }
.gti-toggle { background: var(--body-panel); border: 1px solid var(--body-line); border-radius: 16px; overflow: hidden; }
.gti-toggle[open] { box-shadow: 0 12px 28px rgba(31, 41, 46, .07); }
.gti-toggle summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 16px; font-weight: bold; }
.gti-toggle summary::-webkit-details-marker { display: none; }
.gti-toggle summary::before { content: '▸'; color: var(--body-accent); }
.gti-toggle[open] summary::before { content: '▾'; }
.gti-toggle summary span:first-child { margin-right: auto; }
.gti-panel-content { border-top: 1px solid var(--body-line); padding: 14px 16px 16px; }

.gti-grid-2, .gti-grid-3 { display: grid; gap: 10px; }
.gti-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gti-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.gti-field { background: #fbfaf7; border: 1px solid #eadfcd; border-radius: 12px; padding: 10px; min-height: 62px; }
.gti-field label { display: block; margin: 0 0 6px; color: var(--body-muted); font-size: 12px; font-weight: bold; }
.gti-field div { font-size: 14px; font-weight: bold; }
.gti-field input { width: 100%; border: 1px solid var(--body-line); border-radius: 10px; padding: 9px 10px; font: inherit; color: var(--body-ink); background: #fff; }

.gti-btn { border: 1px solid var(--body-line); border-radius: 999px; padding: 9px 13px; font-weight: bold; font-size: 13px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; color: var(--body-ink); background: #fff; }
.gti-btn.primary { background: var(--body-accent); border-color: var(--body-accent); color: #fff; }
.gti-btn.secondary:hover { background: var(--body-soft); }

.gti-calendar-bridge { display: grid; grid-template-columns: 1fr; gap: 14px; }
.gti-calendar-text { max-width: none; }
.gti-calendar-text h3 { margin: 0 0 8px; }
.gti-calendar-text p { margin: 0 0 12px; color: var(--body-muted); font-size: 14px; line-height: 1.45; }
.gti-calendar-frame { width: 100%; min-height: 560px; border: 1px solid var(--body-line); border-radius: 14px; overflow: hidden; background: #fff; }
.gti-calendar-frame iframe { display: block; width: 100%; min-height: 560px; height: 70vh; border: 0; }

@media (max-width: 820px) {
  body { padding: 12px; }
  .gti-fiche-head { grid-template-columns: 1fr; }
  .gti-head-badges { justify-content: flex-start; }
  .gti-quick-grid, .gti-grid-2, .gti-grid-3, .gti-calendar-bridge { grid-template-columns: 1fr; }
  .gti-calendar-frame { min-height: 420px; }
  .gti-calendar-frame iframe { min-height: 420px; height: 62vh; }
}

/* PATCH STRICT V1.2 — calendrier bloc pur, pleine largeur, sans enveloppe ajoutée */
.gti-toggle[data-step="disponibilites"] .gti-panel-content.gti-panel-calendar-full {
  padding: 0;
  border-top: 1px solid var(--body-line);
}
.gti-calendar-full-frame {
  display: block;
  width: 100%;
  min-height: 760px;
  height: 78vh;
  border: 0;
  background: #fff;
}
@media (max-width: 820px) {
  .gti-calendar-full-frame {
    min-height: 560px;
    height: 72vh;
  }
}


/* PATCH STRUCTUREL PROPRE V1.3 — calendrier hors toggle, pleine largeur réelle */
.gti-calendar-structural-full {
  width: 100%;
  max-width: none;
  margin: 10px 0 10px;
  padding: 0;
  border: 0;
  background: transparent;
}
.gti-calendar-structural-frame {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 100% !important;
  height: 760px !important;
  min-height: 760px !important;
  border: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #fff;
}
.gti-toggle-stack-after-calendar {
  margin-top: 10px;
}
@media (max-width: 820px) {
  .gti-calendar-structural-frame {
    height: 620px !important;
    min-height: 620px !important;
  }
}


/* PATCH EVENT CALENDRIER V1.4 — fermeture UI après sélection réelle */
.gti-calendar-structural-full.is-collapsed {
  display: none !important;
}

/* PATCH V1.6 — ajustement neutre de durée séjour dans la sélection retournée */
.gti-selection-adjust {
  margin-top: 10px;
}
.gti-field input[type="date"],
.gti-field input[type="number"] {
  width: 100%;
  border: 1px solid var(--body-line);
  border-radius: 10px;
  padding: 9px 10px;
  font: inherit;
  color: var(--body-ink);
  background: #fff;
  box-sizing: border-box;
}


/* PATCH V1.7 — création prospect preview avant calendrier */
.gti-prospect-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #d9eadf;
  border-radius: 12px;
  background: #eef8f2;
  color: var(--body-ok);
  font-size: 13px;
}
.gti-prospect-status[hidden] {
  display: none !important;
}
.gti-prospect-status code {
  color: var(--body-ink);
}

/* PATCH V1.8 — sélection provisoire et accès client Azurmare */
.gti-api-warning {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #f2d7a0;
  border-radius: 12px;
  background: #fff7e8;
  color: var(--body-warn);
  font-size: 13px;
  font-weight: 700;
}

/* PATCH V1.9 — accès client Azurmare finalisé : déclenchement mail + suivi état */
.gti-access-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #d9e8eb;
  border-radius: 14px;
  background: #f0fafb;
}
.gti-access-head p {
  margin: 4px 0 0;
  color: var(--body-muted);
  font-size: 13px;
  line-height: 1.4;
}
.gti-access-timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.gti-access-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--body-line);
  border-radius: 999px;
  background: #fbfaf7;
  color: var(--body-muted);
  font-size: 12px;
  font-weight: 700;
}
.gti-access-step span {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #e5dccb;
  color: var(--body-ink);
}
.gti-access-step.current {
  background: var(--body-soft);
  color: var(--body-accent);
  border-color: #cce4e8;
}
.gti-access-step.current span {
  background: var(--body-accent);
  color: #fff;
}
.gti-access-step.done {
  background: #eef6f1;
  color: var(--body-ok);
  border-color: #cfe5d8;
}
.gti-access-step.done span {
  background: var(--body-ok);
  color: #fff;
}
.gti-access-feedback {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
}
.gti-access-feedback[hidden] {
  display: none !important;
}
.gti-access-feedback.ok {
  border: 1px solid #cfe5d8;
  background: #eef8f2;
  color: var(--body-ok);
}
.gti-access-feedback.warn {
  border: 1px solid #f2d7a0;
  background: #fff7e8;
  color: var(--body-warn);
}
.gti-access-feedback.info {
  border: 1px solid #cce4e8;
  background: var(--body-soft);
  color: var(--body-accent);
}
@media (max-width: 820px) {
  .gti-access-head,
  .gti-access-timeline {
    grid-template-columns: 1fr;
  }
  .gti-access-head {
    display: block;
  }
  .gti-access-head .gti-status {
    display: inline-flex;
    margin-top: 10px;
  }
}
