:root {
  --bg: #eef1f6;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #0f172a;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --accent-soft: #eff4ff;
  --money: #0b7a4b;
  --money-soft: #e7f6ee;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --danger: #b42318;
  --danger-soft: #fee4e2;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px -12px rgba(15, 23, 42, .18);
  --shadow-lg: 0 2px 4px rgba(15, 23, 42, .05), 0 18px 40px -18px rgba(15, 23, 42, .28);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --surface: #131c2e;
    --surface-2: #18233a;
    --ink: #e8edf7;
    --ink-soft: #c3cddf;
    --muted: #8b99b3;
    --line: #26324a;
    --brand: #060b16;
    --accent: #5b8cff;
    --accent-ink: #06122c;
    --accent-soft: #1b2947;
    --money: #4ade80;
    --money-soft: #12321f;
    --warn: #fbbf24;
    --warn-soft: #3a2c08;
    --danger: #fda29b;
    --danger-soft: #3d1614;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .4), 0 18px 40px -18px rgba(0, 0, 0, .7);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- App bar ---------- */

.appbar {
  background: var(--brand);
  color: #fff;
  padding: 14px 0;
  box-shadow: var(--shadow);
}

.appbar .inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  letter-spacing: -.01em;
  font-size: 16px;
}

.brand .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, .18);
  flex: none;
}

.who {
  font-size: 13px;
  color: rgba(255, 255, 255, .72);
  display: flex;
  align-items: center;
  gap: 12px;
}

.linkbtn {
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .16);
  color: #fff;
  font: inherit;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease;
}

.linkbtn:hover { background: rgba(255, 255, 255, .22); }

/* ---------- Layout ---------- */

.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 26px 16px 72px;
}

.wrap.narrow { max-width: 440px; padding-top: 8vh; }

.grid { display: grid; gap: 18px; }

@media (min-width: 760px) {
  .grid.two { grid-template-columns: 1.15fr .85fr; align-items: start; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.card + .card { margin-top: 18px; }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 4px;
}

h1 { font-size: 22px; letter-spacing: -.02em; margin: 0 0 4px; }
h2 { font-size: 15px; letter-spacing: -.01em; margin: 0 0 14px; font-weight: 650; }
h3 { font-size: 18px; letter-spacing: -.015em; margin: 0; font-weight: 650; }

.sub { color: var(--muted); font-size: 13.5px; margin: 0; }

.section-label {
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

/* ---------- Highlight / money ---------- */

.spotlight {
  background: linear-gradient(180deg, var(--money-soft), transparent 140%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.money {
  font-size: clamp(36px, 11vw, 52px);
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--money);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  margin: 2px 0;
  transition: transform .18s ease;
}

.money.bump { transform: scale(1.06); }

.money.empty { color: var(--muted); font-size: clamp(20px, 5vw, 26px); font-weight: 600; }

.mini-money {
  font-size: 22px;
  font-weight: 680;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

/* ---------- Pills ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 620;
  white-space: nowrap;
}

.pill.good { background: var(--money-soft); color: var(--money); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.neutral { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.pill.live { background: var(--accent-soft); color: var(--accent); }

.pill .dot {
  width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none;
}

.pill.live .dot { animation: pulse 1.8s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .25; }
}

/* ---------- Forms ---------- */

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 16px 0 6px;
}

label:first-of-type { margin-top: 0; }

input[type="text"], input[type="password"], input[type="number"], textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--surface-2);
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px var(--accent-soft);
}

input.money-input {
  font-size: 26px;
  font-weight: 680;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  padding: 14px 15px;
  text-align: center;
}

textarea { resize: vertical; min-height: 68px; }

.hint { color: var(--muted); font-size: 12.5px; margin: 7px 0 0; }

button {
  font: inherit;
  font-weight: 620;
  cursor: pointer;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  background: var(--accent);
  color: var(--accent-ink);
  transition: filter .15s ease, transform .06s ease;
}

button:hover:not(:disabled) { filter: brightness(1.07); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }

button.block { width: 100%; margin-top: 18px; padding: 14px; font-size: 16px; }

button.ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
}

button.ghost:hover:not(:disabled) { background: var(--surface-2); filter: none; }

button.danger { background: var(--danger-soft); color: var(--danger); }

button.small { padding: 6px 12px; font-size: 12.5px; border-radius: 7px; }

.quickbids { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.quickbids button {
  flex: 1 1 0;
  min-width: 84px;
  background: var(--surface-2);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  font-size: 13.5px;
  padding: 9px 6px;
  font-variant-numeric: tabular-nums;
}

.quickbids button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); filter: none; }

/* ---------- Messages ---------- */

.msg {
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 13.5px;
  margin-top: 14px;
  display: none;
}

.msg.show { display: block; }
.msg.error { background: var(--danger-soft); color: var(--danger); }
.msg.ok { background: var(--money-soft); color: var(--money); }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; margin: 0 -6px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }

th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 8px 9px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

td {
  padding: 11px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

tr.top-bid td { background: var(--money-soft); }
tr.top-bid td:first-child { border-radius: 8px 0 0 8px; font-weight: 650; }
tr.top-bid td:last-child { border-radius: 0 8px 8px 0; }

td.amount { font-variant-numeric: tabular-nums; font-weight: 620; white-space: nowrap; }
td.when { color: var(--muted); font-size: 13px; white-space: nowrap; }
td.actions { text-align: right; white-space: nowrap; }

/* ---------- Misc ---------- */

.empty {
  text-align: center;
  padding: 34px 16px;
  color: var(--muted);
  font-size: 14px;
}

.empty .big { font-size: 30px; margin-bottom: 8px; opacity: .55; }

.stats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.stat {
  flex: 1 1 130px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.stat .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; }
.stat .v { font-size: 20px; font-weight: 680; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }

.rowline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.rowline:last-child { border-bottom: none; }
.rowline .when { color: var(--muted); font-size: 12.5px; }

.meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font-size: 13.5px; color: var(--muted); }
.meta strong { color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.divider { height: 1px; background: var(--line); margin: 20px 0; }

.footnote { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 18px; }

.pw-reveal {
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 14px;
  display: none;
}

.pw-reveal.show { display: block; }
.pw-reveal code { font-size: 16px; font-weight: 650; color: var(--accent); }

/* ---------- Utilities (CSP erlaubt keine style-Attribute im HTML) ---------- */

.confirm-box {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
}

.confirm-question { margin: 0 0 14px; font-size: 15px; }
.confirm-question strong { font-variant-numeric: tabular-nums; }
.confirm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.confirm-actions button { margin-top: 0; flex: 1 1 140px; }

.login-head { text-align: center; margin-bottom: 22px; }
.mt { margin-top: 18px; }
.ml { margin-left: 8px; }
.grid.cols2 { grid-template-columns: 1fr 1fr; gap: 14px; }
.optional { font-weight: 400; color: var(--muted); }
.stat .v.compact { font-size: 16px; }
.reveal-note { margin: 6px 0 0; }

@media (max-width: 520px) {
  .grid.cols2 { grid-template-columns: 1fr; }
}
