/* Mini-Aufgaben – eigenes Monochrom-Design mit Akzentgrün #10b981 */

:root {
  --akzent: #10b981;
  --akzent-dunkel: #059669;
  --akzent-hell: #d1fae5;

  --bg: #f6f7f8;
  --flaeche: #ffffff;
  --flaeche-2: #f0f2f3;
  --linie: #e2e5e8;
  --text: #1f2429;
  --text-leise: #6b7280;
  --text-sehr-leise: #9aa1a9;
  --schatten: 0 1px 2px rgba(20, 25, 30, .06), 0 6px 18px rgba(20, 25, 30, .05);
  --fokus: 0 0 0 3px rgba(16, 185, 129, .45);
  --radius: 16px;
  --radius-s: 11px;
  --gefahr: #e5484d;
}

[data-theme="dark"] {
  --bg: #15181b;
  --flaeche: #1f2327;
  --flaeche-2: #262b30;
  --linie: #31373d;
  --text: #eceef0;
  --text-leise: #9aa3ac;
  --text-sehr-leise: #6c757e;
  --schatten: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .35);
  --akzent-hell: #0e3b2e;
  --gefahr: #ff6166;
}

* { box-sizing: border-box; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
  overflow-x: hidden;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--akzent);
  color: #fff;
  padding: 10px 14px;
  border-radius: 0 0 var(--radius-s) 0;
  z-index: 50;
}
.skip-link:focus { left: 0; }

/* Kopf */
.kopf {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--linie);
  padding-top: env(safe-area-inset-top);
}
.kopf-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.marke { display: flex; align-items: center; gap: 10px; min-width: 0; }
.marke-logo {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  background: linear-gradient(140deg, var(--akzent), var(--akzent-dunkel));
  color: #fff;
  flex: none;
  box-shadow: 0 3px 9px rgba(16, 185, 129, .35);
}
.marke-text {
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border: 1px solid var(--linie);
  background: var(--flaeche);
  color: var(--text);
  border-radius: 11px;
  cursor: pointer;
  flex: none;
  transition: background .15s, transform .1s, border-color .15s;
}
.icon-btn:hover { background: var(--flaeche-2); }
.icon-btn:active { transform: scale(.94); }
.ic-moon { display: none; }
[data-theme="dark"] .ic-sun { display: none; }
[data-theme="dark"] .ic-moon { display: block; }

/* Haupt */
.haupt {
  max-width: 640px;
  margin: 0 auto;
  padding: 18px 16px 48px;
}

/* Eingabe */
.eingabe {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.eingabe-feld {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1rem;
  padding: 14px 16px;
  border: 1px solid var(--linie);
  border-radius: var(--radius-s);
  background: var(--flaeche);
  color: var(--text);
  box-shadow: var(--schatten);
  transition: border-color .15s, box-shadow .15s;
}
.eingabe-feld::placeholder { color: var(--text-sehr-leise); }
.eingabe-feld:focus {
  outline: none;
  border-color: var(--akzent);
  box-shadow: var(--fokus);
}
.add-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  border: none;
  border-radius: var(--radius-s);
  background: linear-gradient(140deg, var(--akzent), var(--akzent-dunkel));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(16, 185, 129, .4);
  transition: transform .1s, filter .15s;
}
.add-btn:hover { filter: brightness(1.05); }
.add-btn:active { transform: scale(.93); }

/* Tabs */
.tabs {
  display: flex;
  gap: 6px;
  padding: 5px;
  background: var(--flaeche-2);
  border: 1px solid var(--linie);
  border-radius: 13px;
  margin-bottom: 16px;
}
.tab {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 8px;
  font-size: .96rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-leise);
  border-radius: 9px;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.tab.is-aktiv {
  background: var(--flaeche);
  color: var(--text);
  box-shadow: var(--schatten);
}
.badge {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  font-size: .78rem;
  font-weight: 700;
  border-radius: 999px;
  background: var(--flaeche-2);
  color: var(--text-leise);
}
.tab.is-aktiv .badge {
  background: var(--akzent);
  color: #fff;
}

/* Liste */
.liste {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 13px 13px 14px;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  animation: rein .18s ease;
}
@keyframes rein {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.check {
  flex: none;
  margin-top: 1px;
  width: 24px; height: 24px;
  border: 2px solid var(--text-sehr-leise);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #fff;
  transition: background .15s, border-color .15s, transform .1s;
}
.check svg { opacity: 0; transition: opacity .12s; }
.check:active { transform: scale(.9); }
.item.is-erledigt .check {
  background: var(--akzent);
  border-color: var(--akzent);
}
.item.is-erledigt .check svg { opacity: 1; }

.item-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1rem;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  padding-top: 2px;
}
.item.is-erledigt .item-text {
  text-decoration: line-through;
  color: var(--text-sehr-leise);
}

.item-aktionen {
  flex: none;
  display: flex;
  gap: 4px;
}
.act {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border: none;
  background: transparent;
  color: var(--text-leise);
  border-radius: 9px;
  cursor: pointer;
  transition: background .15s, color .15s, transform .1s;
}
.act:hover { background: var(--flaeche-2); color: var(--text); }
.act:active { transform: scale(.9); }
.act.act-del:hover { color: var(--gefahr); background: color-mix(in srgb, var(--gefahr) 14%, transparent); }

/* Leer-Zustand */
.leer {
  text-align: center;
  color: var(--text-sehr-leise);
  padding: 46px 20px;
}
.leer p { margin: 12px 0 0; font-size: .95rem; }

/* Erledigt-Block */
.erledigt-block { margin-top: 22px; }
.erledigt-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 6px;
  border: none;
  background: transparent;
  color: var(--text-leise);
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 9px;
}
.erledigt-toggle:hover { color: var(--text); }
.erledigt-toggle .chevron { transition: transform .18s; flex: none; }
.erledigt-toggle[aria-expanded="true"] .chevron { transform: rotate(90deg); }
.mini-link {
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--text-sehr-leise);
  font-size: .85rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 7px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.mini-link:hover { color: var(--gefahr); }
.erledigt-liste { margin-top: 8px; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(14px);
  background: var(--text);
  color: var(--bg);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: .92rem;
  font-weight: 500;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .28);
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100vw - 32px);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.is-an {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.toast-undo {
  border: none;
  background: transparent;
  color: var(--akzent);
  font-weight: 700;
  font-size: .92rem;
  cursor: pointer;
  padding: 2px 4px;
  white-space: nowrap;
}

/* Fokus-States allgemein */
:focus-visible {
  outline: none;
  box-shadow: var(--fokus);
  border-radius: 9px;
}

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

@media (max-width: 400px) {
  .marke-text { font-size: 1.02rem; }
  .haupt { padding: 14px 12px 40px; }
  .kopf-inner { padding: 10px 12px; }
}
