/* HotelDelta V1.35.20 — Paramètres et accueil Référentiel responsive */

/* ---------- Paramètres ---------- */
#parametres-panel{
  background:var(--hd-bg)!important;
  color:var(--hd-text)!important;
  padding:0 14px calc(28px + env(safe-area-inset-bottom,0px))!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
}
#parametres-panel>.panel-header{
  margin:0 -14px 14px!important;
}
#parametres-panel>.hd-settings-grid{
  width:100%!important;
  max-width:1080px!important;
  box-sizing:border-box!important;
  margin:0 auto!important;
  padding:0!important;
}
.hd-settings-grid{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
.hd-settings-column{display:grid;align-content:start;gap:12px;min-width:0}
#parametres-panel .hd-settings-card{
  width:100%!important;
  box-sizing:border-box!important;
  margin:0!important;
  padding:14px!important;
  border:1px solid var(--hd-border)!important;
  border-radius:18px!important;
  background:var(--hd-card)!important;
  color:var(--hd-text)!important;
  box-shadow:0 8px 24px rgba(0,0,0,.12)!important;
}
#parametres-panel .hd-settings-card.secteur-bloc,
#parametres-panel .hd-settings-card.reglage-taille{border-bottom:1px solid var(--hd-border)!important}
.hd-settings-title{display:flex;align-items:center;gap:9px;margin-bottom:12px;color:var(--hd-text);font-size:14px;font-weight:750}
.hd-settings-icon{display:grid;place-items:center;width:32px;height:32px;flex:0 0 32px;border-radius:10px;background:var(--hd-card-2);color:var(--hd-blue-2)}
.hd-settings-icon svg,.hd-settings-link-icon svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#parametres-panel .hd-settings-card>label{display:block;margin:0 0 6px;color:var(--hd-muted)!important;font-size:11px;font-weight:700;letter-spacing:.045em;text-transform:uppercase}
#parametres-panel #select-secteur{
  width:100%!important;
  min-height:46px!important;
  box-sizing:border-box!important;
  padding:0 12px!important;
  border:1px solid var(--hd-border)!important;
  border-radius:12px!important;
  background:var(--hd-card-2)!important;
  color:var(--hd-text)!important;
  font-size:14px!important;
}
#parametres-panel #note-secteur{margin-top:9px!important;color:var(--hd-muted)!important;font-size:11.5px!important;font-style:normal!important;line-height:1.4!important}
#parametres-panel #note-secteur.ok:before{content:"";display:inline-block;width:7px;height:7px;margin-right:7px;border-radius:50%;background:#42c28a;box-shadow:0 0 0 3px rgba(66,194,138,.13)}
#parametres-panel #note-secteur.alerte:before{content:"";display:inline-block;width:7px;height:7px;margin-right:7px;border-radius:50%;background:#e8a338}
#parametres-panel .segmente{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px!important;width:100%!important;box-sizing:border-box!important;padding:4px!important;border-radius:13px!important;background:var(--hd-card-2)!important}
#parametres-panel .segmente button{min-width:0!important;min-height:42px!important;padding:7px 4px!important;border:0!important;border-radius:10px!important;background:transparent!important;color:var(--hd-muted)!important;font-size:12px!important;font-weight:700!important;white-space:normal!important}
#parametres-panel .segmente button.actif{background:var(--hd-blue)!important;color:#fff!important;box-shadow:none!important}
.hd-offline-sector-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:11px;color:var(--hd-muted);font-size:11.5px}
.hd-offline-sector-row b{color:var(--hd-text);font-size:12.5px;text-align:right}
#parametres-panel #btn-offline{width:100%!important;min-height:46px!important;box-sizing:border-box!important;margin:0!important;padding:10px 13px!important;border:0!important;border-radius:13px!important;background:var(--hd-blue)!important;color:#fff!important;font-size:13px!important;font-weight:750!important}
#parametres-panel #btn-offline svg{width:18px;height:18px}
#parametres-panel .hd-offline-note{margin:9px 0 0!important;color:var(--hd-muted)!important;font-size:10.8px!important;line-height:1.4!important;text-align:left!important}
#parametres-panel #offline-status{min-height:0!important;margin-top:8px!important;color:var(--hd-muted)!important;font-size:11px!important;line-height:1.35!important;text-align:left!important}
#parametres-panel #offline-status:empty{display:none!important}
.hd-settings-resources{padding-top:12px!important;padding-bottom:2px!important}
.hd-settings-link{display:grid!important;grid-template-columns:36px minmax(0,1fr) 18px!important;align-items:center!important;gap:10px!important;width:100%!important;min-height:61px!important;box-sizing:border-box!important;margin:0!important;padding:7px 0!important;border:0!important;border-radius:0!important;background:transparent!important;color:var(--hd-text)!important;text-align:left!important;box-shadow:none!important}
.hd-settings-link+.hd-settings-link{border-top:1px solid var(--hd-border)!important}
.hd-settings-link-icon{display:grid;place-items:center;width:36px;height:36px;border-radius:11px;background:var(--hd-card-2);color:var(--hd-blue-2)}
.hd-settings-link>span:nth-child(2){min-width:0}.hd-settings-link b{display:block;color:var(--hd-text);font-size:13px}.hd-settings-link small{display:block;margin-top:3px;color:var(--hd-muted);font-size:10.8px}.hd-settings-link>.hd-chevron{width:18px;height:18px;color:var(--hd-muted)}
.hd-settings-version{max-width:1080px;margin:12px auto 0;color:var(--hd-muted);font-size:10.5px;text-align:center;opacity:.72}

/* ---------- Accueil Référentiel ---------- */
#reference-panel{
  position:fixed!important;
  inset:0!important;
  z-index:9800!important;
  box-sizing:border-box!important;
  padding:0 14px calc(28px + env(safe-area-inset-bottom,0px))!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  background:var(--hd-bg)!important;
  color:var(--hd-text)!important;
}
#reference-panel.hidden{display:none!important}
#reference-panel>.panel-header{margin:0 -14px 14px!important;background:linear-gradient(180deg,rgba(17,40,75,.98),rgba(15,34,65,.965))!important}
.hd-reference-home{width:100%;max-width:1080px;margin:0 auto;box-sizing:border-box}
.hd-reference-hero{display:flex;align-items:center;gap:12px;padding:14px;margin-bottom:12px;border:1px solid var(--hd-border);border-radius:18px;background:linear-gradient(135deg,var(--hd-card),var(--hd-card-2));box-shadow:0 8px 24px rgba(0,0,0,.12)}
.hd-reference-hero-icon{display:grid;place-items:center;width:42px;height:42px;flex:0 0 42px;border-radius:13px;background:var(--hd-card-2);color:var(--hd-blue-2)}
.hd-reference-hero-icon svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.hd-reference-hero p{margin:0 0 3px;color:var(--hd-blue-2);font-size:9px;font-weight:800;letter-spacing:.12em}.hd-reference-hero h2{margin:0;color:var(--hd-text);font-size:17px;line-height:1.15}.hd-reference-hero div>span{display:block;margin-top:5px;color:var(--hd-muted);font-size:10.8px}
.hd-reference-search{position:relative;width:100%;box-sizing:border-box;margin-bottom:5px}
.hd-reference-search>svg{position:absolute;z-index:1;left:14px;top:50%;width:19px;height:19px;transform:translateY(-50%);fill:none;stroke:var(--hd-muted);stroke-width:2;stroke-linecap:round;pointer-events:none}
.hd-reference-search input{display:block;width:100%;height:46px;box-sizing:border-box;padding:0 42px 0 43px;border:1px solid var(--hd-border);border-radius:13px;background:var(--hd-card-2);color:var(--hd-text);font-size:14px;-webkit-appearance:none;appearance:none}
.hd-reference-search input::placeholder{color:var(--hd-muted)}.hd-reference-search input:focus{outline:none;border-color:var(--hd-blue);box-shadow:0 0 0 3px rgba(45,152,240,.18)}.hd-reference-search input::-webkit-search-cancel-button{-webkit-appearance:none}
#hd-reference-search-clear{position:absolute;right:7px;top:6px;width:34px;height:34px;border:0;border-radius:10px;background:var(--hd-card);color:var(--hd-muted);font-size:23px;line-height:30px}
.hd-reference-search-status{min-height:18px;margin:0 3px 7px;color:var(--hd-muted);font-size:10.5px}
.hd-reference-choices{display:grid;grid-template-columns:minmax(0,1fr);gap:12px}
.hd-reference-choice{display:flex!important;flex-direction:column!important;min-width:0!important;min-height:218px!important;box-sizing:border-box!important;padding:15px!important;border:1px solid var(--hd-border)!important;border-radius:18px!important;background:var(--hd-card)!important;color:var(--hd-text)!important;text-align:left!important;box-shadow:0 8px 24px rgba(0,0,0,.12)!important}
.hd-reference-choice-head{display:flex;align-items:center;gap:11px}.hd-reference-choice-icon{display:grid;place-items:center;width:42px;height:42px;flex:0 0 42px;border-radius:13px;background:var(--hd-card-2);color:var(--hd-blue-2)}.hd-reference-choice-icon svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.hd-reference-choice-head b{display:block;color:var(--hd-text);font-size:14.5px}.hd-reference-choice-head small{display:block;margin-top:3px;color:var(--hd-muted);font-size:10.8px}.hd-reference-choice-text{display:block;margin:12px 0;color:var(--hd-text);font-size:11.8px;line-height:1.45}.hd-reference-tags{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:14px}.hd-reference-tags i{padding:5px 7px;border-radius:8px;background:var(--hd-card-2);color:var(--hd-muted);font-size:9.5px;font-style:normal}.hd-reference-open-label{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:42px;margin-top:auto;padding:0 12px;border-radius:12px;background:var(--hd-blue);color:#fff;font-size:12.5px;font-weight:750}.hd-reference-open-label svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.hd-reference-search-results{display:grid;gap:8px}.hd-reference-search-results.hidden{display:none!important}.hd-reference-result{display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:10px;width:100%;min-height:58px;padding:9px 11px;border:1px solid var(--hd-border);border-radius:14px;background:var(--hd-card);color:var(--hd-text);text-align:left}.hd-reference-result-icon{display:grid;place-items:center;width:34px;height:34px;border-radius:10px;background:var(--hd-card-2);color:var(--hd-blue-2)}.hd-reference-result-icon svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.hd-reference-result b{display:block;color:var(--hd-text);font-size:12.5px}.hd-reference-result small{display:block;margin-top:3px;color:var(--hd-muted);font-size:10px}.hd-reference-result em{padding:4px 6px;border-radius:7px;background:var(--hd-card-2);color:var(--hd-blue-2);font-size:8.5px;font-style:normal;font-weight:800;letter-spacing:.04em}.hd-reference-empty{padding:24px 14px;border:1px dashed var(--hd-border);border-radius:16px;background:var(--hd-card);color:var(--hd-muted);font-size:12px;text-align:center}
#reference-panel .hd-reference-credit{margin-top:13px;color:var(--hd-muted)!important;text-align:center}

/* Entêtes internes Doctrine / Glossaire : retour, titre, fermeture. */
#doctrine-panel .hd-reference-inner-header,#glossaire-panel .hd-reference-inner-header{display:grid!important;grid-template-columns:38px minmax(0,1fr) 38px!important;gap:10px!important}
#doctrine-panel .hd-reference-inner-header>span,#glossaire-panel .hd-reference-inner-header>span{text-align:center!important;align-self:center!important}
.hd-reference-back{display:grid!important;place-items:center!important;width:38px!important;height:38px!important;min-width:38px!important;margin:0!important;padding:0!important;border:1px solid var(--hd-border)!important;border-radius:13px!important;background:var(--hd-card-2)!important;color:var(--hd-text)!important}
.hd-reference-back svg{width:18px!important;height:18px!important;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

/* Portrait : empilement naturel. Paysage : deux colonnes sans hauteur imposée. */
@media (orientation:landscape) and (min-width:620px){
  #parametres-panel,#reference-panel{padding-left:max(14px,env(safe-area-inset-left,0px))!important;padding-right:max(14px,env(safe-area-inset-right,0px))!important}
  #parametres-panel>.panel-header,#reference-panel>.panel-header{min-height:54px!important;margin-bottom:12px!important}
  .hd-settings-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .hd-reference-choices{grid-template-columns:repeat(2,minmax(0,1fr))}
  .hd-reference-hero{padding-top:11px;padding-bottom:11px}
  .hd-reference-choice{min-height:205px!important}
}
@media (orientation:landscape) and (max-height:430px){
  .hd-settings-card{padding:11px!important}.hd-settings-title{margin-bottom:9px}.hd-reference-home{padding-bottom:8px}.hd-reference-hero{margin-bottom:9px}.hd-reference-search{margin-bottom:3px}
}
@media (max-width:380px){
  #parametres-panel,#reference-panel{padding-left:12px!important;padding-right:12px!important}
  #parametres-panel>.panel-header,#reference-panel>.panel-header{margin-left:-12px!important;margin-right:-12px!important}
  #parametres-panel .segmente button{font-size:11px!important}
  .hd-reference-choice{min-height:0!important}
}
