/* =============================================================================
   KOTOVA BOOKS · For Tax Advisors (kotova.io/books/accountants)
   -----------------------------------------------------------------------------
   Page-only styles, loaded after /styles.css and /books/books.css. Every class
   is prefixed acc-; the app visuals use the .bk-app kit (books.css §15–16) and
   add their own parts under .bk-app .acc-*.

     1. Hero (centred copy, scaled app screenshot underneath)
     2. Page parts (role chips, inline price, fact row)
     3. App widgets: unscaled .bk-app crops that lay themselves out by their
        own width (container "bkapp"), so text stays at app size on phones
     4. Hero mock: Einstellungen › Organisationen & Rechtsträger (settings
        menu, tablet strip, the adviser triage of a tax firm)
     5. DATEV export screen
     6. HGB book / tax book and the reconciliation
     7. Valuation run (period close)
     8. Derivatives: provision for anticipated losses
   ========================================================================== */


/* =============================================================================
   1. HERO
   ========================================================================== */

.acc-hero .bk-hero-copy {
    max-width: 960px;
}

.acc-h1 {
    margin-top: 20px;
    font-size: clamp(2.1rem, 4.6vw, 3.3rem);
}

.acc-hero .bk-lead {
    max-width: 780px;
}

.acc-hero-visual {
    position: relative;
}

/* Soft gold light behind the screenshot. */
.acc-hero-visual::before {
    content: "";
    position: absolute;
    left: 8%;
    right: 8%;
    top: -40px;
    height: 60%;
    background: radial-gradient(60% 70% at 50% 0%, rgba(197, 165, 114, 0.16), transparent 70%);
    filter: blur(10px);
    pointer-events: none;
}

.acc-hero-frame {
    position: relative;
    box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(197, 165, 114, 0.08);
}

/* Design size of the screenshot (CSS px, unitless). The app re-lays itself out
   at each size: >1100 sidebar + settings menu, 601–1100 icon rail + tab strip,
   <=600 phone.
   - >=1101: 1460, the app's own desktop. The triage's 7 columns need 882 px
     beside the 232 px menu, so a narrower design clips the table (1320 left it
     760 px). Table text renders at 11 px at 1440.
   - 901–1100: the tablet layout at 1040 (1460 at 1024 would render the table
     at 9.4 px; here it is 13 px). The tablet heights leave room for the
     search on its own row with the four chips below it.
   - 601–720: 800. The app has no further column break below 1100, so the
     tablet table needs about 784 px of design width; less clips its right
     columns.
   - <=600: the phone page down to the end of the grouped list "23
     Organisationen" (header row, four organisations, "19 weitere"). Phones
     (<=480) use a 400-px design, so the row sub-lines render at about 11 px
     at 390.
   The desktop shows the whole page down to the triage footer, so it has no
   fade; the tablet sizes fade the content column only, so the sidebar foot
   (Einstellungen, the plan meter) stays crisp. */
.acc-hero-frame .bk-shot {
    --bk-shot-w: 1460;
    --bk-shot-h: 886;
}

@media (max-width: 1100px) {
    .acc-hero-frame .bk-shot {
        --bk-shot-w: 1040;
        --bk-shot-h: 904;
    }
}

@media (min-width: 601px) and (max-width: 1100px) {
    .acc-hero-frame .bk-app .mainc {
        -webkit-mask-image: linear-gradient(180deg, #000 84%, transparent 100%);
        mask-image: linear-gradient(180deg, #000 84%, transparent 100%);
    }
}

@media (max-width: 900px) {
    .acc-hero-frame .bk-shot {
        --bk-shot-w: 860;
        --bk-shot-h: 844;
    }
}

@media (max-width: 720px) {
    .acc-hero-frame .bk-shot {
        --bk-shot-w: 800;
        --bk-shot-h: 824;
    }
}

@media (max-width: 600px) {
    .acc-hero-frame .bk-shot {
        --bk-shot-w: 520;
        --bk-shot-h: 620;
    }
}

@media (max-width: 480px) {
    .acc-hero-frame .bk-shot {
        --bk-shot-w: 400;
        --bk-shot-h: 640;
    }
}

/* The site's global text rule turns on automatic hyphenation. Centred leads
   never hyphenate, and English copy does not either ("con-trol", "prod-uct");
   German keeps it for its long compounds in narrow columns. */
.acc-hero .bk-lead,
.acc-main .bk-head .bk-lead,
.acc-main .bk-faq-t {
    -webkit-hyphens: manual;
    hyphens: manual;
}

/* Centred leads: even line lengths, no one-word last line. */
.acc-hero .bk-lead,
.acc-main .bk-head .bk-lead {
    text-wrap: balance;
}

/* Where German does hyphenate, only long words, 5+ letters on each side
   ("Festschreibungs-kennzeichen", never "Ba-sic" or "DA-TEV"). */
.acc-main :is(p, li) {
    hyphenate-limit-chars: 12 5 5;
    -webkit-hyphenate-limit-before: 5;
    -webkit-hyphenate-limit-after: 5;
}

html[lang|="en"] .acc-main :is(p, li, span, a, strong, b) {
    -webkit-hyphens: manual;
    hyphens: manual;
}


/* =============================================================================
   2. PAGE PARTS
   ========================================================================== */

/* Role chips under the "Invited as a user" card; the two an advisor gets
   (Bookkeeper, Viewer) in gold. */
.acc-roles {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.acc-roles .bk-tag {
    margin-right: 4px;
}

.acc-role {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    border: 1px solid var(--color-border-light);
    background: rgba(255, 255, 255, 0.03);
    color: var(--color-text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
}

.acc-role.is-adv {
    color: var(--color-secondary);
    border-color: var(--bk-gold-line);
    background: var(--bk-gold-tint);
}

/* A price from books.js inside running text. */
.acc-price {
    color: var(--color-text-primary);
    font-weight: 600;
    white-space: nowrap;
}

/* Three facts under the DATEV screen. */
.acc-facts {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--spacing-lg) var(--spacing-xl);
    margin: var(--spacing-2xl) 0 0;
    padding: 0;
}

.acc-facts li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
}

.acc-fact-ico {
    display: grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    background: var(--bk-gold-tint);
    color: var(--color-secondary);
}

.acc-fact-ico .bk-ico {
    width: 20px;
    height: 20px;
}

.acc-facts .bk-text {
    font-size: 0.95rem;
    line-height: 1.65;
}

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

/* Phones: slightly tighter cards, the page carries many of them. */
@media (max-width: 640px) {
    .acc-main .bk-grid .bk-card {
        padding: var(--spacing-lg);
    }

    .acc-main .bk-grid .bk-card-icon {
        width: 44px;
        height: 44px;
        margin-bottom: var(--spacing-sm);
    }
}

.acc-band-section {
    padding-top: 0;
}

/* Stacked splits (<=1024px): keep the copy at a readable measure, centred
   over its visual like the widgets below it. */
@media (max-width: 1024px) {
    .acc-main .bk-split-copy {
        width: 100%;
        max-width: 680px;
        margin-left: auto;
        margin-right: auto;
    }
}


/* =============================================================================
   3. APP WIDGETS (unscaled .bk-app crops)
   ========================================================================== */

.bk-app.acc-widget {
    max-width: 580px;
    margin: 0 auto;
    background: transparent;
    overflow: visible;
}

.bk-app .acc-card {
    box-shadow: 0 30px 80px -28px rgba(0, 0, 0, 0.75), 0 2px 6px rgba(0, 0, 0, 0.25);
}

.bk-app .acc-stack {
    display: grid;
    gap: 14px;
}

/* Shared parts: form-like input, checkbox, key/value list. */
.bk-app .acc-input {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid var(--hairline-strong);
    border-radius: var(--r-md);
    background: var(--surface-2);
    color: var(--ink);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
}

.bk-app .acc-input svg {
    width: 15px;
    height: 15px;
    flex: none;
    color: var(--ink-3);
}

.bk-app .acc-input .t,
.bk-app .acc-input > span:not(.t) {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bk-app .acc-input.mono {
    font-family: var(--f-mono);
    font-size: 13.5px;
}

.bk-app .acc-box {
    display: grid;
    place-items: center;
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border-radius: 5px;
    border: 1.5px solid var(--hairline-strong);
}

.bk-app .acc-box.on {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--on-primary);
}

.bk-app .acc-box svg {
    width: 12px;
    height: 12px;
    stroke-width: 3;
}

.bk-app .acc-kv {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 6px 16px;
    margin: 0;
    font-size: 13.5px;
    line-height: 1.45;
}

.bk-app .acc-kv dt {
    color: var(--ink-3);
}

.bk-app .acc-kv dd {
    margin: 0;
    min-width: 0;
    color: var(--ink);
}

/* .r: amounts right-aligned (provision figures). */
.bk-app .acc-kv.r dd {
    text-align: right;
}


/* =============================================================================
   4. HERO MOCK — Einstellungen › Organisationen & Rechtsträger (/settings), as a
   tax firm sees it. The app's settings frame (settings.css .sorg-*): the menu
   card beside the page's cards on a desktop, a tab strip on a tablet, neither on
   a phone (there the menu is its own screen and the header has "‹ Einstellungen").
   ========================================================================== */

.bk-app .acc-set {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    min-width: 0;
}

.bk-app .acc-setmain {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

/* Menu card: "ORGANISATION {name}" (12 sections), "PERSÖNLICH" (3). */
.bk-app .acc-setnav {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 8px;
}

.bk-app .acc-snh {
    padding: 10px 10px 6px;
    font: 600 10.5px var(--f-mono);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.bk-app .acc-snsep {
    height: 1px;
    margin: 8px 6px 2px;
    background: var(--hairline);
}

.bk-app .acc-sni {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    padding: 7px 10px;
    border-radius: 7px;
    font-size: 13.5px;
    line-height: 1.3;
    color: var(--ink-2);
}

.bk-app .acc-sni svg {
    width: 16px;
    height: 16px;
    flex: none;
    margin-top: 1px;
    color: var(--ink-3);
}

.bk-app .acc-sni .t {
    flex: 1;
    min-width: 0;
}

.bk-app .acc-sni .r {
    margin-top: 1px;
    font: 600 11px var(--f-mono);
    color: var(--ink-3);
}

.bk-app .acc-sni.on {
    background: color-mix(in srgb, var(--primary) 11%, var(--surface));
    color: var(--ink);
    font-weight: 600;
}

.bk-app .acc-sni.on svg {
    color: var(--primary);
}

/* Tablet strip: the first six sections (sections.ts TAB_ORDER); the strip
   scrolls in the app and fades the end that has more (app-shell.css
   "strip-more"), drawn here at its start position. */
.bk-app .acc-settabs {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}

.bk-app .acc-settabs .tab {
    font-size: 13.5px;
}

/* Phone: "‹ Einstellungen" above the h1 (the app's .sorg-back). */
.bk-app .acc-back {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    min-height: 40px;
    margin: -4px 0 2px -4px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
}

.bk-app .acc-back svg {
    width: 18px;
    height: 18px;
}

/* Triage header: the billing account's mark, title and sentence, sort button
   (app .set-triage .card-h, .sorg-vh). */
.bk-app .acc-mand .card-h {
    flex-wrap: nowrap;
    align-items: flex-start;
    padding-top: 10px;
    border-bottom: 0;
}

.bk-app .acc-om.hd {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    font-size: 14px;
}

.bk-app .acc-vh {
    flex: 1;
    min-width: 0;
}

.bk-app .acc-vh p {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--ink-3);
}

@container bkapp (max-width: 1100px) {
    .bk-app .acc-set {
        grid-template-columns: minmax(0, 1fr);
    }

    /* The app's .sorg .page-h .ph-t: the actions go under the lead. */
    .bk-app.acc-set-app .page-h .ph-t {
        flex-basis: 440px;
    }
}

/* Phone: no eyebrow, the lead stays at 13.5 px (app settings.css <=600). */
@container bkapp (max-width: 600px) {
    .bk-app.acc-set-app .page-h .eyebrow {
        display: none;
    }

    .bk-app.acc-set-app .page-h .ph-d {
        font-size: 13.5px;
    }
}

.bk-app .acc-vbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    padding: 0 18px 12px;
    border-bottom: 1px solid var(--hairline);
}

.bk-app .acc-vbar .acc-input {
    flex: none;
    width: 230px;
    min-height: 34px;
    padding: 5px 10px;
    font-size: 13.5px;
    color: var(--ink-4);
    background: var(--surface);
}

.bk-app .acc-vbar .chip .n {
    padding: 0 6px;
    border-radius: 99px;
    background: var(--surface-3);
    color: var(--ink-2);
    font: 600 11px var(--f-mono);
}

.bk-app .acc-mt td {
    vertical-align: middle;
}

/* Organisation mark: gold tile for the firm's own clients, grey for invited. */
.bk-app .acc-om {
    display: grid;
    place-items: center;
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: color-mix(in srgb, var(--gold) 20%, var(--surface));
    color: var(--gold-ink);
    font: 700 12px var(--f-display);
}

.bk-app .acc-om.self {
    background: var(--surface-3);
    color: var(--ink-3);
}

.bk-app .acc-mn {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.bk-app .acc-mn b {
    display: block;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

/* Open items: count + bar. */
.bk-app .acc-q {
    display: grid;
    grid-template-columns: 28px 64px;
    gap: 8px;
    align-items: center;
    justify-content: end;
}

.bk-app .acc-q > .num {
    text-align: right;
    font-weight: 600;
}

.bk-app .acc-q .meter {
    height: 6px;
    --mc: var(--mark-warn);
}

.bk-app .acc-q.self > .num {
    color: var(--ink-3);
    font-weight: 500;
}

.bk-app .acc-q.self .meter {
    --mc: var(--ink-4);
}

.bk-app .tbl td .acc-self {
    text-align: right;
}

.bk-app .acc-due {
    white-space: nowrap;
}

.bk-app .acc-ar {
    display: inline-grid;
    color: var(--ink-4);
}

.bk-app .acc-ar svg {
    width: 16px;
    height: 16px;
}

.bk-app .acc-mf b {
    color: var(--ink);
    font-family: var(--f-mono);
}

.bk-app .acc-mf .abtn {
    margin-left: auto;
}

/* Tablet: the search takes the full row and all four chips wrap below it
   (app settings.css <=1100: .sorg-vbar .input { width: 100% }). */
@container bkapp (max-width: 1100px) {
    .bk-app .acc-vbar .acc-input {
        width: 100%;
    }
}

/* Phone: the triage card is hidden and the grouped list "23 Organisationen"
   takes its place (app phone-directory.tsx; settings.css .sorg-g, .sorg-gh,
   .sorg-gc, .sorg-r, .sorg-chev): a header row with the firm's mark, the four
   most open organisations without marks, each with its count pill (outline for
   "bucht selbst") and a chevron, then "19 weitere". */
.bk-app .acc-pdir {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.bk-app .acc-pgh {
    padding: 0 4px;
    font: 600 11px var(--f-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.bk-app .acc-pgc {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--hairline);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-1);
}

.bk-app .acc-pgc .lrow {
    min-height: 52px;
    padding: 9px 14px;
}

/* The app's class is "top-a"; the mock's "acc-ptop" stays clear of the kit's
   top-bar class .top, which is hidden on phones. */
.bk-app .acc-pgc .lrow.acc-ptop {
    align-items: flex-start;
}

.bk-app .acc-pgc .lt {
    line-height: 1.3;
}

.bk-app .acc-pgc .ls {
    line-height: 1.35;
}

.bk-app .acc-pgc .ls.wrap {
    white-space: normal;
}

.bk-app .acc-pgc .pill {
    flex: none;
}

.bk-app .acc-pchev {
    display: inline-grid;
    flex: none;
    color: var(--ink-4);
}

.bk-app .acc-pchev svg {
    width: 18px;
    height: 18px;
}


/* =============================================================================
   5. DATEV EXPORT SCREEN (Berichte › DATEV-Export)
   ========================================================================== */

.acc-frame {
    margin: 0;
}

.bk-app.acc-app {
    overflow: hidden;
}

.bk-app .acc-app-in {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 24px 28px 28px;
}

/* Report tabs (app reports/tabs.ts, report-tabs.tsx): eight tabs, each with
   its icon, on a desktop and a tablet alike; a phone has the app's row GuV,
   Bilanz, UStVA, DATEV and "Mehr ▾", without icons and with tighter tabs
   (rep.css: 10 px; 9 px here, so the row fits the frame at 375). A strip that
   runs past its edge is scrolled so the lit tab is centred and fades the
   edges that hide tabs (TabStripScroll; inline script under the figure). The
   app's DATEV tab has no header button (reports/datev/page.tsx passes no
   actions), so the mock has none either. */
.bk-app .acc-only-s {
    display: none;
}

.bk-app .acc-more {
    gap: 3px;
}

.bk-app .acc-more svg {
    width: 14px;
    height: 14px;
}

.bk-app .acc-dx {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--hairline);
}

.bk-app .acc-dxc {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    padding: 16px 18px 18px;
}

.bk-app .acc-dxc + .acc-dxc {
    border-left: 1px solid var(--hairline);
}

.bk-app .acc-dxh {
    font: 600 11px var(--f-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.bk-app .acc-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.bk-app .acc-label {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--ink-3);
}

.bk-app .acc-hint {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--warn);
}

.bk-app .acc-hint svg {
    width: 14px;
    height: 14px;
    flex: none;
    margin-top: 2px;
}

.bk-app .acc-f2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.bk-app .acc-map {
    display: grid;
    border: 1px solid var(--hairline);
    border-radius: 10px;
    overflow: hidden;
}

.bk-app .acc-mr {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 9px 12px;
}

.bk-app .acc-mr + .acc-mr {
    border-top: 1px solid var(--hairline);
}

.bk-app .acc-mr .mono {
    font-size: 12.5px;
    color: var(--ink-3);
}

.bk-app .acc-mr .t {
    min-width: 0;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--ink);
}

.bk-app .acc-mr .t small {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: var(--ink-3);
}

.bk-app .acc-okp {
    padding: 3px 6px;
}

.bk-app .acc-okp svg {
    width: 13px;
    height: 13px;
}

.bk-app .acc-mi {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--ink-3);
}

.bk-app .acc-mi svg {
    width: 15px;
    height: 15px;
    flex: none;
    margin-top: 2px;
}

.bk-app .acc-ck {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.35;
}

.bk-app .acc-ck .t {
    min-width: 0;
    font-weight: 500;
}

.bk-app .acc-ck .t small {
    display: block;
    margin-top: 1px;
    font-size: 12.5px;
    font-weight: 400;
    color: var(--ink-3);
}

.bk-app .acc-ck-sum {
    padding: 10px 12px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--mark-pos) 8%, var(--surface));
    border: 1px solid color-mix(in srgb, var(--mark-pos) 30%, transparent);
}

.bk-app .acc-ck-sum .balanced svg {
    width: 18px;
    height: 18px;
}

.bk-app .abtn.acc-block {
    justify-content: center;
    width: 100%;
    margin-top: 2px;
}

.bk-app .acc-file {
    font: 500 11.5px/1.4 var(--f-mono);
    color: var(--ink-3);
    text-align: center;
    overflow-wrap: anywhere;
}

.bk-app .acc-hh {
    padding: 12px 18px 4px;
    border-top: 1px solid var(--hairline);
    font: 600 11px var(--f-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.bk-app .acc-lock {
    color: var(--pos);
    background: color-mix(in srgb, var(--mark-pos) 14%, var(--surface));
}

.bk-app .acc-ibtn {
    display: grid;
    place-items: center;
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: var(--r-md);
    border: 1px solid var(--hairline-strong);
    color: var(--ink-2);
}

.bk-app .acc-ibtn svg {
    width: 16px;
    height: 16px;
}

@container bkapp (max-width: 1000px) {
    .bk-app .acc-dx {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bk-app .acc-dxc:nth-child(3) {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
        gap: 12px 24px;
        border-left: 0;
        border-top: 1px solid var(--hairline);
    }

    .bk-app .acc-dxc:nth-child(3) > .acc-dxh,
    .bk-app .acc-dxc:nth-child(3) > .acc-ck-sum,
    .bk-app .acc-dxc:nth-child(3) > .abtn,
    .bk-app .acc-dxc:nth-child(3) > .acc-file {
        grid-column: 1 / -1;
    }

    /* Without JS: the strip at its start, the end faded. */
    .bk-app .acc-rtabs {
        -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
        mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    }
}

/* With JS (inline script after the figure): the edges that hide tabs. */
.bk-app .acc-rtabs[data-hidden=""] {
    -webkit-mask-image: none;
    mask-image: none;
}

.bk-app .acc-rtabs[data-hidden="end"] {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}

.bk-app .acc-rtabs[data-hidden="start"] {
    -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent);
}

.bk-app .acc-rtabs[data-hidden="start end"] {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent);
}

@container bkapp (max-width: 640px) {
    .bk-app .acc-app-in {
        gap: 14px;
        padding: 16px 14px 18px;
    }

    .bk-app .acc-dx {
        grid-template-columns: minmax(0, 1fr);
    }

    .bk-app .acc-dxc,
    .bk-app .acc-dxc:nth-child(3) {
        display: flex;
        padding: 14px;
    }

    .bk-app .acc-dxc + .acc-dxc {
        border-left: 0;
        border-top: 1px solid var(--hairline);
    }

    .bk-app .acc-hide-s {
        display: none;
    }

    .bk-app span.acc-only-s {
        display: inline;
    }

    .bk-app .tab.acc-only-s {
        display: inline-flex;
    }

    .bk-app .acc-rtabs {
        -webkit-mask-image: none;
        mask-image: none;
    }

    .bk-app .acc-rtabs .tab {
        padding-left: 9px;
        padding-right: 9px;
    }

    .bk-app .acc-rtabs .tab > svg:first-child {
        display: none;
    }

    .bk-app .acc-hh {
        padding: 12px 14px 4px;
    }

    .bk-app .acc-app-in .page-h :is(h1, .h1) {
        font-size: 22px;
    }
}


/* =============================================================================
   6. HGB BOOK / TAX BOOK + RECONCILIATION
   ========================================================================== */

.bk-app .acc-books {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 14px 18px 4px;
}

.bk-app .acc-book {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "r t" "v v";
    gap: 8px 10px;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--hairline-strong);
    border-radius: 10px;
    background: var(--surface-2);
}

.bk-app .acc-book.on {
    border-color: color-mix(in srgb, var(--primary) 60%, transparent);
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.bk-app .acc-radio {
    grid-area: r;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    border-radius: 50%;
    border: 1.5px solid var(--ink-4);
}

.bk-app .acc-book.on .acc-radio {
    border: 5px solid var(--primary);
}

.bk-app .acc-book-t {
    grid-area: t;
    min-width: 0;
}

.bk-app .acc-book-t b {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.bk-app .acc-book-t span {
    display: block;
    font-size: 12.5px;
    color: var(--ink-3);
}

.bk-app .acc-book-v {
    grid-area: v;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--hairline-strong);
}

.bk-app .acc-book-v small {
    width: 100%;
    font-size: 11.5px;
    color: var(--ink-3);
}

.bk-app .acc-book-v .num {
    font: 600 19px/1.2 var(--f-display);
    letter-spacing: -0.02em;
}

.bk-app .acc-bd {
    font: 600 12px var(--f-mono);
    color: var(--pos);
}

.bk-app .acc-ul-h {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 4px 12px;
    padding: 16px 18px 8px;
    font: 600 14px var(--f-display);
    color: var(--ink);
}

.bk-app .acc-ul-h .muted {
    font: 500 12px var(--f-mono);
}

.bk-app .acc-ul {
    font-size: 13.5px;
}

.bk-app .acc-ul td {
    padding: 9px 18px;
    vertical-align: top;
}

.bk-app .acc-ul td.num {
    text-align: right;
    white-space: nowrap;
}

.bk-app .acc-ul-l {
    display: flex;
    gap: 10px;
    min-width: 0;
}

.bk-app .acc-op {
    flex: none;
    width: 12px;
    font-family: var(--f-mono);
    font-weight: 600;
    color: var(--ink-3);
}

.bk-app .acc-ul .sub {
    display: block;
    font-size: 12px;
    color: var(--ink-3);
}

.bk-app .acc-ul tr.acc-ul-sum td {
    border-top: 1.5px solid var(--ink-2);
    border-bottom: 0;
    background: var(--surface-2);
    font-weight: 600;
}

.bk-app .acc-note {
    flex-wrap: nowrap;
    align-items: flex-start;
    line-height: 1.5;
}

.bk-app .acc-note svg {
    width: 15px;
    height: 15px;
    flex: none;
    margin-top: 2px;
    color: var(--m-financial);
}

.bk-app .acc-note b {
    color: var(--ink);
}

@container bkapp (max-width: 420px) {
    .bk-app .acc-books {
        grid-template-columns: minmax(0, 1fr);
    }

    .bk-app .acc-ul td {
        padding-left: 14px;
        padding-right: 14px;
    }
}


/* =============================================================================
   7. VALUATION RUN (Bestände › Periodenabschluss › Bewertungslauf vorbereiten)
   ========================================================================== */

.bk-app .acc-run-h {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--hairline);
}

.bk-app .acc-run-ht {
    flex: 1;
    min-width: 0;
}

.bk-app .acc-run-t {
    margin-top: 2px;
    font: 600 17px/1.25 var(--f-display);
    letter-spacing: -0.01em;
}

.bk-app .acc-x {
    display: inline-grid;
    color: var(--ink-3);
}

.bk-app .acc-x svg {
    width: 18px;
    height: 18px;
}

.bk-app .acc-run-b {
    display: grid;
    gap: 16px;
    padding: 16px 18px;
}

.bk-app .acc-sec {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.bk-app .acc-sec-t {
    font: 600 10.5px var(--f-mono);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-3);
}

.bk-app .acc-rc {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--hairline-strong);
    border-radius: 10px;
}

.bk-app .acc-rc.on {
    border-color: color-mix(in srgb, var(--primary) 55%, transparent);
    background: color-mix(in srgb, var(--primary) 7%, var(--surface));
}

.bk-app .acc-rd {
    flex: none;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    border-radius: 50%;
    border: 1.5px solid var(--ink-4);
}

.bk-app .acc-rc.on .acc-rd {
    border: 5px solid var(--primary);
}

.bk-app .acc-rc .t {
    flex: 1;
    min-width: 0;
    font-size: 13.5px;
    line-height: 1.4;
}

.bk-app .acc-rc .t b {
    display: block;
    font-weight: 600;
}

.bk-app .acc-rc .t span {
    display: block;
    font-size: 12.5px;
    color: var(--ink-3);
}

.bk-app .acc-scope {
    display: grid;
    border: 1px solid var(--hairline);
    border-radius: 10px;
    overflow: hidden;
}

.bk-app .acc-scope > div {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 12px;
}

.bk-app .acc-scope > div + div {
    border-top: 1px solid var(--hairline);
}

.bk-app .acc-scope .t {
    flex: 1;
    min-width: 0;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.4;
}

.bk-app .acc-scope .t span {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: var(--ink-3);
}

.bk-app .acc-scope .r {
    flex: none;
    min-width: 18px;
    text-align: right;
    font-size: 13px;
    color: var(--ink-2);
}

.bk-app .acc-scope .r svg {
    width: 15px;
    height: 15px;
    color: var(--ink-3);
}

.bk-app .acc-scope .dim {
    background: var(--surface-2);
}

.bk-app .acc-scope .dim .t {
    color: var(--ink-2);
}

.bk-app .acc-scope .mi.sm {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border-radius: 5px;
}

.bk-app .acc-scope .mi.sm svg {
    width: 12px;
    height: 12px;
}

.bk-app .acc-res {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.bk-app .acc-res > div {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--surface-2);
}

.bk-app .acc-res .k {
    font-size: 12px;
    color: var(--ink-3);
}

.bk-app .acc-res .v {
    font: 600 17px/1.25 var(--f-display);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.bk-app .acc-res .v.pos {
    color: var(--pos);
}

.bk-app .acc-run-f {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-top: 1px solid var(--hairline);
}

@container bkapp (max-width: 440px) {
    .bk-app .acc-run-h,
    .bk-app .acc-run-b,
    .bk-app .acc-run-f {
        padding-left: 14px;
        padding-right: 14px;
    }

    .bk-app .acc-run .acc-kv {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .bk-app .acc-run .acc-kv dd + dt {
        margin-top: 6px;
    }

    .bk-app .acc-res {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }

    .bk-app .acc-res > div {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "k v" "s v";
        align-items: center;
        column-gap: 12px;
        padding: 8px 12px;
    }

    .bk-app .acc-res .k {
        grid-area: k;
    }

    .bk-app .acc-res .v {
        grid-area: v;
        font-size: 16px;
    }

    .bk-app .acc-res .xs {
        grid-area: s;
    }

    .bk-app .acc-run-f > .xs {
        width: 100%;
    }

    .bk-app .acc-run-f > .sp {
        display: none;
    }
}


/* =============================================================================
   8. DERIVATIVES — provision for anticipated losses (Derivate › Monatsabschluss)
   ========================================================================== */

.bk-app .acc-dv-pos .lrow .lr {
    display: grid;
    justify-items: end;
    gap: 4px;
}

.bk-app .acc-dv-pos .lrow :is(.lt, .ls) {
    white-space: normal;
}

.bk-app .acc-dv-b {
    display: grid;
    gap: 14px;
}

.bk-app .acc-dv-b .acc-kv {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--hairline);
}

.bk-app .acc-own {
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 99px;
    background: var(--surface-3);
    color: var(--ink-3);
    font: 600 10.5px var(--f-mono);
    vertical-align: 1px;
    white-space: nowrap;
}

.bk-app .acc-dv .banner {
    font-size: 13px;
    line-height: 1.5;
}

@container bkapp (max-width: 440px) {
    .bk-app .acc-dv-pos .lrow {
        align-items: flex-start;
    }

    .bk-app .acc-dv .jrnl .num {
        padding-left: 4px;
        padding-right: 4px;
    }
}
