/* rechnungx — free generator and content pages */
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/archivo-latin-400.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/archivo-latin-ext-400.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/archivo-latin-500.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/archivo-latin-ext-500.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/archivo-latin-600.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/archivo-latin-ext-600.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 800; font-display: swap; src: url(/fonts/archivo-latin-800.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Archivo'; font-style: normal; font-weight: 800; font-display: swap; src: url(/fonts/archivo-latin-ext-800.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Archivo Narrow'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/archivo-narrow-latin-500.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Archivo Narrow'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/archivo-narrow-latin-ext-500.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Archivo Narrow'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/archivo-narrow-latin-600.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Archivo Narrow'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/archivo-narrow-latin-ext-600.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
    --desk: #dce1e6;
    --desk-ink: #17212b;
    --desk-muted: #4d5864;
    --paper: #ffffff;
    --ink: #17212b;
    --muted: #5e6975;
    --rule: #c7ced6;
    --pen: #1e40c8;
    --pen-dark: #16309a;
    --pen-soft: #eaf0fd;
    --danger: #b42318;
    --danger-soft: #fdecea;
    --sans: 'Archivo', system-ui, sans-serif;
    --narrow: 'Archivo Narrow', 'Archivo', system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --desk: #1b222b;
        --desk-ink: #eef1f4;
        --desk-muted: #a7b1bc;
    }
}
:root[data-theme="dark"] { --desk: #1b222b; --desk-ink: #eef1f4; --desk-muted: #a7b1bc; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--desk);
    color: var(--desk-ink);
    font: 400 16px/1.5 var(--sans);
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--pen); outline-offset: 2px; }

/* ── Page frame ── */
.top {
    max-width: 1280px; margin: 0 auto; padding: 20px 32px;
    display: flex; align-items: center; justify-content: space-between;
}
.wordmark { font-weight: 800; font-size: 19px; letter-spacing: -0.02em; text-decoration: none; }
.wordmark span { color: var(--pen); }
:root[data-theme="dark"] .wordmark span { color: #8ea6ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wordmark span { color: #8ea6ff; } }
.top { position: relative; z-index: 20; gap: 24px; }

/* Main menu: plain text links; the current page is underlined in pen blue */
.menu { display: flex; align-items: center; gap: 4px 22px; flex-wrap: wrap; justify-content: flex-end; }
.menu > a, .sub-btn { font: 500 15px var(--sans); color: var(--desk-ink); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.menu > a:hover, .sub-btn:hover { border-bottom-color: var(--rule); }
.menu a[aria-current="page"], .sub.is-on > .sub-btn { border-bottom-color: var(--pen); }
.menu > a.login { color: var(--desk-muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; border: 0; margin-left: 10px; }
.sub { position: relative; }
.sub-btn { background: none; border-top: 0; border-left: 0; border-right: 0; cursor: pointer; }
.sub-btn::after { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 0 3px 8px; border-right: 1.5px solid; border-bottom: 1.5px solid; transform: rotate(45deg); }
.sub-list { display: none; position: absolute; right: -14px; top: calc(100% + 8px); min-width: 250px; background: var(--paper); color: var(--ink);
            padding: 8px 0; box-shadow: 0 1px 1px rgba(23,33,43,.08), 0 18px 36px -18px rgba(23,33,43,.45); }
.sub.is-open .sub-list { display: block; }
.sub-list a { display: block; padding: 9px 18px; font-size: 15px; color: var(--ink); text-decoration: none; }
.sub-list a:hover { background: var(--pen-soft); }
.sub-list a[aria-current="page"] { color: var(--pen); font-weight: 600; }
.menu-btn { display: none; }

@media (max-width: 960px) {
    .menu-btn { display: block; background: none; border: 1.5px solid var(--desk-ink); color: var(--desk-ink); font: 600 15px var(--sans); padding: 7px 14px; cursor: pointer; }
    .menu-btn[aria-expanded="true"] { background: var(--desk-ink); color: var(--desk); }
    .menu { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 0;
            background: var(--paper); padding: 8px 16px 16px; box-shadow: 0 24px 40px -24px rgba(23,33,43,.5); }
    .menu.is-open { display: flex; }
    .menu > a, .sub-btn { color: var(--ink); padding: 13px 0; border-bottom: 1px solid #e6e9ed; font-size: 17px; text-align: left; width: 100%; }
    .menu a[aria-current="page"], .sub.is-on > .sub-btn { color: var(--pen); font-weight: 600; border-bottom-color: #e6e9ed; }
    .sub-btn { display: none; }
    .sub-list { display: block; position: static; box-shadow: none; padding: 0; min-width: 0; background: none; }
    .sub-list::before { content: "E-Rechnung"; display: block; font: 600 13px var(--narrow); color: var(--muted); padding: 16px 0 4px; }
    .sub-list a { padding: 13px 0; font-size: 17px; border-bottom: 1px solid #e6e9ed; }
    .sub-list a:hover { background: none; }
    .menu > a.login { color: var(--muted); margin: 14px 0 0; padding: 4px 0; font-size: 15px; }
}

.desk {
    max-width: 1280px; margin: 0 auto; padding: 8px 32px 64px;
    display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
    gap: 48px; align-items: start;
}
.intro { position: sticky; top: 24px; }
.intro h1 {
    font-weight: 800; font-size: clamp(34px, 4vw, 50px); line-height: 1.02;
    letter-spacing: -0.035em; margin: 8px 0 18px;
}
.intro .lead { font-size: 17px; color: var(--desk-muted); margin: 0 0 22px; max-width: 34ch; }
.facts { list-style: none; padding: 0; margin: 0 0 28px; border-top: 1px solid color-mix(in srgb, var(--desk-ink) 18%, transparent); }
.facts li {
    padding: 11px 0; font-size: 15px; line-height: 1.4;
    border-bottom: 1px solid color-mix(in srgb, var(--desk-ink) 18%, transparent);
}
.facts strong { font-weight: 600; }

.actions { display: grid; gap: 10px; }
.btn {
    appearance: none; border: 0; cursor: pointer; text-align: left;
    font: 600 16px/1.2 var(--sans); padding: 15px 18px; border-radius: 6px;
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    transition: background-color .15s, transform .05s;
}
.btn small { font: 500 13px var(--narrow); opacity: .8; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--pen); color: #fff; }
.btn-primary:hover { background: var(--pen-dark); }
.btn-secondary { background: transparent; color: var(--desk-ink); box-shadow: inset 0 0 0 1.5px currentColor; }
.btn-secondary:hover { background: color-mix(in srgb, var(--desk-ink) 7%, transparent); }
.btn.is-busy { opacity: .6; pointer-events: none; }
.reset {
    margin-top: 14px; background: none; border: 0; padding: 4px 0; cursor: pointer;
    font: 500 14px var(--sans); color: var(--desk-muted); text-decoration: underline; text-underline-offset: 3px;
}

/* ── The sheet ── */
.sheet {
    position: relative; background: var(--paper); color: var(--ink);
    padding: 52px 52px 44px; border-radius: 2px;
    box-shadow: 0 1px 1px rgba(23,33,43,.08), 0 24px 48px -28px rgba(23,33,43,.45);
}
/* Fold and punch marks as on a DIN 5008 letterhead */
.sheet::before, .sheet::after {
    content: ""; position: absolute; left: 0; width: 14px; height: 1px; background: var(--rule);
}
.sheet::before { top: 35.4%; }
.sheet::after  { top: 50%; width: 22px; }

.errors {
    background: var(--danger-soft); color: var(--danger); border-left: 3px solid var(--danger);
    padding: 12px 16px; margin: -16px 0 28px; font-size: 15px;
}
.errors ul { margin: 6px 0 0; padding-left: 18px; }

.parties { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.block-title { font: 600 15px var(--narrow); color: var(--ink); margin: 0 0 6px; }
.hint { font: 500 13px/1.4 var(--narrow); color: var(--muted); margin: 4px 0 0; }

.f { display: block; margin-top: 10px; }
.f > span { display: block; font: 500 13px var(--narrow); color: var(--muted); }
.f input, .f select, .f textarea, .cell input, .cell select {
    width: 100%; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0;
    background: transparent; color: var(--pen);
    font: 500 16px/1.4 var(--sans); padding: 5px 2px 6px; margin: 0;
}
.f select, .cell select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: right 8px top 55%, right 3px top 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 18px; }
.f textarea { resize: vertical; min-height: 64px; }
.f input::placeholder, .f textarea::placeholder, .cell input::placeholder { color: #a9b2bc; font-weight: 400; }
.f input:focus, .f select:focus, .f textarea:focus, .cell input:focus, .cell select:focus {
    outline: none; background: var(--pen-soft); border-bottom: 2px solid var(--pen); padding-bottom: 5px;
}
.f input:user-invalid, .cell input:user-invalid { border-bottom: 2px solid var(--danger); background: var(--danger-soft); }
.f.req > span::after { content: " *"; color: var(--pen); }
.row { display: grid; gap: 14px; }
.row-zip { grid-template-columns: 96px 1fr; }
.row-2 { grid-template-columns: 1fr 1fr; }

details.more { margin-top: 14px; }
details.more summary { cursor: pointer; font: 500 14px var(--narrow); color: var(--muted); }
details.more summary:hover { color: var(--pen); }

.title-row { display: flex; align-items: flex-end; gap: 20px; margin: 56px 0 6px; flex-wrap: wrap; }
.title-row h2 { font-weight: 800; font-size: 34px; letter-spacing: -0.03em; margin: 0; line-height: 1; }
.title-row .f { margin: 0; width: 200px; }
.meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* Items */
.items { margin-top: 40px; }
.items-head, .item { display: grid; grid-template-columns: minmax(0,1fr) 56px 64px 96px 66px 92px 28px; gap: 8px; align-items: end; }
.items-head { font: 500 13px var(--narrow); color: var(--muted); padding-bottom: 6px; border-bottom: 1.5px solid var(--ink); }
.items-head .num, .item .amount { text-align: right; }
.item { padding: 8px 0 10px; border-bottom: 1px solid #eef0f3; }
.cell label { display: none; font: 500 12px var(--narrow); color: var(--muted); }
.cell input[data-num] { text-align: right; font-variant-numeric: tabular-nums; }
.item .amount { font-weight: 600; font-variant-numeric: tabular-nums; padding-bottom: 7px; white-space: nowrap; }
.remove {
    border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1;
    width: 28px; height: 32px; border-radius: 4px;
}
.remove:hover { color: var(--danger); background: var(--danger-soft); }
.add {
    margin-top: 12px; border: 1.5px dashed var(--rule); background: none; cursor: pointer;
    color: var(--pen); font: 600 15px var(--sans); padding: 10px 14px; border-radius: 4px; width: 100%; text-align: left;
}
.add:hover { border-color: var(--pen); background: var(--pen-soft); }

.sum-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 40px; margin-top: 28px; align-items: start; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--pen); flex: none; }
.totals { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.totals td { padding: 5px 0; }
.totals td:last-child { text-align: right; }
.totals .grand td { border-top: 1.5px solid var(--ink); padding-top: 10px; font-weight: 800; font-size: 20px; }

.foot { margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--rule); display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }

.page-foot { max-width: 1280px; margin: 0 auto; padding: 0 32px 40px; font-size: 14px; color: var(--desk-muted); }

.mobile-bar { display: none; }

/* ── Tablet: sheet goes full width, intro on top ── */
@media (max-width: 1040px) {
    .desk { grid-template-columns: 1fr; gap: 28px; }
    .intro { position: static; }
    .intro .lead { max-width: 60ch; }
    .actions-slot-top { display: none; }
}
@media (min-width: 1041px) { .actions-slot-bottom { display: none; } }

/* ── Phone ── */
@media (max-width: 680px) {
    .top { padding: 14px 16px; }
    .desk { padding: 4px 16px 120px; }
    .intro h1 { font-size: 34px; }
    .facts { margin-bottom: 0; }
    .sheet { padding: 28px 18px 28px; margin: 0 -4px; }
    .sheet::before, .sheet::after { display: none; }
    .parties { grid-template-columns: 1fr; gap: 28px; }
    .seller { order: -1; }
    .title-row { margin-top: 36px; }
    .title-row h2 { font-size: 28px; }
    .title-row .f { width: 100%; }
    .meta { grid-template-columns: 1fr 1fr; gap: 0 14px; }
    .meta .f:first-child { grid-column: 1 / -1; }
    .items-head { display: none; }
    .item {
        grid-template-columns: 1fr 1fr; gap: 8px 14px;
        padding: 14px 0; border-bottom: 1px solid var(--rule); position: relative;
    }
    .item .c-desc { grid-column: 1 / -1; padding-right: 34px; }
    .cell label { display: block; }
    .item .amount { grid-column: 1 / -1; padding: 4px 0 0; }
    .item .remove { position: absolute; top: 14px; right: 0; }
    .sum-wrap, .foot { grid-template-columns: 1fr; gap: 24px; }
    .page-foot { padding: 0 16px 110px; }
    .mobile-bar {
        display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
        background: var(--paper); color: var(--ink); gap: 12px; align-items: center; justify-content: space-between;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
        box-shadow: 0 -8px 24px -12px rgba(23,33,43,.35);
    }
    .mobile-bar .lbl { font: 500 13px var(--narrow); color: var(--muted); display: block; }
    .mobile-bar .val { font-weight: 800; font-size: 19px; font-variant-numeric: tabular-nums; }
    .mobile-bar .btn { padding: 13px 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ── Guide below the sheet ── */
.guide {
    max-width: 1280px; margin: 0 auto; padding: 24px 32px 72px;
    display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 48px; align-items: start;
}
.toc { position: sticky; top: 24px; font-size: 15px; }
.toc p { font: 600 15px var(--narrow); margin: 0 0 8px; }
.toc ol { margin: 0; padding-left: 20px; color: var(--desk-muted); }
.toc li { padding: 3px 0; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; text-underline-offset: 3px; }
.article { max-width: 70ch; }
.article h2 {
    font-weight: 800; font-size: clamp(26px, 2.6vw, 32px); line-height: 1.1; letter-spacing: -0.025em;
    margin: 64px 0 14px; scroll-margin-top: 20px;
}
.article > section:first-child h2 { margin-top: 8px; }
.article h3 { font-weight: 600; font-size: 19px; margin: 28px 0 6px; }
.article p, .article li { font-size: 17px; line-height: 1.6; }
.article p { margin: 0 0 14px; }
.article ul, .article ol { padding-left: 22px; margin: 0 0 16px; }
.article li { margin-bottom: 6px; }
.article a { color: var(--pen); text-underline-offset: 3px; }
:root[data-theme="dark"] .article a { color: #8ea6ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .article a { color: #8ea6ff; } }
.steps { list-style: none; padding: 0 !important; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding-left: 44px; margin-bottom: 14px; }
.steps li::before {
    content: counter(s); position: absolute; left: 0; top: 0;
    width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
    background: var(--pen); color: #fff; font: 600 15px var(--sans);
}
.cmp { width: 100%; border-collapse: collapse; margin: 8px 0 18px; font-size: 16px; }
.cmp th, .cmp td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid color-mix(in srgb, var(--desk-ink) 18%, transparent); }
.cmp th { font: 600 15px var(--narrow); border-bottom: 1.5px solid var(--desk-ink); }
.cmp-wrap { overflow-x: auto; }
.timeline { list-style: none; padding: 0 !important; border-left: 2px solid var(--pen); margin-left: 6px !important; }
.timeline li { padding: 0 0 14px 20px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -7px; top: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--desk); border: 2px solid var(--pen); }
.timeline strong { display: block; }
.faq details { border-bottom: 1px solid color-mix(in srgb, var(--desk-ink) 18%, transparent); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 17px; list-style-position: outside; }
.faq details p { margin: 10px 0 0; }
.related { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; padding: 0 !important; list-style: none; }
.related a { display: inline-block; padding: 9px 14px; border-radius: 6px; box-shadow: inset 0 0 0 1.5px currentColor; text-decoration: none; color: var(--desk-ink) !important; font-weight: 500; }
.related a:hover { background: color-mix(in srgb, var(--desk-ink) 7%, transparent); }
.crumbs { font-size: 14px; color: var(--desk-muted); margin: 0 0 4px; }
.crumbs a { color: inherit; }

/* ── Site footer ── */
.site-foot { border-top: 1px solid color-mix(in srgb, var(--desk-ink) 18%, transparent); }
.site-foot .in { max-width: 1280px; margin: 0 auto; padding: 28px 32px 40px; display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; font-size: 15px; color: var(--desk-muted); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* ── Legal pages ── */
.legal { max-width: 760px; margin: 0 auto; padding: 16px 32px 72px; }
.legal h1 { font-weight: 800; font-size: clamp(32px, 4vw, 44px); letter-spacing: -0.03em; line-height: 1.05; margin: 8px 0 24px; }
.legal h2 { font-weight: 600; font-size: 21px; margin: 36px 0 8px; }
.legal p, .legal li, .legal td { font-size: 16px; line-height: 1.6; }
.legal table { width: 100%; border-collapse: collapse; }
.legal td, .legal th { text-align: left; vertical-align: top; padding: 8px 10px 8px 0; border-bottom: 1px solid color-mix(in srgb, var(--desk-ink) 18%, transparent); }
.legal a { color: inherit; text-underline-offset: 3px; }

@media (max-width: 1040px) {
    .guide { grid-template-columns: 1fr; gap: 8px; }
    .toc { position: static; }
}
@media (max-width: 680px) {
    .guide { padding: 8px 16px 48px; }
    .site-foot .in { padding: 24px 16px 110px; }
    .legal { padding: 8px 16px 48px; }
    .article h2 { margin-top: 48px; }
    .cmp { font-size: 15px; }
}

/* Fields only the XRechnung needs */
.f.xr > span::after, .xr-mark { content: " X"; font: 600 11px var(--narrow); color: var(--pen); }
.xr-mark { display: inline-block; padding: 0 3px; border: 1px solid currentColor; border-radius: 3px; line-height: 1.3; }
.legal .muted { color: var(--desk-muted); }
.legal code { font-size: 14px; }
.legal td, .legal th { overflow-wrap: anywhere; }

/* ── Validator page ── */
:root { --ok: #11733b; --ok-soft: #e6f4ea; }
.intro .facts a { color: inherit; text-underline-offset: 3px; }
.check-sheet { padding: 40px 44px; }
.upload { display: grid; gap: 14px; }
.drop {
    display: grid; gap: 4px; place-items: center; text-align: center; cursor: pointer;
    border: 1.5px dashed var(--rule); border-radius: 6px; padding: 40px 20px; color: var(--ink);
}
.drop:hover, .drop.is-over, .drop:focus-within { border-color: var(--pen); background: var(--pen-soft); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-main { font-weight: 600; font-size: 17px; color: var(--pen); word-break: break-all; }
.upload .btn { justify-content: center; }
.verdict { border-left: 4px solid; padding: 14px 18px; margin-bottom: 24px; }
.verdict p { margin: 0; }
.verdict-ok { border-color: var(--ok); background: var(--ok-soft); }
.verdict-bad { border-color: var(--danger); background: var(--danger-soft); }
.verdict-title { font-weight: 800; font-size: 24px; letter-spacing: -0.02em; }
.verdict-ok .verdict-title { color: var(--ok); }
.verdict-bad .verdict-title { color: var(--danger); }
.check-h { font: 600 15px var(--narrow); margin: 0 0 8px; }
.rules { list-style: none; padding: 0; margin: 0 0 24px; }
.rules li { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid #eef0f3; font-size: 15px; }
.rules code { font: 600 13px var(--narrow); color: var(--danger); padding-top: 2px; }
.rules-warn code { color: var(--muted); }
@media (max-width: 680px) {
    .check-sheet { padding: 24px 18px; }
    .rules li { grid-template-columns: 1fr; gap: 2px; }
}

/* Document type fields */
[hidden] { display: none !important; }
.meta.ref { margin-top: 4px; }
.convert { margin-top: 6px; }
.link-btn { background: none; border: 0; padding: 4px 0; cursor: pointer; font: 600 14px var(--sans); color: var(--pen); text-decoration: underline; text-underline-offset: 3px; }
body[data-doc="angebot"] .btn[value="zugferd"], body[data-doc="angebot"] .btn[value="xml"],
body[data-doc="mahnung"] .btn[value="zugferd"], body[data-doc="mahnung"] .btn[value="xml"] { display: none; }

/* Viewer: a received e-invoice as a sheet */
.viewer-actions { display: grid; gap: 10px; }
.viewer-actions form, .viewer-actions .btn { width: 100%; }
.viewer-actions a.btn { text-decoration: none; }
.viewer-check { margin: 0 0 16px; padding: 12px 16px; border-left: 4px solid; font-size: 15px; }
.viewer-check.ok { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.viewer-check.bad { border-color: var(--danger); background: var(--danger-soft); color: var(--ink); }
.viewer-check.bad summary { cursor: pointer; font-weight: 600; color: var(--danger); }
.viewer-check .rules { margin: 12px 0 0; }
.xr-view p { margin: 0; line-height: 1.5; }
.xr-view .xr-name { font-weight: 600; }
.xr-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 20px; margin: 40px 0 0; }
.xr-meta dt { font: 400 13px var(--narrow); color: var(--muted); }
.xr-meta dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.xr-lines-wrap { margin-top: 32px; overflow-x: auto; }
.xr-lines { width: 100%; border-collapse: collapse; font-size: 15px; }
.xr-lines th { font: 400 13px var(--narrow); color: var(--muted); text-align: left; padding: 0 10px 8px 0; border-bottom: 1.5px solid var(--ink); }
.xr-lines td { padding: 10px 10px 10px 0; border-bottom: 1px solid #e6e9ed; vertical-align: top; }
.xr-lines th:last-child, .xr-lines td:last-child { padding-right: 0; }
.xr-lines .r { text-align: right; white-space: nowrap; }
.xr-lines td span.muted, .xr-totals td span.muted { display: block; font-size: 13px; }
.xr-totals { margin: 18px 0 0 auto; width: min(100%, 380px); }
.xr-view .muted, .viewer-check .muted { color: var(--muted); }
.xr-pay { margin-top: 28px; }
.xr-note { margin-top: 16px !important; color: var(--muted); }
@media (max-width: 640px) {
    .xr-meta { grid-template-columns: 1fr 1fr; }
    .xr-lines { font-size: 14px; }
}

/* Templates index: a plain register of trades */
.hub { max-width: 1280px; margin: 0 auto; padding: 16px 32px 72px; }
.hub h1 { font-weight: 800; font-size: clamp(34px, 4.6vw, 52px); letter-spacing: -0.035em; line-height: 1.02; margin: 8px 0 14px; }
.hub > .lead { max-width: 62ch; margin: 0 0 24px; }
.hub-group { margin-top: 44px; }
.hub-group h2 { font: 600 15px var(--narrow); color: var(--desk-muted); margin: 0 0 4px; padding-bottom: 8px; border-bottom: 1.5px solid var(--desk-ink); }
.hub-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; }
.hub-list li { border-bottom: 1px solid color-mix(in srgb, var(--desk-ink) 16%, transparent); }
.hub-list a { display: block; padding: 14px 0; text-decoration: none; color: inherit; }
.hub-list a:hover .hub-name, .hub-list a:focus-visible .hub-name { color: var(--pen); text-decoration: underline; text-underline-offset: 3px; }
.hub-name { display: block; font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.hub-lead { display: block; font-size: 15px; line-height: 1.45; color: var(--desk-muted); margin-top: 2px; }
.trade-links { columns: 2; column-gap: 32px; }
.trade-links li { break-inside: avoid; }
@media (max-width: 720px) {
    .hub { padding: 8px 16px 56px; }
    .hub-list { grid-template-columns: 1fr; }
    .trade-links { columns: 1; }
}
:root[data-theme="dark"] .hub-list a:hover .hub-name { color: #8ea6ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hub-list a:hover .hub-name { color: #8ea6ff; } }
