/* MwSt-Rechner. A desk of grey-blue card, a till receipt as the one bold element.
   Palette: desk, receipt paper, ink, stamp blue for actions, till red for the tax line. */
:root {
  --desk: #d9dfe3;
  --desk-deep: #c3cbd1;
  --paper: #fffef9;
  --ink: #1f2328;
  --ink-soft: #56606b;
  --stamp: #24489a;
  --stamp-dark: #1a3675;
  --till: #b0302a;
  --text: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --receipt: "Courier Prime", "Courier New", monospace;
  --measure: 40rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--desk); color: var(--ink); font-family: var(--text); font-size: 1.0625rem; line-height: 1.6; }
a { color: var(--stamp); text-underline-offset: 0.18em; }
a:hover { color: var(--stamp-dark); }
:focus-visible { outline: 3px solid var(--stamp); outline-offset: 2px; }
.wrap { max-width: 60rem; margin: 0 auto; padding: 0 1.25rem; }

.site-header { padding: 1.1rem 0 0.4rem; }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1.5rem; }
.brand { font-weight: 700; font-size: 1.3rem; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
.brand::before { content: "%"; display: inline-block; margin-right: 0.35rem; color: var(--till); font-family: var(--receipt); }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.2rem 1.1rem; font-size: 0.97rem; }
.site-nav a { color: var(--ink-soft); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); line-height: 1.1; letter-spacing: -0.02em; margin: 1.5rem 0 0.5rem; }
h2 { font-size: 1.45rem; line-height: 1.25; margin: 2.75rem 0 0.75rem; letter-spacing: -0.01em; }
.lede { color: var(--ink-soft); max-width: var(--measure); margin: 0 0 1.5rem; font-size: 1.12rem; }
.prose { max-width: var(--measure); }
.prose p, .prose li { margin: 0 0 0.9rem; }
.formula { font-family: var(--receipt); font-size: 1.1rem; background: var(--paper); border-left: 4px solid var(--till); padding: 0.6rem 0.9rem; }

/* Calculator: inputs on the left, receipt on the right */
.rechner { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.75rem; align-items: start; }
.rechner-input { background: var(--paper); border-radius: 8px; padding: 1.4rem; border: 1px solid var(--desk-deep); }
.field-label { display: block; font-weight: 700; margin-bottom: 0.35rem; }
.input { width: 100%; font: inherit; font-size: 1.6rem; font-weight: 600; padding: 0.55rem 0.75rem; border: 2px solid var(--desk-deep); border-radius: 6px; background: #fff; color: var(--ink); }
.input:focus { border-color: var(--stamp); outline: none; box-shadow: 0 0 0 3px rgba(36, 72, 154, 0.22); }
.input-small { width: 5.5rem; font-size: 1rem; padding: 0.25rem 0.45rem; display: inline-block; margin: 0 0.25rem; }
.input-small:disabled { background: #f1f3f4; color: var(--ink-soft); }
.hint { color: var(--ink-soft); font-size: 0.92rem; margin: 0.45rem 0 0; }
.hint button { font: inherit; color: var(--stamp); background: none; border: 0; padding: 0 0.2rem; text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }
.choice { border: 0; margin: 1.25rem 0 0; padding: 0; }
.choice legend { font-weight: 700; margin-bottom: 0.35rem; padding: 0; }
.choice label { display: block; padding: 0.3rem 0; cursor: pointer; }
.choice input[type="radio"] { accent-color: var(--stamp); width: 1.05rem; height: 1.05rem; vertical-align: -0.12rem; margin-right: 0.35rem; }
.choice .note { color: var(--ink-soft); font-size: 0.92rem; }

/* The till receipt */
.rechner-output { position: sticky; top: 1rem; }
.bon {
  font-family: var(--receipt);
  background: var(--paper);
  padding: 1.4rem 1.3rem 2rem;
  box-shadow: 0 1px 0 var(--desk-deep), 0 10px 24px -14px rgba(31, 35, 40, 0.45);
  --tooth: 10px;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--tooth)) 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--tooth)) 100%;
  min-height: 12rem;
}
.bon-head { margin: 0 0 0.9rem; padding-bottom: 0.7rem; border-bottom: 2px dashed var(--desk-deep); text-align: center; font-size: 0.9rem; color: var(--ink-soft); }
.bon-empty, .bon-error { margin: 2.5rem 0 0; text-align: center; color: var(--ink-soft); }
.bon-error { color: var(--till); }
.bon-lines { margin: 0; }
.bon-lines div { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.3rem 0; font-size: 1.05rem; }
.bon-lines dt { white-space: nowrap; }
.bon-lines dd { margin: 0 0 0 auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bon-lines div { background-image: radial-gradient(circle, var(--desk-deep) 1px, transparent 1.2px); background-size: 7px 7px; background-position: 0 calc(100% - 0.55rem); background-repeat: repeat-x; }
.bon-lines dt, .bon-lines dd { background: var(--paper); padding: 0 0.2rem; }
.bon-vat { color: var(--till); }
.bon-total { margin-top: 0.5rem; padding-top: 0.6rem !important; border-top: 2px solid var(--ink); background-image: none !important; font-size: 1.45rem !important; font-weight: 700; }
.btn { margin-top: 0.9rem; font: inherit; font-weight: 600; background: var(--stamp); color: #fff; border: 0; border-radius: 6px; padding: 0.6rem 1.1rem; cursor: pointer; }
.btn:hover:not(:disabled) { background: var(--stamp-dark); }
.btn:disabled { background: var(--desk-deep); color: var(--ink-soft); cursor: default; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 1rem 0; }
table { width: 100%; border-collapse: collapse; background: var(--paper); font-size: 0.97rem; }
th, td { text-align: left; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--desk-deep); vertical-align: top; }
th { background: #eef1f3; font-weight: 700; }
table.num td, table.num th { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.num td:first-child, table.num th:first-child { text-align: left; }

/* FAQ */
details { background: var(--paper); border-radius: 6px; margin: 0 0 0.6rem; padding: 0.75rem 1rem; max-width: var(--measure); }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 0.6rem 0 0.1rem; }

.site-footer { margin-top: 4rem; padding: 1.5rem 0 2.5rem; border-top: 1px solid var(--desk-deep); color: var(--ink-soft); font-size: 0.92rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; }
.site-footer a { color: var(--ink-soft); }

@media (max-width: 760px) {
  .rechner { grid-template-columns: 1fr; }
  .rechner-output { position: static; }
  .input { font-size: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
