:root {
  --paper: #f4f1e9;
  --paper-2: #ece7da;
  --surface: #fffefb;
  --ink: #1b2a2b;
  --ink-soft: #5b6b6a;
  --primary: #0e6e63;
  --primary-d: #0a534b;
  --mine: #e0633a;
  --green: #2e9e5b;
  --amber: #d99800;
  --red: #cf4759;
  --line: #e3ddcf;
  --shadow: 0 6px 22px rgba(27, 42, 43, 0.09);
  --radius: 18px;
  --tap: 52px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Figtree", ui-sans-serif, system-ui, sans-serif;
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(14,110,99,0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(224,99,58,0.07), transparent 55%),
    var(--paper);
  color: var(--ink);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: "Bricolage Grotesque", sans-serif; margin: 0; letter-spacing: -0.02em; }
button { font-family: inherit; cursor: pointer; }

#app { max-width: 680px; margin: 0 auto; padding: 0 16px 96px; }

/* --- Topbar --- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 18px 4px 14px;
  background: linear-gradient(var(--paper) 70%, transparent);
}
.topbar .brand { display: flex; flex-direction: column; line-height: 1.05; }
.topbar .brand .k { font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--primary); font-weight: 700; }
.topbar .brand h1 { font-size: 26px; font-weight: 800; }
.topbar .spacer { flex: 1; }
.chip-user {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 12px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow);
}
.chip-user .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); }

/* --- Date group --- */
.daygroup { margin: 22px 0 10px; display: flex; align-items: baseline; gap: 10px; }
.daygroup h2 { font-size: 17px; font-weight: 700; }
.daygroup .count { font-size: 13px; color: var(--ink-soft); }
.daygroup .rule { flex: 1; height: 1px; background: var(--line); }

/* --- Card --- */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 16px 14px; margin-bottom: 12px;
  box-shadow: var(--shadow); transition: transform .12s ease;
}
.card:active { transform: scale(0.992); }
.card.mine { border-left: 4px solid var(--mine); }
.card .row1 { display: flex; align-items: flex-start; gap: 10px; }
.card .apt { font-family: "Bricolage Grotesque"; font-weight: 700; font-size: 19px; flex: 1; line-height: 1.15; }
.badge { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.badge.checkout { background: #e6f0ef; color: var(--primary-d); }
.badge.zwischen { background: #f3e9fb; color: #6b3fa0; }
.meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; color: var(--ink-soft); font-size: 14px; }
.meta b { color: var(--ink); font-weight: 600; }
.assigned { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.person { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; background: var(--paper-2); padding: 4px 10px; border-radius: 999px; }
.person .pdot { width: 8px; height: 8px; border-radius: 50%; }
.person.is-mine { background: #fbe5dc; color: #a23c1d; }

.cardfoot { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.ampel { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13px; }
.ampel .light { width: 11px; height: 11px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(0,0,0,.04); }
.ampel.rot .light { background: var(--red); } .ampel.rot { color: var(--red); }
.ampel.gelb .light { background: var(--amber); } .ampel.gelb { color: #9a6c00; }
.ampel.gruen .light { background: var(--green); } .ampel.gruen { color: #1f7444; }
.extra-pill { margin-left: auto; font-size: 12.5px; font-weight: 700; color: var(--primary-d); background: #e6f0ef; padding: 4px 10px; border-radius: 999px; }

/* --- Detail --- */
.detailbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 16px 0 12px; background: linear-gradient(var(--paper) 75%, transparent); }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font-size: 20px; box-shadow: var(--shadow); }
.detailbar h2 { font-size: 21px; font-weight: 800; line-height: 1.1; }
.section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 16px; margin: 14px 0; box-shadow: var(--shadow); }
.section > .sechead { font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-soft); font-weight: 700; padding: 12px 0 4px; }
.check {
  display: flex; align-items: center; gap: 14px; min-height: var(--tap);
  padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; user-select: none;
}
.check:last-child { border-bottom: none; }
.check .box {
  width: 28px; height: 28px; border-radius: 9px; border: 2px solid var(--line);
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
  transition: all .15s ease; background: #fff;
}
.check.on .box { background: var(--green); border-color: var(--green); }
.check .box svg { opacity: 0; transform: scale(.5); transition: all .15s ease; }
.check.on .box svg { opacity: 1; transform: scale(1); }
.check .label { font-size: 16px; font-weight: 600; }
.check.on .label { color: var(--ink-soft); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.check.pending .box { border-color: var(--amber); }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; padding: 12px 0 16px; }
.info-grid .full { grid-column: 1 / -1; }
.info .k { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-soft); font-weight: 700; }
.info .v { font-size: 16px; font-weight: 600; margin-top: 2px; }
.note { white-space: pre-wrap; background: var(--paper-2); border-radius: 12px; padding: 12px; font-size: 15px; line-height: 1.5; }

/* --- Login / empty --- */
.center { min-height: 80dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 24px; }
.center .logo { font-family: "Bricolage Grotesque"; font-weight: 800; font-size: 40px; color: var(--primary); letter-spacing: -0.03em; }
.center p { color: var(--ink-soft); max-width: 320px; line-height: 1.5; }
.btn-primary { background: var(--primary); color: #fff; border: none; border-radius: 14px; padding: 16px 26px; font-size: 17px; font-weight: 700; box-shadow: var(--shadow); min-height: var(--tap); }
.btn-primary:active { background: var(--primary-d); }
.btn-ghost { background: transparent; border: none; color: var(--ink-soft); font-weight: 600; font-size: 14px; padding: 8px; }

.banner { background: #fff5e6; border: 1px solid #f0d9a6; color: #8a5a00; border-radius: 14px; padding: 12px 14px; font-size: 14px; margin: 8px 0 4px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; opacity: 0; transition: all .25s ease; z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.footer { text-align: center; color: var(--ink-soft); font-size: 12px; padding: 24px 0; }
.skel { background: linear-gradient(90deg, var(--paper-2), #f7f3ea, var(--paper-2)); background-size: 200% 100%; animation: sh 1.2s infinite; border-radius: var(--radius); height: 96px; margin-bottom: 12px; }
@keyframes sh { to { background-position: -200% 0; } }
.fade-in { animation: fi .4s ease both; }
@keyframes fi { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
