/* furnipilot.com, version 9: the integrations as a hub (design/ONTWERP-V9.md §3.5, prototype design/v9-proto/hub.html).
   Markup src/components/Hub.astro (data src/data/iconen.mjs KOPPELINGEN), script js/v9-hub.js. Loaded after css/v9.css.
   Furnipilot in the middle, what comes in on the left, what leaves on the right, Keten underneath. The logos are the main
   thing of every node; the accounting packages stay text until each documents mailbox is tested once (§7).
   Every node is a <details>: open on a computer and a tablet (the content is shown by CSS, a click does not fold it), one
   compact row on a phone that opens on a tap. Lines (961px and wider): solid hairlines computed from the layout by
   js/v9-hub.js, one dot travels each. 960px and less: a spine on the left with a short branch to every node.
   Motion: transform and opacity only; nodes come in once (js/v9-hub.js adds .wacht only when the hub is below the first
   screen and motion is allowed, so without JavaScript every node is visible); reduced motion shows still lines, no dots.
   Every rule is scoped to .hb9 (the plan cards of the page use .plan, so the badges here are .kp9). */

.hb9 { padding-block: var(--sectie); background: var(--wit); }
/* on its own page (/koppelingen) the hub opens the page: the top of a page head, not of a section */
.hb9-pagina .hb9 { padding-top: clamp(24px, 3vw, 40px); }
/* the breadcrumb in the measures of the function pages (.fp9 .kruimel9); on a phone it is hidden (v9-pagina.css) */
.hb9-pagina .kruimel9 { margin-bottom: clamp(32px, 4vw, 56px); }
@media (max-width: 760px) { .hb9-pagina .hb9 { padding-top: 56px; } }
.hb9-pagina .hb9-kop h1 { font-size: var(--t-h1); line-height: 1.04; }
.hb9-kop { display: grid; gap: 18px; max-width: 780px; }
.hb9-kop > *, .hb9-titel > * { margin: 0; }
.hb9-titel { display: grid; gap: 18px; }
.hb9-kop > p { font-size: var(--t-lead); line-height: 1.6; max-width: 58ch; color: var(--t); }
.hb9-net { position: relative; display: grid; grid-template-columns: minmax(0, 316px) minmax(0, 1fr) minmax(0, 446px); grid-template-rows: auto auto; gap: 24px 0; margin-top: clamp(32px, 3vw, 40px); }
.hb9-lijnen { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.hb9-lijnen .spoor { fill: none; stroke: var(--lijn-2); stroke-width: 1.5; }
.hb9-lijnen .spoor.keten { stroke: #C5CCD9; }
.hb9-lijnen circle { fill: var(--b); }
.hb9-lijnen circle.keten { fill: var(--ink); }
/* the right column (five nodes) sets the height of the row; the left column (three) and Furnipilot stand centred against
   it, so the two sides balance and every line leaves Furnipilot at the height of its node (js/v9-hub.js) */
.hb9-kolom { position: relative; z-index: 1; display: grid; align-content: start; gap: 8px; }
.hb9 .hb9-groep { margin: 0 0 4px; font-size: 0.8125rem; font-weight: 600; line-height: 1.4; letter-spacing: 0.04em; text-transform: uppercase; color: var(--s); text-wrap: initial; }
.hb9-in { grid-column: 1; grid-row: 1; align-self: center; }
.hb9-uit { grid-column: 3; grid-row: 1; }
.hb9-keten { position: relative; z-index: 1; grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; max-width: 900px; margin-inline: auto; width: 100%; }
.hb9-keten .hb9-groep { grid-column: 1 / -1; text-align: center; }

/* a node on a wide computer: one row with the logos, the name and the plan, then one line */
.hb9 .kn { display: block; border-radius: var(--r3); background: #FFFFFF; box-shadow: var(--e2); }
.hb9 .kn summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "beeld titel plan"; gap: 8px 12px; align-items: center; padding: 12px 16px 0; list-style: none; cursor: default; }
.hb9 .kn summary::-webkit-details-marker { display: none; }
.hb9 .kn summary::marker { content: ""; }
.hb9 .kn-beeld { grid-area: beeld; display: flex; align-items: center; gap: 6px; min-height: 28px; }
.hb9 .kn-beeld img { display: block; width: 26px; height: 26px; object-fit: contain; }
.hb9 .kn-ico { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--tint-2); color: var(--b-ink); }
.hb9 .kn-ico svg { width: 16px; height: 16px; }
.hb9 .kn--in .kn-ico { background: var(--ink); color: #FFFFFF; }
.hb9 .kn--keten .kn-ico { background: #EEF0F4; color: var(--ink); }
.hb9 .kn summary b { grid-area: titel; color: var(--ink); font-weight: 500; font-size: 1rem; line-height: 1.3; }
.hb9 .kn-plannen { grid-area: plan; display: flex; flex-wrap: wrap; justify-content: end; gap: 4px; }
/* the second badge of the spreadsheet node ("Export: elk plan") says what its line already says */
.hb9 .kn-plannen .kp9 + .kp9 { display: none; }
.hb9 .kn-pijl { display: none; }
.hb9 .kn-meer { padding: 6px 16px 12px; }
.hb9 .kn-meer p { margin: 0; font-size: 0.875rem; line-height: 1.45; color: var(--s); }
.hb9 .kn-meer p.kn-namen { margin-top: 6px; }
/* the plan badge, as in the app: grey for every plan, blue tint from Toonzaal, ink for Keten */
.hb9 .kp9 { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 0.75rem; font-weight: 500; line-height: 1; white-space: nowrap; background: var(--vlak); color: var(--s); box-shadow: inset 0 0 0 1px var(--lijn); }
.hb9 .kp9--toonzaal { background: var(--tint-2); color: var(--b-ink); box-shadow: none; }
.hb9 .kp9--keten { background: var(--ink); color: #FFFFFF; box-shadow: none; }
.hb9-legende .kp9 { height: 22px; padding: 0 8px; font-size: 0.75rem; }
/* Peppol is no brand of its own here: a small mark in the sentence of the accounting node (WAARHEID-V9 table C) */
.hb9 .kn-badge { display: inline-flex; align-items: center; gap: 4px; vertical-align: -2px; color: var(--ink); font-weight: 500; white-space: nowrap; }
.hb9 .kn-badge img { display: block; width: 14px; height: 14px; object-fit: contain; }

/* the centre: Furnipilot on the gsm and the computer, about 1.4 times the weight of a node */
.hb9-midden { grid-column: 2; grid-row: 1; position: relative; z-index: 1; display: grid; place-items: center; padding-inline: 46px; }
.hb9-kern { position: relative; width: min(100%, 392px); padding: 24px 24px 20px; border-radius: 26px; background: #FFFFFF; box-shadow: 0 0 0 1px rgba(62, 111, 216, 0.28), 0 4px 10px rgba(15, 27, 51, 0.05), 0 44px 80px -36px rgba(23, 48, 111, 0.55); text-align: center; }
.hb9-kern > img.hb9-logo { display: block; width: 172px; height: auto; margin: 16px auto 0; }
.hb9-kern > p { margin: 8px 0 0; font-size: 0.9375rem; line-height: 1.5; color: var(--s); }
.hb9-toestel { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 8px; margin-top: 14px; }
.hb9-toestel span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; background: var(--vlak); color: var(--ink); font-size: 0.8125rem; font-weight: 500; line-height: 1.2; }
.hb9-toestel svg { width: 16px; height: 16px; color: var(--b-ink); }
.hb9-stand { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--lijn); }
.hb9-stand .chip { height: 24px; padding: 0 9px; font-size: 0.75rem; }
/* a narrow card (a small computer) keeps the four statuses in two even rows, never three and one */
@container (max-width: 315px) {
  .hb9-stand { display: grid; grid-template-columns: repeat(2, max-content); justify-content: center; }
}
/* the two devices, drawn small: the same purchase (Lisa hoeksalon, Bevestigd) on the laptop and on the gsm, with real
   names, thumbnails and status chips as the app shows them. The drawing is 300 x 160 units; --u is one unit: 1px where
   the card is wide enough, less where it is narrower (the card is the container), smaller still on a phone. */
.hb9-kern { container-type: inline-size; }
.hb9-mini { --u: min(1px, calc(100cqw / 300)); position: relative; width: calc(300 * var(--u)); height: calc(160 * var(--u)); margin: 0 auto; text-align: left; }
.hb9-mini .mini-pc { position: absolute; right: 0; top: 0; width: calc(250 * var(--u)); }
.hb9-mini .mini-pc-scherm { padding: calc(6 * var(--u)); border-radius: calc(11 * var(--u)); background: #0B1220; }
.hb9-mini .mini-pc-beeld { position: relative; display: grid; align-content: start; gap: calc(5 * var(--u)); height: calc(122 * var(--u)); padding: calc(8 * var(--u)) calc(8 * var(--u)) 0 calc(28 * var(--u)); border-radius: calc(4 * var(--u)); background: #F3F6FB; overflow: hidden; }
.hb9-mini .mini-pc-beeld::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: calc(20 * var(--u)); background: #FFFFFF; border-right: 1px solid #E8ECF3; }
.hb9-mini .mini-pc-voet { height: calc(7 * var(--u)); margin: 0 calc(-12 * var(--u)); border-radius: 0 0 calc(7 * var(--u)) calc(7 * var(--u)); background: linear-gradient(180deg, #E3E8F0, #B5BFCF); }
.hb9-mini .mini-kop { display: block; margin: 0 0 calc(1 * var(--u)) calc(2 * var(--u)); font-size: calc(10 * var(--u)); font-weight: 700; line-height: 1.2; color: var(--ink); }
.hb9-mini .mini-rij { display: grid; grid-template-columns: calc(20 * var(--u)) minmax(0, 1fr) auto; gap: calc(6 * var(--u)); align-items: center; height: calc(28 * var(--u)); padding: 0 calc(6 * var(--u)) 0 calc(4 * var(--u)); border-radius: calc(6 * var(--u)); background: #FFFFFF; box-shadow: 0 1px 2px rgba(15, 27, 51, 0.06); }
.hb9-mini .mini-rij.lisa { box-shadow: 0 0 0 1px var(--b); }
.hb9-mini .duim { --d: calc(20 * var(--u)); border-radius: calc(4 * var(--u)); }
.hb9-mini b { min-width: 0; overflow: hidden; font-size: calc(10.5 * var(--u)); font-weight: 600; line-height: 1.2; color: var(--ink); white-space: nowrap; text-overflow: ellipsis; }
.hb9-mini .chip { height: calc(16 * var(--u)); padding: 0 calc(6 * var(--u)); gap: 0; font-size: calc(9 * var(--u)); }
.hb9-mini .mini-gsm { position: absolute; left: 0; bottom: 0; width: calc(84 * var(--u)); padding: calc(3.5 * var(--u)); border-radius: calc(15 * var(--u)); background: #0B1220; box-shadow: 0 10px 20px -10px rgba(15, 27, 51, 0.6); }
.hb9-mini .mini-gsm-beeld { display: grid; align-content: start; justify-items: start; gap: calc(5 * var(--u)); height: calc(142 * var(--u)); padding: calc(14 * var(--u)) calc(6 * var(--u)) 0; border-radius: calc(11.5 * var(--u)); background: #F3F6FB; }
.hb9-mini .mini-gsm-beeld .duim { width: 100%; height: calc(46 * var(--u)); border-radius: calc(7 * var(--u)); }
.hb9-mini .mini-gsm-beeld b { font-size: calc(10 * var(--u)); font-weight: 700; white-space: normal; }
.hb9-mini .mini-gsm-beeld .chip { height: calc(15 * var(--u)); padding: 0 calc(5 * var(--u)); font-size: calc(8.5 * var(--u)); }

.hb9-voet { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 28px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--lijn); font-size: 0.9375rem; color: var(--s); }
.hb9-legende { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.hb9-legende > span { display: inline-flex; align-items: center; gap: 8px; }

/* the nodes come in once, the centre first, then the sides (only when motion is allowed and js/v9-hub.js set .wacht) */
@media (prefers-reduced-motion: no-preference) {
  .hb9-net.wacht .kn, .hb9-net.wacht .hb9-kern { opacity: 0; transform: translateY(10px); }
  .hb9 .kn, .hb9-kern { transition: opacity 0.5s var(--uit), transform 0.6s var(--zacht-uit); }
  .hb9-in .kn:nth-of-type(2) { transition-delay: 0.08s; } .hb9-in .kn:nth-of-type(3) { transition-delay: 0.16s; }
  .hb9-uit .kn:nth-of-type(1) { transition-delay: 0.2s; } .hb9-uit .kn:nth-of-type(2) { transition-delay: 0.26s; }
  .hb9-uit .kn:nth-of-type(3) { transition-delay: 0.32s; } .hb9-uit .kn:nth-of-type(4) { transition-delay: 0.38s; }
  .hb9-uit .kn:nth-of-type(5) { transition-delay: 0.44s; } .hb9-keten .kn { transition-delay: 0.5s; }
  .hb9-lijnen { transition: opacity 0.8s 0.4s; }
  .hb9-net.wacht .hb9-lijnen { opacity: 0; }
}

/* on a computer and a tablet every node shows its line, even before js/v9-hub.js has opened it */
@media (min-width: 761px) {
  .hb9 .kn::details-content { content-visibility: visible; display: block; }
}

/* a computer: the head splits (title left, intro right) so the network starts higher; the package names of the
   accounting node are left to the Boekhouding section of the start page (they stay on /koppelingen) */
@media (min-width: 961px) {
  .hb9-kop { max-width: none; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); column-gap: 48px; align-items: end; }
  .hb9-kop > p { max-width: 46ch; font-size: 1.0625rem; line-height: 1.6; }
  .hb9-titel h2, .hb9-titel h1 { text-wrap: balance; }
  main:not(.hb9-pagina) .hb9 .kn-namen { display: none; }
  .hb9-spine-stip { display: none; }
}

/* a narrower computer or a tablet on its side: smaller columns, the name of a node under its logos */
@media (min-width: 961px) and (max-width: 1239px) {
  .hb9-net { grid-template-columns: minmax(0, 250px) minmax(0, 1fr) minmax(0, 290px); }
  .hb9-kern { padding: 20px 18px 18px; }
  .hb9 .kn summary { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "beeld plan" "titel titel"; gap: 8px 10px; padding: 12px 14px 0; }
  .hb9 .kn-plannen { align-self: start; }
  .hb9 .kn-meer { padding: 4px 14px 12px; }
  .hb9-keten { max-width: 760px; }
}

/* ------------------------------------------- 960px and less: a spine on the left, a short branch to every node */
@media (max-width: 960px) {
  .hb9-net { grid-template-columns: minmax(0, 1fr); gap: 12px; padding-left: 26px; }
  .hb9-in, .hb9-uit, .hb9-midden, .hb9-keten { grid-column: 1; grid-row: auto; }
  .hb9-midden { padding: 8px 0; justify-items: start; }
  .hb9-kern { width: 100%; max-width: 460px; text-align: left; box-shadow: 0 0 0 1px rgba(62, 111, 216, 0.28), 0 4px 10px rgba(15, 27, 51, 0.05), 0 24px 40px -28px rgba(23, 48, 111, 0.25); }
  .hb9-kern > img.hb9-logo { margin: 14px 0 0; }
  .hb9-mini { margin: 0; }
  .hb9-toestel, .hb9-stand { justify-content: start; }
  .hb9-keten { grid-template-columns: minmax(0, 1fr); max-width: none; }
  .hb9-keten .hb9-groep { text-align: left; }
  .hb9 .hb9-groep { margin-top: 12px; }
  .hb9-lijnen { display: none; }
  .hb9-net::before { content: ""; position: absolute; left: 7px; top: 34px; bottom: 26px; width: 2px; border-radius: 2px; background: var(--lijn-2); }
  .hb9 .kn, .hb9-kern { position: relative; }
  .hb9 .kn::before, .hb9-kern::before { content: ""; position: absolute; left: -18px; top: 26px; width: 18px; height: 1.5px; background: var(--lijn-2); }
  .hb9-spine-stip { position: absolute; left: 3px; top: 34px; width: 10px; height: 10px; border-radius: 50%; background: var(--b); box-shadow: 0 0 0 4px var(--b-zacht); opacity: 0; }
}
@media (max-width: 960px) and (prefers-reduced-motion: no-preference) {
  .hb9-spine-stip { animation: hb9-val 6s cubic-bezier(0.45, 0, 0.55, 1) infinite; }
  .hb9-net.rust .hb9-spine-stip { animation-play-state: paused; }
}
@keyframes hb9-val { 0% { transform: translateY(0); opacity: 0; } 8% { opacity: 1; } 92% { opacity: 1; } 100% { transform: translateY(var(--val, 900px)); opacity: 0; } }

/* a tablet upright: the nodes stay open, one row each on the spine (logos, name, plan, then the line); Furnipilot is one
   wide card with its two devices on the left */
@media (min-width: 761px) and (max-width: 960px) {
  .hb9 .kn summary { padding: 12px 18px 0; }
  .hb9 .kn-meer { padding: 4px 18px 14px; }
  .hb9 .kn::before { top: 26px; }
  .hb9-midden { justify-items: stretch; }
  .hb9-kern { max-width: none; display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: auto auto auto 1fr; gap: 0 32px; align-items: start; padding: 22px 26px; }
  .hb9-kern::before { top: 50%; }
  .hb9-mini { --u: 1px; grid-row: 1 / -1; align-self: center; }
  .hb9-kern > img.hb9-logo { margin: 0; }
  .hb9-kern > p { margin-top: 6px; }
  .hb9-stand { margin-top: 14px; padding-top: 12px; }
}

/* a phone: every node is one compact row (logos, name, plan, chevron); the line under it opens on a tap */
@media (max-width: 760px) {
  .hb9-kop { gap: 14px; }
  .hb9-titel { gap: 14px; }
  .hb9-net { gap: 8px; margin-top: 32px; }
  .hb9-kolom, .hb9-keten { gap: 8px; }
  .hb9 .kn { border-radius: 14px; box-shadow: var(--e1); }
  .hb9 .kn summary { grid-template-columns: auto minmax(0, 1fr) auto 16px; grid-template-areas: "beeld titel plan pijl"; gap: 10px; min-height: 52px; padding: 8px 12px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .hb9 .kn-beeld { gap: 5px; min-height: 0; }
  .hb9 .kn-beeld img { width: 22px; height: 22px; }
  .hb9 .kn-ico { width: 28px; height: 28px; border-radius: 8px; }
  .hb9 .kn-ico svg { width: 16px; height: 16px; }
  .hb9 .kn summary b { font-size: 0.9375rem; line-height: 1.25; }
  /* three logos (Excel, Google Sheets, Power BI) stay, a little closer together */
  .hb9 .kn-beeld[data-n="3"] { gap: 3px; }
  .hb9 .kn-beeld[data-n="3"] img { width: 20px; height: 20px; }
  /* that row puts its plan badge under the name, so the name keeps the width of the row */
  .hb9 .kn summary:has(.kn-beeld[data-n="3"]) { grid-template-columns: auto minmax(0, 1fr) 16px; grid-template-areas: "beeld titel pijl" "beeld plan pijl"; gap: 4px 10px; }
  .hb9 .kn summary:has(.kn-beeld[data-n="3"]) .kn-plannen { justify-content: start; }
  .hb9 .kp9 { height: 24px; padding: 0 9px; font-size: 0.8125rem; }
  .hb9 .kn-plannen { align-self: center; }
  .hb9 .kn-pijl { grid-area: pijl; display: block; width: 16px; height: 16px; color: var(--s2); transition: transform 0.2s var(--uit); }
  .hb9 .kn[open] .kn-pijl { transform: rotate(180deg); }
  .hb9 .kn-meer { padding: 0 12px 12px; }
  .hb9 .kn::before { top: 25px; }
  .hb9-kern { padding: 14px 16px; border-radius: 18px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: center; }
  .hb9-kern::before { top: 50%; }
  /* the same drawing, as a small picture beside the name */
  .hb9-mini { --u: 0.36px; grid-row: span 3; }
  .hb9-mini .mini-gsm { box-shadow: 0 4px 8px -4px rgba(15, 27, 51, 0.6); }
  .hb9-kern > img.hb9-logo { width: 128px; margin: 0; }
  .hb9-kern > p { margin: 0; font-size: 0.8125rem; }
  .hb9-toestel { margin: 2px 0 0; }
  .hb9-toestel span { padding: 3px 8px; font-size: 0.75rem; }
  .hb9-stand { display: none; }
  .hb9-voet { margin-top: 24px; font-size: 0.875rem; }
  .hb9-legende { gap: 8px 12px; }
}
/* a small phone: the plan badge goes under the name, so the name keeps the width of the row */
@media (max-width: 380px) {
  .hb9 .kn summary { grid-template-columns: auto minmax(0, 1fr) 16px; grid-template-areas: "beeld titel pijl" "beeld plan pijl"; gap: 4px 10px; padding-block: 9px; }
  .hb9 .kn-plannen { justify-content: start; }
}
@media (hover: hover) and (pointer: fine) and (max-width: 760px) {
  .hb9 .kn summary:hover b { color: var(--b-ink); }
}
