:root {
  --bg: #0b1f2a;
  --panel: rgba(11, 31, 42, 0.92);
  --ink: #e8f1f5;
  --muted: #9bb4c0;
  --accent: #3d9aad;
  --ok: #2e7d32;
  --warn: #f9a825;
  --bad: #c62828;
  --header-h: 56px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, sans-serif;
}

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 100vh;
}

.app-header {
  min-height: var(--header-h);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(180deg, #0f2c3a 0%, #0b1f2a 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 1000;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
}

.demo-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  margin: 0 0.35rem 0 0;
  padding: 0.28rem 0.55rem;
  border-radius: 0.4rem;
  border: 1px solid rgba(255, 193, 7, 0.45);
  background: rgba(255, 193, 7, 0.12);
  color: #ffe082;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.demo-toggle input {
  width: 0.95rem;
  height: 0.95rem;
  accent-color: #ffc107;
  cursor: pointer;
  margin: 0;
}

.app-shell.is-demo .demo-toggle {
  background: rgba(255, 193, 7, 0.28);
  border-color: #ffc107;
  color: #fff8e1;
  box-shadow: 0 0 0 1px rgba(255, 193, 7, 0.35);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 0.4rem;
  background: var(--accent);
  color: #052029;
  font-weight: 800;
  font-size: 0.75rem;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.brand-title {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-dropdown {
  position: relative;
  min-width: 0;
  flex: 1 1 auto;
  max-width: min(100%, 28rem);
}

.status-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  margin: 0;
  padding: 0.2rem 0.35rem 0.2rem 0.15rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.status-dropdown-toggle:hover,
.status-dropdown-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.status-dropdown-chevron {
  flex: 0 0 auto;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.15rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.18s ease;
  opacity: 0.85;
}

.status-dropdown.is-open .status-dropdown-chevron {
  transform: rotate(-135deg);
  margin-top: 0.25rem;
}

.facility-summary {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
}

.facility-summary-label {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-dropdown-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 1100;
  background: var(--panel);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 0.75rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  max-height: min(60vh, 22rem);
  overflow: auto;
}

.status-dropdown-panel[hidden] {
  display: none;
}

/* Mobile landscape: pasek statusu z boku, panel rozwija się w prawo */
@media (orientation: landscape) and (max-height: 520px) {
  .app-shell--map {
    flex-direction: row;
  }

  .app-shell--map .app-header--status {
    width: 2.85rem;
    min-width: 2.85rem;
    min-height: 0;
    height: auto;
    align-self: stretch;
    flex: 0 0 2.85rem;
    padding: 0.45rem 0.2rem;
    border-bottom: none;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(90deg, #0f2c3a 0%, #0b1f2a 100%);
  }

  .app-shell--map .status-dropdown {
    position: relative;
    flex: 1 1 auto;
    max-width: none;
    width: 100%;
    height: 100%;
  }

  .app-shell--map .status-dropdown-toggle {
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    height: 100%;
    padding: 0.35rem 0.1rem;
  }

  .app-shell--map .facility-summary {
    flex: 0 0 auto;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
  }

  .app-shell--map .facility-summary-label {
    font-size: 0.82rem;
    letter-spacing: 0.04em;
  }

  .app-shell--map .status-dropdown-chevron {
    margin: 0.15rem 0 0;
    transform: rotate(-45deg);
  }

  .app-shell--map .status-dropdown.is-open .status-dropdown-chevron {
    transform: rotate(135deg);
    margin-top: 0.15rem;
  }

  .app-shell--map .status-dropdown-panel {
    top: 0.5rem;
    bottom: 0.5rem;
    left: calc(100% + 0.4rem);
    right: auto;
    width: min(22rem, calc(100vw - 3.6rem));
    max-height: none;
  }

  .app-shell--map .map-wrap {
    flex: 1 1 auto;
    min-width: 0;
  }
}

.map-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

#map {
  width: 100%;
  height: 100%;
  background: #1a3340;
}

.status-panel {
  position: absolute;
  left: 0.75rem;
  right: 3.25rem; /* miejsce na przyciski zoom (+/−) */
  bottom: 0.75rem;
  z-index: 900;
  background: var(--panel);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 0.75rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  max-height: 42%;
  overflow: auto;
}

.panel-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.facility-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.facility-card {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.55rem;
  padding: 0.45rem 0.55rem 0.5rem;
  background: rgba(255, 255, 255, 0.04);
}

.facility-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--muted);
  line-height: 1.1;
}

.facility-card-row {
  display: grid;
  grid-template-columns: minmax(3.2rem, auto) 1fr minmax(3.2rem, auto);
  gap: 0.45rem;
  align-items: start;
}

.facility-card-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}

.facility-card-side--west {
  align-items: flex-start;
}

.facility-card-side--east {
  align-items: flex-end;
}

.facility-card-name {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  padding-top: 0.1rem;
  min-width: 0;
}

.facility-side-desc {
  font-size: 0.62rem;
  line-height: 1.25;
  color: var(--muted);
  text-align: center;
  max-width: 5.5rem;
  word-break: break-word;
}

.facility-card-side--west .facility-side-desc {
  text-align: left;
}

.facility-card-side--east .facility-side-desc {
  text-align: right;
}

.facility-side {
  display: flex;
  align-items: center;
  justify-content: center;
}

.facility-side--empty {
  min-width: 1.55rem;
  min-height: 1.55rem;
}

.facility-dot {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
  display: block;
}

.sign-icon {
  display: grid;
  place-items: center;
  min-width: 1.55rem;
  height: 1.55rem;
  padding: 0 0.2rem;
  font-size: 0.48rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  border: 1.5px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  text-align: center;
}

.sign-icon--stop {
  background: #c62828;
  border-radius: 0.2rem;
  clip-path: polygon(
    30% 0%,
    70% 0%,
    100% 30%,
    100% 70%,
    70% 100%,
    30% 100%,
    0% 70%,
    0% 30%
  );
  width: 1.65rem;
  height: 1.65rem;
  min-width: 1.65rem;
  font-size: 0.42rem;
}

.sign-icon--uwaga {
  background: #f9a825;
  color: #1a1a1a;
  border: none;
  border-radius: 0;
  clip-path: polygon(50% 8%, 4% 92%, 96% 92%);
  width: 1.55rem;
  height: 1.4rem;
  min-width: 1.55rem;
  font-size: 0.7rem;
  padding-top: 0.35rem;
}

.sign-icon--limit_30,
.sign-icon--limit_50 {
  background: #fff;
  color: #1a1a1a;
  border: 2px solid #c62828;
  border-radius: 50%;
  width: 1.55rem;
  height: 1.55rem;
  min-width: 1.55rem;
  font-size: 0.62rem;
}

.sign-icon--green,
.sign-icon--yellow,
.sign-icon--red {
  border-radius: 50%;
  width: 1.55rem;
  height: 1.55rem;
  min-width: 1.55rem;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    inset 0 -2px 4px rgba(0, 0, 0, 0.25),
    0 1px 4px rgba(0, 0, 0, 0.35);
}

.sign-icon--green {
  background: radial-gradient(circle at 35% 30%, #81c784, #2e7d32 55%, #1b5e20);
}

.sign-icon--yellow {
  background: radial-gradient(circle at 35% 30%, #ffe082, #f9a825 55%, #f57f17);
}

.sign-icon--red {
  background: radial-gradient(circle at 35% 30%, #ef9a9a, #c62828 55%, #b71c1c);
}

.legend-toggle {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 900;
  opacity: 0.92;
}

.legend-box {
  position: absolute;
  top: 2.75rem;
  right: 0.75rem;
  z-index: 900;
  width: min(260px, calc(100% - 1.5rem));
}

.legend-inner {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.65rem;
  padding: 0.65rem 0.75rem;
  font-size: 0.75rem;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.3rem 0;
}

.swatch {
  width: 1rem;
  height: 0.35rem;
  border-radius: 999px;
  flex: 0 0 auto;
}

.swatch.outage {
  background: repeating-linear-gradient(
    90deg,
    #b71c1c 0 4px,
    #ff8a80 4px 8px
  );
  height: 0.45rem;
}

.swatch.hidden-swatch {
  background: repeating-linear-gradient(
    90deg,
    #9e9e9e 0 4px,
    transparent 4px 8px
  );
  border: 1px solid #9e9e9e;
  height: 0.45rem;
}

.admin-segment-panel {
  max-height: none;
  bottom: auto;
  top: 0.75rem;
  right: 0.75rem;
  left: auto;
  width: min(18rem, calc(100% - 1.5rem));
}

.admin-controls-panel {
  max-height: calc(100% - 1.5rem);
  overflow: auto;
  bottom: auto;
  top: 0.75rem;
  left: 0.75rem;
  right: auto;
  width: min(19rem, calc(100% - 1.5rem));
}

.routes-edit-panel .routes-edit-meta {
  font-size: 0.78rem;
  line-height: 1.35;
  margin-bottom: 0.65rem;
  opacity: 0.9;
}

.routes-edit-help {
  margin: 0 0 0.75rem;
  padding-left: 1.1rem;
  font-size: 0.72rem;
  line-height: 1.4;
  opacity: 0.85;
}

.routes-edit-help kbd {
  display: inline-block;
  padding: 0.05rem 0.3rem;
  border-radius: 0.2rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 0.68rem;
}

.routes-edit-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.routes-edit-actions .btn:disabled {
  opacity: 0.45;
}

#routes-edit-hint.is-error {
  color: #ff8a80;
}

.route-vertex-marker {
  width: 14px !important;
  height: 14px !important;
  margin-left: -7px !important;
  margin-top: -7px !important;
  border-radius: 50%;
  background: #ffeb3b;
  border: 2px solid #1a1a1a;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  cursor: grab;
}

.route-vertex-marker.is-selected {
  background: #ff9800;
  box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.45);
}

.route-edit-line {
  cursor: crosshair;
}

.admin-empty-main {
  flex: 1 1 auto;
  min-height: 0;
  background: #0b1f2a;
}

.przeprawy-main {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(46, 125, 50, 0.12), transparent 55%),
    #0b1f2a;
}

.przeprawy-layout {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: min(62rem, 100%);
}

.przeprawy-board {
  width: min(42rem, 100%);
  flex: 1 1 auto;
  background: var(--panel);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.85rem;
  padding: 1rem 1rem 0.85rem;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}

.przeprawy-info-board-aside {
  flex: 0 0 16rem;
  width: 16rem;
  align-self: center;
}

.przeprawy-info-board-aside:empty {
  display: none;
}

.przeprawy-board-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.75rem;
  text-align: center;
}

.przeprawy-facility-controls {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.przeprawy-facility-card {
  padding: 0.65rem 0.75rem 0.75rem;
}

.przeprawy-facility-card .facility-card-name {
  font-size: 2rem;
  padding-top: 0.25rem;
}

.przeprawy-facility-card .facility-card-name--with-flag {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding-top: 0.15rem;
}

.przeprawy-facility-card .facility-card-title {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
}

.przeprawy-facility-card .sign-picker-toggle {
  padding: 0.3rem 0.4rem;
}

.przeprawy-facility-card .facility-card-row--admin .facility-card-side {
  max-width: none;
  align-items: center;
}

.przeprawy-karsibor-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 0.35rem 0 0.15rem;
  padding: 0.85rem 1rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text, #e8eef2);
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.przeprawy-karsibor-toggle input {
  width: 1.55rem;
  height: 1.55rem;
  accent-color: #2e7d32;
  cursor: pointer;
  flex-shrink: 0;
}

.przeprawy-composite-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.przeprawy-composite-row-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-align: center;
}

.przeprawy-composite-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.przeprawy-composite-toggle {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0;
  min-width: 0;
  padding: 0.45rem 0.55rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(198, 40, 40, 0.35);
  background: rgba(198, 40, 40, 0.08);
  color: var(--text, #e8eef2);
  user-select: none;
}

.przeprawy-composite-toggle.is-empty {
  visibility: hidden;
  pointer-events: none;
  border: none;
  background: transparent;
}

.przeprawy-composite-enable {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin: 0;
  cursor: pointer;
  min-width: 0;
}

.przeprawy-composite-toggle input {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.1rem;
  accent-color: #c62828;
  cursor: pointer;
  flex-shrink: 0;
}

.przeprawy-composite-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.przeprawy-composite-label {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
}

.przeprawy-composite-side {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  color: #ef9a9a;
  letter-spacing: 0.04em;
}

.przeprawy-composite-codes {
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 0.01em;
  line-height: 1.25;
  word-break: break-word;
}

.przeprawy-composite-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding-left: 1.5rem;
}

.przeprawy-composite-toggle--east {
  align-items: flex-end;
  text-align: right;
}

.przeprawy-composite-toggle--east .przeprawy-composite-enable {
  flex-direction: row-reverse;
  justify-content: flex-start;
  width: 100%;
}

.przeprawy-composite-toggle--east .przeprawy-composite-label {
  flex-direction: row-reverse;
  justify-content: flex-start;
}

.przeprawy-composite-toggle--east .przeprawy-composite-colors {
  padding-left: 0;
  padding-right: 1.5rem;
  justify-content: flex-end;
}

.przeprawy-composite-swatch {
  width: 1.05rem;
  height: 1.05rem;
  padding: 0;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: var(--swatch, #c62828);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.przeprawy-composite-swatch.is-selected {
  border-color: #fff;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.55),
    inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.przeprawy-residents-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0;
  max-width: 100%;
  padding: 0.28rem 0.45rem;
  border-radius: 0.3rem;
  border: 1.5px solid #fff;
  background: #003399;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.15;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.przeprawy-residents-toggle input {
  width: 0.95rem;
  height: 0.95rem;
  accent-color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}

.bielik-residents-sign-marker,
.ferry-info-sign-marker,
.info-board-sign-marker {
  background: transparent !important;
  border: none !important;
}

.bielik-residents-sign,
.ferry-info-sign {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-width: 150px;
  padding: 0.4rem 0.55rem 0.45rem;
  border-radius: 0.35rem;
  background: #003399;
  border: 2px solid #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  color: #fff;
  text-align: center;
  line-height: 1.15;
  font-family: "Arial Narrow", Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.info-board-sign {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
  max-width: 220px;
  padding: 0.45rem 0.6rem;
  border-radius: 0.35rem;
  background: #003399;
  border: 2px solid #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  color: #fff;
  text-align: left;
  line-height: 1.2;
  font-family: "Arial Narrow", Arial, sans-serif;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.sign-icon--info-board {
  flex-shrink: 0;
  width: 1.7rem;
  height: 1.55rem;
  min-width: 1.7rem;
  font-size: 0.75rem;
  padding-top: 0.38rem;
}

.info-board-sign-text {
  font-size: 0.82rem;
  text-transform: none;
  word-break: break-word;
}

.ferry-info-sign-icons {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.35rem;
}

.bielik-residents-sign-car,
.ferry-info-sign-icon {
  width: 2.4rem;
  height: 1.35rem;
  display: block;
}

.ferry-info-sign-icon--truck {
  width: 2.7rem;
  height: 1.35rem;
}

.bielik-residents-sign-text,
.ferry-info-sign-text {
  font-size: 0.72rem;
  text-transform: uppercase;
}

.composite-route-line {
  animation: composite-dash-flow 1.1s linear infinite;
}

@keyframes composite-dash-flow {
  to {
    stroke-dashoffset: -18;
  }
}

.przeprawy-facility-card.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.przeprawy-tunnel-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.przeprawy-tunnel-title {
  text-align: center;
  font-size: 2.1rem;
  font-weight: 700;
  margin: 0;
  padding: 0;
}

.corridor-block {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.55rem 0.5rem 0.6rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.18);
}

.corridor-block-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-align: center;
}

.corridor-chain {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  flex-wrap: nowrap;
}

.corridor-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-width: 2.6rem;
  padding: 0.15rem 0.1rem;
}

.corridor-step--segment,
.corridor-step--sign-mini {
  opacity: 0.85;
}

.corridor-step--segment.is-hidden {
  opacity: 0.35;
}

.corridor-step--segment.is-hidden .corridor-swatch {
  border-style: dashed;
  background: transparent !important;
}

.corridor-step--sign-mini.is-empty .corridor-mini-icon {
  width: 1.35rem;
  height: 1.35rem;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: 0.25rem;
}

.corridor-step--sign-mini.is-empty .corridor-code {
  opacity: 0.55;
}

.corridor-step--sign-mini .sign-icon {
  width: 1.35rem;
  height: 1.35rem;
  font-size: 0.55rem;
  transform: scale(0.85);
}

.corridor-mini-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
}

.corridor-swatch {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.corridor-code {
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: rgba(215, 230, 239, 0.9);
  white-space: nowrap;
}

.corridor-step--picker {
  min-width: 3.4rem;
}

.corridor-chain--inbound .corridor-step--picker {
  margin-left: 0;
}

.corridor-chain--inbound .corridor-city-arrow--in {
  margin-left: auto;
  margin-right: 0.35rem;
}

.corridor-chain--outbound {
  justify-content: flex-start;
}

.corridor-chain--outbound .corridor-city-arrow--out {
  margin-right: auto;
}

.corridor-city-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  padding: 0.15rem 0.35rem;
  color: #e8f5e9;
  user-select: none;
  flex-shrink: 0;
}

.corridor-city-arrow-glyph {
  font-size: 4.8rem;
  font-weight: 900;
  line-height: 0.75;
  letter-spacing: -0.08em;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.35),
    0 0 16px rgba(76, 175, 80, 0.55);
}

.corridor-city-arrow-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #a5d6a7;
  white-space: nowrap;
}

.corridor-picker-btn {
  padding: 0.35rem 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
}

.corridor-picker-btn .sign-icon {
  width: 1.85rem;
  height: 1.85rem;
}

.corridor-fork-inline {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  margin-right: 0.2rem;
  padding-right: 0.35rem;
  border-right: 2px solid rgba(255, 255, 255, 0.22);
}

.corridor-step--fork {
  appearance: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.4rem;
  cursor: pointer;
  min-width: 2.5rem;
  padding: 0.2rem 0.2rem;
}

.corridor-step--fork:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
}

.corridor-step--fork.is-hidden {
  opacity: 0.4;
}

.corridor-step--fork.is-hidden .corridor-swatch {
  border-style: dashed;
  background: transparent !important;
}

.color-modal-option .fork-color-btn {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: var(--swatch, #888);
  display: inline-block;
  flex-shrink: 0;
}

.color-modal-option .fork-color-btn.is-empty {
  background: transparent;
  border-style: dashed;
}

.przeprawy-hint {
  text-align: center;
  margin-top: 0.75rem;
}

.przeprawy-info-board-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  width: 100%;
  padding: 0.75rem 0.8rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--panel);
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}

.przeprawy-info-board-title {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
}

.przeprawy-info-board-title .sign-icon {
  flex-shrink: 0;
}

.przeprawy-info-board-input {
  width: 100%;
  min-height: 5.5rem;
  resize: vertical;
  padding: 0.45rem 0.5rem;
  border-radius: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: 0.78rem;
  line-height: 1.25;
}

.przeprawy-info-board-input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.przeprawy-info-board-save {
  align-self: stretch;
}

@media (max-width: 900px) {
  .przeprawy-layout {
    flex-direction: column;
    align-items: stretch;
    width: min(42rem, 100%);
  }

  .przeprawy-info-board-aside {
    flex: 1 1 auto;
    width: 100%;
    align-self: stretch;
  }
}

.admin-page-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex: 1 1 auto;
  justify-content: center;
  min-width: 0;
  padding: 0 0.5rem;
}

.admin-page-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.admin-page-tab:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  text-decoration: none;
}

.admin-page-tab.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
}

.ip-allowlist-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 1rem 0.9rem 1.5rem;
  background: #0b1f2a;
}

.ip-allowlist-board {
  max-width: 36rem;
  margin: 0 auto;
  padding: 1rem 1.1rem 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.75rem;
  background: rgba(11, 31, 42, 0.92);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.ip-allowlist-lead,
.ip-allowlist-current,
.ip-allowlist-hint {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
  margin: 0 0 0.75rem;
}

.ip-allowlist-current code,
.ip-allowlist-lead code {
  color: var(--ink);
  font-size: 0.78rem;
}

.ip-allowlist-messages {
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.45rem;
  background: rgba(46, 125, 50, 0.25);
  border: 1px solid rgba(129, 199, 132, 0.45);
  color: #c8e6c9;
  font-size: 0.82rem;
}

.ip-allowlist-form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.ip-allowlist-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.2rem 0 0.55rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.ip-allowlist-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  margin-top: 0.25rem;
}

.ip-allowlist-textarea,
.ip-allowlist-form textarea {
  width: 100%;
  min-height: 10rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.28);
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.4;
  resize: vertical;
}

.ip-allowlist-textarea:focus,
.ip-allowlist-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(61, 154, 173, 0.35);
}

.ip-allowlist-errors {
  color: #ef9a9a;
  font-size: 0.78rem;
}

.ip-allowlist-actions {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
}

.analytics-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 1rem 0.9rem 1.5rem;
  background: #0b1f2a;
}

.analytics-board {
  max-width: 52rem;
  margin: 0 auto;
}

.analytics-lead {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
  margin: 0 0 1rem;
}

.analytics-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.analytics-card {
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.75rem;
  background: rgba(11, 31, 42, 0.92);
}

.analytics-card h2 {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.analytics-metric {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink);
}

.analytics-metric span {
  font-size: 1.55rem;
  font-weight: 700;
  margin-right: 0.25rem;
}

.analytics-sub {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.analytics-table-title {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
}

.analytics-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.75rem;
  background: rgba(11, 31, 42, 0.92);
}

.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.analytics-table th,
.analytics-table td {
  padding: 0.55rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.analytics-table th {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.analytics-table td {
  color: var(--ink);
}

.analytics-table tbody tr:last-child td {
  border-bottom: 0;
}

.analytics-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

@media (max-width: 720px) {
  .app-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .admin-page-tabs {
    order: 3;
    flex: 1 1 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .analytics-summary {
    grid-template-columns: 1fr;
  }
}

.facility-controls {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.facility-control-card {
  padding: 0.45rem 0.55rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.04);
}

.facility-card-row--admin {
  align-items: start;
}

.facility-card-row--admin .facility-card-side {
  gap: 0.35rem;
  width: 100%;
  max-width: 5.8rem;
}

.facility-card-row--admin .facility-message {
  font-size: 0.68rem;
  padding: 0.2rem 0.35rem;
}

.sign-picker-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem 0.25rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.4rem;
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  cursor: pointer;
}

.sign-picker-toggle:hover {
  border-color: rgba(255, 255, 255, 0.4);
}

.sign-picker-caret {
  font-size: 0.65rem;
  opacity: 0.75;
}

.sign-icon--none {
  background: rgba(255, 255, 255, 0.12);
  color: #cfd8dc;
  border-radius: 50%;
  width: 1.55rem;
  height: 1.55rem;
  min-width: 1.55rem;
  font-size: 0.7rem;
  border: 1.5px dashed rgba(255, 255, 255, 0.35);
  box-shadow: none;
}

.sign-modal[hidden] {
  display: none !important;
}

.sign-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.sign-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.sign-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(22rem, 100%);
  max-height: min(80vh, 32rem);
  overflow: auto;
  background: #152a33;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.75rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  padding: 0.85rem 0.9rem 1rem;
}

.sign-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.sign-modal-title {
  font-size: 0.9rem;
  font-weight: 700;
}

.sign-modal-close {
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.1rem 0.45rem;
}

.sign-modal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
}

.sign-modal-option {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.sign-modal-option:hover,
.sign-modal-option.is-selected {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.1);
}

.sign-modal-option-label {
  font-size: 0.82rem;
  font-weight: 600;
}

.facility-side-block {
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.facility-side-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 0.35rem;
}

.facility-control-name {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

.admin-segment-panel .form-label,
.admin-controls-panel .form-label {
  color: var(--muted);
}

.admin-segment-panel[hidden] {
  display: none !important;
}

@media (max-width: 640px) {
  .admin-controls-panel {
    max-height: 38%;
    width: calc(100% - 1.5rem);
  }

  .admin-segment-panel {
    top: auto;
    bottom: 0.75rem;
  }
}

.swatch.arrow {
  width: 0;
  height: 0;
  border-left: 0.35rem solid transparent;
  border-right: 0.35rem solid transparent;
  border-bottom: 0.6rem solid var(--accent);
  border-radius: 0;
  background: transparent;
}

.leaflet-div-icon.facility-marker {
  background: transparent;
  border: none;
}

.sign-icon--map {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

/* Znaki na wjazdach do tunelu — o 50% większe */
.facility-marker--tunnel .sign-icon--map {
  transform: scale(1.5);
  transform-origin: center center;
}

.badge-marker {
  min-width: 1.4rem;
  height: 1.4rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.55rem;
  font-weight: 800;
  white-space: nowrap;
  line-height: 1;
}

.facility-side-block {
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.facility-side-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 0.35rem;
}

@media (min-width: 768px) {
  .status-panel {
    left: 0.9rem;
    right: auto;
    bottom: 0.9rem;
    width: 320px;
    max-height: 60%;
  }

  .legend-toggle {
    left: auto;
    right: 0.9rem;
    top: 0.9rem;
  }

  .legend-box {
    left: auto;
    right: 0.9rem;
    top: 3rem;
  }
}
