/* =============================================================================
   KOTOVA BOOKS · product overview (kotova.io/books) — page-specific styles
   -----------------------------------------------------------------------------
   Load AFTER /styles.css and /books/books.css, on books/index.html only.
   Leak rules as in books.css:
     • page parts are prefixed bkp- (books product);
     • app-mock additions are scoped under .bk-app (the app's own tokens) and
       follow the Kotova Books app's class names (rvm-*, pbar, ai-chat …);
     • nothing styles bare elements, html or body; :root is untouched.

   Sections
     1. Hero V3 "Handy-Scan": copy, receipt + phone, the three layouts, reveal
     2. Flow: Sources → Review → Books → Reports
     3. Capability visuals (real-size app cards beside the split rows)
     4. Pricing teaser tiles
     5. Review list mock (M2, "Zu prüfen · Eingang"): page tweaks to books.css §16b
     6. App mock: the review item header and the AI buttons — hero phone
     6b. App mock: AI suggestion chat (phone bottom sheet) — hero phone
     7. App mock: mini visuals (journal, books, valuation, net positions)
   ========================================================================== */


/* =============================================================================
   1. HERO V3 — "Handy-Scan" (owner 26.11.2026)
   <section class="bk-hero bkp-hero bkp-hero--snap"><div class="container bk-hero-inner">
     <div class="bk-hero-copy bkp-snap-copy">h1, lead, CTA, chips</div>
     <div class="bk-hero-visual bkp-snap-visual">
       <figure class="bkp-snap-fig" role="img">
         <div class="bkp-rc-wrap"><div class="bkp-rc">the paper receipt</div></div>
         <span class="bkp-snap-glow"></span>
         <div class="bkp-phone"><div class="bkp-phone-screen"><div class="bk-app bkp-snap-app">
           header.mtop · .content (the item card) · .scrim · section.ai-chat (the sheet)</div></div></div>
       </figure>
       <p class="bkp-snap-cap">…</p> <script>reveal</script></div></div></section>
   Layouts by viewport:
     >= 1024  split: copy left, the visual right. The phone sits at the right
              end of the column, the receipt starts at its left edge and is
              tucked behind the phone (a narrower column hides more of it).
              The visual bleeds into the right margin by up to 72 px.
     601-1023 stacked: the copy, then the same composition centred (<= 604 px).
     <= 600   the phone board: no bezel, the top of the receipt peeks above the
              app screen, the screen is the column's width, the chips follow
              the caption.
   Nothing is scaled. The phone screen is 375 px wide (>= 601) or the column's
   width (<= 600), so the app lays itself out in its own phone layout
   (container bkapp <= 600) at its real text sizes (>= 11 px). The screen's
   height follows its content: the sheet sits in the flow below a window onto
   the item card (the eyebrow and one title line), so a longer language makes
   the phone taller and never clips the sheet. Measured by
   SCRATCH/ea/v3/measure-v3.cjs (6 languages x 17 viewports: overflow,
   >= 11 px, CTA above the fold, clipping, overlap).
   ========================================================================== */

/* Body copy wraps whole words: the site's global rule hyphenates every
   paragraph, which splits acronyms and terms ("DA-TEV", "Zu-gangsposten").
   overflow-wrap from that rule still breaks a word longer than its line. */
.bkp p,
.bkp li {
    -webkit-hyphens: manual;
    hyphens: manual;
}

/* --- copy: the board's sizes (56 px headline at 1440, lead, CTA, chips) --- */
.bkp-hero--snap .bk-hero-inner {
    gap: 0;
}

/* Space Grotesk arrives a moment after Inter. Until then the headline is set
   in Arial Bold sized to Space Grotesk 700 (the six headlines' lines within
   about 2 % in width, not Inter's 2-4 % wider set), so it wraps the same and
   nothing below it jumps (CLS; it at 390 px went from 2 lines to 3 and back).
   Latin only, like Space Grotesk: Cyrillic still falls through to Inter. */
@font-face {
    font-family: "bkp Space Grotesk Fallback";
    src: local("Arial Bold"), local("Arial-BoldMT");
    font-weight: 700;
    font-display: swap;
    size-adjust: 99.5%;
    ascent-override: 98.5%;
    descent-override: 29.1%;
    line-gap-override: 0%;
    unicode-range: U+0000-02FF, U+1D00-1DBF, U+1E00-1EFF, U+2000-206F, U+20A0-20C4, U+2113, U+2122, U+2191, U+2193, U+2212, U+2215, U+2C60-2C7F, U+A720-A7FF, U+FEFF, U+FFFD;
}

.bkp-hero--snap .bk-h1 {
    font-family: "Space Grotesk", "bkp Space Grotesk Fallback", "Inter", sans-serif;
    font-size: clamp(2.25rem, 4.6vw, 3.5rem);
}

.bkp-hero--snap .bk-lead {
    max-width: 40rem;
    margin-top: var(--spacing-lg);
}

.bkp-hero--snap .bk-hero-cta {
    margin-top: var(--spacing-xl);
}

.bkp-hero--snap .bk-chips {
    margin-top: var(--spacing-lg);
}

/* above the phone's and the receipt's shadows (z-index 1-2 in the figure),
   which would otherwise dim the sample-data note to ~2.3:1 */
.bkp-snap-cap {
    position: relative;
    z-index: 3;
    max-width: 34rem;
    margin: 20px auto 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-text-secondary);
    text-align: center;
    text-wrap: balance;
}

/* --- layouts --- */
@media (min-width: 1024px) {
    .bkp-hero.bkp-hero--snap {
        padding-top: calc(var(--bk-offset) + 24px);
        padding-bottom: 72px;
    }

    /* copy 580 + 40 + visual 532 at 1152 (the board); the visual keeps
       >= 420 px (the 395 px phone and a strip of the receipt) */
    .bkp-hero--snap .bk-hero-inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) clamp(420px, 100% - 480px, 532px);
        column-gap: 40px;
        align-items: start;
    }

    .bkp-snap-copy {
        padding-top: 64px;
    }

    /* bleed right up to 72 px, always keeping a 24 px gutter */
    .bkp-snap-visual {
        margin-right: calc(-1 * clamp(0px, (100vw - 1152px) / 2 - 24px, 72px));
    }
}

@media (max-width: 1023.98px) {
    .bkp-hero.bkp-hero--snap {
        padding-top: calc(var(--bk-offset) + 56px);
    }

    .bkp-hero--snap .bk-hero-inner {
        display: block;
    }

    .bkp-snap-visual {
        margin-top: var(--spacing-2xl);
    }
}

/* phone: the copy, the visual, the caption, then the chips (one flex column;
   the two wrappers step aside with display: contents). The copy sits 47 px
   tighter than on the board (top offset, lead leading, CTA gap), so the
   "KI-Vorschlag" sheet's head is in the first screen at 390x844 and the sheet
   plays at load. */
@media (max-width: 600px) {
    .bkp-hero.bkp-hero--snap {
        padding-top: calc(var(--bk-offset) + 32px);
    }

    .bkp-hero--snap .bk-lead {
        line-height: 1.55;
    }

    .bkp-hero--snap .bk-hero-cta {
        margin-top: var(--spacing-lg);
    }

    .bkp-hero--snap .bk-hero-inner {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .bkp-snap-copy,
    .bkp-snap-visual {
        display: contents;
    }

    .bkp-hero--snap .bk-chips {
        order: 1;
        margin-top: 20px;
    }
}

/* --- the composition --- */
.bkp-snap-fig {
    position: relative;
    margin: 0;
}

.bkp-snap-fig .bkp-rc-wrap {
    z-index: 1;
}

.bkp-phone {
    position: relative;
    z-index: 2;
}

.bkp-phone-screen {
    position: relative;
    overflow: hidden;
    background: #0A0F1C;
}

/* soft light behind the phone: the app's AI azure into the page's gold */
.bkp-snap-glow {
    position: absolute;
    z-index: 1;
    top: 36px;
    right: -36px;
    width: 460px;
    height: 700px;
    border-radius: 50%;
    background:
        radial-gradient(closest-side, rgba(90, 168, 247, 0.2), transparent 72%),
        radial-gradient(closest-side at 70% 60%, rgba(197, 165, 114, 0.14), transparent 80%);
    filter: blur(10px);
    pointer-events: none;
}

/* >= 601: the receipt on the table at the left, the phone in a plain bezel
   (no status bar) at the right. Both share one grid cell, so the figure is
   as tall as the taller of the two (the phone grows with a longer language,
   the receipt's height is fixed) and nothing runs into the caption. */
@media (min-width: 601px) {
    .bkp-snap-fig {
        display: grid;
        grid-template: "stage" auto / minmax(0, 1fr);
        max-width: 604px;
        margin: 0 auto;
    }

    .bkp-snap-fig .bkp-rc-wrap {
        position: relative;
        grid-area: stage;
        align-self: start;
        justify-self: start;
        margin: 36px 0 0 2px;   /* the rotated top corner reaches 25 px further left, into the column gap */
    }

    .bkp-phone {
        grid-area: stage;
        align-self: start;
        justify-self: end;
        width: 395px;           /* the 375 px screen + 2 x 10 px bezel */
        padding: 10px;
        border-radius: 50px;
        background: linear-gradient(160deg, #2A3348, #0B0F18 40%, #1A2131);
        box-shadow:
            0 0 0 1px rgba(255, 255, 255, 0.08) inset,
            0 0 0 2px #05070C,
            0 60px 100px -30px rgba(0, 0, 0, 0.9),
            0 20px 40px -12px rgba(0, 0, 0, 0.6);
    }

    .bkp-phone-screen {
        border-radius: 40px;
    }
}

/* stacked (no column gap): the paper's rotated corner stays inside the column */
@media (min-width: 601px) and (max-width: 1023.98px) {
    .bkp-snap-fig .bkp-rc-wrap {
        margin-left: 26px;
    }
}

/* <= 600: no phone in a phone. The top of the receipt peeks above the app
   screen (only its head is drawn, so no corner shows beside a 288 px screen
   at 320); the screen is the column's width. */
@media (max-width: 600px) {
    .bkp-snap-fig {
        margin-top: 20px;
        padding-top: 96px;
    }

    .bkp-snap-fig .bkp-rc-wrap {
        --rc-w: 266px;
        position: absolute;
        top: 14px;
        left: 50%;
        height: 150px;
        margin-left: -133px;
        overflow: hidden;
    }

    .bkp-snap-glow {
        display: none;
    }

    .bkp-phone {
        border: 1px solid rgba(255, 255, 255, 0.16);
        border-radius: 24px;
        background: #0A0F1C;
        box-shadow: 0 -20px 40px -10px rgba(0, 0, 0, 0.55);
    }

    .bkp-phone-screen {
        border-radius: 23px;
    }
}

/* --- the paper receipt (Brasserie Nordlicht): thermal paper, mono print, a
   fold, a serrated tear. German in every language; decorative (aria-hidden,
   the figure's label names it); every size >= 11 px. --- */
.bkp-rc-wrap {
    --rc-w: 260px;
    --rc-rot: -4deg;
    width: var(--rc-w);
    transform: rotate(var(--rc-rot));
    filter: drop-shadow(0 34px 34px rgba(0, 0, 0, 0.6)) drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4));
}

.bkp-rc {
    --z: 6px;
    position: relative;
    padding: 22px 19px calc(22px + var(--z));
    color: #2D2A25;
    font: 500 11px/1.55 "JetBrains Mono", ui-monospace, Menlo, monospace;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
    text-align: left;
    /* the paper must not be the brightest thing in the hero */
    filter: brightness(0.9);
    background:
        linear-gradient(180deg, transparent 52%, rgba(70, 58, 40, 0.1) 52.3%, rgba(255, 255, 255, 0.55) 52.8%, transparent 54.5%),
        linear-gradient(90deg, rgba(80, 64, 40, 0.16), transparent 7%, transparent 91%, rgba(80, 64, 40, 0.18)),
        radial-gradient(130% 55% at 25% 0%, rgba(255, 255, 255, 0.6), transparent 62%),
        linear-gradient(180deg, transparent 70%, rgba(80, 64, 40, 0.08)),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .32  0 0 0 0 .27  0 0 0 0 .2  0 0 0 .55 -.18'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
        #F1EDE3;
    -webkit-mask:
        conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(2 * var(--z)) var(--z) repeat-x,
        linear-gradient(#000 0 0) top / 100% calc(100% - var(--z)) no-repeat;
    mask:
        conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(2 * var(--z)) var(--z) repeat-x,
        linear-gradient(#000 0 0) top / 100% calc(100% - var(--z)) no-repeat;
}

/* light falls off towards the top: the lower half (Bar, MwSt, Anlass) is the brightest zone */
.bkp-rc::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(10, 14, 25, 0.35), transparent 45%);
    pointer-events: none;
}

/* thermal print fades a little in bands */
.bkp-rc::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 30%, rgba(241, 237, 227, 0.35) 36%, transparent 44%, transparent 72%, rgba(241, 237, 227, 0.28) 78%, transparent 86%);
    pointer-events: none;
}

.bkp-rc * {
    -webkit-hyphens: manual;
    hyphens: manual;
    word-break: normal;
    overflow-wrap: normal;
}

.bkp-rc-mark { display: block; width: 46px; height: 16px; margin: 0 auto 8px; }
.bkp-rc-name { font: 700 17px/1.1 "JetBrains Mono", ui-monospace, monospace; letter-spacing: 0.16em; text-align: center; text-shadow: 0 0 0.5px rgba(45, 42, 37, 0.8); }
.bkp-rc-sub { margin-top: 4px; text-align: center; letter-spacing: 0.06em; }
.bkp-rc-addr { margin-top: 5px; text-align: center; line-height: 1.5; }

.bkp-rc-row { display: flex; justify-content: space-between; gap: 10px; white-space: nowrap; }
.bkp-rc-row > span:first-child { overflow: hidden; }
.bkp-rc-row > span:last-child { text-align: right; }
.bkp-rc-row .t { display: inline-block; width: 1.2em; text-align: right; opacity: 0.75; }
.bkp-rc-items { opacity: 0.6; }
.bkp-rc-bar { font-weight: 700; }

.bkp-rc hr { height: 0; margin: 7px 0; border: 0; border-top: 1px dashed rgba(45, 42, 37, 0.5); }
.bkp-rc hr.dbl { height: 3px; border-top: 1px solid rgba(45, 42, 37, 0.55); border-bottom: 1px solid rgba(45, 42, 37, 0.55); }
.bkp-rc-total { font-weight: 700; font-size: 12.5px; letter-spacing: 0.02em; }

.bkp-rc-tax { display: grid; grid-template-columns: 3.6em 1fr 1fr 1fr; column-gap: 8px; white-space: nowrap; }
.bkp-rc-tax > span { text-align: right; }
.bkp-rc-tax > span:nth-child(4n + 1) { text-align: left; white-space: pre; }
.bkp-rc-tax .th { opacity: 0.7; }

.bkp-rc-tse { margin-top: 2px; line-height: 1.45; opacity: 0.62; white-space: nowrap; }
.bkp-rc-foot { margin-top: 8px; text-align: center; }

/* "Angaben zum Nachweis von Bewirtungsaufwendungen": left blank on the bon */
.bkp-rc-bew { margin-top: 10px; padding-top: 8px; border-top: 1px dashed rgba(45, 42, 37, 0.5); line-height: 1.7; }
.bkp-rc-bew b { display: block; margin-bottom: 2px; font-weight: 700; letter-spacing: 0.04em; }
.bkp-rc-bew .ln { display: flex; gap: 6px; }
.bkp-rc-bew .ln i { flex: 1; border-bottom: 1px dotted rgba(45, 42, 37, 0.55); transform: translateY(-4px); }

/* --- the app on the phone screen: its phone layout (books.css §16), the
   review item header (§6) and the KI-Vorschlag sheet (§6b) --- */

/* a window onto the item card: the eyebrow (1-3 lines, by language and
   width) and exactly one whole line of the title show above the sheet, as on
   the board. The window ends on the card's bottom padding, which the sheet's
   20 px overlap covers, so no line of text is ever cut through; the card is
   tall enough that the photo shows whole. */
.bk-app.bkp-snap-app .content {
    padding-bottom: 0;
    overflow: hidden;
}

.bk-app.bkp-snap-app .rvm-h {
    position: relative;
    min-height: 96px;       /* the photo (10 + 54 px) + 12 px, above the sheet's overlap */
    padding-right: 64px;    /* room for the photo */
    padding-bottom: 22px;   /* the sheet's 20 px overlap + 2 px under the title line */
}

.bk-app.bkp-snap-app .rvm-t {
    max-height: 1.25em;     /* one line (line-height 1.25) */
    max-height: 1lh;
    overflow: hidden;
}

/* a screen narrower than a phone (the 288 px column at 320): the app bar
   drops its search button and the sheet's eyebrow may wrap, so the title,
   "Posten 1 von 3 · …" and "Kotova GmbH · 1 Beleg" stay whole in every language */
@container bkapp (max-width: 340px) {
    .bk-app.bkp-snap-app .mtop .icon-btn {
        display: none;
    }

    .bk-app.bkp-snap-app .ai-chat .dlg-h .eyebrow {
        white-space: normal;
    }
}

/* the photographed receipt as the item's evidence thumbnail */
.bk-app .bkp-thumb {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 2;
    width: 40px;
    height: 54px;
    overflow: hidden;
    border: 1px solid var(--hairline-strong);
    border-radius: 6px;
    background: #3A3630;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5);
}

.bk-app .bkp-thumb svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* The sheet (§6b) follows the window in the flow, so its height is its
   content's and nothing is ever clipped; its rounded top overlaps the
   window by 20 px. */
.bk-app.bkp-snap-app .ai-chat {
    margin-top: -20px;
}

/* a little tighter than the app's sheet, as on the board */
.bk-app.bkp-snap-app .ai-chat .dlg-b {
    padding-top: 10px;
    padding-bottom: 12px;
}

.bk-app.bkp-snap-app .ai-prop-lines tr {
    padding: 3px 0;
}

/* --- Reveal: each step plays once, when its top is 40 px inside the
   viewport, so nothing plays out below the fold. Steps (data-step): 0 the
   receipt settles on the table, 1 the phone rises, 2 the sheet slides up
   over the dimmed app (sheet, and the scrim riding along unobserved:
   data-ride), 3 the explanation (bubble and its
   sparkles icon), 4 the proposal card, 5 the question, 6 "Fill in" turns
   active. At 1440x900 steps 0-5 play at load (done by about 1.5 s); "Fill
   in" sits just below the fold there and turns active on the first scroll.
   On phones each plays as it scrolls in. The inline script in index.html
   sets .js-reveal on the figure, then .is-in and --d (its delay) on each
   step; a step that comes into view also starts the earlier ones that have
   not played, 200 ms apart (the first after 120 ms). In any language but
   English the observer starts once the copy is translated, so no step
   starts in the English layout and then sits below the fold. The hidden
   states keep every step inside its clip box (the sheet moves 56 px, not
   off the screen), so the observer always sees it. Only opacity and
   transform move, so nothing shifts. Without JS, under reduced motion and
   in print the complete static state shows. */
.bkp-snap-fig.js-reveal [data-step]:not(.is-in) {
    opacity: 0;
}

.bkp-snap-fig.js-reveal [data-step="6"]:not(.is-in) {
    opacity: 0.45;
}

.bkp-snap-fig.js-reveal [data-step].is-in {
    animation: bkp-snap-in 380ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
    animation-delay: var(--d, 120ms);
}

.bkp-snap-fig.js-reveal .bkp-rc-wrap.is-in {
    animation-name: bkp-snap-settle;
    animation-duration: 700ms;
}

.bkp-snap-fig.js-reveal .bkp-phone.is-in {
    animation-name: bkp-snap-rise;
    animation-duration: 600ms;
}

.bkp-snap-fig.js-reveal .scrim.is-in {
    animation-name: bkp-snap-fade;
}

.bkp-snap-fig.js-reveal .ai-chat.is-in {
    animation-name: bkp-snap-sheet;
    animation-duration: 520ms;
}

/* No translate: in the app "Fill in" is disabled until a proposal exists. */
.bkp-snap-fig.js-reveal [data-step="6"].is-in {
    animation-name: bkp-snap-arm;
}

@keyframes bkp-snap-settle {
    from { opacity: 0; transform: translate(-12px, -18px) rotate(calc(var(--rc-rot) - 5deg)); }
    to { opacity: 1; transform: rotate(var(--rc-rot)); }
}

@keyframes bkp-snap-rise {
    from { opacity: 0; transform: translateY(28px); }
    to { opacity: 1; transform: none; }
}

@keyframes bkp-snap-sheet {
    from { opacity: 0; transform: translateY(56px); }
    to { opacity: 1; transform: none; }
}

@keyframes bkp-snap-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}

@keyframes bkp-snap-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bkp-snap-arm {
    from { opacity: 0.45; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .bkp-snap-fig [data-step] {
        opacity: 1 !important;
        animation: none !important;
    }
}

/* Print: the complete static state. The phone's big soft shadow prints as a
   hard black block over the receipt and the glow as a smudge, so both go; the
   receipt (mask, paper) and the app screen need their backgrounds even when
   "background graphics" is off; the gold gradient words print in solid gold
   instead of vanishing. */
@media print {
    .bkp-snap-fig [data-step] {
        opacity: 1 !important;
        animation: none !important;
    }

    .bkp-phone {
        box-shadow: none;
    }

    .bkp-snap-glow {
        display: none;
    }

    .bkp-snap-fig {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .bkp-hero--snap .bk-gold {
        background: none;
        -webkit-text-fill-color: currentColor;
        color: #9A7A40;
    }
}


/* =============================================================================
   2. FLOW — four stations every euro and token passes
   <ol class="bkp-flow"><li class="bkp-flow-step">…</li>…</ol>
   ========================================================================== */

.bkp-flow {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    --bkp-flow-gap: 40px;
    column-gap: var(--bkp-flow-gap);
    row-gap: 0;
    margin: 0;
    padding: 0;
}

/* Each station spans three rows of the list (head, text, list) through a
   subgrid, so titles, texts and lists line up across the stations. */
.bkp-flow-step {
    position: relative;
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
    row-gap: var(--spacing-md);
    align-content: start;
    min-width: 0;
    padding: var(--spacing-lg);
    background: var(--gradient-card);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-xl);
    transition: border-color var(--transition-normal), transform var(--transition-normal), box-shadow var(--transition-normal);
}

.bkp-flow-step:hover {
    border-color: rgba(197, 165, 114, 0.45);
    box-shadow: var(--shadow-lg);
}

@media (prefers-reduced-motion: no-preference) {
    .bkp-flow-step:hover {
        transform: translateY(-4px);
    }
}

.bkp-flow-ico {
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.bkp-flow-step:hover .bkp-flow-ico {
    background: rgba(197, 165, 114, 0.18);
    border-color: var(--bk-gold-line);
}

.bkp-flow-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "ico . n" "t t t";
    align-items: center;
    column-gap: 14px;
    row-gap: var(--spacing-md);
}

.bkp-flow-head .bk-h3 {
    grid-area: t;
    margin: 0;
}

.bkp-flow-ico {
    grid-area: ico;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    background: var(--bk-gold-tint);
    border: 1px solid var(--color-border);
    color: var(--color-secondary);
    flex: none;
}

.bkp-flow-ico .bk-ico {
    width: 24px;
    height: 24px;
}

.bkp-flow-n {
    grid-area: n;
    font-family: var(--bk-figures);
    font-variant-numeric: tabular-nums;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
}

.bkp-flow-step .bk-text {
    font-size: 0.95rem;
    line-height: 1.6;
}

.bkp-flow-list {
    list-style: none;
    display: grid;
    gap: 9px;
    align-self: start;
    margin: 0;
    padding: var(--spacing-md) 0 0;
    border-top: 1px solid var(--color-border-light);
}

.bkp-flow-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--bk-ink-2);
}

.bkp-flow-list .bk-ico {
    width: 16px;
    height: 16px;
    margin-top: 1px;
    color: var(--color-secondary);
}

/* The arrow between two stations: a bare chevron centred in the gap, on the
   icon's line. It nudges forward while its station is hovered. */
.bkp-flow-step:not(:last-child)::after {
    content: "";
    position: absolute;
    z-index: 2;
    top: calc(var(--spacing-lg) + 12px);
    right: calc(-1 * var(--bkp-flow-gap));
    width: var(--bkp-flow-gap);
    height: 24px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C5A572' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / 24px 24px no-repeat;
    opacity: 0.8;
    pointer-events: none;
    transition: transform var(--transition-normal), opacity var(--transition-normal);
}

@media (prefers-reduced-motion: no-preference) {
    .bkp-flow-step:not(:last-child):hover::after {
        transform: translateX(4px);
    }
}

.bkp-flow-step:not(:last-child):hover::after {
    opacity: 1;
}

.bkp-flow-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm) var(--spacing-lg);
    margin-top: var(--spacing-xl);
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    text-align: center;
}

.bkp-flow-foot > span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.bkp-flow-foot .bk-ico {
    width: 16px;
    height: 16px;
    color: var(--color-success);
}

@media (max-width: 1100px) {
    .bkp-flow {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bkp-flow-step:nth-child(n+3) {
        margin-top: var(--spacing-lg);
    }

    /* Only the arrows between left and right neighbours stay. */
    .bkp-flow-step:nth-child(2)::after {
        display: none;
    }
}

@media (max-width: 640px) {
    .bkp-flow {
        grid-template-columns: minmax(0, 1fr);
    }

    .bkp-flow-step:nth-child(n+2) {
        margin-top: var(--spacing-xl);
    }

    /* Icon, title and number on one line. */
    .bkp-flow-head {
        grid-template-areas: "ico t n";
    }

    .bkp-flow-ico {
        width: 44px;
        height: 44px;
    }

    .bkp-flow-step:nth-child(2)::after {
        display: block;
    }

    /* Arrows point down between stacked stations. */
    .bkp-flow-step:not(:last-child)::after {
        top: auto;
        right: auto;
        bottom: calc(-1 * var(--spacing-xl) / 2 - 12px);
        left: calc(50% - var(--bkp-flow-gap) / 2);
        transform: rotate(90deg);
    }

    @media (prefers-reduced-motion: no-preference) {
        .bkp-flow-step:not(:last-child):hover::after {
            transform: rotate(90deg) translateX(4px);
        }
    }
}


/* =============================================================================
   3. CAPABILITY VISUALS
   <figure class="bkp-vis" role="img" aria-label="…"><div class="bk-app bkp-mini">
     … app cards at real size … </div></figure>
   The cards are the app's own components at 100 % (no scaling), so the
   figures stay legible on every screen.
   ========================================================================== */

.bkp-caps .bk-split + .bk-split {
    margin-top: 120px;
}

.bkp-vis {
    position: relative;
    margin: 0;
    isolation: isolate;
}

/* Soft gold glow behind the card, kept inside the figure's box. */
.bkp-vis::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 6% 3%;
    border-radius: 40px;
    background: radial-gradient(60% 55% at 50% 45%, rgba(197, 165, 114, 0.16), transparent 72%);
    filter: blur(24px);
    pointer-events: none;
}

.bk-app.bkp-mini {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border-light);
    box-shadow: var(--shadow-xl);
}

.bkp-caps .bk-checks {
    gap: 12px;
}

@media (max-width: 1024px) {
    .bkp-caps .bk-split + .bk-split {
        margin-top: var(--spacing-4xl);
    }

    /* Centred under the full-width text, as /books/accountants and the
       homepage sections centre their stacked visuals. */
    .bkp-vis {
        max-width: 640px;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 480px) {
    .bk-app.bkp-mini {
        padding: 10px;
        gap: 10px;
        border-radius: var(--radius-lg);
    }
}


/* Feature and module cards on phones: the icon sits beside the title and
   the text runs full width below, so six cards stay a short column. */
@media (max-width: 640px) {
    .bkp-cards .bk-card {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr);
        column-gap: 16px;
        row-gap: 6px;
        align-items: start;
        padding: 20px;
    }

    .bkp-cards .bk-card-icon {
        width: 44px;
        height: 44px;
        margin: 0;
    }

    .bkp-cards .bk-card-title {
        align-self: center;
    }

    .bkp-cards .bk-card-text {
        grid-column: 1 / -1;
        margin-top: 6px;
    }
}


/* =============================================================================
   4. PRICING TEASER
   ========================================================================== */

.bkp-plans {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--spacing-md);
}

.bkp-plan {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    padding: 24px 22px 22px;
    background: var(--gradient-card);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-xl);
}

.bkp-plan--hot {
    border-color: rgba(197, 165, 114, 0.65);
    background: linear-gradient(165deg, rgba(197, 165, 114, 0.12) 0%, rgba(21, 28, 44, 0.92) 48%);
    box-shadow: 0 0 0 1px rgba(197, 165, 114, 0.22), 0 24px 60px rgba(0, 0, 0, 0.4);
}

.bkp-plan .bk-plan-badge {
    top: -13px;
}

.bkp-plan-name {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text-primary);
}

.bkp-plan-for {
    min-height: 2.9em;
    margin-top: 2px;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--color-text-secondary);
}

.bkp-plan-price {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
}

.bkp-plan-amt {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--color-text-primary);
}

.bkp-plan-from {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.bkp-plan-per {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.bkp-plan-meters {
    list-style: none;
    display: grid;
    gap: 7px;
    margin: 4px 0 0;
    padding: 12px 0 0;
    border-top: 1px solid var(--color-border-light);
}

.bkp-plan-meters li {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--color-text-secondary);
}

.bkp-plan-meters li::before {
    content: "";
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--bkp-mc, var(--color-secondary));
    transform: translateY(-1px);
}

.bkp-plan-meters .m-entries { --bkp-mc: var(--bk-m-ledger); }
.bkp-plan-meters .m-ai { --bkp-mc: var(--bk-m-ai); }
.bkp-plan-meters .m-seats { --bkp-mc: var(--bk-m-payroll); }
.bkp-plan-meters .is-off { opacity: 0.7; }

.bkp-plan-meters b {
    font-family: var(--bk-figures);
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-primary);
    white-space: nowrap;
}

.bkp-pricing-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md) var(--spacing-xl);
    margin-top: var(--spacing-lg);
}

.bkp-pricing-foot .bk-fine {
    margin-top: 0;
}

.bkp-pricing .bk-note {
    margin-bottom: var(--spacing-lg);
}

/* Plans v4: three plans; one column, centred, below 901px (a 2-up grid
   would leave Business alone in a row). */
@media (max-width: 900px) {
    .bkp-plans {
        grid-template-columns: minmax(0, 1fr);
        max-width: 560px;
        margin-left: auto;
        margin-right: auto;
        gap: var(--spacing-lg);
    }
}

@media (max-width: 560px) {
    .bkp-plans {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--spacing-lg);
    }

    .bkp-plan-for {
        min-height: 0;
    }

    .bkp-pricing-foot .btn {
        width: 100%;
    }
}


/* =============================================================================
   5. REVIEW LIST MOCK (M2, "Zu prüfen · Eingang") — page tweaks only; the
   list itself is the kit's §16b (.rv-*, .tag-mod, .conf, .ibx-create).
   ========================================================================== */

/* Tab strip: the app's order (Eingang, Ohne Zuordnung, Entwürfe, Rückfragen)
   stays a prefix; tabs drop from the end where the next one would be cut
   (measured content widths: 4 tabs need 638 px, 3 need 483, 2 need 345).
   "Rückfragen" goes first (606 px at 701-1100, 510 beside the copy), then
   "Entwürfe"; both counts stay in the KPI tiles below. On a phone (336 /
   321 px) even the second tab runs off, so the strip's right end fades over
   28 px, as the app's own scrolling strips do ("strip-more",
   app-shell.css). */
@container bkapp (max-width: 645px) {
    .bk-app .rv-tab-q { display: none; }
}

@container bkapp (max-width: 490px) {
    .bk-app .rv-tab-x { display: none; }
}

@container bkapp (max-width: 352px) {
    .bkp-rv .rv-tabs {
        -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
        mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    }
}

/* KPI tiles in one row of four (app 640 px, tiles 151 px): the kit's 18 px
   side padding leaves 114 px, and "Ohne Zuordnung" needs 121. 12 px leaves
   126. The kit's ellipsis sits on the flex box .k, where it never applies;
   the label span carries it here as a safety net (SCRATCH/kit-requests.md). */
@container bkapp (min-width: 601px) {
    .bkp-rv .rv-kpis > * { padding-left: 12px; padding-right: 12px; }
}

.bkp-rv .rv-kpis .k > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* "8 Belege warten auf eine Zuordnung. Zuordnen →": the line above the
   stacks while "Ohne Zuordnung" holds items (app list-screen.tsx
   UnassignedHint, review.css .ibx-md-hint / .ibx-ua-hint; the link is
   --fg-accent, the kit's --gold-ink). On a phone the link wraps under the
   text, as in the app. */
.bkp-rv .ibx-md-hint {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    margin: 0;
    padding: 10px 14px;
    border: 1px solid var(--hairline);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink-2);
    font-size: 13.5px;
    line-height: 1.45;
}

.bkp-rv .ibx-md-hint > svg { width: 16px; height: 16px; flex: none; color: var(--mark-warn); }
.bkp-rv .ibx-md-a { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; color: var(--gold-ink); font-weight: 500; white-space: nowrap; }
.bkp-rv .ibx-md-a svg { width: 14px; height: 14px; }

@container bkapp (max-width: 600px) {
    .bkp-rv .ibx-md-a { margin-left: 0; }
}

/* The app's accordion (review/overview list.tsx, owner note N4): one stack
   is open at a time and shows its first five rows; the others show only
   their head, count and "Stapel öffnen". The mock is a window onto that
   list: Zahlungen open with its three items (the first is the hero's
   receipt, "Posten 1 von 3 in Zahlungen"), the stacks after it closed, and
   the card fades out at the bottom where the list goes on (34 items in 10
   stacks). The open stack's chevron points up (review.css .ibx-sec.open
   .ibx-sec-tg svg), as on /books/modules. */
.bkp-rv .rv-grp.open > svg:last-child {
    transform: rotate(180deg);
}

.bkp-rv-crop {
    -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 76px), transparent);
    mask-image: linear-gradient(180deg, #000 calc(100% - 76px), transparent);
}

/* Stack heads on a phone-narrow app (306-336 px): the note ("1 Rückfrage")
   keeps its words; the spacer drops out of the gap count and the arrow
   button takes the free space (the kit's .rv-note ellipsis cut it to
   "1 Rückfr…" at 360 px; same override as modules.css, kit-requests.md). */
@container bkapp (max-width: 460px) {
    .bkp-rv .rv-note { flex: none; }
    .bkp-rv .rv-grp > .sp { display: none; }
    .bkp-rv .rv-grp > .abtn { margin-left: auto; }
}

@container bkapp (max-width: 340px) {
    .bkp-rv .rv-grp { gap: 6px; }
}

/* 320 px screens (below the 375 px target): "Zahlung · Lieferantenrechnung"
   may wrap rather than run past the card's edge; the stack note and the
   row's ⋯ give way so the chevron and the amounts keep their room; the
   hint's text stays beside its icon. */
@container bkapp (max-width: 300px) {
    .bkp-rv .tag-mod { white-space: normal; }
    .bkp-rv .rv-note,
    .bkp-rv .rv-act .icon-btn { display: none; }
    .bkp-rv .ibx-md-hint > span:first-of-type { flex: 1 1 160px; min-width: 0; }
}


/* =============================================================================
   6. APP MOCK — the review item header and the AI buttons (hero phone)
   From the app's review mask (review-mask-frame.tsx, ai-assist.css): the
   item header "Zu prüfen · Zahlungen · Beleg vom Handy" that peeks above the
   sheet, and the azure "Ausfüllen" button in the sheet's footer. The rest of
   the mask (desk header, queue bar, Zahlung/Abgang cards, rail, posting bar)
   went with the old hero (26.11.2026). Responsive by the app's width
   (container bkapp), as books.css §16.
   ========================================================================== */

/* --- item header: eyebrow, title (no amount: the receipt is unread) --- */
.bk-app .rvm-h { padding: 16px 18px; }

.bk-app .rvm-t {
    margin-top: 4px;
    font: 600 22px/1.25 var(--f-display);
    letter-spacing: -0.015em;
    color: var(--ink);
    overflow-wrap: anywhere;
}

/* AI button (ai-assist.css): "Ausfüllen" filled azure. */
.bk-app .ai-btn { --ai: var(--m-exchange); }

.bk-app .ai-fill {
    border-color: color-mix(in srgb, var(--ai) 55%, transparent);
    background: color-mix(in srgb, var(--ai) 12%, var(--surface));
    color: var(--ai);
    font-weight: 600;
    justify-content: center;
}

@container bkapp (max-width: 600px) {
    .bk-app .rvm-h { padding: 14px; }
    .bk-app .rvm-t { font-size: 19px; }
}


/* =============================================================================
   6b. APP MOCK — "KI-Vorschlag" / "AI suggestion" chat (hero phone)
   The app's ai-assist.css as its phone bottom sheet over a scrim (the hero
   phone always shows the app's phone layout). The sheet stays in the page
   flow, so its height is its content's: the explanation, the proposal card
   with the four counter-account lines, the question with its answer chips
   and the footer (Abbrechen, Ausfüllen); no compose box, no meter line.
   ========================================================================== */

.bk-app .ai-chat {
    --ai: var(--m-exchange);
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
    background: var(--overlay);
    box-shadow: var(--shadow-2);
}

.bk-app .ai-grab {
    display: block;
    flex: none;
    width: 40px;
    height: 5px;
    margin: 8px auto 2px;
    border-radius: 3px;
    background: var(--surface-3);
}

.bk-app .scrim {
    position: absolute;
    inset: 0;
    z-index: 4;
    background: rgba(8, 12, 24, 0.42);
}

.bk-app .ai-chat .dlg-h {
    flex: none;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--hairline);
}

.bk-app .ai-chat .dlg-h > div { min-width: 0; }
.bk-app .ai-chat .dlg-h .eyebrow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-app .ai-chat .dlg-t { font: 600 19px/1.3 var(--f-display); letter-spacing: -0.01em; color: var(--ink); }
.bk-app .ai-chat .dlg-h .icon-btn { margin-left: auto; }

.bk-app .ai-chat .dlg-b {
    flex: none;
    display: flex;
    flex-direction: column;
    padding: 18px 20px 20px;
}

/* thread and messages */
.bk-app .ai-thread { flex: none; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.bk-app .ai-msg { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.bk-app svg.ai-msg-i { flex: none; width: 16px; height: 16px; margin-top: 9px; color: var(--ai); }
.bk-app .ai-msg-b { display: flex; flex: 1 1 auto; flex-direction: column; gap: 8px; min-width: 0; }

.bk-app .ai-bubble {
    max-width: 92%;
    margin: 0;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--ink);
    overflow-wrap: anywhere;
}

.bk-app .ai-msg-b > .ai-bubble { align-self: flex-start; }
.bk-app .ai-bubble p { margin: 0; }
.bk-app .ai-msg[data-role="assistant"] .ai-bubble { border-top-left-radius: 4px; background: var(--surface-2); }

/* proposal card */
.bk-app .ai-prop {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--ai) 35%, var(--hairline));
    border-radius: 10px;
    background: var(--surface);
    font-size: 13px;
}

.bk-app .ai-prop-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bk-app .ai-prop-t { font-weight: 600; color: var(--ink); }
.bk-app .ai-prop-conf { padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.bk-app .ai-prop-conf[data-band="medium"] { background: color-mix(in srgb, var(--ai) 12%, var(--surface)); color: var(--ai); }

.bk-app .ai-prop-lines table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.bk-app .ai-prop-lines th { padding: 4px 8px 4px 0; border-bottom: 1px solid var(--hairline); font-weight: 500; text-align: left; color: var(--ink-3); }
.bk-app .ai-prop-lines td { padding: 5px 8px 5px 0; border-bottom: 1px solid var(--hairline); vertical-align: top; color: var(--ink); }
.bk-app .ai-prop-lines :is(th, td):last-child { padding-right: 0; }
.bk-app .ai-prop-lines .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bk-app .ai-prop-lines tfoot :is(th, td) { border-bottom: 0; font-weight: 600; color: var(--ink); }
.bk-app .ai-prop-acc { overflow-wrap: anywhere; }
.bk-app .ai-prop-tax { white-space: nowrap; color: var(--ink-2); }

/* questions: a chip answers with its own words */
.bk-app .ai-qs { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.bk-app .ai-qs p { margin: 0; font-size: 13px; line-height: 1.4; color: var(--ink); }
.bk-app .ai-q-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.bk-app .ai-q-opts .chip { max-width: 100%; white-space: normal; text-align: left; }

/* footer: Abbrechen, Ausfüllen */
.bk-app .ai-chat .dlg-f {
    flex: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px 10px;
    padding: 12px 20px;
    border-top: 1px solid var(--hairline);
    background: var(--overlay);
}

.bk-app .ai-chat-apply { min-width: 8rem; }

/* phone: the bottom sheet under the scrim */
@container bkapp (max-width: 600px) {
    .bk-app .ai-chat {
        border-top: 1px solid var(--hairline-strong);
        border-radius: 20px 20px 0 0;
    }

    .bk-app .ai-chat .dlg-h { padding: 6px 16px 12px; }
    .bk-app .ai-chat .dlg-t { font-size: 18px; }
    .bk-app .ai-chat .dlg-b { padding: 16px 16px 20px; }
    .bk-app .ai-chat .dlg-f { padding: 12px 16px; }
    .bk-app .ai-chat .dlg-f > .abtn { flex: 1 1 0; min-height: 44px; justify-content: center; }

    /* the lines as two-row items: "6640 Bewirtungskosten" over "67,31 € · VSt 19 %" */
    .bk-app .ai-prop-lines tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 2px 8px;
        padding: 6px 0;
        border-bottom: 1px solid var(--hairline);
    }

    .bk-app .ai-prop-lines td,
    .bk-app .ai-prop-lines tfoot th { padding: 0; border-bottom: 0; }
    .bk-app .ai-prop-lines .ai-prop-acc { grid-column: 1 / -1; }
    .bk-app .ai-prop-lines tfoot tr { border-bottom: 0; }
}


/* =============================================================================
   7. APP MOCK — mini visuals beside the capability rows (real size)
   ========================================================================== */

/* Card header in a mini visual: icon, title, pills, all on one line. */
.bk-app.bkp-mini .card-h { flex-wrap: nowrap; }
.bk-app.bkp-mini .card-h .ct { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-app.bkp-mini .card-sub { padding: 10px 18px 12px; font-size: 12.5px; color: var(--ink-3); }
.bk-app.bkp-mini .card-sub + .bkp-books { padding-top: 0; }

/* --- Journal entry with quantities ---------------------------------------- */
.bk-app .bkp-jr { width: 100%; border-collapse: collapse; font-size: 13px; }
.bk-app .bkp-jr th { padding: 8px 10px; text-align: left; font: 600 10.5px var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); background: var(--surface-2); border-bottom: 1px solid var(--hairline-strong); white-space: nowrap; }
.bk-app .bkp-jr td { padding: 9px 10px; vertical-align: middle; border-bottom: 1px solid var(--hairline); }
.bk-app .bkp-jr th:first-child,
.bk-app .bkp-jr td:first-child { padding-left: 18px; }
.bk-app .bkp-jr th:last-child,
.bk-app .bkp-jr td:last-child { padding-right: 18px; }
.bk-app .bkp-jr .num { text-align: right; }
.bk-app .bkp-jr .acc-l { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bk-app .bkp-jr .acc-l > span:last-child { min-width: 0; }
.bk-app .bkp-jr .acc { display: block; font: 500 11.5px var(--f-mono); color: var(--ink-3); }
.bk-app .bkp-jr .acc-n { display: block; color: var(--ink); white-space: nowrap; }
.bk-app .bkp-jr .qty { display: block; font: 500 11.5px var(--f-mono); color: var(--ink-3); white-space: nowrap; }
.bk-app .bkp-jr .qty.pos { color: var(--pos); }
.bk-app .bkp-jr tr.tot td { border-top: 1.5px solid var(--ink-2); border-bottom: 0; font-weight: 600; }
.bk-app .bkp-res { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 18px 12px; font-size: 12.5px; color: var(--ink-3); border-top: 1px solid var(--hairline); }
.bk-app .bkp-res b { font-family: var(--f-mono); font-weight: 600; color: var(--ink); }
.bk-app .bkp-res b.pos { color: var(--pos); }

/* --- Two books, one disposal ----------------------------------------------- */
.bk-app .bkp-books { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 14px 18px 16px; }
.bk-app .bkp-book { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--hairline-strong); background: var(--surface-2); }
.bk-app .bkp-book.is-main { border-color: color-mix(in srgb, var(--primary) 45%, transparent); background: color-mix(in srgb, var(--primary) 7%, var(--surface)); }
.bk-app .bkp-book-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; font: 600 14px var(--f-display); color: var(--ink); }
.bk-app .bkp-book-m { font-size: 12px; color: var(--ink-3); }
.bk-app .bkp-book-v { margin-top: 6px; font: 600 18px/1.2 var(--f-display); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.bk-app .bkp-book-d { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--ink-2); }
.bk-app .bkp-book-v + .bkp-book-d { margin-top: 2px; }
.bk-app .bkp-book-d .num { font-size: 12.5px; }
.bk-app .bkp-mv { display: flex; justify-content: space-between; gap: 10px; padding: 0 18px 14px; font-size: 12.5px; color: var(--ink-3); }

/* --- Valuation table + stress test ------------------------------------------ */
.bk-app .bkp-val { width: 100%; border-collapse: collapse; font-size: 13px; }
.bk-app .bkp-val th { padding: 8px 8px; text-align: right; font: 600 10.5px var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); background: var(--surface-2); border-bottom: 1px solid var(--hairline-strong); white-space: nowrap; }
.bk-app .bkp-val th:first-child { text-align: left; padding-left: 18px; }
.bk-app .bkp-val td { padding: 9px 8px; text-align: right; border-bottom: 1px solid var(--hairline); font-family: var(--f-mono); font-size: 12.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bk-app .bkp-val td:first-child { text-align: left; padding-left: 18px; font-family: var(--f-body); font-size: 13px; }
.bk-app .bkp-val th:last-child,
.bk-app .bkp-val td:last-child { padding-right: 18px; }
.bk-app .bkp-val .w { display: flex; align-items: center; gap: 9px; min-width: 0; }
.bk-app .bkp-val .w b { display: block; font-weight: 600; color: var(--ink); }
.bk-app .bkp-val .w small { display: block; font-size: 11.5px; color: var(--ink-3); }
.bk-app .bkp-val .w .mi { width: 26px; height: 26px; border-radius: 7px; }
.bk-app .bkp-val .w .mi svg { width: 14px; height: 14px; }
.bk-app .bkp-val tr.sum td { background: var(--surface-2); border-top: 1px solid var(--hairline-strong); border-bottom: 0; font-weight: 600; color: var(--ink); }
.bk-app .bkp-stress { display: flex; flex-direction: column; gap: 0; }
.bk-app .bkp-stress .card-h .seg > * { padding: 4px 9px; font-size: 12px; }
.bk-app .bkp-st-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 8px 18px; border-bottom: 1px solid var(--hairline); font-size: 13px; color: var(--ink-2); }
.bk-app .bkp-st-row .acc { margin-right: 6px; font: 500 11.5px var(--f-mono); color: var(--ink-3); }
.bk-app .bkp-st-row .num { font-size: 13px; }
.bk-app .bkp-st-row.tot { border-top: 1.5px solid var(--ink-2); border-bottom: 0; font-weight: 600; color: var(--ink); }
.bk-app .bkp-st-row.tot .num { font-size: 14px; }

/* --- Net positions (compact) -------------------------------------------------- */
.bk-app .bkp-kp2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bk-app .bkp-kp2 .kpi { padding: 12px 14px; }
.bk-app .bkp-kp2 .kpi .kv { font-size: 21px; }
.bk-app .bkp-kp2 .kpi .kd { color: var(--ink-3); }
.bk-app .bkp-net { width: 100%; border-collapse: collapse; font-size: 13px; }
.bk-app .bkp-net th { padding: 8px 8px; text-align: left; font: 600 10.5px var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); background: var(--surface-2); border-bottom: 1px solid var(--hairline-strong); white-space: nowrap; }
.bk-app .bkp-net td { padding: 9px 8px; border-bottom: 1px solid var(--hairline); vertical-align: middle; white-space: nowrap; }
.bk-app .bkp-net th:first-child,
.bk-app .bkp-net td:first-child { padding-left: 18px; }
.bk-app .bkp-net th:last-child,
.bk-app .bkp-net td:last-child { padding-right: 18px; }
.bk-app .bkp-net .num { text-align: right; }
.bk-app .bkp-net td.num { font-size: 12.5px; }
.bk-app .bkp-net .sub { display: block; font-family: var(--f-body); font-size: 11.5px; color: var(--ink-3); }
.bk-app .bkp-net tr.sel td { background: color-mix(in srgb, var(--primary) 7%, var(--surface)); }
.bk-app .bkp-net tr:last-child td { border-bottom: 0; }
.bk-app .bkp-net .net-hg { min-width: 92px; }

/* Narrow visuals (phones): tighter cells, secondary lines and columns go. */
@container bkapp (max-width: 470px) {
    .bk-app .bkp-jr th:first-child,
    .bk-app .bkp-jr td:first-child,
    .bk-app .bkp-val th:first-child,
    .bk-app .bkp-val td:first-child,
    .bk-app .bkp-net th:first-child,
    .bk-app .bkp-net td:first-child { padding-left: 12px; }
    .bk-app .bkp-jr th:last-child,
    .bk-app .bkp-jr td:last-child,
    .bk-app .bkp-val th:last-child,
    .bk-app .bkp-val td:last-child,
    .bk-app .bkp-net th:last-child,
    .bk-app .bkp-net td:last-child { padding-right: 12px; }
    .bk-app .bkp-jr td,
    .bk-app .bkp-jr th { padding-left: 6px; padding-right: 6px; }
    .bk-app .bkp-jr .coin { display: none; }
    .bk-app .bkp-val .w .mi { display: none; }
    .bk-app .bkp-val .hide-n { display: none; }
    .bk-app .bkp-net .hide-n { display: none; }
    .bk-app .bkp-books { grid-template-columns: minmax(0, 1fr); padding: 12px 12px 14px; }
    .bk-app .bkp-mv,
    .bk-app .bkp-res,
    .bk-app .bkp-st-row { padding-left: 12px; padding-right: 12px; }
    .bk-app.bkp-mini .card-sub { padding: 8px 12px 10px; }
    /* card titles keep their words: the pill moves to its own line if needed */
    .bk-app.bkp-mini .card-h { flex-wrap: wrap; padding-left: 12px; padding-right: 12px; }
    .bk-app.bkp-mini .card-h .ct { flex: 1 1 auto; white-space: normal; overflow: visible; }
    /* valuation: wallet names may wrap, figures a size smaller */
    .bk-app .bkp-val td:first-child { white-space: normal; }
    .bk-app .bkp-val td { font-size: 12px; }
    .bk-app .bkp-val th,
    .bk-app .bkp-val td { padding-left: 6px; padding-right: 6px; }
    /* net positions: the instrument keeps its name, the netting line goes */
    .bk-app .bkp-net .net-inst .sub { display: none; }
    .bk-app .bkp-net th,
    .bk-app .bkp-net td { padding-left: 6px; padding-right: 6px; }
    .bk-app .bkp-kp2 { gap: 8px; }
    .bk-app .bkp-kp2 .kpi { padding: 10px 12px; }
    .bk-app .bkp-kp2 .kpi .kv { font-size: 18px; }
    /* journal: names may wrap, figures a size smaller */
    .bk-app .bkp-jr .acc-n { white-space: normal; }
    .bk-app .bkp-jr td.num { font-size: 12px; }
    .bk-app .bkp-res { gap: 4px 12px; }
    /* stress test: the four options take their own line under the title */
    .bk-app .bkp-stress .card-h { flex-wrap: wrap; }
    .bk-app .bkp-stress .card-h .seg { flex: 1 0 100%; display: flex; }
    .bk-app .bkp-stress .card-h .seg > * { flex: 1; justify-content: center; }
}

@container bkapp (max-width: 380px) {
    .bk-app .bkp-jr .qty { display: none; }
}

/* the smallest phones (320–360 px) */
@container bkapp (max-width: 340px) {
    .bk-app .bkp-jr td.num,
    .bk-app .bkp-val td,
    .bk-app .bkp-net td.num { font-size: 11px; }
    .bk-app .bkp-jr th,
    .bk-app .bkp-jr td,
    .bk-app .bkp-val th,
    .bk-app .bkp-val td,
    .bk-app .bkp-net th,
    .bk-app .bkp-net td { padding-left: 4px; padding-right: 4px; }
    .bk-app .bkp-jr th:first-child,
    .bk-app .bkp-jr td:first-child,
    .bk-app .bkp-val th:first-child,
    .bk-app .bkp-val td:first-child,
    .bk-app .bkp-net th:first-child,
    .bk-app .bkp-net td:first-child { padding-left: 10px; }
    .bk-app .bkp-jr th:last-child,
    .bk-app .bkp-jr td:last-child,
    .bk-app .bkp-val th:last-child,
    .bk-app .bkp-val td:last-child,
    .bk-app .bkp-net th:last-child,
    .bk-app .bkp-net td:last-child { padding-right: 10px; }
    .bk-app .bkp-net .coin { width: 20px; height: 20px; }
    .bk-app .bkp-net .net-inst { gap: 7px; }
    .bk-app .bkp-net .pill { padding: 2px 7px; font-size: 11px; }
    .bk-app .bkp-kp2 { grid-template-columns: minmax(0, 1fr); }
}
