/* Même navigation que le portail client, uniquement dans Explorer. */
.explorer-account-header { display: none; }
body.explorer-only .hdr { display: none !important; }
/* La carte attend son cadrage initial avant de devenir visible. */
body.explorer-only:not(.map-ready) .work > :not(.explorer-loading) { visibility: hidden; }
body.explorer-only:not(.map-ready) .panel { transition: none; }
.explorer-loading { display: none; }
body.explorer-only:not(.map-ready) .explorer-loading {
  position: absolute; z-index: 35; inset: 0; display: grid; place-items: center;
  color: #385f78; font: 700 15px "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
}
body.explorer-only.map-ready .explorer-loading { display: none; }
body.explorer-only .explorer-account-header {
  position: relative; z-index: 60; grid-column: 1 / -1; grid-row: 1;
  min-height: 84px; display: grid; grid-template-columns: auto minmax(430px,1fr) auto auto;
  align-items: center; gap: clamp(18px,2.2vw,38px); padding: 10px clamp(22px,4vw,66px);
  border-bottom: 1px solid rgba(44,52,59,.12); background: rgba(255,253,249,.96);
  box-shadow: 0 8px 32px rgba(36,61,76,.05);
  color: #2c343b; font-family: "Avenir Next",Avenir,"Helvetica Neue",Helvetica,Arial,sans-serif;
  letter-spacing: normal;
}
body.explorer-only .explorer-account-header::after {
  content: ""; position: absolute; inset: auto 0 -1px; height: 3px;
  background: linear-gradient(90deg,#e39d3f 0 33.333%,#d87351 33.333% 66.666%,#79a1c1 66.666%);
}
.explorer-account-header .havana-brand { flex: 0 0 auto; display: inline-flex; }
.explorer-account-header .havana-brand img { width: 174px; height: 54px; object-fit: contain; object-position: left center; filter: brightness(0); }
.explorer-account-header .portal-nav { position: static; min-width: 0; align-self: stretch; border: 0; background: transparent; }
.explorer-account-header .portal-nav > div { min-height: 64px; display: flex; align-items: stretch; justify-content: center; gap: clamp(14px,1.7vw,30px); }
.explorer-account-header .portal-nav a {
  position: relative; display: flex; align-items: center; flex: 0 0 auto; padding: 0;
  color: #69747a; font-size: 13px; font-weight: 750; text-decoration: none; white-space: nowrap;
}
.explorer-account-header .portal-nav a::after {
  content: ""; position: absolute; right: 50%; bottom: 8px; left: 50%; height: 3px;
  background: #d87351; transition: right .2s ease,left .2s ease;
}
.explorer-account-header .portal-nav a:hover,.explorer-account-header .portal-nav a.is-active { color: #2c343b; }
.explorer-account-header .portal-nav a:hover::after,.explorer-account-header .portal-nav a.is-active::after { right: 0; left: 0; }
.explorer-account-header > .havana-language-switcher { grid-column: 3; grid-row: 1; align-self: center; justify-self: end; }
.explorer-account-header .header-actions { grid-column: 4; grid-row: 1; display: flex; align-items: center; gap: 12px; margin-left: 0; white-space: nowrap; }
.explorer-account-header .header-cart {
  min-height: 44px; display: inline-flex; align-items: center; padding: 0 12px;
  border: 1px solid rgba(44,52,59,.12); border-radius: 13px; background: white;
  color: #385f78; font-size: 13px; font-weight: 850; text-decoration: none;
}
.explorer-account-header .header-cart span {
  display: inline-grid; min-width: 21px; height: 21px; place-items: center; margin-left: 4px;
  border-radius: 50%; background: #e39d3f; color: #2c343b;
}
.explorer-account-header .header-cart .hcart-count { position: static; inset: auto; }
.explorer-account-header .powered { display: flex; align-items: center; gap: 8px; color: #78858c; font-size: 11px; }
.explorer-account-header .powered img { width: 83px; height: 32px; object-fit: contain; mix-blend-mode: multiply; }
.explorer-account-header .header-book {
  min-height: 46px; display: inline-flex; align-items: center; gap: 12px; padding: 0 17px;
  border-radius: 14px; background: #e39d3f; color: #2c343b;
  font-size: 14px; font-weight: 850; text-decoration: none;
}
.explorer-account-header .header-book:hover { background: #d87351; color: white; }
.explorer-account-header .header-book svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.explorer-account-header .account-button {
  min-height: 46px; display: flex; align-items: center; gap: 9px; padding: 0 10px 0 6px;
  border: 1px solid rgba(44,52,59,.12); border-radius: 14px; background: white;
  color: #2c343b; text-decoration: none;
}
.explorer-account-header .account-button:hover { border-color: rgba(56,95,120,.35); }
.explorer-account-header .avatar {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px;
  background: #385f78; color: white; font-size: 13px; font-weight: 900;
}
.explorer-account-header .account-name {
  max-width: 84px; overflow: hidden; font-size: 13px; font-weight: 800;
  text-overflow: ellipsis; white-space: nowrap;
}
.explorer-account-header .account-button svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width:1180px) {
  .explorer-account-header .powered span,.explorer-account-header .account-name { display: none; }
}
@media (max-width:1100px) {
  body.explorer-only .explorer-account-header { grid-template-columns: auto minmax(390px,1fr) auto auto; gap: 16px; padding-right: 24px; padding-left: 24px; }
  .explorer-account-header .havana-brand img { width: 154px; }
  .explorer-account-header .portal-nav > div { gap: 17px; }
  .explorer-account-header .portal-nav a { font-size: 12px; }
}
@media (max-width:1000px) {
  body.explorer-only .explorer-account-header { grid-template-columns: auto minmax(0,1fr) auto auto; gap: 0 12px; padding-bottom: 0; }
  .explorer-account-header > .havana-language-switcher { grid-column: 3; grid-row: 1; }
  .explorer-account-header .header-actions { grid-column: 4; grid-row: 1; }
  .explorer-account-header .portal-nav { grid-column: 1 / -1; grid-row: 2; overflow-x: auto; scrollbar-width: none; }
  .explorer-account-header .portal-nav::-webkit-scrollbar { display: none; }
  .explorer-account-header .portal-nav > div { min-width: max-content; min-height: 48px; justify-content: flex-start; gap: 28px; padding: 0 4px; }
  .explorer-account-header .portal-nav a { font-size: 13px; }
  .explorer-account-header .portal-nav a::after { bottom: 0; }
}
@media (max-width:900px) {
  .explorer-account-header .powered { display: none; }
}
@media (max-width:640px) {
  body.explorer-only .explorer-account-header { flex: 0 0 auto; width: 100%; grid-template-columns: auto minmax(0,1fr); padding-bottom: 10px; }
  .explorer-account-header .header-actions { grid-column: 2; min-width: 0; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
  .explorer-account-header .header-book { padding: 0 9px; }
  .explorer-account-header .header-book span { display: none; }
  .explorer-account-header .header-cart { padding: 0 8px; font-size: 0; }
  .explorer-account-header .header-cart span { font-size: 12px; }
}

/* The shell must exist before the live-data bridge starts so navigation never disappears. */
body.havana-map-shell .app {
  display: grid !important;
  grid-template-columns: 74px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  padding-top: var(--safeT);
}
body.havana-map-shell .explorer-account-header { grid-column: 1 / -1; grid-row: 1; }
body.havana-map-shell .rail { grid-column: 1; grid-row: 2; min-height: 0; height: auto; overflow-y: auto; }
body.havana-map-shell .col { grid-column: 2; grid-row: 2; min-height: 0; height: 100%; overflow: hidden; transition: opacity .2s ease; }
body.havana-map-shell .hdr { display: none !important; }
body.havana-map-shell .sortrow .ttl { white-space: normal; }
body.havana-map-shell .topzone .kwdrop { width: min(430px, calc(100% - 8px)); }
body.havana-map-shell .kwdrop .kwnone { overflow-wrap: anywhere; }
body.havana-map-shell .minicard { max-width: calc(100% - 28px); }
@media (max-width: 900px) {
  /* An open mini or full detail owns the mobile workspace until it closes. */
  body.havana-map-shell .work:has(> .minicard:not([hidden]), > .detail:not([hidden])) > .mobList { display: none !important; }
  /* Keep the floating map/list control below the panel's footer actions. */
  body.havana-map-shell .panel:not(.closed) .pfoot { padding-bottom: calc(66px + var(--safeB)); }
}
@media (max-width: 1000px) {
  body.havana-map-shell .app { grid-template-columns: 74px minmax(0, 1fr); }
}
@media (max-width: 760px) {
  body.havana-map-shell .app { grid-template-columns: 64px minmax(0, 1fr); }
  body.havana-map-shell .rail { width: 64px; }
  body.havana-map-shell .explorer-account-header .portal-nav { display: none; }
}
@media (max-width: 640px) {
  body.havana-map-shell .rail {
    flex-direction: column; justify-content: flex-start; gap: 4px; padding: 12px 0 14px;
    border-top: 0; border-right: 1px solid var(--line);
  }
  body.havana-map-shell .rail button { flex: 0 0 auto; width: 62px; }
}

/* The account page supplies the fixed header in portal-frame mode. */
body.havana-map-embedded.havana-portal-frame .app {
  display: grid !important;
  grid-template-columns: 74px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  height: 100%;
  padding-top: 0;
}
body.havana-map-embedded.havana-portal-frame .explorer-account-header,
body.havana-map-embedded.havana-portal-frame .hdr { display: none !important; }
body.havana-map-embedded.havana-portal-frame .rail {
  display: flex !important;
  grid-column: 1;
  grid-row: 1;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
}
body.havana-map-embedded.havana-portal-frame .col {
  grid-column: 2;
  grid-row: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
body.havana-map-embedded.havana-portal-frame .map-boot-screen { inset: 0 0 0 74px; }
@media (max-width: 760px) {
  body.havana-map-embedded.havana-portal-frame .app { grid-template-columns: 64px minmax(0, 1fr); }
  body.havana-map-embedded.havana-portal-frame .rail { width: 64px; }
  body.havana-map-embedded.havana-portal-frame .map-boot-screen { inset: 0 0 0 64px; }
}
@media (max-width: 640px) {
  body.havana-map-embedded.havana-portal-frame .app { display: flex !important; flex-direction: column; }
  body.havana-map-embedded.havana-portal-frame .col { order: 1; flex: 1; height: auto; }
  body.havana-map-embedded.havana-portal-frame .rail {
    order: 2;
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    overflow: visible;
    flex-direction: row;
  }
  body.havana-map-embedded.havana-portal-frame .map-boot-screen { inset: 0 0 62px; }
}
