/* start-tag.css: Kunden-Startseite "Dein Tag" (dashboard.html, start-tag.js)
 *
 * Nur Token-Variablen aus theme.js, keine Farbwerte, keine Schatten. Status: gruen = fertig,
 * gold (--offen) = ihr seid dran, Ziegel (--warn) = ueberfaellig. Rot gibt es nur im Logo.
 * Ein gefuellter Hauptknopf je Flaeche: in der Liste ist es der erste Knopf, bei offenem
 * Formular der Absende-Knopf des Formulars. Animiert wird nur opacity und transform.
 */

/* ---------------------------------------------------------------- Kopf */
.st-kopf { margin-bottom: 1.75rem; }
.st-kopf[hidden] { display: none; }
.st-gruss { font-size: clamp(26px, 4.4vw, 46px); overflow-wrap: anywhere; }
.st-datum { margin-top: 0.5rem; font-size: 15px; color: var(--text-secondary); }

/* ---------------------------------------------------------------- Spalten */
.st-spalte { display: flex; flex-direction: column; gap: 1.5rem; min-width: 0; }
.st-karte-klein { padding: 1.25rem 1.5rem; }
.st-karte-klein[hidden], .st-zeile[hidden], .st-formular[hidden], .st-antwort[hidden] { display: none; }
.st-kartenkopf { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 0.75rem; margin-bottom: 1rem; }
.st-kartenkopf h2 { min-width: 0; font-size: 18px; font-weight: 600; color: var(--text-primary); }
.st-kartenkopf .st-rechts { margin-left: auto; }
.st-zaehler {
  display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 9px;
  border-radius: 14px; background: var(--btn-primary-bg); color: var(--btn-primary-fg);
  font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.st-zaehler[hidden] { display: none; }
.st-klein { font-size: 13px; color: var(--text-secondary); }
.st-meta { font-size: 13px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.st-meta b { color: var(--text-primary); font-weight: 600; }

/* ---------------------------------------------------------------- Knoepfe */
.st-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; min-height: 44px; padding: 0 1.1rem;
  border-radius: var(--radius-pill); border: 1px solid var(--kontur); background: transparent; color: var(--text-primary);
  font-family: var(--font-body); font-weight: 600; font-size: 14px; line-height: 1; white-space: nowrap; cursor: pointer;
  transition: border-color var(--dur-fast), opacity var(--dur-fast), transform var(--dur-fast);
}
.st-btn[hidden] { display: none; }
.st-btn:hover { border-color: var(--text-primary); }
.st-btn:active { transform: scale(0.97); }
.st-btn[disabled] { opacity: 0.5; cursor: default; }
.st-btn--haupt { background: var(--btn-primary-bg); color: var(--btn-primary-fg); border-color: var(--btn-primary-line); }
.st-btn--haupt:hover { opacity: 0.9; border-color: var(--btn-primary-line); }
.st-btn--leise { border-color: transparent; color: var(--text-secondary); }
.st-btn--leise:hover { color: var(--text-primary); border-color: var(--line); }
.st-btn .material-symbols-outlined { font-size: 18px; }
/* Bei offenem Formular ist der Absende-Knopf der einzige gefuellte */
#todo-card.st-formular-offen .st-zeile .st-btn--haupt { background: transparent; color: var(--text-primary); border-color: var(--kontur); }
/* Notizfeld offen: der Knopf "Erledigt" in der Zeile geht weg, der untere ("Als erledigt senden") bleibt der Hauptknopf */
.st-zeile:has(.st-antwort:not([hidden])) .st-aktion .st-btn[data-act="erledigen"] { display: none; }
#todo-card.st-formular-offen .st-zeile .st-antwort .st-btn--haupt { background: var(--btn-primary-bg); color: var(--btn-primary-fg); border-color: var(--btn-primary-line); }

/* ---------------------------------------------------------------- Pillen */
.st-pille {
  display: inline-flex; align-items: center; max-width: 100%; padding: 3px 12px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: var(--bg-s3); color: var(--text-secondary);
  font-size: 13px; font-weight: 600; line-height: 1.3; white-space: nowrap;
}
.st-pille--offen { background: var(--bg-s3); border-color: var(--offen); color: var(--text-primary); }
.st-pille--warn { background: var(--warn-weich); border-color: var(--warn); color: var(--warn-ink); }
.st-pille--ok { background: var(--ok-weich); border-color: var(--ok); color: var(--ok); }

/* ---------------------------------------------------------------- Liste */
.st-liste { display: flex; flex-direction: column; }
.st-zeile {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 176px auto; align-items: center; gap: 0.5rem 0.9rem;
  padding: 0.8rem 0; border-top: 1px solid var(--line); min-height: 72px;
  grid-template-areas: "bild text pille aktion" "antwort antwort antwort antwort";
}
.st-zeile:first-child { border-top: 0; padding-top: 0; }
.st-zeile:last-child { padding-bottom: 0; }
.st-bild { grid-area: bild; display: flex; align-items: center; justify-content: center; width: 44px; }
.st-text { grid-area: text; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.st-pille-feld { grid-area: pille; display: flex; justify-content: flex-start; min-width: 0; }
.st-aktion { grid-area: aktion; display: flex; justify-content: flex-end; }
.st-aktion .st-btn { min-width: 96px; }
.st-titel {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-weight: 600; font-size: 16px; line-height: 1.3; color: var(--text-primary); overflow-wrap: anywhere;
}
.st-sub { font-size: 14px; line-height: 1.35; color: var(--text-secondary); overflow-wrap: anywhere; }
.st-notiz { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text-muted); }
.st-vorschau {
  width: 34px; height: 60px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-s2);
  display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--text-secondary);
}
.st-vorschau img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-vorschau .material-symbols-outlined { font-size: 20px; }
.st-avatar {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg-s3); color: var(--text-primary);
  display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: 13px; font-weight: 600; flex: none;
}
.st-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-zeile.st-weg { opacity: 0; transform: translateX(8px); transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out); }

/* Antwort-Feld unter der Zeile */
.st-antwort { grid-area: antwort; display: flex; flex-direction: column; gap: 0.6rem; padding: 0.25rem 0 0.25rem calc(44px + 0.9rem); }
.st-antwort-knoepfe { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* Leerer Zustand */
.st-fertig { display: flex; align-items: center; gap: 1rem; padding: 1rem 0.2rem; }
.st-fertig-haken {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  background: var(--ok-weich); color: var(--ok);
}
.st-fertig p { font-size: 15px; line-height: 1.5; color: var(--text-secondary); }
.st-fertig a { color: var(--text-primary); font-weight: 600; }
.st-hinweis { font-size: 14px; line-height: 1.5; color: var(--text-secondary); padding: 0.75rem 0 0; }
.st-hinweis a { color: var(--text-primary); font-weight: 600; }

/* ---------------------------------------------------------------- Formular */
.st-formular {
  display: flex; flex-direction: column; gap: 0.9rem; margin: 0 0 1.25rem; padding: 1.1rem;
  border: 1px solid var(--kontur); border-radius: var(--radius-sm); background: var(--bg-s2);
}
.st-formular h3 { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.st-feldreihe { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.st-feld-box { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.st-feld-box > label, .st-feld-box > .st-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.st-feld {
  width: 100%; min-height: 44px; padding: 0.6rem 0.75rem; font-family: var(--font-body); font-size: 16px; line-height: 1.35;
  color: var(--text-primary); background: var(--input-bg); border: 1px solid var(--kontur); border-radius: var(--radius-sm);
}
textarea.st-feld { min-height: 76px; resize: vertical; }
.st-feld:disabled { opacity: 0.5; }
.st-feld:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 2px; }
.st-schalter { display: inline-flex; align-items: center; gap: 0.65rem; min-height: 44px; cursor: pointer; font-size: 15px; font-weight: 600; color: var(--text-primary); }
.st-schalter input {
  appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 44px; height: 26px; margin: 0;
  border-radius: 13px; border: 1px solid var(--kontur); background: var(--bg-s3); cursor: pointer;
  transition: background-color var(--dur-fast);
}
.st-schalter input::before {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--text-secondary); transition: transform var(--dur-fast), background-color var(--dur-fast);
}
.st-schalter input:checked { background: var(--btn-primary-bg); border-color: var(--btn-primary-line); }
.st-schalter input:checked::before { transform: translateX(18px); background: var(--btn-primary-fg); }
.st-schalter input:focus-visible { outline: 2px solid var(--text-primary); outline-offset: 3px; }
.st-formular-knoepfe { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }
.st-fehler { font-size: 14px; color: var(--warn-ink); }
.st-fehler[hidden] { display: none; }

/* ---------------------------------------------------------------- Von dir vergeben */
.st-vergeben { margin-top: 1.25rem; border-top: 1px solid var(--line); padding-top: 0.5rem; }
.st-vergeben[hidden] { display: none; }
.st-vergeben summary {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-height: 44px; cursor: pointer;
  list-style: none; font-size: 15px; font-weight: 600; color: var(--text-primary);
}
.st-vergeben summary::-webkit-details-marker { display: none; }
.st-vergeben summary .material-symbols-outlined { font-size: 22px; color: var(--text-secondary); transition: transform var(--dur-fast); }
.st-vergeben[open] summary .material-symbols-outlined { transform: rotate(180deg); }
.st-v-zeile {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 0.4rem 0.75rem;
  padding: 0.7rem 0; border-top: 1px solid var(--line);
}
.st-v-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.st-v-zitat { font-size: 14px; line-height: 1.4; color: var(--text-secondary); overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- Liegt bei viel Liebe */
.st-drei { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.st-zahl { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.1rem 0.5rem; color: inherit; border-radius: 8px; }
a.st-zahl:hover .st-zahl-text { color: var(--text-primary); }
.st-zahl b { font-family: var(--font-display); font-weight: 900; font-size: 28px; line-height: 1; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.st-zahl-text { font-size: 14px; line-height: 1.3; font-weight: 600; color: var(--text-secondary); }
.st-zahl.st-null b { color: var(--text-muted); }
.st-trenner { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }
.st-fuss { margin-top: 0.9rem; }

/* ---------------------------------------------------------------- Rechte Spalte */
.st-neu-liste { display: flex; flex-direction: column; }
.st-neu-zeile { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-height: 40px; padding: 0.35rem 0; border-top: 1px solid var(--line); }
.st-neu-zeile:first-child { border-top: 0; }
.st-neu-titel { min-width: 0; font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--text-primary); overflow-wrap: anywhere; }
.st-neu-fuss { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 0.75rem; }
.st-link { font-size: 14px; font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.st-link:hover { opacity: 0.8; }
.st-plattformen { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); padding-top: 0.9rem; }
.st-plattform { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-right: 0.9rem; }
.st-plattform + .st-plattform { padding: 0 0 0 1rem; border-left: 1px solid var(--line); }
.st-plattform .st-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.st-gross { font-family: var(--font-display); font-weight: 900; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.15; color: var(--text-primary); font-variant-numeric: tabular-nums; text-transform: uppercase; }
.st-zeitraum { font-size: 13px; font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.st-zeitraum-warn { margin: 0.75rem 0 0; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.st-leer-zahl { font-size: 16px; font-weight: 600; color: var(--text-muted); padding: 0.35rem 0; }

/* ---------------------------------------------------------------- Handy */
@media (max-width: 767px) {
  .st-kopf { margin-bottom: 1.25rem; }
  .st-karte-klein { padding: 1.1rem; }
}
@media (max-width: 640px) {
  .st-zeile {
    grid-template-columns: 44px minmax(0, 1fr); gap: 0.4rem 0.75rem;
    grid-template-areas: "bild text" "bild pille" "bild aktion" "antwort antwort";
    align-items: start;
  }
  .st-bild { align-self: start; }
  .st-aktion { justify-content: flex-start; margin-top: 0.25rem; }
  .st-aktion .st-btn { min-height: 44px; min-width: 120px; }
  .st-antwort { padding-left: 0; }
  .st-feldreihe { grid-template-columns: 1fr; }
  .st-drei { grid-template-columns: 1fr; gap: 0.75rem; }
  .st-zahl { justify-content: flex-start; min-height: 44px; align-items: center; }
  .st-v-zeile { grid-template-columns: minmax(0, 1fr) auto; }
  .st-v-zeile .st-v-aktion { grid-column: 1 / -1; }
  .st-plattform { padding-right: 0.6rem; }
  .st-plattform + .st-plattform { padding-left: 0.75rem; }
  .st-btn { min-height: 44px; }
  .st-kartenkopf .st-rechts { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .st-zeile.st-weg, .st-btn, .st-schalter input, .st-schalter input::before { transition: none; }
}
