/* Lokalny podgląd nagłówka HUB-u zgodnego wizualnie z pilotem STEEL-MBRD. */
body[data-hub-layout-pilot="1"] { --hub-section-heading-size: 22px; }

body[data-hub-layout-pilot="1"] .hub-pilot-ribbon,
body[data-hub-layout-pilot="1"] .hub-header,
body[data-hub-layout-pilot="1"] .hub-main,
body[data-hub-layout-pilot="1"] .hub-footer {
  box-sizing: border-box;
  width: min(1400px, calc(100vw - 48px));
  margin-inline: auto;
}

.hub-pilot-ribbon {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 8px 12px;
  border: 1px solid var(--hub-line);
  border-bottom: 4px solid var(--hub-line-strong);
  background: var(--hub-panel);
}

.hub-pilot-ribbon-main { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; }

.hub-pilot-brand,
.hub-pilot-tools,
.hub-pilot-contact {
  box-sizing: border-box;
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--hub-muted);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.hub-pilot-brand { gap: 9px; color: var(--hub-text); }
.hub-pilot-brand-name { display: inline-flex; align-items: baseline; gap: 4px; }
.hub-pilot-brand-name strong { font-weight: 800; }
.hub-pilot-brand-name > span { color: var(--hub-muted); font-weight: 400; }
.hub-pilot-contact { position: relative; cursor: pointer; }
.hub-pilot-ribbon-actions { display: flex; align-items: center; gap: 12px; }

.hub-pilot-contact.is-active { color: var(--hub-text); }
.hub-pilot-contact.is-active::after {
  position: absolute;
  right: 12px;
  bottom: 3px;
  left: 12px;
  height: 2px;
  background: currentColor;
  content: "";
}

.hub-pilot-brand:hover,
.hub-pilot-brand:focus-visible,
.hub-pilot-tools:hover,
.hub-pilot-tools:focus-visible,
.hub-pilot-contact:hover,
.hub-pilot-contact:focus-visible {
  border-color: var(--hub-line);
  background: var(--hub-panel-soft);
  color: var(--hub-text);
  outline: none;
}

.hub-pilot-brand-mark,
.hub-pilot-brand-mark img { display: block; width: 28px; height: 28px; }
.hub-pilot-mark-dark,
html[data-theme="dark"] .hub-pilot-mark-light { display: none !important; }
html[data-theme="dark"] .hub-pilot-mark-dark { display: block !important; }

body[data-hub-layout-pilot="1"] .hub-pilot-ribbon .hub-theme-cycle {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  flex: 0 0 36px;
  padding: 5px;
}
body[data-hub-layout-pilot="1"] .hub-pilot-ribbon .hub-theme-cycle > span { display: none; }
.hub-pilot-theme-sun,
.hub-pilot-theme-moon {
  display: none;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
body[data-hub-layout-pilot="1"] .hub-pilot-ribbon .hub-pilot-theme-sun { display: block; }
html[data-theme="light"] body[data-hub-layout-pilot="1"] .hub-pilot-ribbon .hub-pilot-theme-sun { display: none; }
html[data-theme="light"] body[data-hub-layout-pilot="1"] .hub-pilot-ribbon .hub-pilot-theme-moon { display: block; }

body[data-hub-layout-pilot="1"] .hub-header {
  display: block;
  margin-top: 0;
  padding: 24px 24px 0;
  border: 0;
  border-inline: 1px solid var(--hub-line);
  border-radius: 0;
  background: var(--hub-panel);
}
body[data-hub-layout-pilot="1"] .hub-header .hub-logo-link { display: none; }
body[data-hub-layout-pilot="1"] .hub-panel-title {
  margin: 0;
  font-size: 24px;
  text-transform: none;
}
body[data-hub-layout-pilot="1"] .hub-header-controls {
  --hub-pilot-status-edge-gap: 18px;
  margin: 16px 0 0;
  padding: var(--hub-pilot-status-edge-gap) 0;
  border-top: 1px solid var(--hub-line);
  transform: none;
}
body[data-hub-layout-pilot="1"] .hub-header-controls:has(.mjkm-hub-local-upgrade, .hub-production-upgrade) {
  /* CTA ma 32 px wysokości i 8 px odstępu od statusu; nad CTA zostaje ten sam luz co pod statusem. */
  padding-top: calc(var(--hub-pilot-status-edge-gap) + 32px + 8px);
}
body[data-hub-layout-pilot="1"] .hub-header-primary-actions { display: none; }
body[data-hub-layout-pilot="1"] .hub-header-actions {
  width: 100%;
  margin-left: 0;
  flex: 1 1 100%;
  justify-content: flex-start;
  gap: 8px;
}

body[data-hub-layout-pilot="1"] .hub-main > .hub-tab-bar.mjkm-navigation-tabs {
  box-sizing: border-box;
  min-height: 54px;
  margin: 0 0 16px;
  padding: 13px 24px;
  border: 0;
  border-inline: 1px solid var(--hub-line);
  border-top: 1px solid var(--hub-line);
  border-bottom: 1px solid var(--hub-line);
  border-radius: 0 0 14px 14px;
  background: var(--hub-panel);
  overflow-x: auto;
}
body[data-hub-layout-pilot="1"] .hub-main > .hub-tab-bar[hidden] { display: none; }
body[data-hub-layout-pilot="1"] .hub-tab-button[hidden] { display: none !important; }
body[data-hub-layout-pilot="1"] .hub-tab-list { gap: clamp(16px, 3vw, 48px); }
body[data-hub-layout-pilot="1"] .hub-tab-button {
  padding-inline: 14px;
  border: 1px solid transparent;
  font-size: 24px;
}
body[data-hub-layout-pilot="1"] .hub-tab-button:not(.is-active):hover,
body[data-hub-layout-pilot="1"] .hub-tab-button:not(.is-active):focus-visible {
  border-color: var(--hub-line);
  background: var(--hub-panel-soft);
}
body[data-hub-layout-pilot="1"] .hub-tab-button.is-active { border-color: transparent; }

body[data-hub-layout-pilot="1"] .hub-pilot-info-actions {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  padding: 14px 24px;
  border: 1px solid var(--hub-line);
  border-radius: 0 0 14px 14px;
  background: var(--hub-panel);
}
body[data-hub-layout-pilot="1"] .hub-pilot-info-actions[hidden] { display: none; }
body[data-hub-layout-pilot="1"] .hub-pilot-info-button {
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--hub-line-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--hub-muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
}
body[data-hub-layout-pilot="1"] .hub-pilot-info-button:hover,
body[data-hub-layout-pilot="1"] .hub-pilot-info-button:focus-visible {
  background: var(--hub-panel-soft);
  color: var(--hub-text);
}
body[data-hub-layout-pilot="1"] .hub-pilot-info-button:focus-visible,
body[data-hub-layout-pilot="1"] .hub-pilot-info-close:focus-visible {
  outline: 2px solid var(--hub-brand);
  outline-offset: 2px;
}
body[data-hub-layout-pilot="1"] .hub-finder-controls {
  grid-template-columns: minmax(0, 1fr);
  justify-content: stretch;
}
body[data-hub-layout-pilot="1"] .hub-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr));
  width: 100%;
}
body[data-hub-layout-pilot="1"] .hub-filters .hub-filter {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}
body[data-hub-layout-pilot="1"] .hub-filters [data-hub-family="GEO"] { grid-column: auto; }
html.hub-pilot-info-open { overflow: hidden; }
.hub-pilot-info-dialog {
  box-sizing: border-box;
  width: min(1400px, calc(100vw - 48px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 0;
  background: transparent;
  color: var(--hub-text);
}
.hub-pilot-info-dialog::backdrop { background: rgb(2 8 25 / 76%); }
.hub-pilot-info-close {
  position: absolute;
  z-index: 1;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--hub-line-strong);
  border-radius: 8px;
  background: var(--hub-panel-soft);
  color: var(--hub-text);
  font: inherit;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.hub-pilot-info-content > .hub-panel {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--hub-line);
  border-radius: 14px;
  background: var(--hub-panel);
  box-shadow: var(--hub-shadow);
}
.hub-pilot-info-content > .hub-panel[hidden] { display: none; }
.hub-pilot-info-content > .hub-information > .hub-pilot-information-heading,
.hub-pilot-info-content > .hub-information-scope > h2,
.hub-pilot-info-content > .hub-contact > h2 {
  margin-bottom: 20px;
  padding: 0 48px 18px 0;
  border-bottom: 1px solid var(--hub-line);
}
.hub-pilot-info-content > .hub-information-scope > h2 { margin-bottom: 0; }
.hub-pilot-info-content > .hub-information > .hub-pilot-information-heading h2 { margin: 0; }
.hub-pilot-info-content > .hub-information > .hub-information-intro {
  margin-bottom: 0;
  padding: 0;
  border: 0;
}
.hub-pilot-info-content > .hub-information > .hub-information-intro h3 {
  margin: 0;
  color: var(--hub-heading);
  font-family: var(--hub-font-heading);
  font-size: var(--hub-section-heading-size);
  font-weight: var(--hub-section-heading-weight);
  line-height: var(--hub-section-heading-line-height);
}

@media (min-width: 1448px) {
  body[data-hub-layout-pilot="1"] .hub-grid {
    grid-template-columns: repeat(6, minmax(0, var(--hub-card-width)));
    column-gap: 26px;
  }
}

@media (min-width: 1081px) and (max-width: 1247px) {
  body[data-hub-layout-pilot="1"] .hub-grid {
    grid-template-columns: repeat(4, minmax(0, var(--hub-card-width)));
    margin-inline: 0;
    column-gap: 12px;
  }
}

@media (max-width: 1080px) {
  body[data-hub-layout-pilot="1"] .hub-pilot-ribbon,
  body[data-hub-layout-pilot="1"] .hub-header,
  body[data-hub-layout-pilot="1"] .hub-main,
  body[data-hub-layout-pilot="1"] .hub-footer { width: min(1400px, calc(100vw - 28px)); }
  .hub-pilot-info-dialog { width: min(1400px, calc(100vw - 28px)); }
}

@media (max-width: 760px) {
  body[data-hub-layout-pilot="1"] .hub-filters { grid-template-columns: minmax(0, 1fr); }
  body[data-hub-layout-pilot="1"] .hub-pilot-ribbon,
  body[data-hub-layout-pilot="1"] .hub-header,
  body[data-hub-layout-pilot="1"] .hub-main,
  body[data-hub-layout-pilot="1"] .hub-footer { width: min(1400px, calc(100vw - 20px)); }
  .hub-pilot-info-dialog { width: min(1400px, calc(100vw - 20px)); }
  body[data-hub-layout-pilot="1"] .hub-pilot-ribbon { flex-wrap: wrap; }
  .hub-pilot-ribbon-actions { flex-wrap: wrap; }
  body[data-hub-layout-pilot="1"] .hub-header { padding-inline: 16px; }
  body[data-hub-layout-pilot="1"] .hub-header-controls { align-items: flex-start; }
  body[data-hub-layout-pilot="1"] .hub-header-actions { width: 100%; margin-left: 0; justify-content: flex-start; }
  body[data-hub-layout-pilot="1"] .hub-main > .hub-tab-bar.mjkm-navigation-tabs { padding-inline: 16px; }
  body[data-hub-layout-pilot="1"] .hub-pilot-info-actions { padding-inline: 16px; }
  .hub-pilot-info-content > .hub-panel { padding: 20px 16px; }
}

@media (max-width: 600px) {
  .hub-pilot-ribbon-actions { width: 100%; justify-content: space-between; }
  body[data-hub-layout-pilot="1"] .mjkm-hub-local-tools {
    --hub-local-plan-control-width: min(118px, calc((100vw - 100px) / 4));
  }
}
