/* zahlen-screenshot.css: Zahlen per Screenshot (zahlen-screenshot.js), Seite "Zahlen".
   Nur Token-Variablen aus theme.js, keine Schatten, kein Rot (Warnung ist Ziegel, "bitte prüfen" ist gold),
   ein gefüllter Hauptknopf je Fläche. Schriftgrößen wie zahlen-seite.css: 48 (Handy 40) Unbounded, 16 und 13 Funnel. */

.sx { margin: 0 0 40px; }
.sx[hidden] { display: none; }
.sx-kopf { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.sx-titelblock { display: grid; gap: 4px; min-width: 0; flex: 1 1 320px; }
.sx-kopf .zs-meta { max-width: 56ch; }

/* ---- Karten ---- */
.sx-karten { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--zs-gap, 16px); }
.sx-karte { background: var(--bg-body); border: 1px solid var(--kontur); border-radius: var(--zs-r, 20px); padding: 24px 28px 20px; display: flex; flex-direction: column; min-width: 0; }
.sx-karte-kopf { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; }
.sx-karte-kopf h3 { margin: 0; }
.sx-badge { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; background: var(--text-primary); color: var(--bg-body); font: 600 13px/1 var(--font-body); flex: none; }
.sx-konto { margin-left: auto; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-zeile { display: grid; gap: 8px; padding: 16px 0 18px; border-top: 1px solid var(--line); }
.sx-zl { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sx-lbl { font-size: 16px; line-height: 1.3; font-weight: 400; color: var(--text-secondary); }
.sx-ziel { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.sx-wert { overflow-wrap: anywhere; }
.sx-nichts { font-size: 16px; line-height: 1.3; color: var(--text-muted); padding: 6px 0 4px; }
.sx-bar { position: relative; height: 8px; border-radius: 999px; background: var(--line); margin: 4px 0 2px; }
.sx-fuell { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--text-secondary); }
.sx-strich { position: absolute; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: var(--text-primary); }
.sx-unter { font-size: 13px; line-height: 1.4; color: var(--text-muted); min-height: 18px; }
.sx-karte .sx-zeit-warn { color: var(--text-secondary); font-weight: 600; }
.sx-fuss { display: grid; gap: 2px; padding-top: 14px; border-top: 1px solid var(--line); margin-top: auto; }
.sx-leer { display: grid; gap: 4px; padding: 28px 0 24px; border-top: 1px solid var(--line); }

/* ---- Fenster ---- */
.sx-dlg { --zs-r: 20px; padding: 0; border: 1px solid var(--line); border-radius: var(--zs-r); background: var(--bg-body); color: var(--text-primary); width: min(960px, calc(100vw - 48px)); max-width: none; max-height: calc(100dvh - 48px); overflow: auto; overscroll-behavior: contain; }
.sx-dlg::backdrop { background: var(--overlay-bg, rgba(10, 7, 8, 0.72)); }
.sx-dlg[open] { animation: sx-auf var(--dur-base) var(--ease-out); }
@keyframes sx-auf { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
[data-theme] .sx-dlg:focus, [data-theme] .sx-dlg:focus-visible { outline: none !important; }
.sx-dlg-hulle { position: relative; }
.sx-dlg-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px 14px 28px; background: var(--bg-body); border-bottom: 1px solid var(--line); }
.sx-dlg-bar h2 { margin: 0; }
.sx-dlg-in { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: 32px; padding: 24px 28px 32px; align-items: start; }
.sx-dlg-in.sx-schmal { grid-template-columns: minmax(0, 1fr); max-width: 620px; gap: 20px; }
.sx-links, .sx-rechts { display: grid; gap: 16px; min-width: 0; align-content: start; }
.sx-bild { display: block; width: 100%; max-height: 520px; object-fit: contain; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-s2, var(--bg-body)); }
.sx-bild.leer { aspect-ratio: 9 / 16; max-height: 360px; }
.sx-bild.klein { max-height: 160px; width: auto; max-width: 100%; justify-self: start; }
.sx-ki { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 16px; line-height: 1.4; }
.sx-anderes { justify-self: start; }
.sx-block { display: grid; gap: 8px; }
.sx-pillen { display: flex; gap: 8px; flex-wrap: wrap; }
.sx-pillen .zs-pille.sx-an { background: var(--sel-bg); border-color: var(--sel-line); }
.sx-hinweisfeld { display: grid; gap: 8px; }

.sx-zone { display: grid; gap: 8px; justify-items: center; text-align: center; padding: 44px 24px; border: 1px dashed var(--kontur); border-radius: var(--zs-r); cursor: pointer; transition: background var(--dur-fast); }
.sx-zone:hover, .sx-dlg.zieht .sx-zone, .sx-zone:focus-within { background: var(--sel-bg); }
.sx-zone-titel { font-size: 16px; font-weight: 600; }

.sx-eingabe { box-sizing: border-box; width: 100%; min-height: 44px; padding: 0 14px; border: 1px solid var(--kontur); border-radius: 12px; background: var(--input-bg); color: var(--text-primary); font: 400 16px/1.2 var(--font-body); }
select.sx-eingabe { padding-right: 8px; }
[data-theme] .sx-eingabe:focus-visible { outline: 2px solid var(--text-primary) !important; outline-offset: 2px; background: var(--sel-bg); border-color: var(--sel-line); }
.sx-zahl { text-align: right; font-variant-numeric: tabular-nums; }
.sx-zahl::placeholder { color: var(--text-muted); font-size: 13px; }
.sx-konto-feld { display: grid; gap: 10px; }
.sx-neu { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.sx-zeitraum { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sx-feld { display: grid; gap: 6px; }

.sx-tabelle { display: grid; gap: 4px; }
.sx-wz { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 170px) 104px; align-items: center; gap: 12px; padding: 3px 12px; border-radius: 12px; border: 1px solid transparent; }
.sx-wz.niedrig { background: var(--bg-s3); border-color: var(--offen); }
.sx-sicher { font-size: 13px; line-height: 1.3; color: var(--text-muted); }
.sx-sicher.niedrig { color: var(--text-primary); font-weight: 600; }

.sx-fehler { padding: 12px 14px; border: 1px solid var(--warn); border-radius: 12px; background: var(--warn-weich); color: var(--warn-ink); font-size: 16px; line-height: 1.4; }
.sx-rechts > .sx-aktionen { position: sticky; bottom: 0; z-index: 1; padding: 12px 0 4px; background: var(--bg-body); border-top: 1px solid var(--line); }
.sx-aktionen { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.sx-liest { display: flex; gap: 12px; align-items: center; font-size: 16px; }
.sx-punkte { width: 12px; height: 12px; border-radius: 999px; background: var(--text-primary); animation: sx-puls 1.2s var(--ease-out) infinite; flex: none; }
@keyframes sx-puls { 0%, 100% { opacity: 0.25; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1); } }

@media (max-width: 767px) {
  .sx { margin-bottom: 32px; }
  .sx-karten { grid-template-columns: minmax(0, 1fr); }
  .sx-karte { padding: 20px 20px 16px; }
  .sx-kopf { align-items: flex-start; }
  .sx-kopf .zs-knopf { width: 100%; }
  .sx-dlg { width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; border: 0; border-radius: 0; inset: 0; }
  .sx-dlg-bar { padding: 10px 12px 10px 16px; }
  .sx-dlg-in { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 16px 16px 24px; }
  .sx-bild { max-height: 220px; }
  .sx-zone { padding: 36px 16px; }
  .sx-wz { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "l s" "i i"; gap: 6px 12px; padding: 8px 12px 10px; }
  .sx-wz .sx-lbl { grid-area: l; }
  .sx-wz .sx-sicher { grid-area: s; text-align: right; }
  .sx-wz .sx-eingabe { grid-area: i; }
  .sx-neu { grid-template-columns: minmax(0, 1fr); }
  .sx-aktionen .zs-knopf { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .sx-dlg[open] { animation: none; }
  .sx-punkte { animation: none; opacity: 1; }
  .sx-zone { transition: none; }
}
.sx-dlg .zs-meta a { color: var(--text-primary); text-decoration: underline; }
