/* Mobil zuerst. Die Abfrage passiert im Laden, oft in unter zehn Sekunden. */

:root {
  --bg: #0f1115;
  --flaeche: #181b22;
  --flaeche-hoch: #212530;
  --rand: #2c313c;
  --text: #e8eaed;
  --text-leise: #9aa1ad;
  --akzent: #4c8dff;
  --gut: #35c26b;
  --warn: #f0a92c;
  --fehler: #f0564a;
  --radius: 14px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f5f7;
    --flaeche: #ffffff;
    --flaeche-hoch: #eef0f4;
    --rand: #d9dde4;
    --text: #14181f;
    --text-leise: #5d6673;
    --akzent: #1c62d6;
    --gut: #16874a;
    --warn: #9a6708;
    --fehler: #c0392b;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

.huelle {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px 64px;
}

header.kopf {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0 16px;
}

header.kopf h1 {
  font-size: 20px;
  margin: 0;
  letter-spacing: -0.01em;
}

header.kopf .konto {
  font-size: 13px;
  color: var(--text-leise);
  display: flex;
  gap: 10px;
  align-items: center;
}

a {
  color: var(--akzent);
}

.karte {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}

.reiter {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  padding: 4px;
}

.reiter button {
  flex: 1;
  padding: 10px 6px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-leise);
  cursor: pointer;
}

.reiter button[aria-selected='true'] {
  background: var(--flaeche-hoch);
  color: var(--text);
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-leise);
  margin-bottom: 6px;
}

input,
select,
textarea {
  width: 100%;
  padding: 13px 14px;
  font-size: 17px;
  font-family: inherit;
  color: var(--text);
  background: var(--flaeche-hoch);
  border: 1px solid var(--rand);
  border-radius: 10px;
  appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--akzent);
  outline-offset: 1px;
}

input.gross {
  font-size: 30px;
  font-weight: 700;
  padding: 14px;
  letter-spacing: -0.02em;
}

.feld {
  margin-bottom: 14px;
}

.zeile {
  display: flex;
  gap: 10px;
}

.zeile > * {
  flex: 1;
}

button.haupt {
  width: 100%;
  padding: 15px;
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: var(--akzent);
  border: none;
  border-radius: 12px;
  cursor: pointer;
}

button.haupt:disabled {
  opacity: 0.5;
  cursor: default;
}

button.neben {
  padding: 9px 14px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 600;
  color: var(--text);
  background: var(--flaeche-hoch);
  border: 1px solid var(--rand);
  border-radius: 10px;
  cursor: pointer;
}

/* Ergebnis */

.ergebnis {
  text-align: center;
  padding: 22px 16px;
}

.ergebnis .beschriftung {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-leise);
}

.ergebnis .zahl {
  font-size: 58px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 6px 0 2px;
  font-variant-numeric: tabular-nums;
}

.ergebnis .zahl.null {
  color: var(--fehler);
}

.ergebnis .unterzeile {
  font-size: 13px;
  color: var(--text-leise);
}

/* Meldungen */

.meldung {
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 14px;
  margin-bottom: 10px;
  border: 1px solid;
}

.meldung.info {
  border-color: var(--rand);
  color: var(--text-leise);
  background: var(--flaeche-hoch);
}

.meldung.warnung {
  border-color: color-mix(in srgb, var(--warn) 45%, transparent);
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  color: var(--warn);
}

.meldung.fehler {
  border-color: color-mix(in srgb, var(--fehler) 45%, transparent);
  background: color-mix(in srgb, var(--fehler) 12%, transparent);
  color: var(--fehler);
}

/* Aufschluesselung */

details.aufschluesselung summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--akzent);
  padding: 4px 0;
  list-style: none;
}

details.aufschluesselung summary::-webkit-details-marker {
  display: none;
}

details.aufschluesselung summary::before {
  content: '▸ ';
}

details.aufschluesselung[open] summary::before {
  content: '▾ ';
}

table.rechnung {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
}

table.rechnung td {
  padding: 7px 0;
  border-bottom: 1px solid var(--rand);
}

table.rechnung td:last-child {
  text-align: right;
  white-space: nowrap;
}

table.rechnung tr.summe td {
  font-weight: 700;
  border-bottom: none;
  border-top: 2px solid var(--rand);
}

table.rechnung td.leise {
  color: var(--text-leise);
  padding-left: 14px;
  font-size: 13.5px;
}

.fusszeile {
  font-size: 12px;
  color: var(--text-leise);
  text-align: center;
  margin-top: 18px;
  line-height: 1.7;
}

.versteckt {
  display: none !important;
}

/* Admin */

.admin-abschnitt h2 {
  font-size: 16px;
  margin: 0 0 12px;
}

textarea.json {
  min-height: 420px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
}

table.liste {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

table.liste th,
table.liste td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--rand);
  vertical-align: top;
}

table.liste th {
  color: var(--text-leise);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.scrollbar {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
