/* Budowa bez niespodzianek v2 „Podróż z pulsem" — style modułu /budowa.
   Brand PZ: tokeny z platforma.css (--ink, --gold, --cream, --paper…).
   Mobile-first: telefon 390 px na placu budowy = pierwszy obywatel (T8 —
   zero poziomego scrolla); desktop tylko poszerza oddech. */

.bbn { padding-top: 22px; padding-bottom: 48px; }
.bbn-narrow { max-width: 760px; }

/* ─── Nagłówek modułu + okruszki (nawigację niesie powłoka 3.0) ── */

.bbn-head { margin-bottom: 14px; }
.bbn-head-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.bbn-head-top h1 { margin: 0; font-size: 1.45rem; line-height: 1.25; }

/* Breadcrumb podekranu (M3 — orientacja: skąd tu trafiłem, jak wrócić) */
.bbn-breadcrumb {
  margin: 2px 0 14px; font-size: .9rem; color: var(--muted);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.bbn-breadcrumb a { color: var(--gold-deep); text-decoration: none; }
.bbn-breadcrumb a:hover { text-decoration: underline; }
.bbn-breadcrumb .sep { color: var(--line); }
.bbn-breadcrumb span:last-child { color: var(--heading); font-weight: 500; }
.bbn-breadcrumb a::before { content: ""; }

/* ─── Komunikaty ─────────────────────────────────────────── */

.bbn-flash {
  margin-top: 12px; padding: 10px 14px; border-radius: 8px; font-size: .92rem;
}
.bbn-flash.ok { background: #e8f2e4; color: #2c5626; border: 1px solid #c9e0c2; }
.bbn-flash.err { background: #f9e7e4; color: #8a2f23; border: 1px solid #ecc9c2; }

/* ─── Linia werdyktu (N3) ────────────────────────────────── */

.bbn-verdict {
  background: var(--paper); border: 1px solid var(--line);
  border-left: 4px solid var(--gold); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px; margin: 14px 0 18px;
}
.bbn-verdict.ok { border-left-color: #5d8f52; }
.bbn-verdict.watch { border-left-color: #c98f2e; }
.bbn-verdict.alert { border-left-color: #b3462f; }
.bbn-verdict.done { border-left-color: var(--ink-soft); }
.bbn-verdict-text {
  margin: 0; font-size: 1.12rem; font-weight: 600; color: var(--heading);
  font-family: 'Poppins', sans-serif; line-height: 1.4;
}
.bbn-verdict-sub { margin: 6px 0 0; font-size: .92rem; color: var(--muted); }
.bbn-commit-cta {
  display: inline-block; margin-top: 10px; font-size: .92rem; font-weight: 600;
  color: var(--gold-deep); text-decoration: none;
}
.bbn-commit-cta.quiet { font-weight: 400; color: var(--muted); }
.bbn-commit-cta:hover { text-decoration: underline; }

/* ─── Oś etapów (dom-mapa) ───────────────────────────────── */

.bbn-map { list-style: none; margin: 6px 0 0; padding: 0; position: relative; }
.bbn-map::before {
  content: ""; position: absolute; left: 17px; top: 12px; bottom: 12px;
  width: 2px; background: var(--line);
}
.bbn-stage {
  position: relative; display: flex; gap: 14px; padding: 10px 0 14px;
}
.bbn-stage-marker {
  position: relative; z-index: 1; flex: 0 0 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--paper); border: 2px solid var(--line);
  font-weight: 600; font-size: .9rem; color: var(--muted);
}
.bbn-stage.done .bbn-stage-marker {
  background: #5d8f52; border-color: #5d8f52; color: #fff;
}
.bbn-stage.front .bbn-stage-marker {
  background: var(--gold); border-color: var(--gold); color: #fff;
  box-shadow: 0 0 0 4px rgba(197, 164, 78, .22);
}
.bbn-stage.skipped .bbn-stage-marker,
.bbn-stage.closed-nodata .bbn-stage-marker { border-style: dashed; }
.bbn-stage.skipped .bbn-stage-name,
.bbn-stage.closed-nodata .bbn-stage-name { color: var(--muted); }
.bbn-stage-body { flex: 1 1 auto; min-width: 0; padding-top: 5px; }

.bbn-stage-name {
  font-weight: 600; color: var(--heading); text-decoration: none;
  font-size: .98rem; font-family: 'Poppins', sans-serif;
}
.bbn-stage-name:hover { color: var(--gold-deep); }
.bbn-stage.front .bbn-stage-name { font-size: 1.05rem; }
.bbn-now {
  font-size: .68rem; font-weight: 700; letter-spacing: .08em;
  background: var(--gold); color: #fff; border-radius: 4px; padding: 2px 7px;
}
.bbn-stage-note { margin: 3px 0 0; font-size: .86rem; color: var(--muted); line-height: 1.5; }

.bbn-stage-cta {
  display: inline-block; margin-top: 6px; font-size: .88rem; font-weight: 600;
  color: var(--gold-deep); text-decoration: none;
}
.bbn-stage-cta:hover { text-decoration: underline; }

.bbn-map.compact .bbn-stage { padding: 6px 0 8px; }

/* Grupy pozycji etapu budżetu (podsekcje arkusza) — zwinięte z licznikiem. */
.bbn-lib-grupa { margin: 0 0 10px; border-top: 1px solid var(--line); padding-top: 6px; }
.bbn-lib-grupa > summary { cursor: pointer; min-height: 44px; display: flex;
                           align-items: center; gap: 6px; font-weight: 600;
                           color: var(--heading); }

/* ─── Sekcje / drobiazgi ─────────────────────────────────── */

.bbn-section { margin-bottom: 26px; }
.bbn-section h2 { font-size: 1.25rem; margin: 0 0 10px; }
.bbn-section h3 { font-size: 1.08rem; margin: 0 0 8px; }
.bbn-count { color: var(--muted); font-weight: 400; font-size: .92rem; }
.bbn-dim { color: var(--muted); font-size: .85em; }
.bbn-hint { color: var(--muted); font-size: .86rem; margin: 8px 0 0; line-height: 1.55; }
.bbn-empty-quiet {
  color: var(--muted); font-size: .92rem; padding: 14px 0; margin: 0;
}
.bbn-inline-form { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.bbn-linklike {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--gold-deep); font-size: .9rem; font-weight: 600;
  font-family: inherit;
}
.bbn-linklike:hover { text-decoration: underline; }
.bbn-linklike.quiet { color: var(--muted); font-weight: 400; }
.bbn-plan-changes { margin: 0 0 16px; font-size: .88rem; }
.bbn-plan-changes summary { color: var(--muted); cursor: pointer; }
.bbn-plan-changes ul { margin: 8px 0 0; padding-left: 18px; }

.bbn-steps { padding-left: 20px; }
.bbn-steps li { margin-bottom: 8px; }

/* ─── Przyciski ──────────────────────────────────────────── */

.bbn-btn {
  display: inline-block; background: var(--gold); color: #fff; border: none;
  border-radius: 8px; padding: 12px 22px; font-size: 1rem; font-weight: 600;
  font-family: 'Poppins', sans-serif; cursor: pointer; text-decoration: none;
}
.bbn-btn:hover { background: var(--gold-dark); }
.bbn-btn.small { padding: 8px 14px; font-size: .88rem; }
.bbn-btn.ghost {
  background: transparent; color: var(--gold-deep); border: 1px solid var(--gold);
}
.bbn-btn.ghost:hover { background: rgba(197, 164, 78, .1); }
.bbn-btn.quiet {
  background: var(--cream); color: var(--text); border: 1px solid var(--line);
  font-weight: 500;
}
.bbn-btn.quiet:hover { border-color: var(--gold); color: var(--gold-deep); }
.bbn-btn.danger { background: #b3462f; }
.bbn-btn.danger:hover { background: #9c3b26; }

/* ─── Pokój etapu ────────────────────────────────────────── */

.bbn-room-head { margin-bottom: 14px; }
.bbn-room-head h2 { margin: 0 0 6px; font-size: 1.35rem; }
.bbn-room-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.bbn-badge {
  font-size: .74rem; font-weight: 600; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
}
.bbn-badge.done { color: #2c5626; border-color: #c9e0c2; background: #e8f2e4; }

.bbn-room-budget {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px; margin-bottom: 20px;
}
.bbn-room-budget > div {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 14px; border-top: 3px solid var(--gold);
}
.bbn-kpi-label {
  display: block; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted); font-weight: 600;
}
.bbn-kpi {
  font-size: 1.2rem; color: var(--heading); font-family: 'Poppins', sans-serif;
}
.bbn-kpi.over { color: #b3462f; }

.bbn-item, .bbn-lib-item, .bbn-note, .bbn-own-item, .bbn-offer-add {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 8px;
}
.bbn-item > summary, .bbn-lib-item > summary, .bbn-note > summary,
.bbn-own-item > summary, .bbn-offer-add > summary {
  display: flex; align-items: baseline; gap: 10px; padding: 11px 14px;
  cursor: pointer; list-style: none; flex-wrap: wrap;
}
.bbn-item summary::-webkit-details-marker,
.bbn-lib-item summary::-webkit-details-marker,
.bbn-note summary::-webkit-details-marker { display: none; }
.bbn-row-label { flex: 1 1 auto; min-width: 0; font-size: .94rem; color: var(--heading); }
.bbn-row-amount { font-weight: 600; color: var(--heading); white-space: nowrap; }
.bbn-lib-ask { font-size: .8rem; color: var(--gold-deep); white-space: nowrap; }
.bbn-tag {
  display: inline-block; font-size: .68rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; color: #2c5626;
  background: #e8f2e4; border-radius: 4px; padding: 1px 6px; margin-left: 6px;
}
.bbn-tag.est { color: #7a5b13; background: #f7ecd2; }
.bbn-item-source { padding: 0 14px; }

.bbn-item-form { padding: 4px 14px 14px; display: grid; gap: 10px; }
.bbn-item-form label {
  display: grid; gap: 4px; font-size: .82rem; color: var(--muted); font-weight: 600;
}
.bbn-item-form input, .bbn-item-form select, .bbn-item-form textarea {
  font: inherit; font-size: .95rem; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  color: var(--text); width: 100%; box-sizing: border-box;
}
.bbn-item-form input:focus, .bbn-item-form select:focus,
.bbn-item-form textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.bbn-amount-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}
.bbn-amount { text-align: right; }
.bbn-amount.invalid { border-color: #b3462f; background: #fdf2f0; }
.bbn-save-state { font-size: .82rem; color: var(--muted); }
.bbn-save-state.saving { color: var(--gold-deep); }
.bbn-save-state.error { color: #b3462f; }

.bbn-lib-answers { padding: 0 14px 14px; display: grid; gap: 10px; }
.bbn-lib-amount > summary { list-style: none; cursor: pointer; display: inline-block; }
.bbn-lib-amount > summary::-webkit-details-marker { display: none; }

.bbn-offers { padding: 0 14px 14px; }
.bbn-offers h4 { margin: 10px 0 8px; font-size: .88rem; color: var(--muted); }
.bbn-offer {
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  margin-bottom: 8px; background: var(--cream);
}
.bbn-offer.chosen { border-color: #5d8f52; background: #f2f8ef; }
.bbn-offer-main { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.bbn-offer-amount { font-weight: 600; color: var(--heading); }
.bbn-offer-badge { font-size: .78rem; color: #2c5626; font-weight: 600; }
.bbn-offer p { margin: 4px 0 6px; }
.bbn-offer-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.bbn-offer-add { background: var(--cream); }

.bbn-skipped ul { list-style: none; margin: 0; padding: 0; }
.bbn-skipped li {
  display: flex; justify-content: space-between; gap: 10px; align-items: baseline;
  padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: .9rem;
  color: var(--muted); flex-wrap: wrap;
}
.bbn-room-controls { display: grid; gap: 10px; }
.bbn-room-toggles { display: flex; gap: 18px; flex-wrap: wrap; }

.bbn-expense-list { list-style: none; margin: 0; padding: 0; }
.bbn-expense-list li {
  display: flex; gap: 10px; align-items: baseline; padding: 7px 0;
  border-bottom: 1px dashed var(--line); font-size: .92rem; flex-wrap: wrap;
}
.bbn-expense-list li:last-child { border-bottom: 0; }
.bbn-expense-amount { font-weight: 600; color: var(--heading); white-space: nowrap; }
.bbn-note p { padding: 0 14px; margin: 6px 0 10px; white-space: pre-wrap; }
.bbn-note .bbn-inline-form { padding: 0 14px 12px; }
.bbn-note-form { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.bbn-note-form input {
  flex: 1 1 220px; font: inherit; font-size: .95rem; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 8px;
}
.bbn-shelf {
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 14px 16px; background: var(--cream);
}
.bbn-shelf h3 { margin-top: 0; }

/* ─── Capture wydatku (M2 — 20 sekund przy betoniarce) ───── */

.bbn-capture {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 20px;
}
.bbn-capture-amount-label {
  display: grid; gap: 6px; font-weight: 600; color: var(--heading);
  font-size: 1.02rem;
}
.bbn-capture-amount {
  font: inherit; font-size: 1.5rem; font-weight: 600; text-align: right;
  padding: 12px 14px; border: 2px solid var(--line); border-radius: 10px;
  width: 100%; box-sizing: border-box; color: var(--heading);
}
.bbn-capture-amount:focus { outline: none; border-color: var(--gold); }
.bbn-chips { border: none; margin: 14px 0 0; padding: 0; }
.bbn-chips legend {
  font-size: .82rem; color: var(--muted); font-weight: 600; margin-bottom: 8px;
  padding: 0;
}
.bbn-chip { display: inline-block; margin: 0 6px 8px 0; position: relative; }
.bbn-chip input { position: absolute; opacity: 0; pointer-events: none; }
.bbn-chip span {
  display: inline-block; padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--cream); font-size: .88rem;
  cursor: pointer; color: var(--text); line-height: 1.2;
}
.bbn-chip input:checked + span {
  background: var(--gold); border-color: var(--gold); color: #fff; font-weight: 600;
}
.bbn-chip input:focus-visible + span { outline: 2px solid var(--ink-soft); }
.bbn-chip.front span { border-color: var(--gold); font-weight: 600; }
.bbn-chip.none span { border-style: dashed; color: var(--muted); }
.bbn-capture-more { margin-top: 12px; }
.bbn-capture-more > summary {
  font-size: .86rem; color: var(--muted); cursor: pointer; list-style: none;
}
.bbn-capture-more > summary::before { content: "▸ "; }
.bbn-capture-more[open] > summary::before { content: "▾ "; }
.bbn-capture-more > summary::-webkit-details-marker { display: none; }
.bbn-capture-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px; margin-top: 10px;
}
.bbn-capture-grid label {
  display: grid; gap: 4px; font-size: .8rem; color: var(--muted); font-weight: 600;
}
.bbn-capture-grid input, .bbn-capture-grid select {
  font: inherit; font-size: .92rem; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; width: 100%;
  box-sizing: border-box; background: #fff;
}
.bbn-capture-save { width: 100%; margin-top: 14px; }

/* ─── Feed wydatków ──────────────────────────────────────── */

.bbn-feed-head { margin-bottom: 10px; font-size: .95rem; }
.bbn-feed-head p { margin: 0 0 4px; }
.bbn-feed-head a { color: var(--gold-deep); }
.bbn-feed { list-style: none; margin: 0; padding: 0; }
.bbn-feed-item {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); margin-bottom: 8px;
}
.bbn-feed-item > details > summary {
  display: flex; gap: 10px; align-items: baseline; padding: 11px 14px;
  cursor: pointer; list-style: none; flex-wrap: wrap;
}
.bbn-feed-item summary::-webkit-details-marker { display: none; }
.bbn-feed-what { flex: 1 1 auto; min-width: 0; font-size: .92rem; }

.bbn-feed-item .bbn-item-form { border-top: 1px dashed var(--line); padding-top: 12px; }
.bbn-feed-item .bbn-inline-form { padding: 0 14px 12px; }
.bbn-pager {
  display: flex; gap: 14px; justify-content: center; align-items: baseline;
  margin: 16px 0; font-size: .92rem;
}
.bbn-pager a { color: var(--gold-deep); text-decoration: none; }
.bbn-pager span { color: var(--muted); }

/* ─── Rytuał domknięcia kosztorysu ───────────────────────── */

.bbn-commit-ritual {
  background: var(--paper); border: 1px solid var(--gold);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 18px;
}
.bbn-commit-ritual h2 { margin: 0 0 4px; }
.bbn-commit-sum {
  font-size: 2rem; font-weight: 700; color: var(--heading);
  font-family: 'Poppins', sans-serif; margin: 10px 0 2px;
}
.bbn-commit-stages { list-style: none; margin: 14px 0; padding: 0; }
.bbn-commit-stages li {
  display: flex; justify-content: space-between; gap: 10px; padding: 6px 0;
  border-bottom: 1px dashed var(--line); font-size: .9rem; flex-wrap: wrap;
}
.bbn-commit-stages li.open { color: var(--muted); }
.bbn-commit-stages li.ok { color: var(--text); }
.bbn-commit-stages a { color: var(--gold-deep); text-decoration: none; }
.bbn-commit-form { margin-top: 16px; display: grid; gap: 10px; }
.bbn-commit-form h3 { margin: 0; }
.bbn-commit-form p { margin: 0; font-size: .92rem; }
.bbn-commit-form label {
  display: grid; gap: 4px; font-size: .84rem; color: var(--muted); font-weight: 600;
}
.bbn-commit-form select {
  font: inherit; padding: 10px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; max-width: 320px;
}

/* ─── Kafle liczb (przegląd Budżetu; wzór z kreatora startu, który zniknął) ─ */

.bbn-tile {
  text-align: left; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px;
  cursor: pointer; font: inherit; display: grid; gap: 4px;
}
.bbn-tile:hover { border-color: var(--gold); box-shadow: var(--shadow-lift); }
.bbn-tile strong { font-family: 'Poppins', sans-serif; color: var(--heading); font-size: 1.02rem; }
.bbn-tile span { color: var(--muted); font-size: .86rem; }

/* ─── Rejestracja (start.html — bez zmian z tier 1) ──────── */

.bbn-signup-form { display: grid; gap: 14px; max-width: 480px; margin: 18px 0; }
.bbn-signup-form label { display: grid; gap: 6px; font-weight: 600; color: var(--heading); }
.bbn-signup-form input[type="email"] {
  font: inherit; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 8px; width: 100%; box-sizing: border-box;
}
.bbn-consent {
  display: grid !important; grid-template-columns: auto 1fr; gap: 10px !important;
  font-weight: 400 !important; color: var(--muted) !important; font-size: .85rem;
  align-items: start;
}

/* ─── Telefon 390 px (T8) ────────────────────────────────── */

@media (max-width: 480px) {
  .bbn { padding-left: 12px; padding-right: 12px; }
  .bbn-head-top h1 { font-size: 1.25rem; }
  .bbn-map::before { left: 15px; }
  .bbn-stage { gap: 11px; }
  .bbn-stage-marker { flex-basis: 32px; height: 32px; font-size: .82rem; }
  .bbn-verdict-text { font-size: 1.02rem; }
  .bbn-amount-grid { grid-template-columns: 1fr; }
  .bbn-capture-grid { grid-template-columns: 1fr; }
  .bbn-room-budget { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bbn-kpi { font-size: .98rem; }
}

/* ─── Most BBN → kalkulator kosztu (M2, 2026-07-18) ─────────────────── */
.bbn-kalkulator-most { margin: 10px 0 0; font-size: 14px; }
.bbn-kalkulator-most a { color: #3369B1; text-decoration: none; }
.bbn-kalkulator-most a:hover { text-decoration: underline; }

/* ─── Tier 2 (M6, 2026-07-18): wiele budów, dysk, galeria, dokumenty ── */

/* Visible-locked (wzorzec M3) */
.bbn-locked { border: 1px dashed var(--line); background: #faf8f4; }
.bbn-locked-badge {
  font-size: .72rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px;
  vertical-align: 2px; margin-left: 6px;
}

/* Licznik miejsca (2 GB/konto) */
.bbn-quota { margin: 0 0 16px; }
.bbn-quota-bar {
  height: 8px; background: #eee9e0; border-radius: 999px; overflow: hidden;
}
.bbn-quota-bar span { display: block; height: 100%; background: var(--gold); }
.bbn-quota.warn .bbn-quota-bar span { background: #b3261e; }
.bbn-quota p { margin: 6px 0 0; font-size: .86rem; color: var(--muted); }

/* Foldery dysku + kafle galerii */
.bbn-folder-grid {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.bbn-folder {
  display: block; padding: 14px; border: 1px solid var(--line);
  border-radius: 12px; text-decoration: none; color: var(--ink);
  background: #fff; height: 100%;
}
.bbn-folder:hover { border-color: var(--gold); }
.bbn-folder-name { display: block; font-weight: 600; }
.bbn-folder-count { display: block; font-size: .82rem; color: var(--muted); margin-top: 2px; }
.bbn-folder-desc { display: block; font-size: .84rem; color: var(--muted); margin-top: 6px; }

/* Listy plików (dysk, kosz, załączniki) */
.bbn-file-list { list-style: none; margin: 0; padding: 0; }
.bbn-file-list li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.bbn-file-list li:last-child { border-bottom: 0; }
.bbn-file-name { font-weight: 500; color: var(--ink); text-decoration: none; }
a.bbn-file-name:hover { text-decoration: underline; }
.bbn-file-actions { margin-left: auto; display: inline-flex; gap: 10px; align-items: center; }
.bbn-link-danger {
  background: none; border: 0; padding: 0; font: inherit; font-size: .84rem;
  color: #b3261e; cursor: pointer;
}
.bbn-link-danger:hover { text-decoration: underline; }

/* Galeria per etap */
.bbn-photo-grid {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.bbn-photo-grid img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px;
  border: 1px solid var(--line); display: block;
}
.bbn-photo-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .8rem; margin-top: 4px;
}

/* Załączniki wydatków */
.bbn-attach-mark { font-size: .85rem; }
.bbn-attach-list { list-style: none; margin: 0; padding: 4px 14px 0; font-size: .88rem; }
.bbn-attach-list li { padding: 3px 0; }
.bbn-attach-add { padding: 8px 14px; align-items: center; }
.bbn-attach-add input[type="file"] { font-size: .82rem; max-width: 240px; }
.bbn-attach-label { display: block; margin-top: 10px; font-size: .9rem; }
.bbn-attach-locked { margin-top: 10px; }

/* Lista budów w ustawieniach */
.bbn-project-list { list-style: none; margin: 0 0 12px; padding: 0; }
.bbn-project-list li {
  display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--line);
}
.bbn-project-list li:last-child { border-bottom: 0; }

/* Formularz danych dokumentów */
.bbn-doc-form { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bbn-doc-form button { grid-column: 1 / -1; justify-self: start; }

@media (max-width: 560px) {
  .bbn-doc-form { grid-template-columns: 1fr; }
  .bbn-head-top { flex-wrap: wrap; }
}

/* ═══ M16: przegląd Budżetu (dawny pulpit) + Kosztorys ═══ */

/* Trzy liczby pulpitu (PLAN | WYDANE | ZOSTAŁO — wzór arkusza) */
.bbn-tiles {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin: 0 0 14px;
}
.bbn-tile {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 2px;
}
.bbn-tile-k {
  font-size: .68rem; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.bbn-tile-v { font-size: 1.55rem; font-weight: 700; white-space: nowrap; }
.bbn-tile-v small { font-size: .95rem; font-weight: 600; color: var(--muted); }
.bbn-tile-v.dim { color: var(--muted); }
.bbn-tile-v.over { color: #a04040; }
.bbn-tile.spent .bbn-tile-v { color: var(--gold-deep); }
.bbn-tile.left .bbn-tile-v { color: #4a7c59; }
.bbn-tile.left .bbn-tile-v.over { color: #a04040; }
.bbn-tile-s { font-size: .78rem; color: var(--muted); }

/* Tabela statusu etapów */
.bbn-sec-title { font-size: 1.05rem; margin: 0 0 10px; }
.bbn-stage-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.bbn-stage-table th {
  text-align: right; font-size: .68rem; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); font-weight: 600;
  padding: 4px 8px; border-bottom: 2px solid var(--line);
}
.bbn-stage-table th.t-name { text-align: left; }
.bbn-stage-table td {
  padding: 8px; border-bottom: 1px solid var(--line);
  text-align: right; white-space: nowrap; vertical-align: top;
}
.bbn-stage-table td.t-name { text-align: left; white-space: normal; }
.bbn-stage-table td.t-name a {
  color: var(--ink); text-decoration: none; font-weight: 600;
}
.bbn-stage-table td.t-name a:hover { text-decoration: underline; }
.bbn-stage-table .t-sub { display: block; font-size: .78rem; color: var(--muted); }
.bbn-stage-table tr.done td, .bbn-stage-table tr.done td.t-name a { color: var(--muted); }
.bbn-stage-table .t-mark { margin-right: 6px; }
.bbn-stage-table .t-dim { color: var(--muted); }
.bbn-stage-table .t-over { color: #a04040; font-weight: 600; }
.bbn-stage-table td.t-pct { min-width: 60px; }

/* Co dalej + stopka pulpitu */
.bbn-next {
  background: #f6f2e9; border-radius: 12px; padding: 12px 16px; margin-top: 16px;
}
.bbn-next h4 {
  margin: 0 0 6px; font-size: .7rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--gold-deep);
}
.bbn-next ul { margin: 0; padding-left: 18px; }
.bbn-next li { margin: 4px 0; font-size: .92rem; }
.bbn-donebar { font-size: .84rem; color: var(--muted); margin-top: 14px; }

/* Kosztorys: warianty + etapy */
.bbn-warianty { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 8px; }
.bbn-wariant-chip {
  display: inline-block; border: 1px solid var(--line); background: #fff;
  border-radius: 999px; padding: 6px 13px; font-size: .88rem;
  color: var(--ink); text-decoration: none; cursor: pointer;
}
.bbn-wariant-chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.bbn-wariant-chip.add { border-style: dashed; color: var(--muted); list-style: none; }
.bbn-wariant-chip.add::-webkit-details-marker { display: none; }
.bbn-wariant-add { display: inline-block; }
.bbn-wariant-add[open] { display: block; width: 100%; }
.bbn-wariant-add[open] .bbn-item-form {
  margin-top: 8px; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; background: #fff;
}
.bbn-radio { display: block; font-size: .88rem; margin: 4px 0; }
.bbn-wariant-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; flex-wrap: wrap; }

.bbn-kosz-stage {
  border: 1px solid var(--line); border-radius: 10px; margin: 8px 0;
  background: #fff;
}
.bbn-kosz-stage > summary {
  display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
  padding: 10px 14px; cursor: pointer; list-style: none;
}
.bbn-kosz-stage > summary::-webkit-details-marker { display: none; }
.bbn-kosz-name { font-weight: 600; }
.bbn-kosz-meta { font-size: .8rem; color: var(--muted); }
.bbn-kosz-sum { margin-left: auto; font-weight: 600; white-space: nowrap; }
.bbn-kosz-body { padding: 2px 14px 12px; border-top: 1px solid var(--line); }
.bbn-kosz-items { list-style: none; margin: 8px 0; padding: 0; }
.bbn-kosz-items li {
  display: flex; gap: 10px; align-items: baseline; padding: 5px 0;
  border-bottom: 1px dashed var(--line); font-size: .9rem; flex-wrap: wrap;
}
.bbn-kosz-items li:last-child { border-bottom: 0; }
.bbn-kosz-item-label { flex: 1 1 220px; }
.bbn-kosz-item-sum { white-space: nowrap; font-weight: 600; }
.bbn-kosz-item-form { display: flex; gap: 8px; align-items: center; flex: 1 1 100%; flex-wrap: wrap; }
.bbn-kosz-item-form .bbn-amount { width: 120px; }
.bbn-kosz-add > summary {
  cursor: pointer; list-style: none; font-size: .86rem; color: #3369B1;
  padding: 4px 0;
}
.bbn-kosz-add > summary::-webkit-details-marker { display: none; }
.bbn-section-quiet { margin-top: 14px; font-size: .9rem; }
.bbn-section-quiet > summary { cursor: pointer; color: var(--muted); }

@media (max-width: 640px) {
  /* M-A: trzy liczby w dwóch kolumnach (pierwsza — suma planu — przez całą
     szerokość). Trzy karty jedna pod drugą zjadały 330 px pierwszego ekranu,
     a „Wydane" i „Zostało" czyta się PARAMI. */
  .bbn-tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .bbn-tiles .bbn-tile:first-child { grid-column: 1 / -1; }
  .bbn-tile { padding: 10px 12px; }
  .bbn-tile-v { font-size: 1.3rem; }
  .bbn-stage-table { font-size: .86rem; }
}

/* ═══ M16 F3: wydatki — grupy wg etapów + „Zrób zdjęcie" ═══ */
.bbn-feed-tools { font-size: .84rem; color: var(--muted); margin: 2px 0 0; }
.bbn-feed-group { margin: 14px 0 4px; }
.bbn-feed-group-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px; font-size: .95rem; margin: 0 0 4px;
  border-bottom: 2px solid var(--line); padding-bottom: 4px;
}
.bbn-feed-group-sum { font-size: .8rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.bbn-attach-duo { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
.bbn-attach-lead { font-size: .88rem; margin: 0 0 6px; }

/* ═══ M16 F4: notatki jak na blogu + podgląd plików ═══ */
.bbn-notes-tools { margin: 6px 0 14px; }
.bbn-notes-search { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.bbn-notes-search input[type="search"] {
  flex: 1 1 240px; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 8px; font: inherit;
}
.bbn-notes-filters { flex-basis: 100%; font-size: .88rem; }
.bbn-notes-filters > summary { cursor: pointer; color: var(--muted); list-style: none; padding: 2px 0; }
.bbn-notes-filters > summary::-webkit-details-marker { display: none; }
.bbn-notes-filters label { margin-right: 12px; }
.bbn-note-entry {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin: 10px 0;
}
.bbn-note-entry h3 { margin: 0 0 2px; font-size: 1.02rem; }
.bbn-note-meta { margin: 0 0 6px; font-size: .8rem; display: flex; gap: 10px; align-items: baseline; }
.bbn-note-stage {
  background: #f4ead1; color: #7a6a3f; border-radius: 10px;
  padding: 1px 8px; font-size: .74rem;
}
.bbn-note-body { margin: 0 0 8px; white-space: pre-line; }
.bbn-note-edit > summary { list-style: none; display: inline-block; cursor: pointer; }
.bbn-note-edit > summary::-webkit-details-marker { display: none; }
.bbn-note-edit[open] { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 8px; }
.bbn-plik-pdf { width: 100%; min-height: 70vh; border: 1px solid var(--line); border-radius: 8px; }
.bbn-plik-img { max-width: 100%; height: auto; border-radius: 8px; }
.bbn-plik-meta { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-top: 10px; flex-wrap: wrap; }

/* ═══ M-A (2026-09-07): orientacja — okruszki na telefonie ═══
   Nawigację (zakładki, dolny pasek, „+ Dodaj") niesie od B1 powłoka 3.0
   (`powloka3.css`); tu zostają okruszki, które rysuje makro `okruszki`. */

@media (max-width: 640px) {
  /* Okruszki zwijają się do JEDNEGO linku do rodzica z chevronem — to jest
     jednocześnie „wstecz"; bieżącą nazwę niesie tytuł ekranu (blok 3). */
  .bbn-breadcrumb .sep, .bbn-breadcrumb .bbn-crumb-here { display: none; }
  .bbn-breadcrumb a { display: inline-flex; align-items: center; min-height: 44px; }
  .bbn-breadcrumb a::before { content: "‹ "; margin-right: 4px; }
}

/* Podpis nad folderami Teczki (dawniej pod segmentem „Zdjęcia | Dysk"). */
.bbn-seg-kicker { margin-top: 4px; }

/* ═══ M-A (blok 5): statusy 12 etapów kolorem, kształtem i słowem ═══ */
/* Trzy nośniki naraz chronią przed dwoma błędami: daltonizmem (8 % mężczyzn,
   a buduje PARA) i odczytem na słońcu, gdzie subtelne odcienie znikają.
   Kształt (pełne koło vs pierścień) i ptaszek są czytelne w skali szarości. */

.bbn {
  --st-done: #4a7c59;          /* zamknięty */
  --st-now: var(--gold);       /* w trakcie */
  --st-todo: #cfc9bc;          /* przed Wami — szary, nie granat: granat to
                                  kolor nagłówków i mieszałby się z treścią */
}
.bbn-stage-table .bbn-stage-marker {
  width: 28px; height: 28px; flex: none; font-size: .78rem;
  vertical-align: middle; margin-right: 7px;
}
.bbn-stage-table .bbn-stage-marker.done {
  background: var(--st-done); border-color: var(--st-done); color: #fff;
}
.bbn-stage-table .bbn-stage-marker.now {
  background: var(--st-now); border-color: var(--st-now); color: #fff;
  box-shadow: 0 0 0 3px rgba(197, 164, 78, .2);
}
.bbn-stage-table .bbn-stage-marker.todo {
  background: transparent; border: 1.5px solid var(--st-todo); color: var(--muted);
}
.bbn-stage-table tr.skipped .bbn-stage-marker { border-style: dashed; }
.bbn-stage-table tr.done td, .bbn-stage-table tr.done td.t-name a { color: var(--muted); }
.bbn-stage-table td.t-name a { vertical-align: middle; }
.bbn-stage-table .bbn-now { vertical-align: middle; margin-left: 6px; }

/* Legenda — tania asekuracja WCAG 1.4.1 dla osób, które nie czytają podpisów */
.bbn-legend { margin: 0 0 10px; font-size: .84rem; color: var(--muted); display: flex;
              align-items: center; flex-wrap: wrap; gap: 4px 6px; }
.bbn-legend .bbn-stage-marker { flex: none; width: 18px; height: 18px;
                                font-size: .6rem; margin: 0 2px 0 0; }
.bbn-legend a { color: var(--gold-deep); text-decoration: none; }
.bbn-legend a:hover { text-decoration: underline; }
.bbn-over-line { margin: 0 0 10px; color: #a04040; }

/* Powrót z pokoju etapu trafia w TEN wiersz (blok 3): kotwica + krótki błysk. */
.bbn-stage-table tr:target { animation: bbn-target 1.4s ease-out 1; }
@keyframes bbn-target { from { background: #f6f2e9; } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) {
  .bbn-stage-table tr:target { animation: none; background: #f6f2e9; }
}

/* Telefon: tabela staje się LISTĄ (NN/g — adaptacja z zachowaniem etykiet).
   Nazwa etapu dostaje pełną szerokość, więc „1 · Przygotowanie inwestycji"
   nie łamie się na trzy linie (U3); liczby składają się w jedną linię
   metadanych pod nazwą. To nadal <table>, więc semantyka dla czytników
   ekranu zostaje. */
@media (max-width: 640px) {
  .bbn-stage-table thead {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
  }
  .bbn-stage-table tr {
    display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px;
    padding: 7px 0; border-bottom: 1px solid var(--line);
  }
  .bbn-stage-table td { border: 0; padding: 0; text-align: left; white-space: normal; }
  .bbn-stage-table td.t-name { flex: 1 1 auto; order: 1; }
  .bbn-stage-table td.t-pct { flex: 0 0 auto; order: 2; margin-left: auto;
                              text-align: right; min-width: 0; }
  /* Twardy łamacz linii: bez niego przy krótkiej nazwie etapu liczby wciskały
     się w pierwszą linię, a procent lądował na końcu metadanych (zrzut). */
  .bbn-stage-table tr::after { content: ""; flex: 0 0 100%; height: 0; order: 3; }
  .bbn-stage-table td[data-label] { order: 4; flex: 0 0 auto;
                                    font-size: .76rem; color: var(--muted); }
  .bbn-stage-table td[data-label]:not(.t-pct)::before { content: attr(data-label) " "; }
  .bbn-stage-table td[data-label="wydane"]::before { content: "· wydane "; }
  .bbn-stage-table td[data-label="zostało"]::before { content: "· zostało "; }
  .bbn-stage-table td.t-hide-m { display: inline; }
  .bbn-stage-table td.t-dim[colspan] { flex: 1 1 100%; order: 4; }
  .bbn-stage-table .t-sub { margin-top: 1px; line-height: 1.4; }
  .bbn-section { margin-bottom: 18px; }
  .bbn-next { padding: 10px 13px; margin-top: 12px; }
}

/* Chipy etapów (blok 8): cel dotyku ≥ 44 px i odstęp ≥ 8 px (WCAG 2.5.8);
   dalsze etapy pod „inne etapy (N)" — etykieta mówi, ile ich tam jest. */
.bbn-chip { margin: 0 8px 8px 0; }
.bbn-chip span { min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px; }
.bbn-chips-more { flex-basis: 100%; margin-top: 2px; }
.bbn-chips-more > summary {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: .88rem; color: var(--gold-deep); cursor: pointer; list-style: none;
}
.bbn-chips-more > summary::-webkit-details-marker { display: none; }
.bbn-chips-more > summary::before { content: "▸ "; margin-right: 4px; }
.bbn-chips-more[open] > summary::before { content: "▾ "; }
.bbn-chips-rest { margin-top: 6px; }
/* Zapis jednym przyciskiem, pełna szerokość na telefonie (blok 8). */
.bbn-capture-save { min-height: 48px; font-size: 1rem; }

/* Notatki (blok 7.1): wyszukiwarka pierwsza, przycisk „+ Notatka" jako
   summary, nagłówki dat nad wpisami. */
.bbn-note-new { margin: 0 0 6px; }
.bbn-note-new > summary {
  list-style: none; display: inline-flex; align-items: center;
  min-height: 48px; cursor: pointer;
}
.bbn-note-new > summary::-webkit-details-marker { display: none; }
.bbn-note-new[open] > summary { margin-bottom: 10px; }
.bbn-notes-lead { margin: 8px 0 6px; }
.bbn-notes-day {
  margin: 18px 0 4px; font-size: .74rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.bbn-notes-search input[type="search"] { min-height: 44px; }

/* Pager sąsiednich etapów (blok 3) — przeglądanie po kolei bez powrotu
   na pulpit. Cele dotyku pełnej wysokości, po jednym na krawędź. */
.bbn-stage-pager {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line);
}
.bbn-stage-pager a {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: .92rem; font-weight: 500;
}
.bbn-stage-pager a.next { margin-left: auto; text-align: right; }

/* ══ M-B′ (2026-09-07): trzy sytuacje, most kosztorys↔realizacja, późne
   dołączenie. Wszystko cichym drukiem — te elementy INFORMUJĄ, nie wołają.
   ══════════════════════════════════════════════════════════════════════ */

/* Zdanie odcienia u góry hubu i pulpitu (C1). Jedno zdanie, kolor tekstu
   pomocniczego: to kontekst, nie nagłówek — nagłówkiem jest nazwa budowy. */
.bbn-lead {
  margin: 0 0 14px; font-size: .95rem; line-height: 1.55; color: var(--ink-soft);
  border-left: 2px solid var(--gold); padding-left: 12px;
}

/* Wydatki bez etapu na wierzchu (E12) */
.bbn-unpinned-line { margin: 0 0 14px; font-size: .9rem; color: var(--ink-soft); }
.bbn-unpinned-line a { color: var(--gold-deep); }

/* Kwota etapu bez pozycji (N3) — formularz mostu w pokoju etapu
   i w Kosztorysie. Dwa pola obok siebie na komputerze, jedno pod drugim
   na telefonie; przycisk pełnej wysokości celu dotyku. */
.bbn-lump { margin: 10px 0 0; }
.bbn-lump > summary { cursor: pointer; min-height: 44px; display: flex;
                      align-items: center; font-weight: 600; }
.bbn-lump > summary::after { content: " ▾"; color: var(--muted); margin-left: 6px; }
.bbn-lump[open] > summary::after { content: " ▴"; }
.bbn-lump-grid { display: grid; gap: 10px; margin: 10px 0 0; }
@media (min-width: 560px) { .bbn-lump-grid { grid-template-columns: 1fr 1fr; } }
/* Etykieta NAD polem, pole na pełną szerokość komórki — inaczej dwa pola
   o różnej szerokości układają się schodkami (oględziny zrzutów M-B′). */
.bbn-lump-grid label { display: block; font-size: .9rem; }
.bbn-lump-grid input { display: block; width: 100%; min-height: 48px; margin-top: 4px; }
.bbn-lump .bbn-hint { margin-top: 6px; }

/* Etap „zamknięty bez danych" (N3): szary wiersz z etykietą. Kolor NIE jest
   jedynym nośnikiem — obok stoi słowo w podpisie i przerywany pierścień. */
.bbn-stage-table tr.closed-nodata td,
.bbn-stage-table tr.closed-nodata td.t-name a { color: var(--muted); }
.bbn-stage-table tr.closed-nodata .bbn-stage-marker {
  border-style: dashed; background: transparent; color: var(--muted);
}
.bbn-closed-badge {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  background: #efece4; color: var(--muted); font-size: .72rem; white-space: nowrap;
  vertical-align: middle;
}

/* Konfiguracja budowy (C1): grupy pytań w Ustawieniach. Cele dotyku pełne —
   to jest ekran wypełniany raz, ale często z telefonu. */
.bbn-fieldset { border: 0; padding: 0; margin: 0 0 16px; }
.bbn-fieldset legend { padding: 0; font-weight: 600; font-size: .92rem; }
/* Specyficzność MUSI przebić `.bbn-item-form label { display: grid }` (l. 357),
   inaczej radio, etykieta i podpowiedź lądują w trzech osobnych wierszach
   wyrównanych do prawej — tak wyglądały pierwsze zrzuty M-B′. */
.bbn-item-form .bbn-fieldset label.bbn-radio,
.bbn-etapy-lista label.bbn-radio {
  display: flex; align-items: center; gap: 8px; margin: 0;
  min-height: 44px; font-size: .92rem; font-weight: 400;
  color: var(--ink); text-align: left;
}
.bbn-item-form .bbn-fieldset label.bbn-radio input,
.bbn-etapy-lista label.bbn-radio input {
  flex: 0 0 auto; width: auto; min-height: 0; margin: 0;
}
.bbn-item-form .bbn-fieldset label.bbn-radio .bbn-dim { font-size: .86rem; }
.bbn-fieldset input[type="text"] { margin-top: 4px; min-height: 44px; }

/* „Które etapy macie już za sobą?" — dwanaście pozycji w dwóch kolumnach
   na komputerze, jedna pod drugą na telefonie. */
.bbn-etapy-lista { display: grid; gap: 2px 16px; margin: 0 0 12px; }
@media (min-width: 560px) { .bbn-etapy-lista { grid-template-columns: 1fr 1fr; } }

/* Cicha linia orientacyjnego budżetu (C1) — notatka sprzed kosztorysu,
   NIGDY w kolorze alarmowym: produkt nie ocenia, czy się w niej mieścicie. */
.bbn-budget-hint { margin: 0 0 12px; font-size: .88rem; color: var(--muted); }

/* Etap zamknięty bez danych — nota w pokoju etapu i kwota sprzed dołączenia */
.bbn-closed-note {
  margin: 0 0 14px; padding: 10px 12px; border-radius: 8px;
  background: #f4f2ec; color: var(--ink-soft); font-size: .9rem; line-height: 1.55;
}
.bbn-spent-before { margin: 0 0 8px; font-size: .9rem; color: var(--ink-soft); }

