:root {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  color: #243a45;
  background: #f3f5f7;
  --accent: #087f81;
  --accent-dark: #066c6e;
  --muted: #697d86;
  --border: #dce3e7;
  --side-col: 300px;
}

body {
  margin: 0;
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
aside.side {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--side-col);
  height: 100vh;
  background: #122d39;
  color: #e8f0f3;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-sizing: border-box;
  z-index: 100;
}

.brand {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.mark {
  width: 34px;
  height: 34px;
  background: #47d3bc;
  color: #123a43;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-style: italic;
  font-weight: 700;
  flex-shrink: 0;
}

.sidehead {
  font-size: 10px;
  letter-spacing: 1px;
  color: #9ab6c3;
  text-transform: uppercase;
  margin-bottom: 8px;
}

select#project-select {
  background: #203e4b;
  border: 1px solid #35515d;
  color: white;
  border-radius: 7px;
  padding: 9px;
  width: 100%;
  box-sizing: border-box;
  font: 14px "Segoe UI", Arial, sans-serif;
  cursor: pointer;
}

select#project-select:hover {
  background: #2d5063;
}

select#project-select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sidefoot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid #314b57;
  font-size: 11px;
  color: #bdd0d8;
}

.switch-mithra-btn {
  display: block;
  padding: 10px;
  border: 1px solid #5a7b89;
  border-radius: 7px;
  color: #e8f0f3;
  text-decoration: none;
  text-align: center;
  font-weight: 600;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 10px;
  font-size: 12px;
}

.switch-mithra-btn:hover {
  background: #1f4556;
  border-color: #7a99a7;
}

/* ===== MAIN CONTENT ===== */
main {
  margin-left: var(--side-col);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
}

header {
  background: #fff;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  font-size: 9px;
  letter-spacing: 1.4px;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  margin: 0 0 2px;
}

header h1 {
  font-size: 16px;
  margin: 0;
  color: #243a45;
  line-height: 1.3;
}

#subtitle {
  color: var(--muted);
  margin: 0;
  font-size: 12px;
}

#content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 18px;
}

/* ===== METRIC CARDS ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
}

.card .value {
  font-size: 17px;
  font-weight: 600;
  color: #243a45;
  margin-bottom: 4px;
  line-height: 1;
}

.card > div:not(.value) {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  line-height: 1.3;
}

/* ===== ARTICLES (PANELS) ===== */
article {
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0;
  margin-bottom: 6px;
}

article h2 {
  font-size: 14px;
  margin: 0;
  color: #243a45;
}

article p {
  margin: 0 0 6px;
  padding: 0;
}

article p:last-child {
  margin-bottom: 0;
}

/* ===== TABS ===== */
nav.tabs {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid #d4dfe4;
  margin: 0 0 10px;
  overflow-x: auto;
  position: sticky;
  top: 0;
  background: #f3f5f7;
  z-index: 5;
  min-height: 32px;
  align-items: center;
  padding-bottom: 7px;
  flex-wrap: wrap;
}

nav.tabs button {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 0;
  font: 12px "Segoe UI", Arial, sans-serif;
  color: #38515d;
  cursor: pointer;
  transition: all 0.15s;
  white-space: normal;
  line-height: 1.2;
  word-break: break-word;
}

nav.tabs button:hover {
  color: var(--accent);
}

nav.tabs button.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.tab {
  display: none;
}

.tab.active {
  display: block;
}

/* ===== BUTTONS ===== */
button, .btn-convert, .btn-view, .btn-download {
  font: 12px "Segoe UI", Arial, sans-serif;
  border-radius: 7px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-download, .btn-view, .btn-convert {
  border: 1px solid #ccd8de;
  background: white;
  color: #38515d;
  text-decoration: none;
  display: inline-block;
  margin: 2px 5px 2px 0;
}

.btn-download:hover, .btn-view:hover {
  background: #edf4f5;
  border-color: #b8c7d0;
}

.btn-convert {
  background: #ffc107;
  color: #000;
  border: 1px solid #ffc107;
}

.btn-convert:hover {
  background: #ff9900;
  border-color: #ff9900;
}

.btn-primary, .btn-download {
  background: var(--accent);
  color: white;
  border: none;
}

.btn-download:hover {
  background: var(--accent-dark);
}

/* ===== TABLES ===== */
.table-scroll {
  overflow-x: auto;
  margin: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th {
  background: #f5f8f9;
  color: #6c818d;
  font-weight: 600;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #e4ebee;
}

td {
  padding: 8px 10px;
  border-bottom: 1px solid #e4ebee;
  vertical-align: top;
}

.path {
  word-break: break-word;
}

.hash {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  word-break: break-all;
}

.action-cell {
  white-space: nowrap;
}

.kv th {
  width: 12rem;
}

/* ===== GALLERY ===== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.preview {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
}

.preview img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: contain;
  background: #17202a;
}

.preview figcaption {
  padding: 10px;
  font-size: 12px;
  line-height: 1.45;
  background: white;
}

.image-fallback {
  height: 220px;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: #e7ebf0;
  color: #6b7280;
  text-align: center;
  font-size: 12px;
}

/* ===== STATUS ===== */
.notice {
  font-size: 11px;
  line-height: 1.45;
  color: #bdd0d8;
  margin: 0;
}

.ok {
  color: #087c4c;
  font-weight: 700;
}

.error {
  color: #b42318;
  font-weight: 700;
}

.unknown {
  color: #6b7280;
  font-weight: 700;
}

.level {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.level-decoded {
  background: #d1fadf;
  color: #05603a;
}

.level-parsed {
  background: #e0f2fe;
  color: #075985;
}

.level-preview {
  background: #fef3c7;
  color: #92400e;
}

.level-error {
  background: #fee4e2;
  color: #b42318;
}

.level-inventory {
  background: #f0f0f0;
  color: #666;
}

/* ===== MODAL ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9999;
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Segoe UI", Arial, sans-serif;
}

.modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 80px rgba(18, 45, 57, 0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-width: 1400px;
  width: 95%;
  max-height: 90vh;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: #f9fafb;
}

.modal-header h2 {
  margin: 0;
  font-size: 16px;
  color: #243a45;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #666;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #000;
}

.modal-body {
  padding: 16px 20px;
  overflow: auto;
  flex: 1;
}

.binary-files-panel {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  padding: 12px;
}

.binary-files-panel h3 {
  margin: 0 0 10px;
  font-size: 14px;
  color: #243a45;
  font-weight: 600;
}

/* ===== DETAILS/SUMMARY ===== */
details {
  margin: 8px 0;
}

summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--accent);
  user-select: none;
}

summary:hover {
  text-decoration: underline;
}

pre {
  background: #1e1e1e;
  color: #e7f0f7;
  padding: 12px;
  border-radius: 6px;
  font-size: 11px;
  overflow: auto;
  max-height: 300px;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 8px 0;
}

code {
  font-family: ui-monospace, monospace;
  font-size: 12px;
}

/* ===== GEOBAZA STYLES (preserved for compatibility) ===== */
.gb-grid {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 1rem;
}

.gb-tree {
  font-size: 0.9rem;
  max-height: 70vh;
  overflow: auto;
  border-right: 1px solid #e7ebf0;
  padding-right: 0.5rem;
}

.gb-tree ul {
  list-style: none;
  padding-left: 0.6rem;
  margin: 0.3rem 0;
}

.gb-tree li {
  margin: 0.25rem 0;
}

.gb-file {
  background: none;
  border: none;
  color: #0a5d86;
  cursor: pointer;
  padding: 0;
  text-align: left;
  font: inherit;
  text-decoration: underline;
}

.gb-file.active {
  font-weight: 700;
  color: #14324a;
}

.gb-filters {
  display: flex;
  gap: 1rem;
  align-items: end;
  flex-wrap: wrap;
  margin: 0.5rem 0;
}

.gb-filters input,
.gb-filters select {
  width: auto;
  padding: 0.35rem;
}

.gb-scroll {
  max-height: 45vh;
  overflow: auto;
}

.gb-objects tr[data-i] {
  cursor: pointer;
}

.gb-objects tr[data-i]:hover,
.gb-objects tr[data-i]:focus {
  background: #eef6fb;
  outline: 2px solid #0a5d86;
}

.gb-objects tr.selected {
  background: #d9ecf7;
}

.conf {
  display: inline-block;
  padding: 0 5px;
  border-radius: 3px;
  font-size: 11px;
}

.conf-ok {
  background: #d1fadf;
  color: #05603a;
}

.conf-maybe {
  background: #fef3c7;
  color: #92400e;
}

.gb-objects td:last-child {
  font-size: 0.8rem;
  max-width: 28rem;
}

@media (max-width: 900px) {
  .gb-grid {
    grid-template-columns: 1fr;
  }

  .gb-tree {
    border-right: none;
  }
}

/* ===== RESULTS STYLES (preserved for compatibility) ===== */
.results-grid {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 1rem;
}

.results-tree {
  font-size: 0.9rem;
  max-height: 70vh;
  overflow: auto;
  border-right: 1px solid #e7ebf0;
  padding-right: 0.5rem;
}

.results-tree button {
  background: none;
  border: none;
  color: #0a5d86;
  cursor: pointer;
  padding: 0;
  text-align: left;
  font: inherit;
  text-decoration: underline;
  display: block;
  width: 100%;
  margin: 0.3rem 0;
}

.results-run.active {
  font-weight: 700;
  color: #14324a;
}

.results-filters {
  display: flex;
  gap: 1rem;
  align-items: end;
  flex-wrap: wrap;
  margin: 0.5rem 0;
}

.results-filters input,
.results-filters select,
.results-filters button {
  width: auto;
  padding: 0.35rem;
}

.results-filters button {
  background: #0066cc;
  color: white;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
}

.results-filters button:hover {
  background: #0052a3;
}

.results-scroll {
  max-height: 45vh;
  overflow: auto;
}

.results-receivers {
  font-size: 0.85rem;
}

.exceed {
  color: #b42318;
  font-weight: 600;
}

@media (max-width: 900px) {
  .results-grid {
    grid-template-columns: 1fr;
  }

  .results-tree {
    border-right: none;
  }
}

/* ===== GEOBAZA VIEW (full screen Geobaza mode) ===== */
body.gbv-open {
  overflow: hidden;
}

#gbv {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  grid-template-rows: minmax(34px, auto) 1fr 24px;
  background: #f3f5f7;
  color: #243a45;
  font: 13px "Segoe UI", Arial, sans-serif;
}

#gbv h3 {
  margin: 0;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  background: #f7f9fa;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #243a45;
}

.gbv-title {
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-end;
  display: flex;
  align-items: center;
  gap: 4px;
}

.gbv-title > span {
  flex-shrink: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  font-size: 12px;
  color: #243a45;
  max-width: 320px;
}

.gbv-home, .gbv-switch-mithra {
  white-space: nowrap;
  background: white;
  color: #243a45;
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 8px;
  text-decoration: none;
  display: inline-block;
  border-radius: 4px;
  transition: all 0.15s;
  flex-shrink: 0;
}

.gbv-home:hover, .gbv-switch-mithra:hover {
  background: #f0f2f4;
  border-color: #b8cbd2;
}

.gbv-close {
  height: 26px;
  width: 26px;
  border: none;
  background: transparent;
  color: #243a45;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 4px;
  transition: all 0.15s;
}

.gbv-close:hover {
  background: #f0f2f4;
  color: #243a45;
}

.gbv-ribbon {
  display: flex;
  gap: 0;
  background: #f8fafb;
  border-bottom: 1px solid var(--border);
  min-height: 0;
  align-items: center;
  height: auto;
  padding: 0 8px;
  overflow: hidden;
  flex-wrap: nowrap;
}

.gbv-group {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 12px 4px;
  border-right: 1px solid var(--border);
  gap: 4px;
  flex-shrink: 0;
}

.gbv-group-title {
  flex-direction: row;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 0 0 12px;
  border-right: none;
  margin-left: auto;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.gbv-group-title small {
  display: none;
}

.gbv-group small {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gbv-group button {
  padding: 4px 9px;
  border: 1px solid var(--border);
  background: #fff;
  color: #243a45;
  cursor: pointer;
  font-size: 12px;
  border-radius: 4px;
  transition: all 0.15s;
}

.gbv-group select {
  padding: 4px 6px;
  border: 1px solid var(--border);
  background: #fff;
  color: #243a45;
  cursor: pointer;
  font-size: 12px;
  border-radius: 4px;
  transition: all 0.15s;
  font-family: inherit;
}

.gbv-group button:hover:not(:disabled) {
  background: #e6f4f1;
  border-color: var(--accent);
}

.gbv-group button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.gbv-radios {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
}

.gbv-seg {
  display: flex;
  gap: 0;
  flex-shrink: 0;
  border-radius: 4px;
  background: white;
  border: 1px solid var(--border);
}

.gbv-seg-btn {
  background: white;
  border: none;
  padding: 3px 7px;
  font-size: 12px;
  color: #243a45;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  flex: 1;
}

.gbv-seg-btn:not(:last-child) {
  border-right: 1px solid var(--border);
}

.gbv-seg-btn[aria-pressed="true"] {
  background: var(--accent);
  color: white;
}

.gbv-seg-btn:hover:not([disabled]) {
  background: #f0f2f4;
}

.gbv-seg-btn[aria-pressed="true"]:hover {
  background: var(--accent-dark);
  color: white;
}

.gbv-seg-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.gbv-radios label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: #243a45;
  margin: 0;
  white-space: nowrap;
}

.gbv-note {
  display: none;
}

.gbv-body {
  display: grid;
  /* Panele boczne Geobazy: lewy panel 260 px, prawy panel dostosowany do przycisku akcji. */
  --gbv-side: 260px;
  --gbv-right: 186px;
  grid-template-columns: var(--gbv-side) 1fr var(--gbv-right);
  min-height: 0;
  gap: 0;
}

.gbv-left,
.gbv-right {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
  border-right: 1px solid var(--border);
}

.gbv-left {
  overflow: auto;
}

.gbv-right {
  border-right: 0;
  border-left: 1px solid var(--border);
  overflow-x: hidden;
  overflow-y: auto;
}

.gbv-panel {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
  min-height: 0;
}

.gbv-grow {
  flex: 1;
  overflow: auto;
}

.gbv-sub {
  padding: 6px 10px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
}

.gbv-list {
  max-height: 132px;
  overflow: auto;
}

.gbv-row {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px 8px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.1s;
  height: 24px;
  min-height: 24px;
}

.gbv-row:hover {
  background: #f3f8f8;
}

.gbv-row small {
  color: var(--muted);
  font-size: 11px;
  margin-left: auto;
}

.gbv-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gbv-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: #243a45;
}

.gbv-padlock {
  cursor: not-allowed;
}

.gbv-sun {
  color: #e0a100;
  cursor: default;
}

.gbv-bulb {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #243a45;
  transition: all 0.15s;
}

.gbv-bulb svg {
  width: 14px;
  height: 14px;
}

.gbv-bulb.on svg {
  fill: #f2c230;
  color: #7a6a1a;
  stroke: #7a6a1a;
}

.gbv-bulb.off {
  opacity: 0.5;
}

.gbv-bulb:hover {
  opacity: 1;
}

.gbv-row.cur {
  background: #e6f4f1;
  color: #243a45;
  border-left: 3px solid var(--accent);
  padding-left: 5px;
}

.gbv-row.cur small,
.gbv-row.cur .gbv-name {
  color: #243a45;
}

.gbv-objects tr.cur td {
  background: #e6f4f1;
  color: #243a45;
}

.gbv-eye {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  color: #243a45;
  transition: opacity 0.15s;
}

.gbv-eye:hover {
  opacity: 0.7;
}

.gbv-eye.off {
  opacity: 0.3;
}

#gbv-overview {
  display: block;
  margin: 6px auto;
  border: 1px solid var(--accent);
  background: #fff;
  cursor: pointer;
  width: calc(100% - 12px);
  height: auto;
}

.gbv-objects {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.gbv-objects th {
  font-weight: 700;
  background: #f7f9fa;
  border-bottom: 1px solid var(--border);
  padding: 3px 8px;
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  height: 24px;
}

.gbv-icon-header {
  width: 16px;
  padding: 3px 2px;
  text-align: center;
}

.gbv-bulb-icon {
  width: 14px;
  height: 14px;
  color: #243a45;
}

.gbv-objects td {
  padding: 3px 8px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  color: #243a45;
  font-size: 13px;
  transition: all 0.1s;
  height: 24px;
  vertical-align: middle;
}

.gbv-objects tbody tr:hover {
  background: #f3f8f8;
}

.gbv-objects td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding-right: 8px;
}

.gbv-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid;
  box-sizing: border-box;
  vertical-align: middle;
  flex-shrink: 0;
}

.gbv-center {
  position: relative;
  background: #fff;
  min-width: 0;
  min-height: 0;
}

/* Rysunek nad podkładem: podkład (#gbv-basemap) w tle, płótno obiektów przezroczyste (bez podkładu draw() maluje białe tło). */
#gbv-basemap {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 0;
  pointer-events: none;
}
#gbv-canvas {
  position: relative;
  z-index: 1;
  display: block;
  cursor: crosshair;
  touch-action: none;
  background: transparent;
}

/* Basemap loading indicator for geobaza-view */
#gbv-basemap-loading.basemap-loading {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1050;
  background: white;
  border: 1px solid #dce3e7;
  border-radius: 4px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #243a45;
  box-shadow: 0 2px 8px rgba(18, 45, 57, 0.12);
  white-space: nowrap;
}

#gbv-basemap-loading.basemap-loading[hidden] {
  display: none;
}

.gbv-status {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px;
  background: #f7f9fa;
  border-top: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  white-space: pre;
  font-size: 12px;
  color: #243a45;
}

.gbv-kv {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.gbv-kv th {
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  padding: 6px 10px;
  width: 45%;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  background: #f7f9fa;
  font-size: 11px;
}

.gbv-kv td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  word-break: break-word;
  color: #243a45;
  font-size: 12px;
}

#gbv-props {
  padding: 8px 10px;
  overflow: auto;
}

#gbv-props details {
  margin-top: 8px;
}

#gbv-props summary {
  cursor: pointer;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}

#gbv-props summary:hover {
  text-decoration: underline;
}

/* ===== COLLAPSIBLE FOLDS ===== */
.fold {
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 6px;
  overflow: hidden;
}

.fold-head {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: #f8fafb;
  border: 0;
  border-radius: 6px;
  font: 12.5px "Segoe UI", Arial, sans-serif;
  font-weight: 600;
  color: #243a45;
  cursor: pointer;
  transition: all 0.15s;
}

.fold-head:hover {
  background: #edf4f5;
}

.fold.open .fold-head {
  border-bottom: 1px solid var(--border);
  border-radius: 6px 6px 0 0;
  color: var(--accent);
}

.fold-caret {
  display: inline-flex;
  align-items: center;
  transition: transform 0.15s;
  flex-shrink: 0;
}

.fold.open .fold-caret {
  transform: rotate(90deg);
}

.fold-body {
  display: none;
  padding: 8px 10px;
}

.fold.open .fold-body {
  display: block;
}

.fold-body p {
  margin: 4px 0;
  font-size: 12px;
}

.fold-body table {
  font-size: 12px;
}

.fold-body td,
.fold-body th {
  padding: 4px 8px;
}

.fold-body .table-scroll {
  max-height: 360px;
  overflow: auto;
}

.fold-tools {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin: 0 0 6px;
}

.fold-tools button {
  font-size: 11px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  background: #f8fafb;
  color: #243a45;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.fold-tools button:hover {
  background: #edf4f5;
  border-color: #bbb;
}

.gbv-hint {
  color: var(--muted);
  padding: 8px 10px;
  margin: 0;
  font-size: 12px;
}

#gbv-log {
  display: inline;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

#gbv-log div {
  display: none;
}

#gbv-log div:last-child {
  display: inline;
}

#gbv-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f3f5f7;
  color: #697d86;
  padding: 0 12px;
  font-size: 11px;
  border-top: 1px solid var(--border);
  height: 24px;
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  gap: 12px;
}

#gbv-logbar {
  white-space: nowrap;
  flex-shrink: 0;
}

.gb-scenes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
}

.gbv-name {
  display: inline;
  color: #243a45;
  font-size: 12px;
}

#gbv label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 400;
  margin: 0;
  white-space: nowrap;
  font-size: 12px;
  color: #243a45;
}

#gbv input[type="radio"] {
  margin: 0;
  cursor: pointer;
}

.conf {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 500;
}

.conf-ok {
  background: #d1fadf;
  color: #05603a;
}

.conf-maybe {
  background: #fef3c7;
  color: #92400e;
}

.sp-legend {
  background: #fff;
  padding: 8px 10px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  font: 12px "Segoe UI", system-ui, sans-serif;
  max-width: 260px;
}

.sp-legend label {
  display: grid;
  grid-template-columns: 16px 16px 1fr auto;
  align-items: center;
  gap: 5px;
  margin: 3px 0;
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
}

.sp-legend label small {
  margin-left: auto;
  color: #666;
}

.sp-legend > small {
  display: block;
  margin-top: 4px;
  color: #666;
}

.sp-legend input {
  margin: 0;
}

.sp-legend summary {
  cursor: pointer;
  font-weight: 600;
}

@media (max-width: 1300px) {
  .gbv-body {
    --gbv-side: 170px;   /* wąski ekran: 250 px × 2/3, lewy panel */
    --gbv-right: 170px;  /* prawy panel zmniejszony do szerokości na wąskim ekranie */
    grid-template-columns: var(--gbv-side) 1fr var(--gbv-right);
  }

  .gbv-group small {
    font-size: 10px;
    line-height: 1.2;
  }
}

@media (max-width: 1280px) {
  .gbv-ribbon {
    min-height: 60px;
  }

  .gbv-group {
    padding: 4px 8px 3px;
    flex: 0 1 auto;
  }

  .gbv-group small {
    font-size: 9px;
    display: block;
  }

  .gbv-group > div {
    display: flex;
    gap: 2px;
    flex-wrap: nowrap;
  }

  .gbv-group button,
  .gbv-group select {
    padding: 3px 6px;
    font-size: 11px;
  }

  .gbv-group-title {
    flex: 1 1 auto;
  }

  #gbv .gbv-home, #gbv .gbv-switch-mithra {
    padding: 3px 6px;
    font-size: 11px;
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  :root {
    --side-col: 260px;
  }

  header h1 {
    font-size: 15px;
  }
}

@media (max-width: 900px) {
  aside.side {
    position: static;
    width: 100%;
    height: auto;
    padding: 16px;
  }

  main {
    margin-left: 0;
  }

  body {
    flex-direction: column;
  }

  #content {
    padding: 20px 16px;
  }

  header {
    padding: 20px 16px;
  }

  nav.tabs {
    gap: 16px;
    overflow-x: auto;
  }

  .cards {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
  }

  .gallery {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .preview img,
  .image-fallback {
    height: 180px;
  }

  .modal-content {
    width: 90%;
    max-width: 95vw;
  }
}

@media (max-width: 600px) {
  aside.side {
    margin-bottom: 10px;
  }

  header h1 {
    font-size: 20px;
  }

  #content {
    padding: 16px;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  article {
    padding: 12px;
  }

  table {
    font-size: 11px;
  }

  th,
  td {
    padding: 6px 8px;
  }

  nav.tabs {
    gap: 12px;
  }

  nav.tabs button {
    padding: 0 0 10px;
  }
}

/* ===== Dopracowanie gęstości (27.09.2026): kafelki w jednym wierszu, mniejsze pola, nazwa programu w jednej linii ===== */
.cards { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px; margin-bottom: 8px; }
.card { display: flex; align-items: baseline; gap: 6px; padding: 6px 10px; font-size: 11px; line-height: 1.25; color: var(--muted, #697d86); }
.card .value { font-size: 15px; margin: 0; color: #243a45; font-weight: 600; flex: 0 0 auto; }
select#project-select { font-size: 12px; padding: 6px 8px; }
.brand { white-space: nowrap; }
.brand-text, .brand > div { font-size: 15px; line-height: 1.15; }
.brand small { font-size: 7.5px; letter-spacing: 1.4px; }
aside.side .notice, aside.side p { font-size: 11px; }
/* Najechanie na zakładkę nie może wyglądać jak zakładka aktywna (tylko kolor, bez podkreślenia). */
nav.tabs button:hover:not(.active) { border-bottom-color: transparent; color: var(--accent, #087f81); }
/* Przyciski generowane przez moduły (np. Geobaza: button.primary.gb-scene) — styl wspólny, kompaktowy. */
button.primary, .fold-body button.primary { background: var(--accent, #087f81); border: 1px solid var(--accent, #087f81); color: #fff; }
button.primary:hover { background: var(--accent-dark, #066c6e); }
.fold-body button { font-size: 12px; padding: 4px 9px; border-radius: 6px; margin: 2px 4px 2px 0; }

/* ===== MIDDLE COLUMN OPTIMIZATIONS ===== */
.main-left .cards {
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.main-left .cards .card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.main-left .card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  font-size: 10px;
  line-height: 1.3;
  background: #f8fafc;
  border: 1px solid var(--border, #dce3e7);
  border-radius: 5px;
}

.main-left .card .value {
  font-size: 18px;
  font-weight: 700;
  color: #243a45;
  margin: 0 0 2px 0;
}

.main-left .card > div:not(.value) {
  color: var(--muted, #697d86);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Compact segmented tab control */
.main-left nav.tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 0;
  border: 1px solid var(--border, #dce3e7);
  border-bottom: none;
  border-radius: 5px;
  overflow: hidden;
  padding: 0;
  margin: 0 0 10px 0;
  background: #f8fafc;
}

.main-left nav.tabs button {
  padding: 7px 8px;
  font-size: 11px;
  text-align: center;
  border: none;
  border-right: 1px solid var(--border, #dce3e7);
  border-bottom: none;
  background: #f8fafc;
  color: #38515d;
  border-radius: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  line-height: 1.2;
}

.main-left nav.tabs button:last-child {
  border-right: none;
}

.main-left nav.tabs button:hover:not(.active) {
  background: #eef4f6;
  border-bottom-color: transparent;
}

.main-left nav.tabs button.active {
  background: var(--accent, #087f81);
  color: white;
  border-color: var(--accent, #087f81);
}

/* Stacked key/value tables in middle column */
.main-left .kv {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.main-left .kv th {
  width: auto;
  padding: 4px 10px 2px;
  font-size: 10px;
  color: var(--muted, #697d86);
  background: none;
  border-bottom: none;
  border-top: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  display: block;
}

.main-left .kv tr {
  display: block;
  padding: 0;
  border-bottom: 1px solid var(--border, #dce3e7);
  padding: 8px 0;
}

.main-left .kv tr:last-child {
  border-bottom: none;
}

.main-left .kv td {
  display: block;
  padding: 4px 10px;
  border-bottom: none;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.main-left .kv small {
  display: block;
  color: var(--muted, #697d86);
  font-size: 10px;
  margin-top: 2px;
}

/* Horizontal scroll for wide tables in middle column */
.main-left .table-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0;
  border: 1px solid var(--border, #dce3e7);
  border-radius: 5px;
}

.main-left table {
  font-size: 11px;
}

.main-left th {
  font-size: 10px;
  padding: 6px 8px;
}

.main-left td {
  padding: 6px 8px;
  font-size: 11px;
}

.main-left .path {
  word-break: break-word;
  overflow-wrap: break-word;
}

.main-left button.btn-view,
.main-left button.btn-download {
  font-size: 10px;
  padding: 4px 6px;
  white-space: nowrap;
}

/* Header improvements for narrow column */
.main-left header {
  padding: 8px 12px;
}

.main-left header > div[style*="inline-flex"] {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px !important;
  align-items: center !important;
}

.main-left header h1 {
  font-size: 14px;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.main-left .home-btn {
  flex-shrink: 0;
}

/* ===== Dok mapy (27.09.2026) ===== */
main {
  display: grid;
  grid-template-columns: var(--side-col) minmax(0, 1fr);
  gap: 12px;
  height: 100vh;
  overflow: hidden;
  padding: 10px 12px;
}

.main-left {
  display: flex;
  flex-direction: column;
  overflow: auto;
  min-height: 0;
}

.map-dock {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--border, #dce3e7);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.map-dock-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border, #dce3e7);
  background: #f8fafb;
  font-size: 12px;
}

.map-dock-map {
  flex: 1;
  min-height: 0;
  position: relative;
}

.map-dock-map.nobase {
  background-color: #fff;
  background-image: linear-gradient(#eef2f4 1px, transparent 1px), linear-gradient(90deg, #eef2f4 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Basemap loading indicator for map-dock */
.map-dock #map-dock-loading.basemap-loading {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1050;
  background: white;
  border: 1px solid var(--border, #dce3e7);
  border-radius: 4px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #243a45;
  box-shadow: 0 2px 8px rgba(18, 45, 57, 0.12);
  white-space: nowrap;
}

.map-dock #map-dock-loading.basemap-loading[hidden] {
  display: none;
}

/* Basemap loading indicator spinner */
.basemap-loading-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid var(--border, #dce3e7);
  border-top-color: #087f81;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.seg button {
  border-radius: 0;
  margin: 0;
  padding: 4px 9px;
  border: 1px solid var(--border, #dce3e7);
  background: #fff;
  color: #38515d;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.seg button:first-child {
  border-radius: 6px 0 0 6px;
}

.seg button:last-child {
  border-radius: 0 6px 6px 0;
}

.seg button[aria-pressed='true'] {
  background: var(--accent, #087f81);
  color: #fff;
  border-color: var(--accent, #087f81);
}

.seg button:hover {
  background: #edf4f5;
  border-color: #b8c7d0;
}

.seg button[aria-pressed='true']:hover {
  background: var(--accent-dark, #066c6e);
  border-color: var(--accent-dark, #066c6e);
}

@media (max-width: 1000px) {
  main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    height: auto;
    overflow: visible;
    padding: 10px 12px;
  }

  .main-left {
    overflow: visible;
    min-height: auto;
  }

  .map-dock {
    height: 60vh;
  }
}

/* ===== SEND TO MITHRA BUTTON ===== */
.send-mithra-btn {
  display: block;
  padding: 10px;
  border: 1px solid #5a7b89;
  border-radius: 7px;
  color: #fff;
  background: var(--accent, #087f81);
  text-decoration: none;
  text-align: center;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 12px;
  margin-bottom: 10px;
}

.send-mithra-btn:hover {
  background: var(--accent-dark, #066c6e);
  border-color: var(--accent-dark, #066c6e);
}

.send-mithra-btn[aria-disabled='true'] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== HOME BUTTON ===== */
.home-btn {
  font-size: 11px;
  padding: 3px 8px;
  border: 1px solid var(--border, #dce3e7);
  border-radius: 5px;
  background: #fff;
  color: #38515d;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  white-space: nowrap;
}

.home-btn:hover {
  background: #edf4f5;
}


/* Tool Palette */
.tool-btn {
  aspect-ratio: 1;
  background: #f8fafb;
  border: 1px solid #d5dde2;
  border-radius: 4px;
  padding: 2px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-btn:hover {
  background: #e6f4f1;
  border-color: #0f7c73;
}

.tp {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tp-group {
  display: grid;
  grid-template-columns: repeat(5, 28px);
  gap: 3px;
  padding-bottom: 4px;
  border-bottom: 1px solid #d5dde2;
}

.tp-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.tp-btn {
  width: 28px;
  height: 28px;
  aspect-ratio: auto;
  padding: 0;
  color: #243a45;
}

.tp-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

.tp-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.tp-btn:disabled:hover {
  background: #f8fafb;
  border-color: #d5dde2;
}

.tool-palette {
  position: fixed;
  left: 320px;
  top: 90px;
  z-index: 3001;
  width: 176px;
  background: #fff;
  border: 1px solid #d5dde2;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.tool-palette[hidden] {
  display: none;
}

body:not(.gbv-open) #tool-palette {
  display: none !important;
}

.tool-palette-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  border-bottom: 1px solid #d5dde2;
  font-size: 11px;
  font-weight: 700;
  color: #243a45;
}

.tool-palette-close {
  background: none;
  border: none;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: #6b7c85;
}

.tool-palette-content {
  padding: 8px;
}

/* Żarówka (widoczność): bańka wypełniana żółto, gdy włączona — jak w SoundPLAN / AutoCAD. */
.gbv-bulb svg, .gbv-bulb-icon { width: 14px; height: 14px; }
.gbv-bulb .bulb-glass, .gbv-bulb-icon .bulb-glass { fill: none; stroke: currentColor; }
.gbv-bulb.on { color: #7a6a1a; opacity: 1; }
.gbv-bulb.on .bulb-glass { fill: #f2c230; stroke: #7a6a1a; }
.gbv-bulb.off { color: #9aa7ae; }

/* Sesja edycji Geobazy: formularz atrybutów, akcje, podgląd wydruku, druk. */
.gbv-badge { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 3px; background: #e6f4f1; color: #066c6e; font-size: 11px; font-weight: 600; }
.gbv-kv input, .gbv-kv select { width: 100%; box-sizing: border-box; font: 12px "Segoe UI", Arial, sans-serif; padding: 2px 4px; border: 1px solid var(--border); border-radius: 3px; }
.gbv-kv input.gbv-invalid, .gbv-kv select.gbv-invalid { border-color: #c24a25; background: #fff3ef; }
.gbv-actions { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 8px; }
.gbv-actions button, #gbv-props > button { font-size: 12px; padding: 3px 8px; border: 1px solid var(--border); border-radius: 4px; background: #fff; color: #243a45; cursor: pointer; }
.gbv-actions button:hover, #gbv-props > button:hover { background: #e6f4f1; border-color: var(--accent); }
.gbv-trow { cursor: pointer; }
.gbv-trow:hover { background: #f3f8f8; }
.gbv-flash { outline: 2px solid var(--accent); outline-offset: -2px; }
#gbv-dirty { color: #c24a25; font-weight: 600; }
.gbv-preview { position: fixed; inset: 0; z-index: 4000; background: rgba(18, 45, 57, .55); display: flex; align-items: center; justify-content: center; }
.gbv-preview-box { background: #fff; border-radius: 8px; box-shadow: 0 10px 40px rgba(0, 0, 0, .35); max-width: 92vw; max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; }
.gbv-preview-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.gbv-preview-head button { font-size: 12px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 4px; background: #fff; cursor: pointer; }
.gbv-preview-box img { display: block; max-width: 90vw; max-height: 80vh; object-fit: contain; margin: 8px auto; border: 1px solid var(--border); }
@media print {
  body.gbv-printing > *:not(#gbv) { display: none !important; }
  body.gbv-printing #gbv .gbv-title, body.gbv-printing #gbv .gbv-ribbon, body.gbv-printing #gbv .gbv-left, body.gbv-printing #gbv .gbv-right, body.gbv-printing #gbv .gbv-log { display: none !important; }
  body.gbv-printing #gbv, body.gbv-printing #gbv .gbv-body, body.gbv-printing #gbv .gbv-center { position: static !important; display: block !important; }
}
.gbv-attr-actions { border-top: 1px solid var(--border); padding-top: 8px; }
.gbv-attr-actions .gbv-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.gbv-attr-actions button:disabled { opacity: .45; cursor: default; }
.gbv-attr-status { color: var(--muted); }
.gbv-kv input.gbv-changed, .gbv-kv select.gbv-changed { border-color: var(--accent); background: #e6f4f1; }

/* Przyciski Geobazy = przyciski MITHRA-lite */
#gbv .gbv-actions button,
#gbv .gbv-attr-actions button:not(.gbv-primary),
#gbv .gbv-group button,
#gbv .gbv-save-btn,
#gbv .gbv-save-as-btn,
#gbv #gbv-note-ok,
#gbv .gbv-preview-head button {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  color: #243a45;
  background: white;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

#gbv .gbv-actions button:hover:not(:disabled),
#gbv .gbv-attr-actions button:hover:not(:disabled):not(.gbv-primary),
#gbv .gbv-group button:hover:not(:disabled),
#gbv .gbv-save-btn:hover,
#gbv .gbv-save-as-btn:hover,
#gbv #gbv-note-ok:hover,
#gbv .gbv-preview-head button:hover {
  background: #f0f2f4;
  border-color: #b8cbd2;
}

#gbv .gbv-actions button:disabled,
#gbv .gbv-attr-actions button:disabled,
#gbv .gbv-group button:disabled,
#gbv .gbv-save-btn:disabled,
#gbv .gbv-save-as-btn:disabled,
#gbv #gbv-note-ok:disabled,
#gbv .gbv-preview-head button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#gbv .gbv-attr-actions .gbv-primary,
#gbv .gbv-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

#gbv .gbv-attr-actions .gbv-primary:hover,
#gbv .gbv-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

/* Prawy panel Geobazy (wąski, szerokość 2 przycisków): etykieta nad wartością zamiast dwóch kolumn — tekst i pola się mieszczą. */
#gbv .gbv-right .gbv-kv, #gbv .gbv-right .gbv-kv tbody, #gbv .gbv-right .gbv-kv tr, #gbv .gbv-right .gbv-kv th, #gbv .gbv-right .gbv-kv td { display: block; width: auto; }
#gbv .gbv-right .gbv-kv tr { padding: 4px 0; border-bottom: 1px solid var(--border); }
#gbv .gbv-right .gbv-kv th { padding: 0 8px 2px; font-size: 11px; color: var(--muted); background: none; border: 0; }
#gbv .gbv-right .gbv-kv th[colspan] { font-size: 12px; color: #243a45; font-weight: 700; }
#gbv .gbv-right .gbv-kv td { padding: 0 8px; border: 0; word-break: break-word; }
#gbv .gbv-right .gbv-actions { flex-wrap: wrap; }

/* Geobaza: pasek bez podpisów grup (jak MITHRA-lite); tytuł projektu w pasku stanu na dole. */
#gbv .gbv-group[hidden] { display: none; }
#gbv .gbv-ribbon .gbv-group { justify-content: center; padding-top: 6px; padding-bottom: 6px; }
#gbv-status-bar .gbv-title { flex: 0 1 auto; min-width: 0; justify-content: flex-end; }
#gbv-status-bar .gbv-title > span { font-size: 11px; font-weight: 600; color: #243a45; max-width: 360px; }
/* Menedżer obiektów dopasowany do Menedżera Plików-Geo: te same wiersze, czcionka i kolumna liczby. */
#gbv .gbv-row { font-size: 12px; height: 24px; min-height: 24px; padding: 2px 8px; }
#gbv .gbv-objects { table-layout: fixed; font-size: 12px; }
#gbv .gbv-objects th { height: 22px; padding: 2px 8px; font-size: 11px; }
#gbv .gbv-objects td { height: 24px; padding: 2px 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-bottom: 1px solid var(--border); }
#gbv .gbv-objects td:nth-child(1) { width: 22px; padding-left: 8px; }
#gbv .gbv-objects td:nth-child(2) { width: 20px; text-align: center; }
#gbv .gbv-objects td.gbv-cname { padding-left: 2px; color: #243a45; }
#gbv .gbv-objects td.num { width: 60px; padding-right: 8px; text-align: right; color: var(--muted); font-size: 11px; }
#gbv .gbv-objects tr.cur td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
#gbv .gbv-swatch { width: 12px; height: 12px; }

/* ===== CSP-COMPLIANT INLINE STYLES ===== */
/* Converted from inline style attributes to meet CSP style-src 'self' requirement */
.brand > div {
  font-size: 15px;
  line-height: 1.15;
  font-weight: 650;
}

label[for="project-select"] {
  display: block;
  font-weight: 700;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

aside.side .notice {
  font-size: 11px;
  line-height: 1.45;
  color: #bdd0d8;
  margin: 12px 0 0;
}

.sidefoot > div {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  margin-bottom: 10px;
}

.sidefoot > div > span {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #50d5bd;
  border-radius: 50%;
}

.sidefoot > small {
  display: block;
  font-size: 10px;
  color: #9ab6c3;
  text-align: center;
  margin-top: 8px;
}

header > div:first-of-type {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.modal.hidden {
  display: none;
}

.modal-content.modal-binary {
  width: 95%;
  max-width: 1400px;
}

.modal-content.modal-convert {
  width: 90%;
  max-width: 900px;
}

.modal-header > div {
  display: flex;
  gap: 8px;
}

.modal-notice {
  margin: 0;
  padding: 0.6rem 1.5rem;
  background: #fff8e1;
}

.modal-body.modal-body-grid {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 1rem;
}

#wms-map-container {
  position: relative;
  width: 100%;
  height: 600px;
  background: #e5e5e5;
  border-radius: 8px;
  overflow: hidden;
}

#wms-map {
  width: 100%;
  height: 100%;
}

#wms-status {
  display: none;
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 1001;
  max-width: 65%;
  padding: 8px 10px;
  background: #fff8e1;
  border: 1px solid #d6b656;
  border-radius: 4px;
  font-size: 12px;
}

#map-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 10px;
  border-radius: 4px;
  font-size: 12px;
}

#map-controls > div {
  margin-top: 5px;
}

#map-controls > div:first-child {
  margin-top: 0;
}

#map-controls button {
  padding: 4px 8px;
  margin-right: 5px;
  cursor: pointer;
}

.binary-files-panel > div {
  max-height: 550px;
  overflow-y: auto;
}

#convert-body {
  overflow: auto;
  max-height: 70vh;
}

/* Binary viewer file list styling */
.binary-files-list-header {
  padding: 10px;
  background: #e8f4f8;
  border-bottom: 2px solid #0066cc;
}

.binary-files-list-header strong {
  font-weight: 600;
}

.binary-file-item {
  padding: 10px;
  border-bottom: 1px solid #ddd;
  background: #fff;
}

.binary-file-item strong {
  color: #0066cc;
  font-weight: 600;
}

.binary-file-item small {
  color: #444;
  font-size: 12px;
  line-height: 1.5;
}

.file-note {
  color: #666;
  font-size: 11px;
  font-style: italic;
}
