/* ═══════════════════════════════════════════════════════════════════════════
   Plan & cash → Budget, round 2 (2026-10-20) — templates/fpa/budget.html.

   Founder: «вкладка бюджет — что это? тоже кривая». The page now says what a
   budget is in one line, and with no budget it is ONE card of three choice
   tiles; the forms open only inside the tile that was chosen.

   * ``.fb2-purpose``  — the page's purpose line under the view switch.
   * ``.fb2-ways``     — the tiles, a wrapping flex row. A tile that opens
                         (the draft after it was asked for, «Type or upload»
                         as a native <details>) takes the whole row; the rest
                         share the row above. No script — CSP-safe.
   * ``.fb2-collect``  — the department card's ONE explanation + ONE link.
   * ``.fb2-how*``     — the small «How budgets work» fold at the bottom.

   Tokens are the kit's (``--fa-*``, static/css/fpa-analyst.css — not edited
   here); every rule is scoped to the FP&A roots like the rest of the app.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── What a budget is ───────────────────────────────────────────────────────── */
:is(.cv5, .fa-root) .fb2-purpose {
  margin: -4px 0 16px; font-size: 14px; line-height: 1.5; color: var(--fa-ink2); max-width: 78ch;
}

/* ── The card of ways ───────────────────────────────────────────────────────── */
:is(.cv5, .fa-root) .fb2-card .fa-card-body { margin-top: 4px; }
:is(.cv5, .fa-root) .fb2-ways { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }

:is(.cv5, .fa-root) .fb2-way {
  flex: 1 1 240px; min-width: 0; box-sizing: border-box;
  border: 1px solid var(--fa-line); border-radius: 12px; background: #fbfcfe; padding: 14px 16px;
}
:is(.cv5, .fa-root) div.fb2-way { display: flex; flex-direction: column; gap: 4px; }
/* An opened tile takes the whole row; the closed ones share the row above. */
:is(.cv5, .fa-root) .fb2-way.is-open,
:is(.cv5, .fa-root) .fb2-way[open] { flex-basis: 100%; background: var(--fa-card); }
:is(.cv5, .fa-root) .fb2-ways .fb2-way.is-open { order: -1; }

:is(.cv5, .fa-root) .fb2-way-t { margin: 0; font-size: 15px; font-weight: 600; color: var(--fa-ink); line-height: 1.35; }
:is(.cv5, .fa-root) .fb2-way-l { display: block; margin: 0; font-size: 13px; color: var(--fa-muted); line-height: 1.45; font-weight: 400; }
:is(.cv5, .fa-root) .fb2-way-a { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: auto; padding-top: 8px; }
:is(.cv5, .fa-root) .fb2-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; }
:is(.cv5, .fa-root) .fb2-way .fb-locked { margin: 0; }
:is(.cv5, .fa-root) .fb2-way .fb-note { margin: 10px 0 0; }

/* «Type or upload» — the summary IS the tile; its button is a styled span
   (a button inside <summary> is not allowed), labelled by the open state. */
:is(.cv5, .fa-root) .fb2-sum {
  list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 4px; height: 100%;
  border-radius: 8px;
}
:is(.cv5, .fa-root) .fb2-sum::-webkit-details-marker { display: none; }
:is(.cv5, .fa-root) .fb2-sum:focus-visible { outline: 2px solid var(--fa-accent); outline-offset: 4px; }
:is(.cv5, .fa-root) .fb2-sum:hover .fb2-sum-btn { border-color: var(--fa-accent); }
:is(.cv5, .fa-root) .fb2-sum-btn::after { content: " \25BE"; }
:is(.cv5, .fa-root) .fb2-enter[open] .fb2-sum-btn::after { content: " \25B4"; }
:is(.cv5, .fa-root) .fb2-enter[open] .fb2-show,
:is(.cv5, .fa-root) .fb2-enter:not([open]) .fb2-hide { display: none; }
:is(.cv5, .fa-root) .fb2-enter[open] .fb2-sum { height: auto; }

:is(.cv5, .fa-root) .fb2-enter-body {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--fa-line-soft);
}
:is(.cv5, .fa-root) .fb2-pane { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
:is(.cv5, .fa-root) .fb2-pane-t { margin: 0; font-size: 14px; font-weight: 600; color: var(--fa-ink); }
:is(.cv5, .fa-root) .fb2-pane .fb-row { margin-top: 6px; }
:is(.cv5, .fa-root) .fb2-pane .fb-form2 { margin-top: 4px; }
:is(.cv5, .fa-root) .fb2-file { padding-top: 0; }

/* «How the file should look» — the format and the example, one click away. */
:is(.cv5, .fa-root) .fb2-howto { margin-top: 4px; }
:is(.cv5, .fa-root) .fb2-howto > summary {
  cursor: pointer; list-style: none; font-size: 13px; font-weight: 600; color: var(--fa-accent); display: inline-block;
}
:is(.cv5, .fa-root) .fb2-howto > summary::-webkit-details-marker { display: none; }
:is(.cv5, .fa-root) .fb2-howto > summary::after { content: " \25BE"; }
:is(.cv5, .fa-root) .fb2-howto[open] > summary::after { content: " \25B4"; }
:is(.cv5, .fa-root) .fb2-howto > summary:focus-visible { outline: 2px solid var(--fa-accent); outline-offset: 2px; border-radius: 4px; }
:is(.cv5, .fa-root) .fb2-howto[open] > :not(summary) { margin-top: 8px; }

/* The status line that closes an empty page's card, and the reports note. */
:is(.cv5, .fa-root) .fb2-card .fb2-pend {
  margin-top: 14px; padding: 9px 14px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px;
}
:is(.cv5, .fa-root) .fb2-card .fb2-pend small { margin-top: 0; }
:is(.cv5, .fa-root) .fb2-card .fb2-pend small br { display: none; }
:is(.cv5, .fa-root) .fb2-card .fb2-or { margin: 12px 0 0; }

/* ── The department card: one explanation, one link ─────────────────────── */
:is(.cv5, .fa-root) .fa-card .fb2-collect { margin: 12px 0 0; font-size: 13px; line-height: 1.5; color: var(--fa-muted); }
:is(.cv5, .fa-root) .fb2-collect .fa-link { margin-left: 2px; }

/* ── How budgets work ──────────────────────────────────────────────────────── */
:is(.cv5, .fa-root) .fb2-howwrap { max-width: 720px; }
:is(.cv5, .fa-root) .fb2-howwrap .fa-fold > summary { padding: 11px 18px; font-size: 13.5px; }
:is(.cv5, .fa-root) .fb2-how { display: grid; gap: 14px; }
:is(.cv5, .fa-root) .fb2-how .fb2-how-t { margin: 0 0 6px; font-size: 13.5px; font-weight: 600; color: var(--fa-ink); }

/* ── Phone ─────────────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  :is(.cv5, .fa-root) .fb2-enter-body { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  :is(.cv5, .fa-root) .fb2-way { flex-basis: 100%; padding: 12px 14px; }
  :is(.cv5, .fa-root) .fb2-howwrap { max-width: none; }
  :is(.cv5, .fa-root) .fb2-howwrap .fa-fold-d { display: none; }
}
