/* Lato – selbst gehostet (SIL OFL, siehe fonts/OFL-Lato.txt), keine Anfrage an Google */
@font-face { font-family: "Lato"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/lato-400.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/lato-700.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/lato-ext-400.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, 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: "Lato"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/lato-ext-700.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/*
 * Theme – Farben aus dem Buchungskalender auf www.kellerstoeckl.eu
 *   Jedes Kellerstöckl hat seine Kalenderfarbe (prices.json -> haeuser[].farben).
 *   app.js setzt beim Hauswechsel die Variablen --brand*, --belegt*, --reserviert, --inv-*.
 *   Die Werte unten sind der Standard (Am Satz, rot), falls prices.json keine Farben enthält.
 *   Neutral: Tageszellen #F4F4F4, Rahmen #DFDFDF, Ziffern #686868, Hintergrund #F5FAFD, Text #0C1416, Lato.
 * Die kopierte Rechnungstabelle liest ihre Farben ebenfalls aus diesen Variablen (--inv-*).
 */
:root {
  --brand: #d33939;
  --brand-dark: #b81616;
  --brand-soft: #fbeaea;
  --belegt: #dd7171;
  --belegt-text: #0c1416;
  --reserviert: #ebadad;

  --inv-dark: var(--brand-dark);   /* Kopf + Gesamtsumme */
  --inv-rest: var(--belegt);       /* Restbetrag (wie "Belegt") */
  --inv-rest-text: var(--belegt-text);
  --inv-light: #f4f4f4;     /* jede zweite Zeile */
  --inv-pale: var(--reserviert);   /* Anzahlung (wie "Reserviert") */
  --inv-line: #dfdfdf;
  --inv-muted: #686868;
  --inv-text: #0c1416;

  --wine: var(--brand-dark);
  --wine-dark: var(--brand-dark);
  --wine-soft: var(--brand-soft);
  --cream: #f5fafd;
  --card: #ffffff;
  --ink: #0c1416;
  --muted: #686868;
  --line: #dfdfdf;
  --ok: #2f6b3a;
  --warn-bg: #fff6df;
  --warn: #7a5a00;
  --err-bg: #fdeceb;
  --err: #9b1c1c;
  --radius: 10px;
  --font: "Lato", Arial, Helvetica, sans-serif;
  font-family: var(--font);
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--cream); }
body.embed, body.transparent { background: transparent; }

.ks { max-width: 860px; margin: 0 auto; padding: 20px 16px 28px; }
.ks-head { text-align: center; margin-bottom: 18px; }
.ks-head h1 { font-family: var(--font); font-weight: 700; font-size: 2rem; margin: 0; color: var(--ink); letter-spacing: .01em; }
.ks-sub { margin: 4px 0 0; color: var(--muted); }
body.kompakt .ks-head { display: none; }

.ks-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(0, 0, 0, .05); }
.ks-step { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; font-weight: 600; margin: 0 0 14px; }
.ks-step span { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(var(--brand), var(--brand-dark)); color: #fff; font-size: .85rem; flex: none; }
.ks-step small { color: var(--muted); font-weight: 400; }
details.ks-card > summary { cursor: pointer; list-style: none; margin: 0; }
details.ks-card > summary::-webkit-details-marker { display: none; }
details.ks-card > summary::after { content: "+"; margin-left: auto; color: var(--wine); font-size: 1.4rem; font-weight: 400; line-height: 1; }
details[open].ks-card > summary { margin-bottom: 14px; }
details[open].ks-card > summary::after { content: "−"; }

.ks-houses { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ks-house { text-align: left; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; font: inherit; color: inherit; transition: border-color .15s, background .15s; }
.ks, .ks * { transition-property: background-color, border-color, color; transition-duration: .2s; }
.ks-house { --c: var(--brand-dark); --c-res: var(--reserviert); --c-soft: var(--brand-soft); border-top: 5px solid var(--c-res); }
.ks-house:hover { border-color: var(--c-res); }
.ks-house.on { border-color: var(--c); border-top-color: var(--c); background: var(--c-soft); box-shadow: inset 0 0 0 1px var(--c); }
.ks-house-name { font-weight: 700; }
.ks-house-ort { font-size: .82rem; color: var(--muted); }
.ks-house-price { white-space: nowrap; margin-top: 6px; font-weight: 700; color: var(--c); }
.ks-house-price small { font-weight: 400; color: var(--muted); }

.ks-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.ks-field { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; font-weight: 600; }
.ks-field small { font-weight: 400; color: var(--muted); font-size: .78rem; }
.ks-field input { font: inherit; font-weight: 400; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); width: 100%; min-height: 44px; }
.ks-field input:focus { outline: none; border-color: var(--wine); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-dark) 18%, transparent); }
.ks-stepper { display: flex; align-items: stretch; }
.ks-stepper input { text-align: center; border-radius: 0; border-left: 0; border-right: 0; -moz-appearance: textfield; }
.ks-stepper input::-webkit-outer-spin-button, .ks-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.ks-stepper button { width: 44px; flex: none; border: 1.5px solid var(--line); background: var(--cream); font-size: 1.2rem; cursor: pointer; color: var(--wine); }
.ks-stepper button:first-child { border-radius: 10px 0 0 10px; }
.ks-stepper button:last-child { border-radius: 0 10px 10px 0; }
.ks-stepper button:hover { background: var(--wine-soft); }
.ks-nights { margin: 12px 0 0; color: var(--muted); font-size: .9rem; }

.ks-msg { padding: 10px 12px; border-radius: 10px; margin: 0 0 10px; font-size: .9rem; }
.ks-msg.warn { background: var(--warn-bg); color: var(--warn); }
.ks-msg.err { background: var(--err-bg); color: var(--err); }

.ks-total { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; background: var(--brand-dark) linear-gradient(var(--brand), var(--brand-dark)); color: #fff; border-radius: 10px; padding: 18px 20px; margin-bottom: 14px; }
.ks-total-label { font-size: .85rem; opacity: .85; text-transform: uppercase; letter-spacing: .06em; }
.ks-total-sum { font-family: var(--font); font-size: 2.4rem; font-weight: 700; text-shadow: 0 1px 3px rgba(0, 0, 0, .3); line-height: 1.1; font-variant-numeric: tabular-nums; }
.ks-total-meta { font-size: .88rem; opacity: .9; margin-top: 2px; }
.ks-pay { display: grid; gap: 4px; font-size: .9rem; min-width: 210px; }
.ks-pay div { display: flex; justify-content: space-between; gap: 16px; }
.ks-pay span { opacity: .85; }
.ks-pay b { font-variant-numeric: tabular-nums; }

.ks-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--inv-line); border-radius: 10px; }
.ks-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.ks-table th { text-align: left; font-weight: 700; color: #fff; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; padding: 10px 10px; }
.ks-table td { padding: 9px 10px; border-bottom: 1px solid var(--inv-line); color: var(--inv-text); vertical-align: top; }
/* Zeilenfarbe je Zeile; der 1-px-Schatten schließt Rundungslücken zwischen Zellen bei krummen Zoomstufen */
.ks-table th, .ks-table td { background: var(--row-bg, #fff); box-shadow: 1px 0 0 var(--row-bg, #fff); }
.ks-table thead tr { --row-bg: var(--inv-dark); }
.ks-table tbody tr { --row-bg: #fff; }
.ks-table tbody tr:nth-child(even) { --row-bg: var(--inv-light); }
.ks-table .n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ks-table tbody tr.neg td { color: var(--ok); }
.ks-table tfoot tr.tot { --row-bg: var(--inv-dark); }
.ks-table tfoot tr.tot td { color: #fff; font-weight: 700; font-size: 1rem; padding-top: 11px; padding-bottom: 11px; border-bottom: 0; }
.ks-table tfoot tr.sub { --row-bg: #fff; }
.ks-table tfoot tr.sub td { color: var(--inv-muted); font-size: .82rem; padding-top: 4px; padding-bottom: 4px; }
.ks-table tfoot tr.pay { --row-bg: var(--inv-pale); }
.ks-table tfoot tr.pay td { font-weight: 700; color: var(--inv-text); border-bottom: 0; }
.ks-table tfoot tr.rest { --row-bg: var(--inv-rest); }
.ks-table tfoot tr.rest td { color: var(--inv-rest-text); font-weight: 700; border-bottom: 0; }
.ks-fine { font-size: .78rem; color: var(--muted); margin: 12px 0 0; line-height: 1.5; }

.ks-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.ks-btn { font: inherit; font-weight: 700; padding: 11px 18px; border-radius: 6px; border: 1.5px solid var(--brand-dark); background: #fff; color: var(--brand-dark); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.ks-btn:hover { background: var(--wine-soft); }
.ks-btn.primary { background: var(--brand-dark); color: #fff; }
.ks-btn.primary:hover { background: #9c1212; border-color: #9c1212; }
.ks-btn.ghost { border-color: var(--line); color: var(--muted); }

.ks-foot { text-align: center; margin-top: 6px; font-size: .78rem; }
.ks-foot a { color: var(--muted); text-decoration: none; }
.ks-foot a:hover { text-decoration: underline; }
body.embed .ks-foot, body.kompakt .ks-foot { display: none; }
@media print { .ks-foot { display: none; } }

@media (max-width: 560px) {
  .ks-head h1 { font-size: 1.6rem; }
  .ks-card { padding: 14px; }
  .ks-houses { grid-template-columns: 1fr 1fr; }
  .ks-total-sum { font-size: 2rem; }
  .ks-pay { min-width: 0; width: 100%; }
  .ks-table .hm { display: none; }
  .ks-table { font-size: .85rem; }
}

@media print {
  html, body { background: #fff; }
  .ks-card { border: 0; box-shadow: none; padding: 0; }
  .ks-card:not(.ks-result), .ks-actions { display: none; }
  .ks-total { background: none; color: var(--ink); border: 1px solid var(--ink); }
  .ks-table tr, .ks-table th, .ks-table td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
