:root {
  /* Geometria kart jest komponentem katalogu, a nie częścią CORE HUB-u. */
  --hub-card-width: 200px;
  --hub-card-height: 240px;
}

.hub-workspace-switch { display: none; flex-wrap: wrap; align-items: center; gap: 8px; }
html[data-hub-local-preview="developer"] .hub-workspace-switch { display: flex; }
.hub-header-actions:has(.hub-workspace-switch) > .mjkm-hub-local-tools { order: 0; }
.hub-header-actions:has(.hub-workspace-switch) > .mjkm-hub-local-preview-toggle { order: 1; }
.hub-header-actions:has(.hub-workspace-switch) > .mjkm-hub-local-atlas-link { order: 2; }
.hub-header-actions > .hub-workspace-switch { order: 3; }
.hub-header-actions:has(.hub-workspace-switch) > .hub-user { order: 4; }
.hub-workspace-switch button {
  box-sizing: border-box;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--hub-line);
  border-radius: 8px;
  background: var(--hub-panel);
  color: var(--hub-brand-strong);
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.hub-workspace-switch button.is-active { border-color: var(--hub-brand); background: var(--hub-panel-soft); }
.hub-workspace-switch button:hover,
.hub-workspace-switch button:focus-visible { border-color: var(--hub-brand); outline: none; }

.hub-header,
.hub-main,
.hub-footer {
  width: min(1200px, calc(100vw - 48px));
  margin-inline: auto;
}

.hub-header {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-auto-rows: min-content;
  align-items: start;
  column-gap: 24px;
  row-gap: 12px;
  margin-top: 12px;
  /* Samodzielne odwzorowanie trzech wierszy .topbar CORE. */
  padding: 2px 0 4px;
  border: 0;
  border-bottom: 1px solid var(--hub-line);
  border-radius: 0;
  background: transparent;
}

.hub-logo-link {
  grid-column: 1;
  grid-row: 1;
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  text-decoration: none;
}
.hub-logo-link:focus-visible {
  outline: 2px solid var(--hub-brand);
  outline-offset: 6px;
  border-radius: 4px;
}

.hub-logo {
  display: block;
  width: auto;
  height: clamp(56px, 7vw, 112px);
  max-width: min(360px, 48vw);
  object-fit: contain;
}

.hub-logo--light { display: none; }
html[data-theme="light"] .hub-logo--dark { display: none; }
html[data-theme="light"] .hub-logo--light { display: block; }

.hub-panel-title {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 16px 0 0;
  color: var(--hub-heading);
  font-family: Arial, sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: normal;
  text-transform: none;
}

.hub-header-controls {
  grid-column: 1 / -1;
  grid-row: 3;
  display: flex;
  min-width: 0;
  margin: 20px 0;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hub-header-actions {
  display: flex;
  min-width: 0;
  margin-left: auto;
  flex: 0 1 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.hub-header-primary-actions {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.hub-production-plan-summary {
  --hub-production-plan-control-width: 118px;
  position: relative;
  display: flex;
  width: max-content;
  max-width: 100%;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
}

.hub-production-plan-statuses {
  display: grid;
  grid-template-columns: repeat(var(--hub-plan-columns, 3), var(--hub-production-plan-control-width));
  gap: 5px;
  width: max-content;
  max-width: 100%;
}

.hub-production-plan-slot { position: relative; width: 100%; }

.hub-production-plan-status {
  box-sizing: border-box;
  width: 100%;
  height: 32px;
  display: inline-grid;
  place-items: center;
  padding: 0 9px;
  border: 1px solid var(--hub-line);
  border-radius: 999px;
  background: var(--hub-access-free-bg);
  color: var(--hub-access-free-text);
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .04em;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

.hub-production-plan-status[data-plan="pro"] {
  background: var(--hub-access-pro-bg);
  color: var(--hub-access-pro-text);
}

.hub-production-upgrade {
  position: absolute;
  z-index: 1;
  bottom: calc(100% + 8px);
  left: 50%;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--hub-production-plan-control-width);
  height: 32px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: var(--hub-access-pro-bg);
  color: var(--hub-access-pro-text);
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  transform: translateX(-50%);
  white-space: nowrap;
}

.hub-production-upgrade:hover,
.hub-production-upgrade:focus-visible {
  background: var(--hub-access-pro-hover);
  outline: none;
}

/* Jak w kalkulatorach: cały rząd skrótów wizualnie schodzi bliżej zakładek. */
@media (min-width: 1041px) {
  .hub-header-controls { transform: translateY(12px); }
}


.hub-account {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  color: inherit;
  text-decoration: none;
}

/* Samodzielna kopia paska konta z kalkulatorów; HUB nie ładuje ich CSS na serwerze. */
.hub-account-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid var(--hub-line);
  border-radius: 999px;
  background: var(--hub-panel);
  color: var(--hub-text-secondary);
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}

.hub-account:hover .hub-account-bar,
.hub-account:focus-visible .hub-account-bar {
  border-color: var(--hub-brand);
  background: var(--hub-panel-soft);
  color: var(--hub-brand-hover);
}

.hub-account:focus-visible { outline: none; }

.hub-account-mark,
.hub-account-mark img {
  display: block;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
}

.hub-account-mark-dark { display: none !important; }

.hub-account-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

html[data-theme="dark"] .hub-account-bar {
  border-color: var(--hub-line);
  background: var(--hub-account-dark-bg);
  color: var(--hub-account-dark-text);
}

html[data-theme="dark"] .hub-account:hover .hub-account-bar,
html[data-theme="dark"] .hub-account:focus-visible .hub-account-bar {
  border-color: var(--hub-account-dark-hover-line);
  background: var(--hub-account-dark-hover-bg);
  color: var(--hub-account-dark-hover-text);
}

html[data-theme="dark"] .hub-account-mark-light { display: none !important; }
html[data-theme="dark"] .hub-account-mark-dark { display: block !important; }


.hub-theme-cycle {
  box-sizing: border-box;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 130px;
  min-width: 130px;
  flex: 0 0 130px;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--hub-line-strong);
  border-radius: 8px;
  background: var(--hub-panel);
  color: var(--hub-text);
  font: inherit;
  font-size: var(--hub-base-size);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.hub-theme-cycle span:first-child { color: var(--hub-muted); font-weight: 600; }
.hub-theme-cycle span:last-child { min-width: 6ch; color: var(--hub-brand-strong); text-align: left; }
.hub-theme-cycle:hover,
.hub-theme-cycle:focus-visible {
  border-color: var(--hub-brand);
  background: var(--hub-panel-soft);
  outline: none;
}

.hub-main { padding: 0; }

.hub-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
}


.hub-tab-list {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 18px;
}


.hub-page > .hub-panel {
  grid-column: 1;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.hub-page > .hub-panel:not(.hub-panel--calculators) {
  padding: 16px 24px 26px;
  border: 1px solid var(--hub-line-soft);
  border-radius: 8px;
  background: var(--hub-panel);
  box-shadow: var(--hub-shadow);
}

.hub-panel--calculators {
  display: grid;
  gap: 16px;
}

/* D-099: nie dokładamy drugiego górnego odstępu wewnątrz obu zakładek HUB-u. */
.hub-panel { padding-top: 0; }
.hub-panel[hidden] { display: none; }

.hub-personal {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: 0 0 22px;
  padding: 0;
  border: 0;
}

.hub-personal[hidden] { display: none; }

.hub-personal-group {
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.hub-personal-group[hidden] { display: none; }

.hub-personal-group:not([hidden]) + .hub-personal-group {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--hub-line-soft);
}

.hub-personal-head {
  display: flex;
  /* D-147: przycisk ma 36 px; nagłówek nie może być przez niego centrowany w dół. */
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

/* D-121: ten sam górny start nagłówka jak w zakładce Informacje. */
.hub-personal-head h2 { margin: 0; }

.hub-personal-clear {
  box-sizing: border-box;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--hub-line-strong);
  border-radius: 8px;
  /* Sekcja Ulubionych leży już na --hub-panel; soft daje przyciskowi
     takie samo wyraźne wypełnienie, jakie Motyw ma na tle strony. */
  background: var(--hub-panel-soft);
  color: var(--hub-text);
  font: inherit;
  font-size: var(--hub-base-size);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.hub-personal-clear:hover,
.hub-personal-clear:focus-visible { border-color: var(--hub-brand); background: var(--hub-panel); outline: none; }
.hub-personal-clear[hidden] { display: none; }

.hub-personal-empty { margin: 0; }
.hub-personal-empty[hidden] { display: none; }

.hub-finder {
  display: grid;
  gap: 13px;
  padding: 14px 0 0;
  border-top: 1px solid var(--hub-line);
}

.hub-finder-controls {
  display: grid;
  justify-content: start;
  gap: 9px;
}

.hub-finder-primary {
  display: flex;
  align-items: flex-end;
  gap: 9px;
}

.hub-filters {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 9px;
}

.hub-filter {
  flex: 0 0 var(--hub-filter-width, auto);
  max-width: 100%;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--hub-line);
  border-radius: 4px;
  background: var(--hub-filter-inactive-bg);
  color: var(--hub-muted);
  font-family: var(--hub-font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
}

.hub-filter span { color: inherit; }
.hub-filter:hover,
.hub-filter:focus-visible { border-color: var(--hub-brand); color: var(--hub-text); }
.hub-filter.is-active { border-color: var(--hub-line-strong); background: var(--hub-panel-soft); color: var(--hub-text); }

.hub-filter[data-hub-family="all"].is-active {
  box-shadow: inset 0 0 0 2px var(--hub-text);
}

.hub-filter[data-hub-family="STEEL"] {
  background: color-mix(in srgb, var(--hub-family-card-steel-bg) 60%, var(--hub-panel-soft) 40%);
  color: var(--hub-text);
}

.hub-filter[data-hub-family="STEEL"].is-active {
  border-color: var(--hub-family-card-steel-bg);
  background: var(--hub-family-card-steel-bg);
  color: var(--hub-family-card-foreground);
  box-shadow: inset 0 0 0 2px var(--hub-family-card-foreground);
}

.hub-filter[data-hub-family="RC"] {
  background: color-mix(in srgb, var(--hub-family-card-rc-bg) 60%, var(--hub-panel-soft) 40%);
  color: var(--hub-text);
}

.hub-filter[data-hub-family="RC"].is-active {
  border-color: var(--hub-family-card-rc-bg);
  background: var(--hub-family-card-rc-bg);
  color: var(--hub-family-card-foreground);
  box-shadow: inset 0 0 0 2px var(--hub-family-card-foreground);
}

.hub-filter[data-hub-family="MAS"] {
  background: color-mix(in srgb, var(--hub-family-card-mas-bg) 60%, var(--hub-panel-soft) 40%);
  color: var(--hub-text);
}

.hub-filter[data-hub-family="MAS"].is-active {
  border-color: var(--hub-family-card-mas-bg);
  background: var(--hub-family-card-mas-bg);
  color: var(--hub-family-card-foreground);
  box-shadow: inset 0 0 0 2px var(--hub-family-card-foreground);
}

.hub-filter[data-hub-family="GEO"] {
  background: color-mix(in srgb, var(--hub-family-card-geo-bg) 60%, var(--hub-panel-soft) 40%);
  color: var(--hub-text);
}

.hub-filter[data-hub-family="GEO"].is-active {
  border-color: var(--hub-family-card-geo-bg);
  background: var(--hub-family-card-geo-bg);
  color: var(--hub-family-card-foreground);
  box-shadow: inset 0 0 0 2px var(--hub-family-card-foreground);
}

.hub-search-wrap {
  min-width: 0;
  flex: 0 0 var(--hub-search-width, 380px);
  max-width: 100%;
  margin-left: 0;
}

.hub-search-control { position: relative; }

.hub-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hub-search {
  width: 100%;
  min-height: 42px;
  padding: 0 43px 0 12px;
  border: 1px solid var(--hub-line);
  border-radius: 4px;
  outline: none;
  background: var(--hub-panel-soft);
  color: var(--hub-text);
}

.hub-search::placeholder { color: var(--hub-card-reference-color); opacity: 1; }
.hub-search:focus { border-color: var(--hub-brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hub-brand) 22%, transparent); }
.hub-search::-webkit-search-cancel-button { display: none; }

.hub-search-clear {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--hub-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.hub-search-clear:hover,
.hub-search-clear:focus-visible { background: var(--hub-panel-soft); color: var(--hub-text); outline: none; }
.hub-search-clear[hidden] { display: none; }

.hub-catalog { display: grid; gap: 22px; margin-top: 18px; }

.hub-family {
  padding: 14px 0 0;
  border: 0;
  border-top: 1px solid var(--hub-line);
  border-radius: 0;
  background: transparent;
}

.hub-section-panel {
  min-width: 0;
  margin: 0;
  padding: 16px 24px 26px;
  border: 1px solid var(--hub-line-soft);
  border-radius: 8px;
  background: var(--hub-panel);
  box-shadow: var(--hub-shadow);
}

.hub-panel--calculators .hub-catalog {
  gap: 16px;
  margin-top: 0;
}

.hub-family[hidden] { display: none; }

.hub-family-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}

.hub-personal-head h2,
.hub-finder-title,
.hub-family h2 {
  margin: 0;
}

.hub-family-title {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.hub-family[data-hub-section="STEEL"] .hub-family-title h2,
.hub-family[data-hub-section="RC"] .hub-family-title h2,
.hub-family[data-hub-section="MAS"] .hub-family-title h2,
.hub-family[data-hub-section="GEO"] .hub-family-title h2 {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--hub-family-card-foreground);
}

.hub-family[data-hub-section="STEEL"] .hub-family-title h2 {
  border-color: var(--hub-family-card-steel-bg);
  background: var(--hub-family-card-steel-bg);
}

.hub-family[data-hub-section="RC"] .hub-family-title h2 {
  border-color: var(--hub-family-card-rc-bg);
  background: var(--hub-family-card-rc-bg);
}

.hub-family[data-hub-section="MAS"] .hub-family-title h2 {
  border-color: var(--hub-family-card-mas-bg);
  background: var(--hub-family-card-mas-bg);
}

.hub-family[data-hub-section="GEO"] .hub-family-title h2 {
  border-color: var(--hub-family-card-geo-bg);
  background: var(--hub-family-card-geo-bg);
}

.hub-family p { margin: 3px 0 0; }

.hub-family-meta {
  flex: 0 0 auto;
  align-self: flex-start;
  text-align: right;
  white-space: nowrap;
}

.hub-family-access:not([hidden]) {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: var(--hub-access-free-bg);
  color: var(--hub-access-free-text);
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.hub-family-access[data-plan="pro"] {
  background: var(--hub-access-pro-bg);
  color: var(--hub-access-pro-text);
}

.hub-family-upgrade {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--hub-access-pro-bg);
  color: var(--hub-access-pro-text);
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.hub-family-upgrade:hover,
.hub-family-upgrade:focus-visible {
  background: var(--hub-access-pro-hover);
  outline: none;
}

.hub-family-available[hidden],
.hub-family-upcoming[hidden] { display: none; }

.hub-subgroup[hidden] { display: none; }
.hub-subgroup + .hub-subgroup { margin-top: 20px; }
.hub-subgroup-title {
  margin: 0 0 12px;
  color: var(--hub-heading);
  font-size: .95rem;
  font-weight: 700;
}

.hub-family-upcoming {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--hub-line-soft);
}

.hub-family-subhead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.hub-family-subhead h3 {
  margin: 0;
  color: var(--hub-heading);
  font-size: .88rem;
  font-weight: 700;
}

.hub-family-subhead p { margin: 2px 0 0; color: var(--hub-text-secondary); font-size: .78rem; }

.hub-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, var(--hub-card-width)));
  grid-auto-rows: var(--hub-card-height);
  align-items: stretch;
  justify-content: start;
  margin-inline: 9px;
  column-gap: 33px;
  row-gap: 12px;
}

.hub-subgroup + .hub-grid { margin-top: 20px; }

.hub-card-shell {
  position: relative;
  width: 100%;
  min-width: 0;
  height: var(--hub-card-height);
}

.hub-card-shell[hidden] { display: none; }

.hub-card {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: var(--hub-card-height);
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--hub-line);
  border-radius: 8px;
  background: var(--hub-panel-soft);
  color: var(--hub-text);
  text-align: center;
  text-decoration: none;
}

.hub-card {
  grid-template-rows: 42px 100px 42px;
  /* Gwiazdka jest nad identyfikatorem, a pozostała treść zachowuje rytm karty. */
  align-content: start;
}

.hub-card-favorite {
  position: absolute;
  z-index: 1;
  /* Znak gwiazdki zaczyna się około 25 px od górnej ramki karty. */
  top: 20px;
  right: auto;
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--hub-brand-strong);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.hub-card-favorite:hover,
.hub-card-favorite:focus-visible,
.hub-card-favorite.is-active { border-color: var(--hub-brand); color: var(--hub-brand); outline: none; }

.hub-card[hidden] { display: none; }
.hub-card:hover,
.hub-card:focus-visible { border-color: var(--hub-brand); background: var(--hub-panel-soft); outline: none; }

.hub-card-reference {
  display: grid;
  min-height: 44px;
  place-items: center;
  color: var(--hub-card-reference-color);
  font-family: var(--hub-card-reference-font);
  font-size: var(--hub-card-reference-size);
  font-weight: var(--hub-card-reference-weight);
  letter-spacing: var(--hub-card-reference-letter-spacing);
}

.hub-card > .hub-card-reference {
  min-height: 1.1em;
  padding: 0;
  font-size: var(--hub-card-reference-size);
  align-self: end;
  line-height: var(--hub-card-reference-line-height);
}

.hub-card-reference,
.hub-card-graphic,
.hub-card-name {
  user-select: text;
}

.hub-card-code {
  height: 1.2em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--hub-muted);
  opacity: .84;
  font-size: .666rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.hub-card-graphic {
  display: flex;
  min-height: 120px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

/* D-114: symbol jest pośrodku między identyfikatorem a skrótem karty.
   Ulubione dziedziczą dokładnie tę samą geometrię co katalog. */
.hub-card .hub-card-graphic {
  min-height: 0;
  justify-content: center;
  padding: 0 6px;
}

.hub-card {
  /* D-118: regularny rytm 30 / 50 / 10 / 80 / 10 / 50 / 10 px. */
  grid-template-rows: 50px 80px 50px;
  gap: 10px;
  padding: 30px 8px 10px;
  /* Obrys jest wewnętrzny, więc nie odbiera 2 px polom karty. */
  border: 0;
  box-shadow: inset 0 0 0 1px var(--hub-line);
}

.hub-card:hover,
.hub-card:focus-visible { box-shadow: inset 0 0 0 1px var(--hub-brand); }

.hub-card-graphic-family {
  color: var(--hub-brand-strong);
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .16em;
}

.hub-card-symbol {
  color: var(--hub-card-symbol-color);
  font-family: var(--hub-card-symbol-font);
  font-size: var(--hub-card-symbol-size);
  font-weight: var(--hub-card-symbol-weight);
  letter-spacing: var(--hub-card-symbol-letter-spacing);
  line-height: var(--hub-card-symbol-line-height);
}

.hub-card-symbol sub {
  vertical-align: sub;
  margin-left: .04em;
  font-size: .52em;
  letter-spacing: -.03em;
  line-height: 0;
}

.hub-card-symbol,
.hub-card-symbol sub { font-style: italic; }

.hub-card-name {
  display: grid;
  min-height: 42px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--hub-card-name-color);
  font-family: var(--hub-card-name-font);
  font-size: var(--hub-card-name-size);
  font-weight: var(--hub-card-name-weight);
  line-height: var(--hub-card-name-line-height);
}

/* Podpisy standardowych kart zaczynają się na jednej górnej osi.
   Druga linia, jeżeli występuje, rozwija się wyłącznie w dół. */
.hub-card:not(.hub-personal-card) .hub-card-name {
  place-items: start center;
  transform: none;
}

.hub-card-name--compact {
  grid-template-rows: repeat(2, min-content);
  align-content: start;
  /* Koniec drugiej linii jest 25 px nad dolną ramką aktywnej karty. */
  padding-top: 0;
  justify-items: center;
}

.hub-card-name-category,
.hub-card-name-topic {
  display: block;
}

/* Rodzinny pilot STEEL: identyczne wypełnienie w obu motywach.
   Atrybut rodziny pozostaje także na klonach kart w Ulubionych. */
.hub-card[data-hub-family="STEEL"] {
  --hub-card-reference-color: var(--hub-family-card-foreground);
  --hub-card-symbol-color: var(--hub-family-card-foreground);
  --hub-card-name-color: var(--hub-family-card-foreground);
  background: var(--hub-family-card-steel-bg);
  color: var(--hub-family-card-foreground);
}

.hub-card[data-hub-family="STEEL"]:hover,
.hub-card[data-hub-family="STEEL"]:focus-visible {
  background: var(--hub-family-card-steel-bg);
  box-shadow: inset 0 0 0 1px var(--hub-family-card-foreground);
}

.hub-card[data-hub-family="STEEL"] + .hub-card-favorite {
  border-color: var(--hub-family-card-foreground);
  color: var(--hub-family-card-foreground);
}

.hub-card[data-hub-family="RC"] {
  --hub-card-reference-color: var(--hub-family-card-foreground);
  --hub-card-symbol-color: var(--hub-family-card-foreground);
  --hub-card-name-color: var(--hub-family-card-foreground);
  background: var(--hub-family-card-rc-bg);
  color: var(--hub-family-card-foreground);
}

.hub-card[data-hub-family="RC"]:hover,
.hub-card[data-hub-family="RC"]:focus-visible {
  background: var(--hub-family-card-rc-bg);
  box-shadow: inset 0 0 0 1px var(--hub-family-card-foreground);
}

.hub-card[data-hub-family="RC"] + .hub-card-favorite {
  border-color: var(--hub-family-card-foreground);
  color: var(--hub-family-card-foreground);
}

.hub-card[data-hub-family="MAS"] {
  --hub-card-reference-color: var(--hub-family-card-foreground);
  --hub-card-symbol-color: var(--hub-family-card-foreground);
  --hub-card-name-color: var(--hub-family-card-foreground);
  background: var(--hub-family-card-mas-bg);
  color: var(--hub-family-card-foreground);
}

.hub-card[data-hub-family="MAS"]:hover,
.hub-card[data-hub-family="MAS"]:focus-visible {
  background: var(--hub-family-card-mas-bg);
  box-shadow: inset 0 0 0 1px var(--hub-family-card-foreground);
}

.hub-card[data-hub-family="MAS"] + .hub-card-favorite {
  border-color: var(--hub-family-card-foreground);
  color: var(--hub-family-card-foreground);
}

.hub-card[data-hub-family="GEO"] {
  --hub-card-reference-color: var(--hub-family-card-foreground);
  --hub-card-symbol-color: var(--hub-family-card-foreground);
  --hub-card-name-color: var(--hub-family-card-foreground);
  background: var(--hub-family-card-geo-bg);
  color: var(--hub-family-card-foreground);
}

.hub-card[data-hub-family="GEO"]:hover,
.hub-card[data-hub-family="GEO"]:focus-visible {
  background: var(--hub-family-card-geo-bg);
  box-shadow: inset 0 0 0 1px var(--hub-family-card-foreground);
}

.hub-card[data-hub-family="GEO"] + .hub-card-favorite {
  border-color: var(--hub-family-card-foreground);
  color: var(--hub-family-card-foreground);
}

.hub-card-action {
  display: grid;
  min-height: 44px;
  place-items: center;
  border: 1px solid var(--hub-line);
  border-radius: 4px;
  color: var(--hub-text);
  font-size: .84rem;
  font-weight: 700;
  letter-spacing: .01em;
  text-transform: uppercase;
}

.hub-card:hover .hub-card-action,
.hub-card:focus-visible .hub-card-action { border-color: var(--hub-brand); background: var(--hub-brand); color: var(--hub-brand-ink); }

.hub-empty {
  margin: 0;
  padding: 17px;
  border: 1px dashed var(--hub-line);
  border-radius: 5px;
  color: var(--hub-muted);
  text-align: center;
}

.hub-information { color: var(--hub-text-secondary); }
.hub-information-intro { max-width: 760px; }
.hub-information h2 { margin: 0 0 8px; }
.hub-information h3 { margin: 0 0 8px; color: var(--hub-heading); font-size: 1rem; font-weight: 700; }
.hub-information p { margin: 0; }
.hub-information a { color: var(--hub-brand); font-weight: 700; }

/* O kalkulatorach: legenda jest bezpośrednią treścią głównego panelu. */
.hub-card-guide {
  display: grid;
  gap: 22px;
  margin-top: 22px;
  padding: 20px;
  border: 1px solid var(--hub-line);
  border-radius: 8px;
  background: var(--hub-panel);
}
.hub-card-guide-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.hub-card-guide-header p { max-width: 780px; }
.hub-draft-badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid var(--hub-line-strong);
  border-radius: 999px;
  color: var(--hub-brand-strong);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.hub-card-guide-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  margin-top: 22px;
}
.hub-card-guide-figure {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin: 0;
}
.hub-card-guide-figure figcaption {
  color: var(--hub-muted);
  font-size: .82rem;
  text-align: center;
}
.hub-card-guide-card {
  display: grid;
  grid-template-rows: 40px 58px 104px 70px;
  width: min(100%, 230px);
  min-height: 272px;
  padding: 16px 10px 10px;
  border-radius: 7px;
  background: var(--hub-panel-soft);
  box-shadow: inset 0 0 0 1px var(--hub-line);
  color: var(--hub-text);
}
.hub-card-guide-card-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  place-items: center;
  min-width: 0;
  text-align: center;
}
.hub-card-guide-card-favorite {
  align-self: start;
}
.hub-card-guide-reference {
  align-self: end;
  color: var(--hub-card-reference-color);
  font-size: var(--hub-card-reference-size);
  letter-spacing: var(--hub-card-reference-letter-spacing);
}
.hub-card-guide-symbol strong {
  color: var(--hub-card-symbol-color);
  font-size: 48px;
  font-weight: var(--hub-card-symbol-weight);
  font-style: italic;
  line-height: 1;
}
.hub-card-guide-symbol sub {
  margin-left: .04em;
  font-size: .52em;
  line-height: 0;
}
.hub-card-guide-card-name {
  display: grid;
  align-content: start;
  color: var(--hub-card-name-color);
  font-size: var(--hub-card-name-size);
  line-height: var(--hub-card-name-line-height);
}
.hub-card-guide-marker {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--hub-brand);
  color: var(--hub-brand-ink);
  font-size: .72rem;
  font-weight: 800;
  line-height: 1;
}
.hub-card-guide-legend {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hub-card-guide-legend li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hub-line-soft);
}
.hub-card-guide-legend li:first-child { padding-top: 0; }
.hub-card-guide-legend li:last-child { padding-bottom: 0; border-bottom: 0; }
.hub-card-guide-legend strong { color: var(--hub-heading); }
.hub-card-guide-legend p { margin-top: 3px; color: var(--hub-heading); }
html[data-theme="dark"] .hub-card-guide-legend p { color: #fff; }
.hub-card-guide-legend code {
  color: inherit;
  font-family: var(--hub-font-body);
  font-weight: 700;
}
.hub-card-guide-section {
  display: grid;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--hub-line);
}
.hub-card-guide-definitions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.hub-card-guide-definitions--families { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hub-card-guide-definitions--other { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hub-card-guide-definitions article {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid var(--hub-line);
  border-radius: 6px;
  background: var(--hub-panel-soft);
}
.hub-card-guide-definitions strong { color: var(--hub-heading); }
.hub-card-guide-definitions span { line-height: 1.42; }
.hub-card-guide-definitions--families article[data-hub-family="STEEL"] {
  border-color: var(--hub-family-card-steel-bg);
  background: var(--hub-family-card-steel-bg);
  color: var(--hub-family-card-foreground);
}
.hub-card-guide-definitions--families article[data-hub-family="STEEL"] strong { color: inherit; }
.hub-card-guide-definitions--families article[data-hub-family="RC"] {
  border-color: var(--hub-family-card-rc-bg);
  background: var(--hub-family-card-rc-bg);
  color: var(--hub-family-card-foreground);
}
.hub-card-guide-definitions--families article[data-hub-family="RC"] strong { color: inherit; }
.hub-card-guide-definitions--families article[data-hub-family="MAS"] {
  border-color: var(--hub-family-card-mas-bg);
  background: var(--hub-family-card-mas-bg);
  color: var(--hub-family-card-foreground);
}
.hub-card-guide-definitions--families article[data-hub-family="MAS"] strong { color: inherit; }
.hub-card-guide-definitions--families article[data-hub-family="GEO"] {
  border-color: var(--hub-family-card-geo-bg);
  background: var(--hub-family-card-geo-bg);
  color: var(--hub-family-card-foreground);
}
.hub-card-guide-definitions--families article[data-hub-family="GEO"] strong { color: inherit; }
.hub-card-guide-access-description { color: var(--hub-heading); }
html[data-theme="dark"] .hub-card-guide-access-description { color: #fff; }
.hub-card-guide-pro {
  width: fit-content;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f28b2c;
  color: #fff !important;
  font-size: .78rem;
}
.hub-card-guide-access-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.hub-card-guide-free {
  width: fit-content;
  padding: 3px 9px;
  border: 1px solid var(--hub-line-strong);
  border-radius: 999px;
  background: var(--hub-access-free-bg);
  color: var(--hub-text) !important;
  font-size: .78rem;
}
.hub-card-guide-favorite {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--hub-brand);
  border-radius: 50%;
  color: var(--hub-brand) !important;
  font-size: 1.2rem;
  line-height: 1;
}
.hub-card-guide-favorite--inactive {
  border-color: transparent;
  color: var(--hub-brand-strong) !important;
  font-size: 1.35rem;
  font-weight: 400;
}
.hub-card-guide-favorite-states {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--hub-brand);
}
.hub-card-guide-favorite-label { color: var(--hub-heading); }

/* Informacje: semantyczna tabela zakładek w lokalnym stylu HUB-u. */
.hub-information-intro {
  max-width: none;
  padding-bottom: 0;
  border-bottom: 0;
}
.hub-information-table-wrap {
  width: fit-content;
  max-width: 100%;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--hub-line);
  border-radius: 8px;
  background: var(--hub-panel);
}
.hub-information-structure-title {
  margin-top: 22px !important;
  padding-top: 18px;
  border-top: 1px solid var(--hub-line);
}
.hub-information-table-scroll { overflow-x: auto; }
.hub-information-table {
  width: max-content;
  min-width: 620px;
  border-collapse: collapse;
  table-layout: auto;
  color: var(--hub-text);
  font-size: var(--hub-base-size);
  line-height: 1.45;
}
.hub-information-table th,
.hub-information-table td {
  padding: 12px 14px;
  border-right: 1px solid var(--hub-line);
  border-bottom: 1px solid var(--hub-line);
  text-align: left;
  vertical-align: top;
}
.hub-information-table tr > :last-child { border-right: 0; }
.hub-information-table tbody tr:last-child > * { border-bottom: 0; }
.hub-information-table thead th {
  background: var(--hub-panel-soft);
  color: var(--hub-heading);
  font-weight: 700;
}
.hub-information-table tbody th {
  width: 1%;
  color: var(--hub-heading);
  font-weight: 700;
  white-space: nowrap;
}
.hub-information-scope {
  display: grid;
  gap: 12px;
  color: var(--hub-text-secondary);
}
.hub-information-scope h2 { margin: 0; }
.hub-information-scope p { margin: 0; }

/* Kontakt jest bezpośrednią treścią głównego panelu — bez wewnętrznej karty. */
.hub-contact {
  display: grid;
  gap: 12px;
  color: var(--hub-text-secondary);
}
.hub-contact h2 {
  margin: 0;
}
.hub-contact-copy {
  max-width: none;
  margin: 0;
}
.hub-contact-link {
  color: var(--hub-brand);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.hub-contact-link:hover,
.hub-contact-link:focus-visible { color: var(--hub-brand-hover); }

.hub-footer {
  /* D-137: rytm stopki odwzorowuje CORE STEEL-MBRD. */
  margin-top: 28px;
  padding: 22px 0 34px;
  border-top: 1px solid var(--hub-line);
  color: var(--hub-brand);
  font-size: 12px;
  line-height: 1.5;
  font-weight: 400;
  text-align: center;
}

.hub-footer [data-hub-footer-copy] { color: inherit; font: inherit; }

.hub-footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
  color: inherit;
}

.hub-footer-legal-links a { color: inherit; text-decoration: none; }
.hub-footer-legal-links a:hover,
.hub-footer-legal-links a:focus-visible { color: var(--hub-text); outline: none; }

@media (max-width: 1080px) {
  .hub-header,
  .hub-main,
  .hub-footer { width: min(1200px, calc(100vw - 28px)); }
  .hub-header { padding-bottom: 14px; }
  .hub-footer { padding-bottom: 30px; }
  .hub-grid {
    grid-template-columns: repeat(4, minmax(0, var(--hub-card-width)));
    margin-inline: 0;
    column-gap: 12px;
  }
}

@media (max-width: 760px) {
  .hub-header,
  .hub-main,
  .hub-footer { width: min(1200px, calc(100vw - 20px)); }
  .hub-header { margin-top: 12px; }
  .hub-panel-title { margin-inline: 0; }
  .hub-logo { width: auto; height: clamp(48px, 14vw, 72px); max-width: min(300px, 78vw); }
  .hub-page > .hub-panel:not(.hub-panel--calculators),
  .hub-section-panel { padding: 16px 16px 21px; }
  .hub-header-controls { width: auto; justify-content: space-between; }
  .hub-tab-bar { overflow-x: visible; overflow-y: visible; }
  .hub-tab-list { flex-wrap: wrap; gap: 12px; }
  .hub-header-actions { justify-content: flex-end; }
  .hub-finder-primary { flex-wrap: wrap; align-items: stretch; }
  .hub-filters { flex-wrap: wrap; gap: 7px; }
  .hub-filter { flex: 0 0 var(--hub-filter-width, auto); padding-inline: 10px; font-size: 14px; }
  .hub-search-wrap { flex: 1 1 100%; width: 100%; max-width: none; }
  .hub-personal { grid-template-columns: 1fr; }
  .hub-family-head { flex-direction: column; }
  .hub-family-meta { align-self: flex-start; text-align: left; }
  .hub-family-subhead { flex-direction: column; gap: 4px; }
  .hub-grid { grid-template-columns: repeat(2, minmax(0, var(--hub-card-width))); gap: 10px; }
  .hub-card-guide-layout { grid-template-columns: 1fr; }
  .hub-card-guide-definitions,
  .hub-card-guide-definitions--families { grid-template-columns: 1fr; }
  .hub-card-guide-definitions--other { grid-template-columns: 1fr; }
  .hub-footer { padding-bottom: 30px; }
}

@media (max-width: 600px) {
  .hub-production-plan-summary { --hub-production-plan-control-width: min(118px, calc((100vw - 100px) / var(--hub-plan-columns, 3))); }
}

@media (max-width: 480px) {
  .hub-header { margin-top: 12px; }
  .hub-account,
  .hub-link,
  .hub-theme-cycle { flex: 1 1 auto; justify-content: center; }
  .hub-grid { grid-template-columns: minmax(0, var(--hub-card-width)); }
  .hub-card-guide { padding: 16px; }
  .hub-card-guide-header { display: grid; }
  .hub-draft-badge { width: fit-content; }
}
