/* MeinKassenbuch. Fonts are self-hosted (no requests to Google from the visitor's browser). */
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/plex-sans.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 400; font-display: swap; src: url(/assets/fonts/plex-mono-400.woff2) format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-display: swap; src: url(/assets/fonts/plex-mono-500.woff2) format('woff2'); }
@font-face { font-family: 'Source Serif 4'; font-weight: 600 700; font-display: swap; src: url(/assets/fonts/source-serif.woff2) format('woff2'); }

/* Design tokens: variant C "Amtlich" (the variants differ only here). */
:root {
  --font: 'IBM Plex Sans', system-ui, sans-serif; --hfont: 'Source Serif 4', Georgia, serif; --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --ink: #14233d; --muted: #4f5b70; --bg: #fff; --hero: #edf0f5; --hdr: #14284b; --hdr-ink: #fff;
  --card: #fff; --soft: #f5f7fa; --line: #d5dbe5; --line2: #e8ecf2;
  --accent: #f2b234; --accent-ink: #14233d; --accent-hover: #e0a020; --eyebrow: #a86d00;
  --pill: #fdf1d6; --pill-ink: #7a5000; --pos: #14633d; --neg: #a12a2a; --focus: #2f6fdf; --r: 3px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 16px; line-height: 1.55; }
img { max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--hfont); line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: clamp(32px, 5vw, 46px); margin: 12px 0 18px; }
h2 { font-size: clamp(24px, 3.2vw, 30px); margin: 48px 0 16px; }
h3 { font-size: 20px; margin: 28px 0 8px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 10; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.mono, .n { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.site-header { background: var(--hdr); color: var(--hdr-ink); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 8px 24px; flex-wrap: wrap; }
.brand { display: flex; gap: 10px; align-items: center; font-weight: 700; font-size: 19px; text-decoration: none; }
.nav { display: flex; gap: 6px 22px; font-size: 15px; flex-wrap: wrap; }
.nav a { text-decoration: none; opacity: .88; padding: 4px 0; }
.nav a:hover, .nav a[aria-current] { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }

.hero { background: var(--hero); padding: 64px 0 56px; }
.hero .wrap { display: grid; grid-template-columns: 1fr 1.25fr; gap: 48px; align-items: center; }
.eyebrow { color: var(--eyebrow); font-weight: 600; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin: 0; }
.lead { font-size: 18px; color: var(--muted); }
.btns { display: flex; gap: 12px; margin: 26px 0 18px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: var(--r);
  font: 600 16px/1.2 var(--font); border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--ink); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-small { padding: 7px 12px; font-size: 14px; }
.btn-link { background: none; border: 0; padding: 4px; text-decoration: underline; font-weight: 500; color: var(--muted); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.note { font-size: 14px; color: var(--muted); margin: 6px 0; }

section.band { padding: 8px 0 56px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.card h3 { margin-top: 0; font-family: var(--font); font-size: 17px; }
.card p { margin: 0; font-size: 15px; color: var(--muted); }
.price-card.hl { border: 2px solid var(--accent); }
.amt { font: 700 32px/1.1 var(--hfont); margin: 6px 0; }

/* The cash book table (landing example and app) */
.book { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.book-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--soft); flex-wrap: wrap; }
.book-head b { font-family: var(--hfont); font-size: 17px; }
.pill { font-size: 12px; padding: 3px 9px; border-radius: 99px; background: var(--pill); color: var(--pill-ink); font-weight: 600; white-space: nowrap; }
.tablewrap { overflow-x: auto; }
table.kb { width: 100%; border-collapse: collapse; font-size: 14px; }
table.kb th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.kb td { padding: 9px 12px; border-bottom: 1px solid var(--line2); vertical-align: top; }
table.kb .n { text-align: right; white-space: nowrap; }
.in { color: var(--pos); } .out { color: var(--neg); }
tr.storned td:not(.act) { color: var(--muted); text-decoration: line-through; }
.tag { display: inline-block; font-size: 11px; background: var(--pill); color: var(--pill-ink); padding: 1px 6px; border-radius: 4px; font-weight: 600; text-decoration: none; }
.book-sum { display: flex; justify-content: space-between; padding: 12px 18px; background: var(--soft); font-weight: 600; gap: 12px; }
.book-foot { padding: 10px 18px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
tr.closed-row td { background: var(--soft); font-size: 13px; color: var(--muted); }

/* Articles */
.article { padding: 40px 0 64px; }
.article p, .article li { max-width: 72ch; }
.answer { font-size: 18px; border-left: 4px solid var(--accent); padding: 4px 0 4px 16px; }
.qa { border-top: 1px solid var(--line); padding: 4px 0; }
.qa h3 { font-family: var(--font); font-size: 17px; }
table.facts { border-collapse: collapse; margin: 16px 0; font-size: 15px; }
table.facts th, table.facts td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
table.facts th { background: var(--soft); }
.crumbs { font-size: 14px; color: var(--muted); margin: 0 0 8px; }
.cta-box { background: var(--hero); border: 1px solid var(--line); padding: 20px; border-radius: var(--r); margin: 32px 0; }
.cta-box p { margin: 0 0 12px; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }
.field input, .field select, .field textarea { font: 400 16px var(--font); padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background-color: #fff; color: var(--ink); min-width: 0; min-height: 44px; line-height: 1.3; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
/* Factory fix 2026-10-31: custom chevron instead of the native select arrow; label + hint on one line. */
select { -webkit-appearance: none; -moz-appearance: none; appearance: none; padding-right: 40px; cursor: pointer; text-overflow: ellipsis; white-space: nowrap;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%234F5B70' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px; }
select:hover, .field input:hover { border-color: var(--muted); }
select::-ms-expand { display: none; }
.field > .lbl { display: block; }
.field > .lbl .hint { margin-left: 6px; }
.field input:focus, .field select:focus { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: -1px; }
.select-sm { font: 500 14px var(--font); padding: 6px 34px 6px 10px; border: 1px solid var(--line); border-radius: var(--r); background-color: #fff; color: var(--ink); background-position: right 11px center; }
.entry-grid { display: grid; gap: 12px 14px; grid-template-columns: repeat(6, minmax(0, 1fr)); align-items: end; }
.entry-grid .c1 { grid-column: span 1; } .entry-grid .c2 { grid-column: span 2; } .entry-grid .c3 { grid-column: span 3; } .entry-grid .c4 { grid-column: span 4; }
@media (max-width: 760px) {
  .entry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entry-grid .c1, .entry-grid .c2, .entry-grid .c3 { grid-column: span 1; }
  .entry-grid .c4 { grid-column: span 2; }
}
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.err { color: var(--neg); font-weight: 600; }
.ok { color: var(--pos); font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.seg button { font: 600 15px var(--font); padding: 10px 18px; border: 0; background: #fff; color: var(--ink); cursor: pointer; }
.seg button[aria-pressed="true"].s-in { background: var(--pos); color: #fff; }
.seg button[aria-pressed="true"].s-out { background: var(--neg); color: #fff; }

dialog { border: 1px solid var(--line); border-radius: var(--r); padding: 24px; max-width: 560px; width: calc(100% - 32px); color: var(--ink); }
dialog::backdrop { background: rgba(20, 35, 61, .45); }
dialog h2 { margin-top: 0; font-size: 24px; }

.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 14px; color: var(--muted); background: var(--soft); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 8px 18px; flex-wrap: wrap; }

.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 20; max-width: 640px; margin: 0 auto; background: #fff; border: 1px solid var(--line);
  box-shadow: 0 8px 30px rgba(0,0,0,.15); padding: 16px 18px; border-radius: var(--r); font-size: 14px; }
.consent p { margin: 0 0 12px; }
.consent .btns { margin: 0; }

@media (max-width: 860px) {
  .hero .wrap, .grid4, .grid3 { grid-template-columns: 1fr; }
  .grid4 { grid-template-columns: 1fr 1fr; }
  .hero { padding: 32px 0 40px; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .grid4 { grid-template-columns: 1fr; }
  .site-header .wrap { padding-top: 10px; padding-bottom: 10px; }
  .nav { font-size: 14px; gap: 4px 14px; }
  table.kb { font-size: 13px; }
  table.kb td, table.kb th { padding: 8px 6px; }
  .hide-sm { display: none; }
}
@media print {
  .site-header, .site-footer, .no-print, .consent, dialog { display: none !important; }
  body { font-size: 11pt; }
  .book { border: 0; }
  table.kb { font-size: 9.5pt; }
  table.kb td, table.kb th { padding: 4px 6px; }
  .print-only { display: block !important; }
}
.print-only { display: none; }
.show-sm, .show-sm-i { display: none; }
@media (max-width: 560px) { .show-sm { display: table-cell; } .show-sm-i { display: inline; } }
@media print { .show-sm { display: none !important; } .hide-sm { display: table-cell !important; } }

/* Free generators (Quittung, Bewirtungsbeleg, Kassenbericht): form left, printable preview right. */
.tool { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: start; margin: 24px 0 8px; }
.tool form { display: grid; gap: 14px; background: var(--soft); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.tool .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tool textarea { resize: vertical; min-height: 72px; }
.tool .btns { margin: 4px 0 0; }
.tool .warn { background: var(--pill); color: var(--pill-ink); border-radius: var(--r); padding: 10px 14px; font-size: 14px; }
.tool .warn p { margin: 4px 0; }
.preview { position: sticky; top: 16px; }
.preview-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 6px; font-weight: 600; }
.receipt { background: #fff; border: 1px solid var(--line); padding: 22px 24px; font-size: 14px; line-height: 1.45; }
.receipt + .receipt { margin-top: 0; }
.r-head { display: flex; align-items: baseline; gap: 16px; border-bottom: 2px solid var(--ink); padding-bottom: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.r-head b { font: 700 24px var(--hfont); margin-right: auto; }
.r-copy { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.r-amt, .r-grid, .r-count { width: 100%; border-collapse: collapse; margin: 6px 0 12px; }
.r-amt th, .r-grid th { text-align: left; font-weight: 400; color: var(--muted); padding: 5px 0; border-bottom: 1px solid var(--line2); }
.r-amt td { text-align: right; font-family: var(--mono); padding: 5px 0; border-bottom: 1px solid var(--line2); white-space: nowrap; min-width: 8em; }
.r-grid th { width: 38%; vertical-align: top; padding-right: 12px; }
.r-grid td { padding: 5px 0; border-bottom: 1px solid var(--line2); }
.r-amt tr.tot th, .r-amt tr.tot td { font-weight: 700; color: var(--ink); border-bottom: 2px solid var(--ink); }
.r-amt tr.big th, .r-amt tr.big td { font-size: 16px; }
.r-count { font-size: 13px; }
.r-count th, .r-count td { padding: 3px 6px; border-bottom: 1px solid var(--line2); text-align: left; }
.r-count .n { text-align: right; }
.r-count tr.tot td { font-weight: 700; border-top: 2px solid var(--ink); }
.r-sub { font: 600 15px var(--font); margin: 14px 0 4px; }
.r-line { display: flex; gap: 10px; margin: 8px 0; align-items: baseline; }
.r-l { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; min-width: 5.5em; }
.r-line .r-l { display: inline-block; }
.r-conf { margin: 14px 0 6px; font-weight: 600; }
.r-note { font-size: 12.5px; margin: 6px 0; }
.r-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 22px; }
.r-issuer { margin-top: 14px; font-size: 13px; border-top: 1px solid var(--line2); padding-top: 8px; }
.ln { display: inline-block; border-bottom: 1px solid var(--ink); min-height: 1.2em; vertical-align: bottom; }
.ln.sig { display: block; width: 100%; height: 2.2em; }
.cut { text-align: center; font-size: 11px; color: var(--muted); border-top: 1px dashed var(--muted); margin: 18px 0; padding-top: 2px; }
.tool-links { margin-top: 32px; }
@media (max-width: 860px) {
  .tool { grid-template-columns: 1fr; }
  .preview { position: static; }
}
@media (max-width: 560px) {
  .tool .row2, .r-foot { grid-template-columns: 1fr; }
  .receipt { padding: 16px; }
}
@media print {
  body:has(.tool) .article > :not(.tool), body:has(.tool) .tool form, body:has(.tool) .preview-label { display: none !important; }
  body:has(.tool) .article { padding: 0; }
  .tool { display: block; margin: 0; }
  .preview { position: static; }
  .receipt { border: 1px solid #999; break-inside: avoid; font-size: 10.5pt; }
  .cut { margin: 10mm 0; }
}
