/* ==========================================================================
   Bröllopsbudget / wedding budget calculator (/brollopsbudget, /en/wedding-budget-calculator).
   Built by brollopsbudget.js. Settings on the left, the budget as a sheet on the right; stacked on phones.
   Shared parts (intro, buttons, inputs, tips, ad, feedback) come from verktyg.css. Prefix bb-.
   ========================================================================== */
.bb-app {
  display: grid; grid-template-columns: minmax(270px, 340px) minmax(0, 1fr); gap: clamp(18px, 3vw, 40px);
  align-items: start; padding-block: 8px 56px; --bb-line: #e7e1d8; --bb-muted: #7b7267; --bb-paper: #fffdf9;
}
.bb-settings { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 14px; padding: 22px; background: #f7f3ec; border-radius: 22px; }
.bb-settings h2 { margin: 0; font: italic 400 1.45rem/1.2 var(--bp-serif); letter-spacing: 0; }
.bb-field { display: flex; flex-direction: column; gap: 6px; font-size: .84rem; color: var(--bb-muted); }
.bb-money { position: relative; display: flex; align-items: center; }
.bb-money em { position: absolute; right: 12px; font-style: normal; color: var(--bb-muted); font-size: .9rem; pointer-events: none; }
.bb-big .bp-input { font: 600 1.45rem/1.2 var(--bp-sans); padding: 10px 40px 10px 12px; font-variant-numeric: tabular-nums; }
.bb-pg { display: flex; flex-direction: column; gap: 4px; font-size: .84rem; color: #4b453d; }
.bb-pg span::before { content: "·"; margin-right: 6px; color: var(--bb-muted); }
.bb-hint { display: flex; gap: 8px; margin: 0; padding: 10px 12px; border-radius: 12px; background: #fdf3d9; font-size: .82rem; line-height: 1.45; color: #6b4d12; }
.bb-hint-cost { background: #eaf4e5; color: #2f5a1c; } .bb-hint-cost svg { color: #4f8a2e !important; }
.bb-hint svg { width: 16px; height: 16px; flex: none; margin-top: 1px; color: #d59a1c; }
.bb-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 2px; }
.bb-actions .bp-btn.primary { background: var(--bp-accent); border-color: var(--bp-accent); color: #10200a; }
.bb-actions .bp-btn.primary:hover { background: #94d167; }
.bb-link { appearance: none; border: 0; background: none; padding: 4px 2px; font: 500 .85rem var(--bp-sans); color: var(--bb-muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.bb-danger { color: var(--bp-danger); }

.bb-sheet { background: var(--bb-paper); border: 1px solid var(--bb-line); border-radius: 24px; padding: clamp(20px, 3.2vw, 40px); box-shadow: 0 18px 50px -30px rgba(60, 40, 20, .45); position: relative; overflow: hidden; }
.bb-sheet::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, #e8909f, #f2a46f 22%, #e2bd50 42%, #8cc184 62%, #7fb0df 80%, #b29ae2); }
.bb-head { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: clamp(18px, 3vw, 36px); align-items: center; padding-bottom: 20px; border-bottom: 1px solid var(--bb-line); }
.bb-donut { position: relative; width: 200px; aspect-ratio: 1; }
.bb-donut svg { width: 100%; height: 100%; display: block; }
.bb-donut circle { transition: stroke-dasharray .4s ease, stroke-dashoffset .4s ease; }
.bb-donut-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.bb-donut-c b { font: 600 1.15rem/1.2 var(--bp-sans); font-variant-numeric: tabular-nums; }
.bb-donut-c span { font-size: .76rem; color: var(--bb-muted); margin-top: 2px; }
.bb-sums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.bb-sums div { padding: 12px 14px; border-radius: 14px; background: #f4efe7; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bb-sums em { font-style: normal; font-size: .76rem; color: var(--bb-muted); }
.bb-sums b { font: 600 1.05rem/1.2 var(--bp-sans); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bb-sums .is-over { background: #fbe4e6; } .bb-sums .is-over b { color: #9b2c3a; }
.bb-alert { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; margin: 14px 0 0; padding: 10px 14px; border-radius: 14px; background: #fff3dc; color: #74480a; font-size: .88rem; }
.bb-alert.is-over { background: #fbe4e6; color: #8a2433; }
.bb-alert[hidden] { display: none; }
.bb-list { list-style: none; margin: 8px 0 0; padding: 0; }
.bb-cat { padding: 12px 6px 10px; border-bottom: 1px solid #f0ebe3; }
.bb-row { display: grid; grid-template-columns: 14px minmax(0, 1fr) 32px 150px 150px 30px; gap: 10px; align-items: center; }
.bb-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.bb-name { display: flex; flex-direction: column; min-width: 0; font-weight: 600; font-size: .96rem; line-height: 1.3; }
.bb-name em { font-style: normal; font-weight: 400; font-size: .76rem; color: var(--bb-muted); font-variant-numeric: tabular-nums; }
.bb-namein { border: 0; border-bottom: 1px dashed #cfc6b9; background: transparent; font: 600 .96rem/1.3 var(--bp-sans); padding: 2px 0; width: 100%; color: inherit; }
.bb-namein:focus { outline: none; border-bottom-color: var(--bp-accent-ink); }
.bb-star, .bb-toggle, .bb-lock { appearance: none; border: 0; background: transparent; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; cursor: pointer; color: #b9b0a3; }
.bb-star svg, .bb-toggle svg { width: 18px; height: 18px; }
.bb-star:hover, .bb-toggle:hover { background: #f4efe7; color: #6b6156; }
.bb-star.is-on { color: #d59a1c; } .bb-star.is-on svg { fill: #f2c24f; }
.bb-star:disabled { opacity: .3; cursor: default; background: none; }
.bb-amt { display: flex; flex-direction: column; gap: 3px; font-size: .7rem; color: var(--bb-muted); }
.bb-amt .bp-input { padding: 7px 10px; font: 500 .92rem/1.2 var(--bp-sans); text-align: right; font-variant-numeric: tabular-nums; }
.bb-amt .bb-money .bp-input { padding-right: 34px; }
.bb-lock { position: absolute; right: 2px; width: 28px; height: 28px; color: #9a6a2e; }
.bb-lock svg { width: 15px; height: 15px; }
.bb-lock:hover { background: #f4efe7; }
.bb-cat.is-open .bb-toggle svg { transform: rotate(180deg); }
.bb-bar { height: 5px; border-radius: 5px; background: #f0ebe3; margin: 9px 0 0 24px; overflow: hidden; }
.bb-bar i { display: block; height: 100%; border-radius: inherit; background: var(--c); transition: width .4s ease; }
.bb-cat.is-over .bb-bar i { background: #d9576a; }
.bb-diff { margin: 5px 0 0 24px; font-size: .78rem; color: var(--bp-accent-ink); font-variant-numeric: tabular-nums; }
.bb-cat.is-over .bb-diff { color: #9b2c3a; }
.bb-diff.bb-follows { color: var(--bb-muted); }
.bb-detail { margin: 10px 0 2px 24px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.bb-detail .bb-field { width: 100%; max-width: 520px; }
.bb-tip { margin: 0; font-size: .88rem; line-height: 1.55; color: #4b453d; max-width: 70ch; }
.bb-tip a { color: var(--bp-accent-ink); }
.bb-more { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.bb-chip { appearance: none; border: 1px dashed #d4cabd; background: transparent; border-radius: 999px; padding: 7px 13px; font: 500 .82rem var(--bp-sans); color: #4b453d; cursor: pointer; display: inline-flex; gap: 7px; align-items: center; }
.bb-chip span { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.bb-chip:hover { border-color: #9a8f82; background: #f8f4ee; }
.bb-add { color: var(--bp-accent-ink); font-weight: 600; }
.bb-foot { display: none; }
.bb-app :focus-visible { outline: 3px solid var(--bp-accent); outline-offset: 2px; }

@media (max-width: 960px) {
  .bb-app { grid-template-columns: minmax(0, 1fr); }
  .bb-settings { position: static; }
}
@media (max-width: 640px) {
  .bb-head { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .bb-sums { grid-template-columns: minmax(0, 1fr); width: 100%; }
  .bb-donut-c b { font-size: 1rem; }
  .bb-sums div { flex-direction: row; justify-content: space-between; align-items: baseline; }
  .bb-row { grid-template-columns: 14px minmax(0, 1fr) 30px 30px; }
  .bb-amt { grid-column: 2 / -1; flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; }
  .bb-amt > span:first-child { min-width: 64px; }
  .bb-amt .bp-input, .bb-amt .bb-money { width: 62%; }
  .bb-amt .bb-money .bp-input { width: 100%; }
  .bb-row .bb-star { grid-column: 3; grid-row: 1; }
  .bb-row .bb-toggle { grid-column: 4; grid-row: 1; }
}

/* Print: only the budget, on white */
@media print {
  @page { size: A4 portrait; margin: 14mm; }
  html, body { background: #fff !important; }
  .site-header, .site-footer, .bb-hide-print, .bb-settings, .bb-more, .bb-toggle, .bb-alert .bp-btn, .fb-dialog, .mobile-menu { display: none !important; }
  .bb-app { display: block; padding: 0; }
  .bp-wrap { padding: 0 !important; max-width: none; }
  .bb-sheet { border: 0; box-shadow: none; padding: 0; border-radius: 0; }
  .bb-sheet::before { display: none; }
  .bb-cat { break-inside: avoid; }
  .bb-star:not(.is-on) { visibility: hidden; }
  .bb-amt .bp-input { border: 0; padding: 0; background: none; }
  .bb-amt .bp-input::placeholder { color: transparent; }
  .bb-lock { display: none; }
  .bb-head, .bb-sums div, .bb-bar, .bb-dot, .bb-donut { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .bb-foot { display: block; margin: 18px 0 0; text-align: center; font-size: 8pt; color: #aaa; }
}
