/* =========================================================================
   Kwartał — raport okolicy mieszkania (UI)
   Warstwa stylów nad Bootstrap 5.3. Tokeny zgodne z makietami (deck).
   ========================================================================= */

/* Typography uses CSS fallback fonts; font binaries are not bundled. */

/* ---------- Design tokens ---------- */
:root {
  --oi-navy: #0F2340;
  --oi-navy-2: #1E3A5F;
  --oi-navy-3: #0B1626;
  --oi-teal: #2DD4BF;          /* CTA, obszar analizy, pieszo */
  --oi-teal-600: #0D9488;      /* seria A w wykresach */
  --oi-teal-700: #0F766E;      /* linki, stan aktywny */
  --oi-teal-50: #E6F6F3;
  --oi-blue: #2563EB;          /* rower, seria B */
  --oi-blue-50: #DBEAFE;
  --oi-amber: #F59E0B;         /* samochód */
  --oi-amber-700: #D97706;     /* seria C */
  --oi-orange: #EA580C;        /* konkurencja, ryzyka */
  --oi-bg: #F4F6F9;
  --oi-surface: #FFFFFF;
  --oi-surface-2: #FBFCFD;
  --oi-border: #DDE3EA;
  --oi-border-strong: #CBD5E1;
  --oi-ink: #1B2433;
  --oi-ink-2: #4A5568;
  --oi-muted: #64748B;
  --oi-radius: 14px;
  --oi-radius-sm: 10px;
  --oi-shadow: 0 8px 24px rgba(15, 35, 64, .10);
  --oi-shadow-lg: 0 18px 44px rgba(15, 35, 64, .20);
  --oi-header-h: 64px;

  /* Bootstrap overrides */
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --bs-body-color: var(--oi-ink);
  --bs-body-bg: var(--oi-bg);
  --bs-border-color: var(--oi-border);
  --bs-link-color: var(--oi-teal-700);
  --bs-link-color-rgb: 15, 118, 110;
  --bs-link-hover-color: #115E59;
  --bs-primary: var(--oi-teal-700);
  --bs-primary-rgb: 15, 118, 110;
  --bs-border-radius: 10px;
  --bs-border-radius-lg: 14px;
  --bs-focus-ring-color: rgba(45, 212, 191, .35);
}

body { font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
.font-display, h1, h2, h3, .h1, .h2, .h3 { font-family: "Plus Jakarta Sans", "Inter", system-ui, sans-serif; }
h1, .h1 { font-weight: 800; color: var(--oi-navy); letter-spacing: -.01em; }
h2, .h2, h3, .h3 { font-weight: 800; color: var(--oi-navy); }
.text-muted-2 { color: var(--oi-muted) !important; }
.text-ink-2 { color: var(--oi-ink-2) !important; }
.text-navy { color: var(--oi-navy) !important; }
.text-teal { color: var(--oi-teal-700) !important; }
.text-orange { color: #C2410C !important; }
.text-amber { color: #B45309 !important; }
.fw-800 { font-weight: 800 !important; }
.tabular { font-variant-numeric: tabular-nums; }
.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--oi-muted); }
.small-2 { font-size: .8125rem; }
a { text-underline-offset: 2px; }
:focus-visible { outline: 3px solid rgba(45, 212, 191, .6); outline-offset: 2px; }

/* ---------- Przyciski ---------- */
.btn { font-weight: 600; border-radius: var(--oi-radius-sm); }
.btn-cta { --bs-btn-color: var(--oi-navy); --bs-btn-bg: var(--oi-teal); --bs-btn-border-color: var(--oi-teal);
  --bs-btn-hover-color: var(--oi-navy); --bs-btn-hover-bg: #5EEAD4; --bs-btn-hover-border-color: #5EEAD4;
  --bs-btn-active-bg: #14B8A6; --bs-btn-active-border-color: #14B8A6; --bs-btn-active-color: var(--oi-navy);
  --bs-btn-disabled-bg: #A7E9DF; --bs-btn-disabled-border-color: #A7E9DF; --bs-btn-disabled-color: #4B6470; font-weight: 700; }
.btn-brand { --bs-btn-color: #fff; --bs-btn-bg: var(--oi-teal-700); --bs-btn-border-color: var(--oi-teal-700);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #115E59; --bs-btn-hover-border-color: #115E59;
  --bs-btn-active-bg: #134E4A; --bs-btn-active-border-color: #134E4A; }
.btn-outline-brand { --bs-btn-color: var(--oi-teal-700); --bs-btn-border-color: var(--oi-teal-700); --bs-btn-bg: #fff;
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--oi-teal-700); --bs-btn-hover-border-color: var(--oi-teal-700);
  --bs-btn-active-bg: #115E59; --bs-btn-active-border-color: #115E59; --bs-btn-active-color: #fff; border-width: 2px; }
.btn-ghost { --bs-btn-color: #475569; --bs-btn-hover-bg: #E9EEF3; --bs-btn-hover-color: var(--oi-ink); --bs-btn-border-color: transparent; }
.btn-icon { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0; }

/* ---------- Formularze ---------- */
.form-control, .form-select { border-color: var(--oi-border-strong); border-radius: var(--oi-radius-sm); padding: .6rem .85rem; }
.form-control:focus, .form-select:focus { border-color: var(--oi-teal-700); box-shadow: 0 0 0 .25rem rgba(45, 212, 191, .25); }
.form-label { font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }
.form-check-input:checked { background-color: var(--oi-teal-700); border-color: var(--oi-teal-700); }
.form-check-input:focus { box-shadow: 0 0 0 .25rem rgba(45, 212, 191, .25); border-color: var(--oi-teal-700); }
.form-switch .form-check-input { width: 2.6em; height: 1.4em; }
.form-range::-webkit-slider-thumb { background: var(--oi-teal-700); }
.form-range::-moz-range-thumb { background: var(--oi-teal-700); }
.input-icon { position: relative; }
.input-icon > .bi { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--oi-muted); pointer-events: none; }
.input-icon > .form-control { padding-left: 2.4rem; }

/* Segmented control */
.segmented { display: inline-flex; background: #E9EEF3; border-radius: var(--oi-radius-sm); padding: 4px; gap: 2px; }
.segmented .seg { border: 0; background: transparent; color: #475569; font-weight: 500; font-size: .875rem; padding: .35rem .85rem; border-radius: 8px; white-space: nowrap; }
.segmented .seg:hover { color: var(--oi-ink); }
.segmented .seg.active { background: #fff; color: var(--oi-navy); font-weight: 700; box-shadow: 0 1px 3px rgba(15,35,64,.12); }
.segmented.w-100 .seg { flex: 1; }

/* Chipy */
.chip { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--oi-border); background: #F1F5F9; color: #334155;
  font-size: .8125rem; font-weight: 500; padding: .3rem .75rem; border-radius: 999px; cursor: pointer; user-select: none; white-space: nowrap; }
.chip:hover { border-color: var(--oi-border-strong); background: #E9EEF3; }
.chip.active { background: var(--oi-teal-700); border-color: var(--oi-teal-700); color: #fff; font-weight: 700; }
.chip.active-orange { background: var(--oi-orange); border-color: var(--oi-orange); color: #fff; font-weight: 700; }
.chip-static { cursor: default; }
.chip .count { opacity: .8; font-variant-numeric: tabular-nums; }
.chip-walk { background: #fff; border-color: #5EEAD4; color: var(--oi-teal-700); font-weight: 600; }
.chip-bike { background: #fff; border-color: #93C5FD; color: #1E40AF; font-weight: 600; }
.chip-car { background: #fff; border-color: #FCD34D; color: #92400E; font-weight: 600; }

/* ---------- Badge jakości danych (kolor + symbol + słowo) ---------- */
.q-badge { display: inline-flex; align-items: center; gap: .25rem; font-size: .75rem; font-weight: 700; padding: .15rem .55rem; border-radius: 999px; white-space: nowrap; cursor: help; }
.q-high { background: #DCFCE7; color: #166534; }
.q-medium { background: #FEF3C7; color: #92400E; }
.q-low { background: #FFEDD5; color: #9A3412; }
.q-unknown { background: #E2E8F0; color: #475569; }
.status-badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; white-space: nowrap; }
.st-ok { background: #DCFCE7; color: #166534; }
.st-run { background: #DBEAFE; color: #1E40AF; }
.st-partial { background: #FEF3C7; color: #92400E; }
.st-fail { background: #FEE2E2; color: #B42318; }
.st-queue { background: #F1F5F9; color: #64748B; }

/* ---------- Header aplikacji ---------- */
.app-header { background: var(--oi-navy); height: var(--oi-header-h); position: sticky; top: 0; z-index: 1030; }
.app-header .container-fluid { height: 100%; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand img { width: 36px; height: 36px; }
.brand-name { font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 1.25rem; color: #F8FAFC; white-space: nowrap; }
.brand-name span { color: var(--oi-teal); }
.brand-dark .brand-name { color: var(--oi-navy); }
.brand-dark .brand-name span { color: var(--oi-teal-700); }
.app-nav .nav-link { color: #AFC0D6; font-weight: 500; padding: .45rem .8rem !important; border-radius: 8px; white-space: nowrap; }
.app-nav .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.app-nav .nav-link.active { color: #fff; background: var(--oi-navy-2); font-weight: 600; }
.header-icon-btn { position: relative; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: #CBD5E1; font-size: 1.25rem; }
.header-icon-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.header-icon-btn .dot { position: absolute; top: 6px; right: 7px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--oi-amber); color: var(--oi-navy); font-size: .65rem; font-weight: 800; line-height: 18px; border: 2px solid var(--oi-navy); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: #3B5B8C; color: #fff; font-weight: 700; font-size: .85rem; display: inline-flex; align-items: center; justify-content: center; border: 0; }
.avatar-lg { width: 88px; height: 88px; font-size: 1.8rem; background: #CCFBF1; color: var(--oi-navy); font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; }
.dropdown-menu { border-color: var(--oi-border); border-radius: 12px; box-shadow: var(--oi-shadow-lg); padding: .4rem 0; }
.dropdown-item { padding: .5rem 1.1rem; font-size: .9rem; }
.dropdown-item:active { background: var(--oi-teal-700); }
.notif-menu { width: 360px; }
.notif-item { display: flex; gap: .75rem; padding: .7rem 1rem; border-bottom: 1px solid #EEF1F4; text-decoration: none; color: var(--oi-ink); }
.notif-item:hover { background: #F7FAFB; }
.notif-item .ic { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: none; }

/* ---------- Stopka ---------- */
.app-footer { background: var(--oi-surface-2); border-top: 1px solid var(--oi-border); font-size: .8125rem; color: var(--oi-muted); }
.app-footer a { color: var(--oi-teal-700); text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }

/* ---------- Layout ---------- */
.page { min-height: calc(100vh - var(--oi-header-h)); display: flex; flex-direction: column; }
.page-main { flex: 1; }
.page-pad { padding: 1.5rem 2rem; }
@media (max-width: 767.98px) { .page-pad { padding: 1rem; } }

.card-lite { background: var(--oi-surface); border: 1px solid var(--oi-border); border-radius: var(--oi-radius); }
.card-lite.pad { padding: 1.25rem 1.4rem; }
.card-title-sm { font-family: "Plus Jakarta Sans", sans-serif; font-weight: 700; font-size: 1.05rem; color: var(--oi-navy); margin: 0; }
.section-title { font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 1.35rem; color: var(--oi-navy); }
.divider { height: 1px; background: #EEF1F4; }

/* ---------- KPI / metric card ---------- */
.kpi { background: #fff; border: 1px solid var(--oi-border); border-radius: var(--oi-radius); padding: 1rem 1.15rem; display: flex; flex-direction: column; gap: .2rem; height: 100%; transition: box-shadow .15s, border-color .15s; }
.kpi.clickable { cursor: pointer; }
.kpi.clickable:hover { box-shadow: var(--oi-shadow); border-color: var(--oi-border-strong); }
.kpi-label { font-size: .85rem; font-weight: 600; color: var(--oi-ink-2); display: flex; justify-content: space-between; gap: .5rem; align-items: center; }
.kpi-value { font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 1.75rem; color: var(--oi-navy); line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-value .unit { font-size: 1rem; color: #94A3B8; font-weight: 700; }
.kpi-sub { font-size: .8125rem; color: var(--oi-muted); }
.kpi-sub.pos { color: var(--oi-teal-700); font-weight: 600; }
.kpi-sub.neg { color: #C2410C; font-weight: 600; }
.kpi-sub.warn { color: #B45309; font-weight: 600; }
.kpi-foot { margin-top: auto; padding-top: .5rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem; font-size: .75rem; color: var(--oi-muted); }

.score { background: #fff; border: 1px solid var(--oi-border); border-radius: var(--oi-radius); padding: .9rem 1rem; height: 100%; }
.score-val { font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 1.6rem; color: var(--oi-navy); }
.score-val small { color: #94A3B8; font-size: .9rem; font-weight: 700; }
.bar { height: 8px; background: #E2E8F0; border-radius: 4px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 4px; background: var(--oi-teal-700); }
.bar.lg { height: 12px; border-radius: 6px; }

.stat-tile { display: flex; align-items: center; gap: 1rem; }
.icon-tile { width: 48px; height: 48px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; flex: none; }
.it-teal { background: var(--oi-teal-50); color: var(--oi-teal-700); }
.it-blue { background: #EEF2FF; color: var(--oi-blue); }
.it-amber { background: #FEF3C7; color: #B45309; }
.it-orange { background: #FFEDD5; color: #C2410C; }
.it-navy { background: #E2E8F0; color: var(--oi-navy); }

/* ---------- Alerty ---------- */
.alert-soft { display: flex; gap: .75rem; align-items: flex-start; border-radius: 12px; padding: .75rem 1rem; font-size: .9rem; border: 1px solid; }
.alert-soft .bi { font-size: 1.15rem; line-height: 1.3; }
.as-warn { background: #FFFBEB; border-color: #FCD34D; color: #78350F; }
.as-error { background: #FEF2F2; border-color: #FCA5A5; color: #7F1D1D; }
.as-info { background: #EEF6FF; border-color: #BFDBFE; color: #1E3A5F; }
.as-ok { background: #F0FDF4; border-color: #BBF7D0; color: #14532D; }

/* ---------- Stepper (kreator) ---------- */
.stepper { display: flex; align-items: center; gap: .75rem; padding: .85rem 2rem; background: var(--oi-surface-2); border-bottom: 1px solid var(--oi-border); overflow-x: auto; }
.step { display: flex; align-items: center; gap: .6rem; white-space: nowrap; color: var(--oi-muted); background: none; border: 0; padding: 0; }
.step .num { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; border: 2px solid var(--oi-border-strong); background: #fff; color: var(--oi-muted); }
.step.done { color: var(--oi-teal-700); font-weight: 600; cursor: pointer; }
.step.done .num { background: var(--oi-teal); border-color: var(--oi-teal); color: var(--oi-navy); }
.step.current { color: var(--oi-navy); font-weight: 700; }
.step.current .num { background: var(--oi-navy); border-color: var(--oi-navy); color: #fff; }
.step-line { flex: 1; min-width: 24px; height: 2px; background: var(--oi-border-strong); }
.step-line.done { background: var(--oi-teal); }
.wizard-actions { padding: .9rem 2rem; background: var(--oi-surface-2); border-top: 1px solid var(--oi-border); }

/* Karty profili */
.profile-card { position: relative; text-align: left; width: 100%; background: #fff; border: 1px solid var(--oi-border); border-radius: 16px; padding: 1.15rem; transition: all .15s; height: 100%; }
.profile-card:hover { border-color: var(--oi-teal-700); box-shadow: var(--oi-shadow); }
.profile-card.selected { background: #F0FBF9; border: 2px solid var(--oi-teal-700); box-shadow: 0 10px 26px rgba(15, 118, 110, .15); padding: calc(1.15rem - 1px); }
.profile-card .picon { width: 52px; height: 52px; border-radius: 14px; background: var(--oi-teal-50); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.profile-card .picon img { width: 32px; height: 32px; }
.profile-card.selected .picon { background: var(--oi-teal-700); }
.profile-card.selected .picon img { filter: brightness(0) invert(1); }
.profile-card .check { position: absolute; top: .8rem; right: .9rem; color: var(--oi-teal-700); font-size: 1.3rem; display: none; }
.profile-card.selected .check { display: block; }

/* ---------- Nagłówek wyniku + zakładki ---------- */
.result-header { background: var(--oi-surface-2); border-bottom: 1px solid var(--oi-border); padding: .9rem 2rem 0; }
.result-title { font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 1.5rem; color: var(--oi-navy); margin: 0; }
.result-tabs { display: flex; gap: .15rem; overflow-x: auto; margin-top: .6rem; scrollbar-width: thin; }
.result-tabs a { white-space: nowrap; padding: .6rem .8rem .65rem; color: #475569; text-decoration: none; font-size: .9rem; border-bottom: 3px solid transparent; }
.result-tabs a:hover { color: var(--oi-navy); }
.result-tabs a.active { color: var(--oi-teal-700); font-weight: 700; border-bottom-color: var(--oi-teal-700); }
.result-tabs .warn-dot { color: #B45309; font-weight: 800; }
.scope-btn { background: var(--oi-teal-50); border: 2px solid var(--oi-teal-700); color: var(--oi-navy); font-weight: 700; font-size: .85rem; padding: .3rem .7rem; border-radius: 10px; }
.scope-btn::after { margin-left: .4rem; }

/* ---------- Mapa ---------- */
.map { width: 100%; height: 100%; min-height: 280px; background: #E7EAE4; border-radius: var(--oi-radius); z-index: 0; }
.map-wrap { position: relative; border-radius: var(--oi-radius); border: 1px solid var(--oi-border); overflow: hidden; }
.map-wrap .map { border-radius: 0; }
.map-full { position: relative; height: calc(100vh - var(--oi-header-h)); }
.map-full .map { border-radius: 0; height: 100%; }
.map-float { position: absolute; z-index: 500; background: #fff; border-radius: 12px; box-shadow: var(--oi-shadow); }
.map-legend { font-size: .8rem; padding: .6rem .85rem; }
.map-legend .sw { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: .35rem; }
.map-legend .dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; vertical-align: -1px; margin-right: .35rem; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.grad-pop { height: 10px; border-radius: 5px; background: linear-gradient(90deg, #E3EFEC, #0F766E); }
.map-toolbar { display: flex; flex-direction: column; padding: 4px; gap: 2px; }
.map-toolbar button { width: 38px; height: 38px; border: 0; background: transparent; border-radius: 8px; color: #334155; font-size: 1.1rem; }
.map-toolbar button:hover { background: #EEF2F6; }
.map-toolbar button.active { background: var(--oi-teal-700); color: #fff; }
.leaflet-container { font-family: var(--bs-body-font-family); }
.leaflet-popup-content-wrapper { border-radius: 12px; box-shadow: var(--oi-shadow-lg); }
.leaflet-popup-content { margin: 14px 16px; font-size: .85rem; }
.leaflet-tooltip.oi-tip { background: var(--oi-navy); color: #fff; border: 0; border-radius: 8px; font-weight: 600; box-shadow: var(--oi-shadow); }
.leaflet-tooltip.oi-tip::before { border-top-color: var(--oi-navy); }
.leaflet-tooltip.oi-label { background: #fff; color: var(--oi-navy); border: 0; border-radius: 6px; font-weight: 700; padding: 2px 8px; box-shadow: 0 2px 8px rgba(15,35,64,.18); }
.leaflet-tooltip.oi-label::before { display: none; }
.pin-marker { width: 36px; height: 46px; }
.num-marker { width: 28px; height: 28px; border-radius: 50%; background: var(--oi-orange); color: #fff; font-weight: 800; font-size: .75rem; display: flex; align-items: center; justify-content: center; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.num-marker.sel { background: #9A3412; transform: scale(1.25); box-shadow: 0 0 0 6px rgba(234, 88, 12, .25); }
.sq-marker { width: 30px; height: 30px; border-radius: 7px; background: var(--oi-navy); color: #fff; display: flex; align-items: center; justify-content: center; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); font-size: .85rem; }
.metro-marker { width: 30px; height: 30px; border-radius: 50%; background: #1E3A8A; color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); }

/* Panel warstw */
.layer-panel { width: 340px; flex: none; background: var(--oi-surface-2); border-right: 1px solid var(--oi-border); overflow-y: auto; padding: 1rem 1.1rem; }
.layer-group { margin-bottom: .6rem; }
.layer-group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--oi-muted); padding: .45rem .1rem; }
.layer-group > summary::-webkit-details-marker { display: none; }
.layer-group > summary .bi { transition: transform .15s; }
.layer-group[open] > summary .bi { transform: rotate(90deg); }
.layer-row { display: flex; align-items: center; gap: .6rem; padding: .3rem 0; font-size: .875rem; }
.layer-row .form-check-input { margin: 0; flex: none; }
.layer-row .cnt { margin-left: auto; color: var(--oi-muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.layer-opacity { padding: 0 0 .3rem 1.75rem; display: flex; align-items: center; gap: .6rem; font-size: .8rem; color: var(--oi-muted); }

/* ---------- Listy POI ---------- */
.poi-list { background: #fff; border: 1px solid var(--oi-border); border-radius: 12px; overflow: hidden; }
.poi-row { display: flex; align-items: center; gap: .75rem; padding: .6rem .9rem; border-bottom: 1px solid #EEF1F4; cursor: pointer; border-left: 4px solid transparent; }
.poi-row:last-child { border-bottom: 0; }
.poi-row:hover { background: #F8FAFC; }
.poi-row.selected { background: #FFF7ED; border-left-color: var(--oi-orange); }
.poi-num { width: 28px; height: 28px; border-radius: 50%; background: var(--oi-orange); color: #fff; font-weight: 800; font-size: .75rem; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.poi-num.gen { border-radius: 7px; background: var(--oi-navy); }
.poi-num.retail { background: var(--oi-blue); }

/* ---------- Tabele ---------- */
.table-oi { --bs-table-bg: transparent; font-size: .875rem; margin: 0; }
.table-oi thead th { color: var(--oi-muted); font-weight: 600; font-size: .8rem; border-bottom: 1px solid var(--oi-border); white-space: nowrap; }
.table-oi td { vertical-align: middle; border-color: #EEF1F4; }
.table-oi tbody tr.clickable { cursor: pointer; }
.table-oi tbody tr.clickable:hover td { background: #F8FAFC; }
.table-oi tbody tr.sel td { background: #FFF7ED; }
.table-oi tbody tr.picked td { background: #F0FBF9; }

/* ---------- Drawer (offcanvas) ---------- */
.offcanvas.drawer { --bs-offcanvas-width: 460px; border-left: 0; box-shadow: -16px 0 40px rgba(15,35,64,.18); }
.offcanvas.drawer .offcanvas-header { border-bottom: 1px solid #EEF1F4; }
.kv { font-size: .875rem; }
.kv dt { font-weight: 600; color: var(--oi-ink); }
.kv dd { color: var(--oi-ink-2); margin-bottom: .75rem; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: flex; background: var(--oi-bg); }
.auth-visual { position: relative; flex: 0 0 52%; background: var(--oi-navy-3); color: #fff; overflow: hidden; }
.auth-visual .map { position: absolute; inset: 0; border-radius: 0; min-height: 0; }
.auth-visual .scrim { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11,22,38,.96) 0%, rgba(11,22,38,.7) 55%, rgba(11,22,38,.15) 100%); z-index: 400; pointer-events: none; }
.auth-visual .content { position: relative; z-index: 401; height: 100%; display: flex; flex-direction: column; padding: 3rem; pointer-events: none; }
.auth-visual h1 { color: #F8FAFC; font-size: clamp(2rem, 3.4vw, 3.25rem); line-height: 1.08; max-width: 14ch; }
.auth-visual .lead { color: #B6C4D6; max-width: 34ch; }
.auth-feature { display: flex; align-items: center; gap: .9rem; color: #E2E8F0; margin-bottom: .9rem; }
.auth-feature .bi { font-size: 1.4rem; }
.auth-form { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 2rem; }
.auth-form .inner { width: 100%; max-width: 460px; margin: auto 0; }
@media (max-width: 991.98px) { .auth-visual { display: none; } }
.pw-meter { display: flex; gap: 6px; }
.pw-meter span { flex: 1; height: 6px; border-radius: 3px; background: var(--oi-border); transition: background .2s; }
.rule { font-size: .8125rem; color: var(--oi-muted); }
.rule.ok { color: #166534; }
.rule .bi { margin-right: .25rem; }

/* ---------- Postęp ---------- */
.module-tile { display: flex; align-items: center; gap: .75rem; background: #fff; border: 1px solid #E2E8F0; border-radius: 10px; padding: .55rem .8rem; font-size: .875rem; transition: all .2s; }
.module-tile .ms { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }
.module-tile.ok .ms { background: #DCFCE7; color: #166534; }
.module-tile.run { border-color: #93C5FD; }
.module-tile.run .ms { background: #DBEAFE; color: #1E40AF; }
.module-tile.warn { background: #FFFBEB; border-color: #FCD34D; }
.module-tile.warn .ms { background: #FEF3C7; color: #92400E; }
.module-tile.fail { background: #FEF2F2; border-color: #FCA5A5; }
.module-tile.fail .ms { background: #FEE2E2; color: #B42318; }
.module-tile.queue .ms { background: #F1F5F9; color: #64748B; }
.ring { position: relative; width: 140px; height: 140px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .ring-val { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 2rem; color: var(--oi-navy); }
.spin { animation: oi-spin 1s linear infinite; display: inline-block; }
@keyframes oi-spin { to { transform: rotate(360deg); } }

/* ---------- Raport AI ---------- */
.report-paper { background: #fff; border: 1px solid var(--oi-border); border-radius: 16px; padding: 1.75rem 2.25rem; box-shadow: 0 10px 30px rgba(15,35,64,.06); }
.report-paper h2 { font-size: 1.6rem; }
.report-paper h3 { font-size: 1.05rem; margin-top: 1.25rem; }
.report-paper p, .report-paper li { color: #334155; line-height: 1.6; }
.ref { color: var(--oi-teal-700); font-weight: 700; cursor: pointer; text-decoration: none; font-size: .85em; }
.ref:hover { text-decoration: underline; }
.ref-item { padding: .65rem .9rem; border-bottom: 1px solid #EEF1F4; font-size: .875rem; transition: background .3s; }
.ref-item:last-child { border-bottom: 0; }
.ref-item.flash { background: #E6F6F3; }
.version-item { background: #fff; border: 1px solid var(--oi-border); border-radius: 12px; padding: .7rem .9rem; cursor: pointer; width: 100%; text-align: left; }
.version-item.active { border: 2px solid var(--oi-teal-700); padding: calc(.7rem - 1px) calc(.9rem - 1px); }
.ai-label { background: var(--oi-blue-50); color: #1E40AF; font-weight: 700; font-size: .8rem; padding: .25rem .7rem; border-radius: 999px; }

/* ---------- Skeleton / stany ---------- */
.skeleton { background: linear-gradient(90deg, #E2E8F0 25%, #EEF2F6 37%, #E2E8F0 63%); background-size: 400% 100%; animation: oi-shimmer 1.4s ease infinite; border-radius: 8px; }
@keyframes oi-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.empty-state { text-align: center; padding: 2rem 1rem; color: var(--oi-muted); }
.empty-state > .bi { font-size: 2.6rem; color: #94A3B8; display: block; margin-bottom: .5rem; }

/* ---------- Toggle tiles (środowisko) ---------- */
.env-tile { cursor: pointer; text-align: left; width: 100%; }
.env-tile.active { background: #FFFBEB; border: 2px solid var(--oi-amber); padding: calc(1rem - 1px) calc(1.15rem - 1px); }
.env-tile.disabled { border-style: dashed; opacity: .75; }

/* ---------- Mini mapki (SVG) ---------- */
.thumb { width: 84px; height: 54px; border-radius: 6px; flex: none; display: block; }

/* ---------- Toast ---------- */
.toast-container { z-index: 2000; }
.toast.oi-toast { background: var(--oi-navy); color: #F8FAFC; border: 0; border-radius: 12px; box-shadow: var(--oi-shadow-lg); }

/* ---------- Mobile bottom nav ---------- */
.mobile-nav { display: none; }
@media (max-width: 767.98px) {
  .mobile-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1030; background: #fff; border-top: 1px solid var(--oi-border); justify-content: space-around; align-items: center; padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom)); }
  .mobile-nav a { display: flex; flex-direction: column; align-items: center; font-size: .7rem; color: var(--oi-muted); text-decoration: none; gap: 2px; }
  .mobile-nav a .bi { font-size: 1.25rem; }
  .mobile-nav a.active { color: var(--oi-teal-700); font-weight: 700; }
  .mobile-nav .fab { width: 50px; height: 50px; border-radius: 50%; background: var(--oi-teal); color: var(--oi-navy); justify-content: center; margin-top: -22px; box-shadow: var(--oi-shadow); }
  .mobile-nav .fab .bi { font-size: 1.5rem; }
  body.has-shell { padding-bottom: 72px; }
  .layer-panel { width: 100%; border-right: 0; border-bottom: 1px solid var(--oi-border); max-height: 40vh; }
  .offcanvas.drawer { --bs-offcanvas-width: 100%; }
  .result-header { padding: .75rem 1rem 0; }
  .stepper { padding: .75rem 1rem; }
  .wizard-actions { padding: .75rem 1rem; }
}

/* ---------- Ekran-katalog (index) ---------- */
.screen-card { display: block; background: #fff; border: 1px solid var(--oi-border); border-radius: 14px; padding: 1rem 1.1rem; text-decoration: none; color: var(--oi-ink); height: 100%; transition: all .15s; }
.screen-card:hover { border-color: var(--oi-teal-700); box-shadow: var(--oi-shadow); color: var(--oi-ink); }
.screen-id { display: inline-block; font-size: .72rem; font-weight: 800; background: #CCFBF1; color: var(--oi-teal-700); border-radius: 6px; padding: .1rem .45rem; }

@media print {
  .app-header, .app-footer, .result-tabs, .mobile-nav, .no-print { display: none !important; }
  body { background: #fff; }
}

/* Nav pills (ustawienia) */
.nav-pills { --bs-nav-pills-link-active-bg: var(--oi-teal-50); --bs-nav-pills-link-active-color: var(--oi-teal-700); --bs-nav-link-color: #334155; --bs-nav-link-hover-color: var(--oi-navy); }
.nav-pills .nav-link { font-weight: 500; border-radius: 10px; }
.nav-pills .nav-link.active { font-weight: 700; }
.recent-row:hover { background: #F7FAFB; }
.min-w-0 { min-width: 0; }
.list-group-item.active { background: var(--oi-teal-50); color: var(--oi-ink); border-color: transparent; }

/* =========================================================================
   Kwartał — komponenty specyficzne dla raportu okolicy
   ========================================================================= */
.leaflet-container { background: #EEF0EA; }

/* Hero / wyszukiwarka */
.hero { position: relative; background: var(--oi-navy-3); color: #fff; overflow: hidden; }
.hero .map { position: absolute; inset: 0; border-radius: 0; min-height: 0; opacity: .55; }
.hero .scrim { position: absolute; inset: 0; z-index: 400; pointer-events: none; background: radial-gradient(ellipse at 30% 40%, rgba(11,22,38,.55) 0%, rgba(11,22,38,.92) 65%); }
.hero .inner { position: relative; z-index: 401; }
.hero h1 { color: #F8FAFC; font-size: clamp(2rem, 4.2vw, 3.6rem); line-height: 1.06; }
.hero .lead { color: #B6C4D6; }
.search-xl { background: #fff; border-radius: 18px; padding: .5rem; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.search-xl .form-control { border: 0; font-size: 1.1rem; padding: .85rem 1rem .85rem 2.8rem; }
.search-xl .form-control:focus { box-shadow: none; }
.search-xl .input-icon > .bi { left: 1rem; font-size: 1.2rem; }
.search-tabs .seg { color: #CBD5E1; }
.search-tabs.segmented { background: rgba(255,255,255,.08); }
.search-tabs .seg.active { background: #fff; color: var(--oi-navy); }
.suggest-pop { position: absolute; left: .5rem; right: .5rem; top: calc(100% + 6px); z-index: 1050; border-radius: 14px; overflow: hidden; box-shadow: var(--oi-shadow-lg); }
.trust-row { color: #94A3B8; font-size: .85rem; }
.step-card { background: #fff; border: 1px solid var(--oi-border); border-radius: 16px; padding: 1.25rem; height: 100%; }
.step-card .n { width: 36px; height: 36px; border-radius: 50%; background: var(--oi-teal-50); color: var(--oi-teal-700); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.feature-ico { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; background: var(--oi-teal-50); color: var(--oi-teal-700); flex: none; }

/* Oceny okolicy (3 poziomy, zawsze z symbolem i słowem) */
.rate { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 700; padding: .2rem .6rem; border-radius: 999px; white-space: nowrap; }
.rate-good { background: #DCFCE7; color: #166534; }
.rate-mid { background: #FEF3C7; color: #92400E; }
.rate-bad { background: #FFEDD5; color: #9A3412; }
.rate-info { background: #E2E8F0; color: #334155; }
.profile-tile { background: #fff; border: 1px solid var(--oi-border); border-radius: 14px; padding: .9rem 1rem; height: 100%; display: flex; gap: .75rem; align-items: center; text-decoration: none; color: inherit; }
.profile-tile:hover { border-color: var(--oi-border-strong); box-shadow: var(--oi-shadow); color: inherit; }
.flag { display: flex; gap: .75rem; padding: .75rem .9rem; border-radius: 12px; border: 1px solid; font-size: .9rem; }
.flag .bi { font-size: 1.15rem; line-height: 1.3; }
.flag-warn { background: #FFFBEB; border-color: #FCD34D; color: #78350F; }
.flag-info { background: #EEF6FF; border-color: #BFDBFE; color: #1E3A5F; }
.flag-ok { background: #F0FDF4; border-color: #BBF7D0; color: #14532D; }

/* Raport — układ z nawigacją boczną */
.report-hero { background: var(--oi-surface-2); border-bottom: 1px solid var(--oi-border); }
.report-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 2rem; }
.toc { position: sticky; top: calc(var(--oi-header-h) + 1rem); align-self: start; max-height: calc(100vh - var(--oi-header-h) - 2rem); overflow: auto; }
.toc a { display: flex; align-items: center; gap: .55rem; padding: .4rem .7rem; border-radius: 8px; color: #475569; text-decoration: none; font-size: .875rem; }
.toc a:hover { background: #EEF2F6; color: var(--oi-navy); }
.toc a.active { background: var(--oi-teal-50); color: var(--oi-teal-700); font-weight: 700; }
.toc a .bi { width: 18px; text-align: center; }
.toc .st { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; flex: none; }
@media (max-width: 991.98px) { .report-layout { grid-template-columns: minmax(0, 1fr); } .toc { display: none; } }
.r-section { scroll-margin-top: calc(var(--oi-header-h) + 16px); background: #fff; border: 1px solid var(--oi-border); border-radius: 18px; padding: 1.5rem 1.6rem; margin-bottom: 1.25rem; }
.r-head { display: flex; align-items: flex-start; gap: .9rem; margin-bottom: 1rem; }
.r-head .ico { width: 46px; height: 46px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; flex: none; }
.r-head h2 { font-size: 1.3rem; margin: 0; }
.r-head .verdict { margin-left: auto; }
.r-lead { color: var(--oi-ink-2); margin-bottom: 1rem; }
.r-src { font-size: .78rem; color: var(--oi-muted); border-top: 1px solid #EEF1F4; margin-top: 1rem; padding-top: .7rem; display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.big-num { font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; color: var(--oi-navy); font-size: 2.1rem; line-height: 1.05; font-variant-numeric: tabular-nums; }
.big-num .unit { font-size: 1rem; color: #94A3B8; font-weight: 700; }
.mini { background: var(--oi-bg); border-radius: 12px; padding: .8rem .95rem; height: 100%; }
.mini .lbl { font-size: .78rem; color: var(--oi-muted); font-weight: 600; }
.mini .val { font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 1.35rem; color: var(--oi-navy); font-variant-numeric: tabular-nums; }

/* Skala z markerem (hałas min–max, HPI, PPI, światło) */
.scale { position: relative; height: 14px; border-radius: 7px; }
.scale-wrap { padding: 26px 0 22px; position: relative; }
.scale-mark { position: absolute; top: 0; transform: translateX(-50%); text-align: center; font-size: .72rem; font-weight: 700; color: var(--oi-navy); white-space: nowrap; }
.scale-mark::after { content: ""; display: block; width: 3px; height: 26px; background: var(--oi-navy); margin: 2px auto 0; border-radius: 2px; }
.scale-range { position: absolute; top: 24px; height: 18px; border: 3px solid var(--oi-navy); border-radius: 9px; }
.scale-ticks { display: flex; justify-content: space-between; font-size: .72rem; color: var(--oi-muted); margin-top: 6px; }
.level-steps { display: flex; gap: 6px; }
.level-steps span { flex: 1; text-align: center; padding: .45rem .3rem; border-radius: 10px; background: #F1F5F9; color: #94A3B8; font-weight: 600; font-size: .85rem; }
.level-steps span.on { background: var(--oi-navy); color: #fff; }

/* Gauge (półokrąg) */
.gauge { position: relative; width: 190px; height: 108px; }
.gauge .gv { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; }
.gauge .gv b { font-family: "Plus Jakarta Sans", sans-serif; font-size: 2rem; font-weight: 800; color: var(--oi-navy); display: block; line-height: 1; }
.gauge .gv small { color: var(--oi-muted); font-size: .75rem; }

/* Teaser / zablurowane */
.locked { position: relative; overflow: hidden; }
.locked .blur { filter: blur(7px); user-select: none; pointer-events: none; opacity: .75; }
.locked .lock-cta { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: .5rem; background: linear-gradient(180deg, rgba(244,246,249,.2), rgba(244,246,249,.85)); text-align: center; padding: 1rem; }
.lock-ic { width: 44px; height: 44px; border-radius: 50%; background: var(--oi-navy); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; }

/* Cennik */
.price-card { background: #fff; border: 1px solid var(--oi-border); border-radius: 18px; padding: 1.5rem; height: 100%; display: flex; flex-direction: column; position: relative; cursor: pointer; transition: all .15s; }
.price-card:hover { border-color: var(--oi-teal-700); }
.price-card.selected { border: 2px solid var(--oi-teal-700); box-shadow: 0 14px 34px rgba(15,118,110,.18); padding: calc(1.5rem - 1px); }
.price-card .ribbon { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--oi-navy); color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .06em; padding: .25rem .7rem; border-radius: 999px; text-transform: uppercase; white-space: nowrap; }
.price { font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 2.2rem; color: var(--oi-navy); }
.price small { font-size: .95rem; color: var(--oi-muted); font-weight: 600; }
.pay-method { border: 1px solid var(--oi-border-strong); border-radius: 12px; padding: .7rem .9rem; display: flex; align-items: center; gap: .6rem; cursor: pointer; background: #fff; }
.pay-method.active { border: 2px solid var(--oi-teal-700); background: #F0FBF9; padding: calc(.7rem - 1px) calc(.9rem - 1px); }

/* Trasy */
.route-box { background: var(--oi-navy); color: #fff; border-radius: 12px; padding: .75rem .95rem; }
.route-box .bi { color: var(--oi-teal); }
.poi-cat { border: 1px solid var(--oi-border); border-radius: 14px; padding: .85rem 1rem; background: #fff; height: 100%; cursor: pointer; text-align: left; width: 100%; }
.poi-cat:hover { border-color: var(--oi-border-strong); }
.poi-cat.active { border: 2px solid var(--oi-teal-700); background: #F0FBF9; padding: calc(.85rem - 1px) calc(1rem - 1px); }
.poi-cat .cnt { font-family: "Plus Jakarta Sans", sans-serif; font-weight: 800; font-size: 1.5rem; color: var(--oi-navy); }

/* Mapa w raporcie */
.layer-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.layer-chip { border: 1px solid var(--oi-border-strong); background: #fff; color: #334155; font-size: .82rem; font-weight: 600; padding: .35rem .7rem; border-radius: 999px; display: inline-flex; align-items: center; gap: .35rem; }
.layer-chip .sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.layer-chip.on { background: var(--oi-navy); border-color: var(--oi-navy); color: #fff; }
.watermark { position: absolute; right: 12px; top: 12px; z-index: 500; font-size: .72rem; color: #64748B; background: rgba(255,255,255,.85); border-radius: 6px; padding: .15rem .5rem; }

@media print {
  .toc, .report-actions, .layer-chips, .route-panel { display: none !important; }
  .report-layout { grid-template-columns: 1fr; }
  .r-section { break-inside: avoid; border-color: #ccc; }
}

/* Mobile — dopracowanie raportu i kroków */
@media (max-width: 575.98px) {
  .r-section { padding: 1.1rem 1rem; border-radius: 14px; }
  .r-head { flex-wrap: wrap; }
  .r-head > div:nth-child(2) { flex: 1 1 0; min-width: 0; }
  .r-head .verdict { margin-left: calc(46px + .9rem); flex-basis: 100%; }
  .r-section table.table-oi { display: block; overflow-x: auto; white-space: nowrap; }
  .stepper .step:not(.current) { font-size: 0; gap: 0; }
  .stepper .step:not(.current) .num { font-size: .85rem; }
  .stepper .step-line { min-width: 12px; }
}
@media (max-width: 575.98px) {
  .level-steps { flex-wrap: wrap; gap: 4px; }
  .level-steps span { flex: 1 1 30%; font-size: .75rem; padding: .4rem .2rem; }
}
.layer-chip.on .sw { box-shadow: 0 0 0 2px #fff; }
.provider-attribution { padding: 10px 12px; color: #5f6368; font: 14px Arial, sans-serif; }
@media (max-width: 575.98px) {
  [data-page="location"] .map-instructions { right: 56px; left: 12px !important; font-size: .75rem; }
  [data-page="location"] .location-legend { bottom: 80px !important; max-width: calc(100% - 32px); font-size: .7rem; }
}
@media (max-width: 575.98px) {
  #r-base { top: 12px; bottom: auto !important; right: auto !important; left: 12px; }
  #r-legend { right: 12px; max-width: none !important; font-size: .72rem; }
}
