/* Besparelsesberegner (/da/besparelsesberegner-brands-plus-agencies/) only.
   Every class is prefixed bb- so nothing collides with site.css (.steps, .card ...).
   Site tokens only. Orange stays for the CTA; teal is not used (it means "cleared"). */
.bb { display: flex; flex-direction: column; gap: 28px; }
.bb-num { font-variant-numeric: tabular-nums; }
.bb-draft {
  display: inline-block; font-size: 12.5px; font-weight: 500; padding: 4px 10px;
  border: 1px solid var(--line-strong); color: var(--muted-foreground);
  border-radius: var(--radius-btn); margin-top: 6px;
}

.bb-panel {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 22px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow);
}
.bb-panel h2.kicker { margin: 0; font-size: 12px; color: var(--muted-foreground); }
.bb-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.bb-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.bb-field label { font-size: 13px; color: var(--muted-foreground); line-height: 1.35; }
.bb-field input {
  font: inherit; font-size: 16px; font-variant-numeric: tabular-nums; padding: 9px 11px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-btn);
  background: var(--background); color: var(--foreground); width: 100%;
}
.bb input:focus-visible, .bb button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.bb-presets { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bb-presets span { font-size: 13px; color: var(--muted-foreground); }
.bb-chip {
  font: inherit; font-size: 13.5px; padding: 6px 13px; border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong); background: var(--background); color: var(--primary); cursor: pointer;
}
.bb-chip:hover { background: var(--secondary); }
.bb-chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--chrome-foreground); }
.bb-hint { font-size: 13.5px; color: var(--muted-foreground); max-width: none; }
.bb-hint a { color: var(--primary); }

.bb-block { display: flex; flex-direction: column; gap: 12px; }
.bb-block h2 { margin: 0; }
.bb-note { font-size: 14px; color: var(--muted-foreground); max-width: 75ch; }

.bb-tablewrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--card); }
.bb table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 760px; }
.bb th, .bb td { padding: 11px 13px; border-bottom: 1px solid var(--line-soft); text-align: right; font-variant-numeric: tabular-nums; }
.bb th:first-child, .bb td:first-child { text-align: left; }
.bb thead th { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-foreground); font-weight: 600; vertical-align: bottom; }
.bb th.s, .bb td.s { background: var(--paper-reading); color: var(--primary); }
.bb tbody tr:last-child td { border-bottom: none; }
.bb td.save { font-weight: 600; color: var(--primary); }

.bb-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.bb-tabs button {
  font: inherit; font-size: 14px; padding: 8px 15px; border-radius: var(--radius-btn);
  border: 1px solid var(--border); background: var(--card); color: var(--foreground); cursor: pointer;
}
.bb-tabs button[aria-selected="true"] { border-color: var(--primary); box-shadow: inset 0 -2px 0 var(--primary); font-weight: 600; }

.bb-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 800px) { .bb-pair { grid-template-columns: 1fr; } }
.bb-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: 20px; display: flex; flex-direction: column; gap: 18px; min-width: 0;
}
.bb-card.sattr { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.bb-card header { display: flex; flex-direction: column; gap: 3px; }
.bb-card h3 { font-size: 18px; color: var(--primary); }
.bb-tag { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-foreground); }
.bb-sec { display: flex; flex-direction: column; gap: 6px; }
.bb-sec h4 { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-foreground); }
.bb-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: baseline;
  padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 14px;
}
.bb-row:last-child { border-bottom: none; }
.bb-row .what { min-width: 0; }
.bb-row .amt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bb-row small { display: block; color: var(--muted-foreground); font-size: 12.5px; line-height: 1.4; }
.bb-pill { font-size: 11px; font-weight: 500; padding: 1px 7px; border-radius: 4px; white-space: nowrap; border: 1px solid transparent; }
.bb-pill.money { background: #e6ebf1; color: var(--primary); }
.bb-pill.vat { background: var(--secondary); color: #5b4a1f; }
.bb-pill.goods { background: var(--paper-reading); color: var(--primary); border-color: var(--line-strong); }
.bb-pill.doc { background: var(--background); color: var(--muted-foreground); border-color: var(--border); }
.bb-net { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bb-net div { background: var(--paper-reading); border-radius: var(--radius); padding: 9px 11px; min-width: 0; }
.bb-net span { display: block; font-size: 12px; color: var(--muted-foreground); }
.bb-net b { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--primary); }
.bb-docs { margin: 0; padding-left: 18px; font-size: 14px; }
.bb-docs li { margin: 2px 0; }
.bb-step {
  display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: baseline;
  padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 14px;
}
.bb-step:last-child { border-bottom: none; }
.bb-who { font-size: 11px; padding: 1px 7px; border-radius: 4px; border: 1px solid var(--line-strong); color: var(--muted-foreground); white-space: nowrap; }
.bb-min { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bb-total { display: flex; justify-content: space-between; font-weight: 600; padding-top: 7px; border-top: 1px solid var(--line-strong); font-size: 14px; }

.bb-fine { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--border); padding-top: 24px; }
.bb-fine h3 { font-size: 17px; color: var(--primary); }
.bb-fine ul { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--muted-foreground); }
.bb-fine li { margin: 3px 0; }

/* Focus band with the Uden/Med Sattr switch. Navy chrome: the big figures may be
   orange here (site rule: orange for the large figures on navy). The switch is a
   state, so it is never orange. */
.bb-focus {
  background: var(--gradient-chrome); color: var(--chrome-foreground);
  border-radius: var(--radius-card-lg); padding: 26px; display: flex; flex-direction: column; gap: 18px;
}
.bb-switchrow { display: flex; align-items: center; gap: 12px; }
.bb-switchlbl { font-size: 15px; font-weight: 600; color: var(--chrome-foreground); cursor: pointer; user-select: none; }
.bb-focus.on #bb-off-lbl, .bb-focus:not(.on) #bb-on-lbl { color: var(--chrome-muted); font-weight: 500; }
.bb-switch {
  position: relative; width: 56px; height: 30px; flex: none; border-radius: var(--radius-pill);
  border: 1px solid rgba(245, 242, 236, 0.3); background: rgba(245, 242, 236, 0.12); cursor: pointer; padding: 0;
}
.bb-switch[aria-checked="true"] { background: var(--chrome-foreground); border-color: var(--chrome-foreground); }
.bb-switch[aria-checked="true"] .bb-knob { background: var(--primary); }
.bb-knob {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--chrome-foreground); transition: transform .2s var(--ease);
}
.bb-switch[aria-checked="true"] .bb-knob { transform: translateX(26px); }
.bb-focus .bb-switch:focus-visible { outline: 2px solid var(--chrome-foreground); outline-offset: 3px; }
.bb-bigrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 18px; }
.bb-biglbl { display: block; font-size: 13px; color: var(--text-on-navy); }
.bb-big { display: block; font-size: clamp(36px, 5.4vw, 56px); font-weight: 600; letter-spacing: -0.035em; line-height: 1.05; color: var(--brand); font-variant-numeric: tabular-nums; }
.bb-split { font-size: 14px; color: var(--text-on-navy); max-width: none; }
.bb-save { font-size: 16px; font-weight: 600; color: var(--chrome-foreground); max-width: none; }
.bb-pair { grid-template-columns: minmax(0, 1fr); max-width: 860px; }
@media (prefers-reduced-motion: reduce) { .bb-knob { transition: none; } }

/* Info icon next to a field label, opening a short note as a native popover (no JS) */
.bb-lblrow { display: flex; align-items: flex-start; gap: 6px; }
.bb-info {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; margin-top: 1px; padding: 0; border-radius: 50%;
  border: 1.5px solid var(--primary); background: none; color: var(--primary);
  font: 600 11px/1 var(--font); cursor: pointer;
}
.bb-info:hover { background: var(--primary); color: var(--chrome-foreground); }
.bb-pop {
  width: min(26rem, calc(100vw - 32px)); margin: auto; padding: 18px 20px 20px;
  background: var(--card); color: var(--foreground);
  border: 1px solid var(--border); border-radius: var(--radius-card);
  box-shadow: 0 16px 48px rgba(10, 21, 38, 0.24);
  font-family: var(--font); font-size: 15px; line-height: 1.6;
}
.bb-pop::backdrop { background: rgba(10, 21, 38, 0.32); }
.bb-pop p { margin: 0 0 8px; max-width: none; }
.bb-pop p:last-child { margin: 0; }
.bb-poptop { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.bb-pop .bb-poplbl { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-foreground); margin: 0; }
.bb-popclose {
  flex: none; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  background: var(--secondary); color: var(--primary); border: 0; border-radius: var(--radius-btn); padding: 4px 10px;
}
.bb-pop .bb-num { font-weight: 600; color: var(--primary); }

/* Shown only with Sattr on: the "% mindre tid" pill under each big figure and
   the two bars. The pill is light on navy rather than orange or teal - orange is
   for action and the big figures, teal means "cleared" only. The Med Sattr bar is
   an orange fill, like the big figures beside it. Width is set from the script
   through the CSSOM, which the CSP allows (no inline style attributes). */
.bb-pct {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  padding: 5px 12px; border-radius: var(--radius-pill);
  background: var(--chrome-foreground); color: var(--primary);
  font-size: 14px; font-weight: 700; letter-spacing: -0.01em;
  opacity: 0; transform: translateY(6px) scale(0.92); visibility: hidden;
}
.bb-focus.on .bb-pct { opacity: 1; transform: none; visibility: visible; }
.bb-bars {
  display: grid; gap: 10px; max-height: 0; opacity: 0; overflow: hidden;
}
.bb-focus.on .bb-bars { max-height: 140px; opacity: 1; }
.bb-bar { display: grid; grid-template-columns: 92px 1fr auto; align-items: center; gap: 12px; font-size: 13.5px; }
.bb-barlbl { color: var(--text-on-navy); }
.bb-barval { color: var(--chrome-foreground); font-weight: 600; font-variant-numeric: tabular-nums; min-width: 72px; text-align: right; }
.bb-track { height: 14px; border-radius: var(--radius-pill); background: rgba(245, 242, 236, 0.08); overflow: hidden; }
.bb-fill { display: block; height: 100%; width: 100%; border-radius: var(--radius-pill); background: var(--brand); }
.bb-fill.off { background: rgba(245, 242, 236, 0.32); }
@media (prefers-reduced-motion: no-preference) {
  .bb-pct { transition: opacity .35s var(--ease) .15s, transform .45s cubic-bezier(0.34, 1.56, 0.64, 1) .15s, visibility 0s linear .5s; }
  .bb-focus.on .bb-pct { transition-delay: .35s, .35s, 0s; }
  .bb-bars { transition: max-height .35s var(--ease), opacity .3s var(--ease); }
  .bb-fill { transition: width .9s cubic-bezier(0.22, 1, 0.36, 1) .15s; }
}

/* Fields the chosen example does not use, plus the eurokurs, fold away here */
.bb-more { border-top: 1px dashed var(--border); padding-top: 12px; }
.bb-more summary {
  cursor: pointer; font-size: 13.5px; font-weight: 500; color: var(--primary);
  list-style-position: outside; margin-left: 16px; width: fit-content;
}
.bb-more summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.bb-more[open] summary { margin-bottom: 14px; }

/* The calculator follows the hero directly - no CTA in between */
.page-section.bb-section { padding-top: 8px; }
.hero > .wrap:has(.bb-draft) { padding-bottom: 48px; }

/* "Proces og tid for brandet" - one editable row per step */
.bb-proc { display: flex; flex-direction: column; }
.bb-prow {
  display: grid; grid-template-columns: minmax(0, 1fr) 170px 110px; gap: 12px; align-items: center;
  padding: 10px 0; border-bottom: 1px dashed var(--border);
}
.bb-prow:last-child { border-bottom: none; }
.bb-pname { font-size: 14.5px; min-width: 0; }
.bb-pname small { display: block; font-size: 12.5px; color: var(--muted-foreground); line-height: 1.4; }
.bb-prow select, .bb-pmin input {
  font: inherit; font-size: 14px; padding: 7px 9px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-btn); background: var(--background); color: var(--foreground); width: 100%;
}
.bb-pmin { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted-foreground); }
.bb-pmin input { font-variant-numeric: tabular-nums; text-align: right; }
.bb-procfoot { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.bb-procfoot .bb-hint { flex: 1 1 360px; }
@media (max-width: 640px) {
  .bb-prow { grid-template-columns: minmax(0, 1fr) 96px; }
  .bb-pname { grid-column: 1 / -1; }
}

/* Foldable panels: "Proces og tid for brandet" and "Vederlag pr. creator",
   both closed by default. <details> itself stays a block - the flex
   layout lives on .bb-foldbody, since older browsers ignore flex on details. */
details.bb-panel.bb-fold { display: block; padding: 0; }
.bb-fold > summary {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px;
  padding: 18px 52px 18px 22px; cursor: pointer; list-style: none; position: relative;
  border-radius: var(--radius-card);
}
.bb-fold > summary::-webkit-details-marker { display: none; }
.bb-fold > summary::after {
  content: ""; position: absolute; right: 24px; top: 50%; width: 9px; height: 9px;
  border-right: 2px solid var(--primary); border-bottom: 2px solid var(--primary);
  transform: translateY(-70%) rotate(45deg);
}
.bb-fold[open] > summary::after { transform: translateY(-30%) rotate(-135deg); }
.bb-fold > summary:hover { background: var(--paper-reading); }
.bb-fold > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.bb-fold > summary h2.kicker { color: var(--primary); }
.bb-peek { font-size: 13.5px; color: var(--muted-foreground); }
.bb-fold[open] .bb-peek { display: none; }
.bb-foldbody { display: flex; flex-direction: column; gap: 16px; padding: 0 22px 22px; }
@media (prefers-reduced-motion: no-preference) { .bb-fold > summary::after { transition: transform .2s var(--ease); } }

/* Card sections fold (closed by default); each Moms, Kostpris, Bilag, document and
   process line can carry an "i" that opens the shared #bb-pop-info popover */
.bb-sub { border-top: 1px solid var(--line-soft); }
.bb-sub > summary {
  display: flex; align-items: baseline; gap: 10px; padding: 12px 28px 12px 0; cursor: pointer;
  list-style: none; position: relative;
}
.bb-sub > summary::-webkit-details-marker { display: none; }
.bb-sub > summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 7px; height: 7px;
  border-right: 2px solid var(--muted-foreground); border-bottom: 2px solid var(--muted-foreground);
  transform: translateY(-70%) rotate(45deg);
}
.bb-sub[open] > summary::after { transform: translateY(-30%) rotate(-135deg); }
.bb-sub > summary:hover h4 { color: var(--primary); }
.bb-sub > summary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.bb-sub h4 { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-foreground); }
.bb-secmeta { margin-left: 8px; font-weight: 500; letter-spacing: 0; text-transform: none; font-size: 12.5px; color: var(--primary); }
.bb-subbody { display: flex; flex-direction: column; gap: 6px; padding-bottom: 12px; }
.bb-card > .bb-sub:last-child { padding-bottom: 0; }
.bb-row .what .bb-info, .bb-step .bb-info, .bb-docs .bb-info { margin-left: 6px; vertical-align: 0.05em; width: 16px; height: 16px; font-size: 10.5px; }
.bb-docs .bb-info, .bb-row .what .bb-info, .bb-step .bb-info { display: inline-flex; }
@media (prefers-reduced-motion: no-preference) { .bb-sub > summary::after { transition: transform .2s var(--ease); } }
.bb-sub + .bb-sub { margin-top: -18px; }

/* "Start her": number of creators and the period the overview covers */
.bb-start { border-color: var(--primary); }
.bb-start h2.kicker { color: var(--primary); }
.bb-startrow { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-end; }
.bb-nfield { width: 180px; }
.bb-nfield input { font-size: 22px; font-weight: 600; }
.bb-seglbl { font-size: 13px; color: var(--muted-foreground); }
.bb-seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-btn); overflow: hidden; background: var(--background); }
.bb-seg button { font: inherit; font-size: 14.5px; padding: 10px 16px; border: 0; background: none; color: var(--primary); cursor: pointer; }
.bb-seg button + button { border-left: 1px solid var(--line-strong); }
.bb-seg button[aria-pressed="true"] { background: var(--primary); color: var(--chrome-foreground); font-weight: 600; }
.bb-start h2.kicker { font-size: 20px; text-transform: none; letter-spacing: -0.015em; max-width: none; }
.bb-seg button { white-space: nowrap; }
@media (max-width: 480px) {
  .bb-startrow > .bb-field:last-child { width: 100%; }
  .bb-seg { display: flex; }
  .bb-seg button { flex: 1; padding: 10px 8px; font-size: 14px; }
}

/* Forudsætninger and Grundlag fold too, closed by default */
.bb-fine { gap: 0; }
.bb-finesub > summary { padding: 14px 28px 14px 0; }
.bb-finesub h3 { font-size: 17px; color: var(--primary); }
.bb-finesub > ul { padding-bottom: 14px; }
.bb-finesub + .bb-finesub { margin-top: 0; }
.bb-fine > .bb-finesub:first-child { border-top: 0; }
.bb-prow[hidden] { display: none; }
.bb-hint b { color: var(--primary); }

/* Field labels stay on one line, as wide as the input; overflow is cut with an
   ellipsis. The script marks a cut field with data-full, and the full text then
   shows in a bubble over the label on hover - and while the field has focus, since
   touch screens have no hover. The bubble floats, so nothing moves while typing. */
.bb-field > label, .bb-lblrow > label {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.bb-lblrow { min-width: 0; }
.bb-field { position: relative; }
.bb-field[data-full] > label { cursor: help; }
.bb-field[data-full]::before {
  content: attr(data-full); position: absolute; left: -6px; right: -6px; bottom: calc(100% - 22px); z-index: 5;
  padding: 6px 9px; border-radius: var(--radius-btn); background: var(--primary); color: var(--chrome-foreground);
  font-size: 13px; line-height: 1.35; box-shadow: 0 8px 20px rgba(10, 21, 38, 0.2);
  opacity: 0; visibility: hidden; pointer-events: none;
}
.bb-field[data-full]:has(label:hover)::before, .bb-field[data-full]:focus-within::before { opacity: 1; visibility: visible; }
@media (prefers-reduced-motion: no-preference) { .bb-field[data-full]::before { transition: opacity .15s var(--ease), visibility 0s linear .15s; } .bb-field[data-full]:has(label:hover)::before, .bb-field[data-full]:focus-within::before { transition-delay: 0s; } }
.bb-net small { display: block; font-size: 11.5px; color: var(--muted-foreground); line-height: 1.35; margin-top: 2px; }

/* "i" on the navy focus band */
.bb-split .bb-info { margin-left: 6px; vertical-align: 0.05em; width: 16px; height: 16px; font-size: 10.5px; display: inline-flex; border-color: var(--chrome-foreground); color: var(--chrome-foreground); }
.bb-split .bb-info:hover { background: var(--chrome-foreground); color: var(--primary); }
.bb-split .bb-info:focus-visible { outline-color: var(--chrome-foreground); }
