:root {
  color-scheme: dark;
  --bg: #090f10;
  --bg-radial: radial-gradient(1200px 700px at 20% -5%, #0f1c1a 0%, #0b1416 55%, #090f10 100%);
  --surface: #12181c;
  --surface-2: #171f22;
  --surface-3: #1a2427;
  --border: #243033;
  --border-soft: #2a373a;
  --text: #e6efec;
  --text-dim: #8fa39d;
  --text-faint: #61736e;
  --accent: #5ec7a8;
  --accent-ink: #04231b;
  --warn: #e0c05f;
  --warn-bg: #231c14;
  --warn-border: #4a3a24;
  --danger: #e88b7a;
  --danger-bg: #2a1815;
  --danger-border: #5a2f28;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 11px;
}

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

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg-radial), var(--bg);
  color: var(--text);
  font-family: 'Nunito Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

h1, h2, h3, .display {
  font-family: 'Nunito', system-ui, sans-serif;
  font-weight: 900;
  letter-spacing: -.4px;
  margin: 0;
}

a { color: inherit; }

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-bottom: 90px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 20px 4px;
}

.app-main {
  flex: 1;
  padding: 8px 20px 24px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 2px 9px;
}

input[type="checkbox"] {
  accent-color: var(--accent);
}

input[type=number].stepper-input {
  background: transparent;
  border: none;
  padding: 0;
  width: 100%;
  outline: none;
  -moz-appearance: textfield;
}
input[type=number].stepper-input::-webkit-outer-spin-button,
input[type=number].stepper-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type=range].hue-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(to right,
    hsl(0,70%,55%), hsl(60,70%,55%), hsl(120,70%,55%),
    hsl(180,70%,55%), hsl(240,70%,55%), hsl(300,70%,55%), hsl(360,70%,55%));
  outline: none;
  cursor: pointer;
}
input[type=range].hue-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--surface-2);
  box-shadow: 0 0 0 1px var(--border-soft);
  cursor: pointer;
}
input[type=range].hue-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--surface-2);
  box-shadow: 0 0 0 1px var(--border-soft);
  cursor: pointer;
}
input[type=range].hue-slider::-moz-range-track {
  height: 10px;
  border-radius: 999px;
  background: transparent;
}

.hue-swatch {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  display: grid;
  place-items: center;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  background: var(--surface-3);
  color: var(--text-dim);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 7px 15px;
  text-decoration: none;
  cursor: pointer;
}
.chip.active {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  border-color: transparent;
}

/* Checkbox-backed toggle chip (e.g. "Für wen"): the checkbox stays in the DOM
   for form semantics but is visually hidden -- the whole pill communicates
   checked state via color, same look as the .chip.active filter pills. */
.chip-check {
  position: relative;
}
.chip-check input[type=checkbox] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.chip-check:has(input:checked) {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  border-color: transparent;
}

.card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 15px;
}

.card-accent {
  background: linear-gradient(120deg, #0f2b24, #0c261f);
  border: 1.5px solid var(--accent);
}

.card-warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
}

.card-danger {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
}

.btn {
  font-family: inherit;
  font-weight: 900;
  font-size: 14px;
  border-radius: 12px;
  padding: 11px 16px;
  cursor: pointer;
  border: none;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-secondary { background: transparent; color: var(--text-dim); border: 1px solid var(--border-soft); }
.btn-block { width: 100%; }

.badge {
  background: var(--border);
  color: var(--accent);
  font-size: 12px;
  border-radius: 6px;
  padding: 2px 7px;
}

.avatar {
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-weight: 900;
  color: var(--accent-ink);
}

.field-label {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-dim);
  display: block;
  margin: 0 2px 7px;
}

.field-value, input[type=text], input[type=number], input[type=date], input[type=time],
input[type=datetime-local], input[type=email], input[type=password], input[type=url], select, textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 15px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  font-family: inherit;
}

.form-row { display: flex; gap: 12px; margin-bottom: 16px; }
.form-row > * { flex: 1; }

.tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: #0f1417;
  border-top: 1px solid var(--border);
  padding: 10px 24px 22px;
  display: flex;
  justify-content: space-between;
}
.tab-bar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-faint);
  text-decoration: none;
  font-size: 10.5px;
  font-weight: 700;
}
.tab-bar a.active { color: var(--accent); font-weight: 800; }

.progress-track {
  height: 8px;
  border-radius: 99px;
  background: var(--border);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
}

@keyframes pulseDue {
  0%, 100% { box-shadow: 0 0 0 0 rgba(94,199,168,.5); }
  50% { box-shadow: 0 0 0 7px rgba(94,199,168,0); }
}
.pulse-due { animation: pulseDue 2.4s ease-out infinite; }

.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,8,9,.7);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet-panel {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 20px 20px 0 0;
  padding: 20px;
  width: 100%;
  max-width: 480px;
  box-sizing: border-box;
}
@media (min-width: 640px) {
  .sheet-overlay { align-items: center; }
  .sheet-panel { border-radius: 20px; max-width: 420px; }
}

.messages { list-style: none; padding: 0; margin: 0 0 14px; }
.messages li {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 8px;
  font-size: 13.5px;
}
