/* ==========================================================================
   Work Points — design system
   Navy-forward, mobile-first. Airbnb-ish: generous space, quiet surfaces,
   one confident accent, type doing the hierarchy work.
   ========================================================================== */

:root {
  color-scheme: light;

  /* surface + ink */
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f7;
  --surface-3: #e8ecf3;
  --line: #e3e7ee;
  --line-strong: #d3d9e3;
  --ink: #0f1729;
  --ink-2: #5b6577;
  --ink-3: #8a93a3;

  /* brand + status */
  --brand: #2b5cd9;
  --brand-press: #234bb4;
  --brand-ink: #ffffff;
  --brand-soft: #eaf0fe;
  --brand-border: #c4d5fb;
  --gold: #b7791f;
  --good: #0f8a5f;
  --good-soft: #e4f5ee;
  --bad: #c2334a;
  --bad-solid: #c2334a;
  --bad-soft: #fdeaed;

  /* shape */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 26px;
  --r-pill: 999px;

  /* elevation */
  --sh-1: 0 1px 2px rgba(15, 23, 41, .05);
  --sh-2: 0 2px 8px rgba(15, 23, 41, .07), 0 1px 2px rgba(15, 23, 41, .04);
  --sh-3: 0 12px 32px rgba(15, 23, 41, .12);
  --ring: 0 0 0 3px rgba(43, 92, 217, .28);

  /* motion */
  --fast: 130ms cubic-bezier(.2, .8, .3, 1);
  --base: 220ms cubic-bezier(.2, .8, .3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --bg: #080d18;
    --surface: #101828;
    --surface-2: #172033;
    --surface-3: #1e2942;
    --line: #212d45;
    --line-strong: #2c3a56;
    --ink: #eef2f9;
    --ink-2: #a3b0c6;
    --ink-3: #74819a;

    --brand: #5b8dff;
    --brand-press: #7ba3ff;
    --brand-ink: #06122c;
    --brand-soft: #16233f;
    --brand-border: #2b4478;
    --gold: #f0b849;
    --good: #38d39a;
    --good-soft: #102e26;
    --bad: #ff7583;
    --bad-solid: #c62c45;
    --bad-soft: #33161d;

    --sh-1: 0 1px 2px rgba(0, 0, 0, .4);
    --sh-2: 0 2px 10px rgba(0, 0, 0, .38);
    --sh-3: 0 16px 40px rgba(0, 0, 0, .55);
    --ring: 0 0 0 3px rgba(91, 141, 255, .35);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.022em; }
p { margin: 0; }
b, strong { font-weight: 650; }

.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.grow { min-width: 0; flex: 1; }
.num { font-variant-numeric: tabular-nums; }

:where(button, a, input, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--r-sm);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 48px; padding: 12px 20px;
  font: inherit; font-size: 15px; font-weight: 650; letter-spacing: -.01em;
  text-decoration: none; white-space: nowrap;
  border: 1px solid transparent; border-radius: var(--r-md);
  cursor: pointer;
  transition: background var(--fast), border-color var(--fast), transform var(--fast), opacity var(--fast);
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-lg { min-height: 54px; font-size: 16px; }

.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-press); }

.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--surface-2); }

.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { color: var(--bad); }

.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; padding: 0;
  background: transparent; border: 0; border-radius: var(--r-pill);
  color: var(--ink-3); cursor: pointer;
  transition: background var(--fast), color var(--fast);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.is-danger:hover { background: var(--bad-soft); color: var(--bad); }

.btn-mini {
  flex: none; min-height: 36px; width: auto; padding: 0 14px;
  font-size: 13.5px; font-weight: 650;
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--r-pill); cursor: pointer; transition: background var(--fast);
}
.btn-mini:hover { background: var(--surface-3); }

/* ==========================================================================
   Forms
   ========================================================================== */

.form { display: grid; gap: 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.field { display: grid; gap: 7px; min-width: 0; }
.label, .field > label {
  font-size: 13px; font-weight: 650; color: var(--ink-2); letter-spacing: -.005em;
}
.opt { font-weight: 500; color: var(--ink-3); }
.field-hint { font-size: 12.5px; color: var(--ink-3); line-height: 1.35; }

input {
  width: 100%; min-height: 50px; padding: 13px 15px;
  font: inherit; font-size: 16px; color: var(--ink);
  background: var(--surface-2);
  border: 1px solid transparent; border-radius: var(--r-md);
  transition: border-color var(--fast), background var(--fast), box-shadow var(--fast);
}
input::placeholder { color: var(--ink-3); }
input:hover { border-color: var(--line-strong); }
input:focus { outline: none; background: var(--surface); border-color: var(--brand); box-shadow: var(--ring); }
input[type="date"] { appearance: none; }

.input-wrap { position: relative; }
.input-wrap input { padding-right: 52px; }
.input-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 38px; height: 38px;
  background: transparent; border: 0; border-radius: var(--r-pill);
  color: var(--ink-3); cursor: pointer;
}
.input-btn:hover { color: var(--ink); background: var(--surface-3); }

.form-error {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 11px 14px; border-radius: var(--r-sm);
  background: var(--bad-soft); color: var(--bad);
  font-size: 13.5px; font-weight: 550; line-height: 1.4;
}

.notice {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 13px 15px; margin-bottom: 18px; border-radius: var(--r-md);
  background: var(--brand-soft); color: var(--ink);
  font-size: 13.5px; line-height: 1.45;
}
.notice .ico { color: var(--brand); margin-top: 1px; }

/* ==========================================================================
   Segmented control
   ========================================================================== */

.seg {
  position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 4px; margin-bottom: 18px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-pill);
}
.seg-thumb {
  position: absolute; top: 4px; left: 4px; bottom: 4px;
  width: calc((100% - 8px) / var(--n));
  background: var(--surface); border-radius: var(--r-pill);
  box-shadow: var(--sh-2);
  transform: translateX(calc(var(--i) * 100%));
  transition: transform var(--base);
}
.seg-btn {
  position: relative; z-index: 1;
  min-height: 38px; padding: 0 6px;
  background: transparent; border: 0; border-radius: var(--r-pill);
  font: inherit; font-size: 13.5px; font-weight: 650; color: var(--ink-2);
  cursor: pointer; transition: color var(--fast);
}
.seg-btn.is-active { color: var(--ink); }
.seg-3 .seg-btn, .seg-4 .seg-btn { font-size: 13px; letter-spacing: -.015em; }

/* ==========================================================================
   Auth
   ========================================================================== */

.auth {
  min-height: 100dvh; display: grid; place-items: center;
  padding: 32px 20px calc(32px + env(safe-area-inset-bottom));
}
.auth-shell { width: 100%; max-width: 420px; }
.auth-hero { text-align: center; margin-bottom: 26px; }
.auth-logo {
  width: 62px; height: 62px; margin: 0 auto 16px;
  display: grid; place-items: center; font-size: 30px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
}
.auth-hero h1 { font-size: 29px; letter-spacing: -.03em; }
.auth-hero p { margin-top: 7px; color: var(--ink-2); font-size: 15px; }

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

/* ==========================================================================
   App shell
   ========================================================================== */

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: calc(12px + env(safe-area-inset-top)) 18px 12px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar-id { display: flex; align-items: center; gap: 11px; min-width: 0; }
.topbar-text { min-width: 0; }
.topbar-name { font-size: 15.5px; font-weight: 650; letter-spacing: -.015em; }
.topbar-sub {
  font-size: 12.5px; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.points-chip {
  flex: none; display: flex; flex-direction: column; align-items: center;
  padding: 6px 14px; border-radius: var(--r-pill);
  background: var(--brand-soft); border: 1px solid var(--brand-border);
  line-height: 1.15;
}
.points-chip strong { font-size: 17px; color: var(--brand); font-variant-numeric: tabular-nums; }
.points-chip span { font-size: 10.5px; font-weight: 600; color: var(--ink-2); letter-spacing: .01em; }

.view {
  max-width: 560px; margin: 0 auto;
  padding: 22px 18px calc(112px + env(safe-area-inset-bottom));
  animation: rise var(--base) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.view-title {
  font-size: 21px; letter-spacing: -.03em;
  margin: 30px 2px 12px;
}
.view > .view-title:first-child { margin-top: 0; }
.view-note { margin: -4px 2px 14px; color: var(--ink-2); font-size: 13.5px; }

.card {
  padding: 18px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-1);
}
.card-flush { padding: 4px 18px; }
.card + .btn, .btn + .card { margin-top: 14px; }

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

/* ==========================================================================
   Rows
   ========================================================================== */

.rows { list-style: none; margin: 0; padding: 0; }
.rows > li {
  display: flex; align-items: center; gap: 13px;
  min-height: 62px; padding: 12px 0;
  border-top: 1px solid var(--line);
}
.rows > li:first-child { border-top: 0; }
.rows .t { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.012em; }
.rows .s {
  display: block; font-size: 13px; color: var(--ink-2); line-height: 1.35;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rows .amount { font-size: 15px; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rows .amount.is-spend { color: var(--ink-2); }

.row-link {
  display: flex; align-items: center; gap: 13px; width: 100%;
  padding: 0; margin: 0; text-align: left;
  background: transparent; border: 0; color: inherit; font: inherit;
  text-decoration: none; cursor: pointer;
}
.row-link:hover .t { color: var(--brand); }
.row-ico { color: var(--brand); }
.chev { color: var(--ink-3); width: 18px; height: 18px; }

.kv > li { min-height: 52px; justify-content: space-between; gap: 16px; }
.kv .k { font-size: 14.5px; color: var(--ink-2); }
.kv .v { font-size: 14.5px; font-weight: 600; text-align: right; word-break: break-word; }

.empty { display: block; padding: 30px 4px; text-align: center; }
.empty .ico { width: 26px; height: 26px; color: var(--ink-3); margin-bottom: 8px; }
.empty p { font-size: 14px; color: var(--ink-2); }
.empty .hint { font-size: 13px; color: var(--ink-3); margin-top: 3px; }

.tag {
  flex: none; padding: 3px 9px; border-radius: var(--r-pill);
  font-size: 10.5px; font-weight: 700; letter-spacing: .045em; text-transform: uppercase;
  background: var(--surface-3); color: var(--ink-2);
}
.tag.is-paid { background: var(--good-soft); color: var(--good); }
.tag.is-brand { background: var(--brand-soft); color: var(--brand); }

.avatar {
  flex: none; display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: var(--r-pill);
  font-size: 13.5px; font-weight: 700; letter-spacing: -.01em;
  background: var(--brand-soft); color: var(--brand);
  border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
}
.avatar.sm { width: 34px; height: 34px; font-size: 12.5px; }

/* skeletons */
.skel { border-top: 1px solid var(--line); padding: 14px 0; display: flex; gap: 13px; align-items: center; }
.skel:first-child { border-top: 0; }
.skel i, .skel u {
  display: block; border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%; animation: shimmer 1.4s linear infinite;
}
.skel i { width: 38px; height: 38px; border-radius: var(--r-pill); flex: none; }
.skel u { height: 11px; }
.skel .lines { flex: 1; display: grid; gap: 7px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ==========================================================================
   Log form
   ========================================================================== */

.choice-set { display: block; padding: 0; margin: 0; border: 0; min-width: 0; }
.choice-set legend { padding: 0; margin-bottom: 9px; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { display: flex; } /* damit die Karte die volle Zeilenhöhe bekommt */
.choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.choice-body {
  position: relative; flex: 1;
  display: flex; flex-direction: column;
  padding: 15px 14px;
  background: var(--surface-2); border: 1.5px solid transparent; border-radius: var(--r-md);
  cursor: pointer; transition: border-color var(--fast), background var(--fast);
}
.choice-body:hover { background: var(--surface-3); }
.choice-title { display: block; padding-right: 24px; font-size: 15.5px; font-weight: 650; letter-spacing: -.015em; }
.choice-sub { display: block; margin-top: auto; padding-top: 4px; font-size: 12.5px; color: var(--ink-2); }
.choice-check {
  position: absolute; top: 12px; right: 12px;
  width: 19px; height: 19px; padding: 3px; stroke-width: 2.5;
  border-radius: var(--r-pill); background: var(--brand); color: var(--brand-ink);
  opacity: 0; transform: scale(.6); transition: opacity var(--fast), transform var(--fast);
}
.choice input:checked + .choice-body { border-color: var(--brand); background: var(--brand-soft); }
.choice input:checked + .choice-body .choice-check { opacity: 1; transform: none; }
.choice input:focus-visible + .choice-body { box-shadow: var(--ring); }

.stepper { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.step {
  display: grid; place-items: center; flex: none;
  width: 52px; height: 52px;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-pill);
  cursor: pointer; transition: background var(--fast), transform var(--fast);
}
.step:hover { background: var(--surface-3); }
.step:active { transform: scale(.92); }
.stepper-value { flex: 1; text-align: center; }
.stepper-value input {
  min-height: auto; padding: 0; text-align: center;
  font-size: 34px; font-weight: 700; letter-spacing: -.035em;
  background: transparent; border: 0; font-variant-numeric: tabular-nums;
}
.stepper-value input:focus { box-shadow: none; background: transparent; }
.stepper-value span { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: -2px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chips button {
  min-height: 36px; padding: 0 15px;
  background: transparent; color: var(--ink-2);
  border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: all var(--fast);
}
.chips button:hover { background: var(--surface-2); color: var(--ink); }
.chips button.is-on { background: var(--ink); color: var(--surface); border-color: var(--ink); }

.submit-bar { margin-top: 18px; display: grid; gap: 12px; }
.earn-preview {
  display: flex; align-items: baseline; justify-content: center; gap: 8px;
  font-size: 14px; color: var(--ink-2);
}
.earn-preview strong {
  font-size: 19px; color: var(--brand); font-variant-numeric: tabular-nums;
  transition: transform var(--fast);
}
.earn-preview.bump strong { transform: scale(1.14); }

/* ==========================================================================
   Scoreboard
   ========================================================================== */

.board > li { gap: 12px; }
.board .rank {
  flex: none; width: 26px; text-align: center;
  font-size: 14px; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.board .medal { font-size: 19px; line-height: 1; }
.board .is-me-tag { margin-left: 6px; }
.board li.is-me .t { color: var(--brand); }

.rank-card {
  display: flex; align-items: center; gap: 14px;
  padding: 15px 18px; margin-bottom: 14px;
  background: var(--brand-soft); border: 1px solid var(--brand-border); border-radius: var(--r-lg);
}
.rank-card .big { font-size: 25px; font-weight: 700; color: var(--brand); letter-spacing: -.03em; }
.rank-card .lbl { font-size: 13px; color: var(--ink-2); }
.rank-card .lbl b { color: var(--ink); }

.board-foot { margin: 22px 2px 0; text-align: center; font-size: 12.5px; line-height: 1.45; color: var(--ink-3); }
.board-foot:empty { display: none; }

/* ==========================================================================
   Prizes
   ========================================================================== */

.hero {
  display: grid; justify-items: center; gap: 3px;
  padding: 28px 20px; margin-bottom: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); box-shadow: var(--sh-1);
}
.hero-label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.hero-value {
  font-size: 56px; line-height: 1.05; font-weight: 700; letter-spacing: -.04em;
  color: var(--brand); font-variant-numeric: tabular-nums;
}
.hero-sub { font-size: 13px; color: var(--ink-3); }
.hero-progress { width: 100%; max-width: 280px; margin-top: 16px; text-align: center; }
.hero-progress .bar { height: 7px; background: var(--surface-3); border-radius: var(--r-pill); overflow: hidden; }
.hero-progress .bar i { display: block; height: 100%; background: var(--brand); border-radius: var(--r-pill); transition: width var(--base); }
.hero-progress span { display: block; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }

.prize-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.prize {
  position: relative; display: grid; justify-items: center; gap: 3px;
  padding: 20px 12px 16px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-1); color: inherit; font: inherit; cursor: pointer;
  transition: transform var(--fast), border-color var(--fast), box-shadow var(--fast);
}
.prize:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--brand-border); box-shadow: var(--sh-2); }
.prize:active:not(:disabled) { transform: scale(.98); }
.prize .emoji {
  display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 7px;
  font-size: 27px; background: var(--surface-2); border-radius: var(--r-pill);
}
.prize .n { font-size: 14.5px; font-weight: 650; letter-spacing: -.015em; }
.prize .c { font-size: 13px; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.prize:disabled { cursor: not-allowed; box-shadow: none; background: var(--surface-2); }
.prize:disabled .emoji { filter: grayscale(1); opacity: .55; background: var(--surface-3); }
.prize:disabled .n { color: var(--ink-2); }
.prize:disabled .c { color: var(--ink-3); font-weight: 600; }

/* ==========================================================================
   Stats
   ========================================================================== */

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat {
  display: grid; gap: 2px; padding: 16px 10px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.stat strong { font-size: 23px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11.5px; color: var(--ink-2); letter-spacing: -.005em; }

/* ==========================================================================
   Tab bar
   ========================================================================== */

.tabbar {
  position: fixed; inset: auto 0 0; z-index: 30;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--line);
}
.tab {
  display: grid; justify-items: center; gap: 3px;
  padding: 7px 2px 6px;
  background: transparent; border: 0; border-radius: var(--r-md);
  font: inherit; font-size: 10.5px; font-weight: 600; color: var(--ink-3);
  cursor: pointer; transition: color var(--fast);
}
.tab .ico { width: 23px; height: 23px; stroke-width: 1.7; transition: transform var(--fast), stroke-width var(--fast); }
.tab:hover { color: var(--ink-2); }
.tab.is-active { color: var(--brand); }
.tab.is-active .ico { stroke-width: 2.1; transform: translateY(-1px); }

/* ==========================================================================
   Toast
   ========================================================================== */

.toast {
  position: fixed; z-index: 60; left: 50%; top: calc(14px + env(safe-area-inset-top));
  max-width: min(92vw, 420px); padding: 13px 18px;
  background: var(--ink); color: var(--bg);
  border-radius: var(--r-md); box-shadow: var(--sh-3);
  font-size: 14px; font-weight: 600; text-align: center;
  animation: drop var(--base) both;
}
@keyframes drop {
  from { opacity: 0; transform: translate(-50%, -14px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.toast { transform: translateX(-50%); }
.toast.is-ok { background: var(--good); color: #fff; }
.toast.is-err { background: var(--bad); color: #fff; }

/* ==========================================================================
   Bottom sheet
   ========================================================================== */

.sheet-root { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(6, 11, 22, .5); animation: fade var(--base) both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  position: relative; width: 100%; max-width: 480px;
  padding: 12px 20px calc(20px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--sh-3);
  animation: slide-up var(--base) both;
  max-height: 88dvh; overflow-y: auto;
}
@keyframes slide-up { from { transform: translateY(100%); } to { transform: none; } }
@media (min-width: 560px) {
  .sheet-root { align-items: center; }
  .sheet { border-radius: var(--r-xl); margin: 20px; animation-name: pop; }
  @keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
}
.sheet-grab { width: 38px; height: 4px; margin: 0 auto 16px; background: var(--line-strong); border-radius: var(--r-pill); }
.sheet-x { position: absolute; top: 12px; right: 12px; }
.sheet h3 { font-size: 19px; padding-right: 40px; }
.sheet #sheet-desc { margin-top: 7px; color: var(--ink-2); font-size: 14px; line-height: 1.5; white-space: pre-line; }
.sheet #sheet-desc:empty { display: none; }
#sheet-form { display: grid; gap: 16px; margin-top: 20px; }
#sheet-form:empty { display: none; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 24px; }
.sheet-actions.is-stacked { grid-template-columns: 1fr; gap: 8px; }
.sheet-actions .btn-danger-solid { background: var(--bad-solid); color: #fff; }
.sheet-actions .btn-danger-solid:hover { filter: brightness(1.08); }

/* ==========================================================================
   Kampagnen-Streifen und Runden-Info
   ========================================================================== */

.strip {
  position: sticky; top: 0; z-index: 15;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  background: var(--brand); color: var(--brand-ink);
  font-size: 13.5px; font-weight: 600;
}
.strip .ico { width: 18px; height: 18px; }
.strip b { font-weight: 750; }
.strip .cd { margin-left: auto; font-variant-numeric: tabular-nums; opacity: .9; white-space: nowrap; }

.round-strip {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 15px; margin-bottom: 14px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md);
  font-size: 13px; color: var(--ink-2);
}
.round-strip .ico { width: 17px; height: 17px; color: var(--ink-3); }
.round-strip b { color: var(--ink); }
.round-strip .cd { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ==========================================================================
   Benachrichtigungen (Käufe)
   ========================================================================== */

.notices {
  display: grid; gap: 8px;
  max-width: 560px; margin: 0 auto;
  padding: 14px 18px 0;
}
.notices:empty { display: none; }
.note-card {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px 11px 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--r-md); box-shadow: var(--sh-2);
  animation: slide-in var(--base) both;
}
@keyframes slide-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
.note-card p { flex: 1; font-size: 13.5px; line-height: 1.35; }
.note-card p b { font-weight: 700; }

/* ==========================================================================
   Profil
   ========================================================================== */

.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.profile-head h2 { font-size: 20px; }
.profile-head p { font-size: 13px; margin-top: 2px; }
.profile-head .btn-mini { margin-left: auto; }
.muted { color: var(--ink-2); }

.avatar-xl { width: 66px; height: 66px; font-size: 22px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.avatar.is-emoji { font-size: 1.15em; }
.avatar-xl.is-emoji { font-size: 32px; }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 430px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }

.log > li { min-height: 56px; }
.log .day {
  flex: none; width: 46px; text-align: center; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.log .day b { display: block; font-size: 15px; font-weight: 700; }
.log .day span { display: block; font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .03em; }
.log .amount.is-minus { color: var(--bad); }

.emoji-pick { display: flex; flex-wrap: wrap; gap: 7px; }
.emoji-pick button {
  width: 42px; height: 42px; display: grid; place-items: center;
  font-size: 20px; background: var(--surface-2);
  border: 1.5px solid transparent; border-radius: var(--r-md);
  cursor: pointer; transition: border-color var(--fast), background var(--fast);
}
.emoji-pick button:hover { background: var(--surface-3); }
.emoji-pick button.is-on { border-color: var(--brand); background: var(--brand-soft); }

/* ==========================================================================
   Admin
   ========================================================================== */

.back-btn {
  display: inline-flex; align-items: center; gap: 5px;
  margin-bottom: 6px; padding: 6px 10px 6px 6px;
  background: transparent; border: 0; border-radius: var(--r-sm);
  font: inherit; font-size: 14px; font-weight: 600; color: var(--brand); cursor: pointer;
}
.back-btn:hover { background: var(--brand-soft); }

.nav-ico {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px;
  border-radius: var(--r-sm); background: var(--brand-soft); color: var(--brand);
}
.nav-ico .ico { width: 19px; height: 19px; }
.count-pill {
  flex: none; min-width: 24px; padding: 2px 8px; border-radius: var(--r-pill);
  background: var(--surface-3); color: var(--ink-2);
  font-size: 12px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums;
}

.status-tag { flex: none; }
.status-tag.is-open { background: var(--brand-soft); color: var(--brand); }
.status-tag.is-done { background: var(--good-soft); color: var(--good); }

.factor-tag { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }

select {
  width: 100%; min-height: 50px; padding: 13px 42px 13px 15px;
  font: inherit; font-size: 16px; color: var(--ink);
  background: var(--surface-2) no-repeat right 14px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a93a3' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  border: 1px solid transparent; border-radius: var(--r-md);
  appearance: none; cursor: pointer;
}
select:focus { outline: none; background-color: var(--surface); border-color: var(--brand); box-shadow: var(--ring); }


/* ==========================================================================
   Bonus-Chips an einer eigenen Schicht
   ========================================================================== */

.bonus-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.chip-toggle {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 30px; padding: 0 11px;
  background: transparent; color: var(--ink-3);
  border: 1px dashed var(--line-strong); border-radius: var(--r-pill);
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: all var(--fast);
}
.chip-toggle:hover { border-color: var(--brand); color: var(--brand); }
.chip-toggle.is-on {
  background: var(--good-soft); color: var(--good);
  border-style: solid; border-color: color-mix(in srgb, var(--good) 35%, transparent);
}
.chip-toggle .ico { width: 14px; height: 14px; stroke-width: 2.4; }
.chip-toggle.is-locked { cursor: default; border-style: solid; opacity: .8; }
.chip-toggle.is-locked:hover { border-color: var(--line-strong); color: var(--ink-3); }

/* ==========================================================================
   Abzeichen
   ========================================================================== */

.count-soft { color: var(--ink-3); font-weight: 600; font-size: 15px; }

.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.badge {
  display: grid; justify-items: center; gap: 3px; text-align: center;
  padding: 13px 8px 11px;
  background: var(--surface-2); border: 1px solid transparent; border-radius: var(--r-md);
}
.badge .b-emoji { font-size: 26px; line-height: 1.1; }
.badge .b-label { font-size: 11.5px; font-weight: 650; letter-spacing: -.015em; line-height: 1.25; }
.badge .b-meta { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.badge.is-earned {
  background: color-mix(in srgb, var(--gold) 12%, transparent);
  border-color: color-mix(in srgb, var(--gold) 34%, transparent);
}
.badge.is-earned .b-meta { color: var(--gold); font-weight: 650; }
.badge.is-locked .b-emoji { filter: grayscale(1); opacity: .4; }
.badge.is-locked .b-label { color: var(--ink-2); }
.badge .b-bar { width: 100%; height: 3px; margin-top: 4px; background: var(--surface-3); border-radius: var(--r-pill); overflow: hidden; }
.badge .b-bar i { display: block; height: 100%; background: var(--ink-3); border-radius: var(--r-pill); }

/* ==========================================================================
   Teams und Verlauf
   ========================================================================== */

.team-row { display: grid; gap: 6px; }
.team-row + .team-row { margin-top: 16px; }
.team-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.team-head .t-name { font-size: 15px; font-weight: 650; }
.team-head .t-value { font-size: 15px; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.team-bar { height: 10px; background: var(--surface-2); border-radius: var(--r-pill); overflow: hidden; }
.team-bar i { display: block; height: 100%; background: var(--brand); border-radius: var(--r-pill); transition: width var(--base); }
.team-sub { font-size: 12.5px; color: var(--ink-3); }

.mini-chart { width: 100%; }
.mini-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.mini-chart .area { fill: color-mix(in srgb, var(--brand) 16%, transparent); }
.mini-chart .line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.mini-chart .dot { fill: var(--brand); stroke: var(--surface); stroke-width: 2; }
.mini-chart .grid { stroke: var(--line); stroke-width: 1; }
.mini-chart .tick { fill: var(--ink-3); font-size: 10.5px; font-weight: 600; }
.chart-readout {
  min-height: 20px; margin-bottom: 8px;
  font-size: 13px; font-weight: 650; color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.chart-note { margin-top: 10px; font-size: 12.5px; color: var(--ink-3); }

/* Sechs Tabs müssen auch auf ein schmales Handy passen. */
.tabbar:has(.tab:nth-child(6)) .tab { font-size: 10px; letter-spacing: -.02em; }
.tabbar:has(.tab:nth-child(6)) .tab .ico { width: 21px; height: 21px; }

/* Schnellwahl über dem Tagesrest ist nicht anklickbar */
.chips button:disabled {
  opacity: .35; cursor: not-allowed;
  background: transparent; color: var(--ink-3); border-color: var(--line);
}

/* Leerer Tageshinweis soll keinen Platz einnehmen */
#hours-hint:empty { display: none; }
