/* LMP Assistenz – minimalistisch, ruhig, hochwertig.
   Verbindliche Farben: Puderrosa #F4DDE4, Beige #EDE3D7, Cremeweiß #FAF8F5,
   Anthrazit #333333, Altrosa #C77D96 (wichtige Schaltflächen).
   Keine Animationen, große Schrift, Bedienung im Daumenbereich.
   Startseite: ein Punkt „Als Nächstes“, dann der vollständige Tagesüberblick. */

:root {
  color-scheme: light;
  --powder: #f4dde4;
  --beige: #ede3d7;
  --cream: #faf8f5;
  --ink: #333333;
  --rose: #c77d96;

  /* Ableitungen aus den Grundfarben (Deckkraft), keine zusätzlichen Farbtöne */
  --ink-soft: rgba(51, 51, 51, 0.74);
  --line: #ede3d7;
  --tile: #ffffff;
  --rose-soft: rgba(199, 125, 150, 0.16);

  --radius: 24px;
  --radius-sm: 16px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --tabbar-h: 76px;
  --max: 680px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  animation: none !important;
  transition: none !important;
}

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  font-size: 19px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--rose);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -999px;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  z-index: 100;
  background: var(--tile);
  padding: 8px 12px;
  border-radius: 10px;
}

.icon {
  flex: none;
  display: block;
}

/* ---------- Kopfbereich ---------- */

.topbar {
  background: var(--cream);
  padding-top: env(safe-area-inset-top);
}

.topbar-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px max(20px, env(safe-area-inset-right)) 8px max(20px, env(safe-area-inset-left));
}

.topbar-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  margin: 0;
  color: var(--ink-soft);
  font-size: 17px;
}

h1 {
  margin: 2px 0 0;
  font-weight: 700;
  font-size: 36px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--beige);
  color: var(--ink);
  flex: none;
}

.area-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 16px;
  padding: 4px;
  background: var(--beige);
  border-radius: 999px;
}

.area-switch button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 17px;
  font-weight: 500;
}

.area-switch button.is-active {
  background: var(--tile);
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Inhalt ---------- */

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px max(20px, env(safe-area-inset-right)) calc(var(--tabbar-h) + 120px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  outline: none;
}

.section {
  margin-top: 32px;
}

.section-title {
  margin: 0 4px 12px;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.section-quiet {
  margin-top: 20px;
}

.card-list {
  display: grid;
  gap: 12px;
}

/* ---------- Als Nächstes ---------- */

.hero {
  margin-top: 8px;
  padding: 22px 22px 20px;
  border-radius: var(--radius);
  background: var(--powder);
}

.hero-label {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.hero-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.hero-kind {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 17px;
  color: var(--ink-soft);
}

.hero-title {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.hero-sub {
  margin: 0;
  font-size: 20px;
  overflow-wrap: anywhere;
}

.hero .due {
  margin-top: 4px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-actions .btn {
  flex: 1 1 130px;
  padding: 0 12px;
}

.hero-actions .btn-secondary {
  font-size: 17px;
}

/* Die Hauptaktion steht immer rechts bzw. unten, im Daumenbereich. */
.hero-actions .btn-primary {
  order: 2;
}

.hero-empty .hero-title {
  margin-top: 2px;
}

.hero-empty .hero-sub {
  margin-top: 6px;
  color: var(--ink-soft);
}

/* ---------- Dein Tag (Morgen-Update) ---------- */

.greeting {
  margin: 0 4px 10px;
  font-size: 20px;
  font-weight: 600;
}

.assistant-line {
  color: var(--ink-soft);
  font-weight: 400;
}

.evening {
  background: var(--powder);
}

.evening-text {
  margin: 0 4px;
  font-size: 18px;
}

.day {
  margin-top: 16px;
  padding: 18px 18px 10px;
  border-radius: var(--radius);
  background: var(--beige);
}

.day-title {
  margin: 0 0 6px 4px;
  font-size: 22px;
  font-weight: 700;
}

.day-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 56px;
  padding: 6px 4px;
  border: 0;
  border-top: 1px solid rgba(51, 51, 51, 0.08);
  background: transparent;
  text-align: left;
}

.day-row:first-of-type {
  border-top: 0;
}

.day-num {
  min-width: 44px;
  padding: 2px 0;
  border-radius: 12px;
  background: var(--tile);
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.day-label {
  font-size: 19px;
}

.day-alert {
  margin: 8px 4px 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--powder);
  font-weight: 600;
  font-size: 17px;
}

/* ---------- Karten ---------- */

.card {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--tile);
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

.card.is-urgent::before {
  content: '';
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 5px;
  border-radius: 0 5px 5px 0;
  background: var(--rose);
}

.card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 18px 8px 18px 22px;
  border: 0;
  background: transparent;
  text-align: left;
}

.card-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.card-sub {
  color: var(--ink-soft);
  font-size: 17.5px;
  overflow-wrap: anywhere;
}

.card.is-done .card-title {
  text-decoration: line-through;
  color: var(--ink-soft);
}

.due {
  font-size: 16.5px;
  color: var(--ink-soft);
}

.due-overdue,
.due-today {
  display: inline-block;
  margin-top: 2px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--powder);
  color: var(--ink);
  font-weight: 600;
}

.hero .due-overdue,
.hero .due-today {
  background: var(--tile);
}

.time {
  flex: none;
  margin-left: 18px;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--beige);
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.time + .card-body {
  padding-left: 14px;
}

/* Erledigt-Kreis rechts: mit dem Daumen gut erreichbar. */
.check {
  flex: none;
  display: grid;
  place-items: center;
  width: 64px;
  align-self: stretch;
  min-height: 72px;
  padding: 0 14px 0 4px;
  border: 0;
  background: transparent;
  color: transparent;
}

.check .icon {
  width: 38px;
  height: 38px;
  padding: 7px;
  border: 2px solid var(--rose);
  border-radius: 50%;
}

.check:active .icon,
.card.is-done .check .icon {
  background: var(--rose);
  color: #ffffff;
}

.round-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--beige);
  color: var(--ink);
}

/* ---------- Chips ---------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 2px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--beige);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.7;
}

.chip-sample {
  background: transparent;
  border: 1px dashed var(--ink-soft);
  color: var(--ink-soft);
}

.chip-accent {
  background: var(--powder);
}

/* ---------- Links, Hinweise ---------- */

.link-btn {
  display: block;
  width: 100%;
  min-height: 56px;
  margin-top: 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--beige);
  color: var(--ink);
  font-weight: 600;
  font-size: 18px;
}

.link-quiet {
  background: transparent;
  color: var(--ink-soft);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--rose);
  text-underline-offset: 4px;
}

.link-danger {
  background: transparent;
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.note {
  margin: 24px 4px 0;
  color: var(--ink-soft);
  font-size: 16.5px;
}

.hint-box {
  margin-top: 32px;
  padding: 18px 20px 6px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 17px;
}

.hint-box p {
  margin: 0;
}

.hint-box strong {
  color: var(--ink);
}

.hint-box .btn-block {
  width: 100%;
  margin-top: 14px;
}

.hint-box .link-btn {
  min-height: 48px;
  margin-top: 4px;
  text-align: left;
  padding: 0;
}

.empty {
  margin-top: 48px;
  padding: 24px;
  text-align: center;
  color: var(--ink-soft);
}

.empty p {
  margin: 6px 0;
}

.empty-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
}

/* ---------- Einstellungen ---------- */

.panel {
  margin-top: 16px;
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--tile);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 17.5px;
}

.panel p {
  margin: 0 0 14px;
}

.panel strong {
  color: var(--ink);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-weight: 700;
  font-size: 21px;
  color: var(--ink);
}

.panel-title .icon {
  color: var(--rose);
}

.plain-list {
  margin: 0;
  padding-left: 22px;
}

.plain-list li {
  margin-bottom: 8px;
}

.integration-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.integration-list li {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.integration-list p {
  margin: 4px 0 0;
  font-size: 16.5px;
}

.integration-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  margin-top: 8px;
  color: var(--ink);
}

.check-row input {
  width: 26px;
  height: 26px;
  accent-color: var(--rose);
}

.small {
  font-size: 15.5px;
}

.panel .btn-stack p {
  margin: 4px 0 0;
}

.version {
  margin: 28px 0 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 15px;
}

/* ---------- Buttons ---------- */

.btn-stack {
  display: grid;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 60px;
  padding: 0 22px;
  border-radius: 18px;
  border: 0;
  font-weight: 700;
  font-size: 19px;
  text-decoration: none;
}

.panel > .btn,
.btn-stack .btn {
  width: 100%;
}

/* Altrosa nur für die wichtigste Schaltfläche. Weiße, fette Schrift ab 19 px. */
.btn-primary {
  background: var(--rose);
  color: #ffffff;
}

.btn-secondary {
  background: var(--tile);
  color: var(--ink);
}

.panel .btn-secondary,
.sheet .btn-secondary {
  background: var(--beige);
}

.btn-danger {
  background: var(--powder);
  color: var(--ink);
}

/* ---------- Plus-Button und Tableiste (Daumenbereich) ---------- */

.fab {
  position: fixed;
  z-index: 20;
  right: max(20px, calc((100vw - var(--max)) / 2 + 20px));
  bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border: 0;
  border-radius: 50%;
  background: var(--rose);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(51, 51, 51, 0.18);
}

.tabbar {
  position: fixed;
  z-index: 15;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--cream);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}

.tabbar-inner {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 max(4px, env(safe-area-inset-left));
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: var(--tabbar-h);
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11.5px;
  letter-spacing: -0.01em;
  font-weight: 500;
}

.tab .icon {
  width: 26px;
  height: 26px;
}

.tab.is-active {
  color: var(--ink);
  font-weight: 700;
}

.tab.is-active .icon {
  color: var(--rose);
  stroke-width: 2.2;
}

/* ---------- Bottom Sheet ---------- */

.sheet {
  width: 100%;
  max-width: 640px;
  max-height: 94dvh;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 28px 28px 0 0;
  background: var(--cream);
  color: var(--ink);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sheet::backdrop {
  background: rgba(51, 51, 51, 0.35);
}

@media (min-width: 700px) {
  .sheet {
    margin: auto;
    border-radius: 28px;
  }
}

.sheet-form {
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.sheet-head h2 {
  margin: 0;
  font-weight: 700;
  font-size: 28px;
}

.field {
  display: block;
  margin: 18px 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.field legend,
.field-label {
  display: block;
  margin-bottom: 8px;
  padding: 0;
  font-size: 17px;
  font-weight: 600;
}

.field-label em {
  font-weight: 400;
  font-style: normal;
  color: var(--ink-soft);
}

#entry-form .field-label [data-for] {
  display: none;
}

#entry-form[data-kind='task'] [data-for='task'],
#entry-form[data-kind='callback'] [data-for='callback'],
#entry-form[data-kind='reply'] [data-for='reply'],
#entry-form[data-kind='appointment'] [data-for='appointment'] {
  display: inline;
}

.field input,
.field textarea {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  border: 1px solid var(--beige);
  border-radius: var(--radius-sm);
  background: var(--tile);
  font-size: 19px;
  -webkit-appearance: none;
  appearance: none;
}

.field select {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  border: 1px solid var(--beige);
  border-radius: var(--radius-sm);
  background: var(--tile);
  font-size: 19px;
  color: var(--ink);
}

.field textarea {
  resize: vertical;
  line-height: 1.4;
}

#capture-text {
  min-height: 132px;
  font-size: 22px;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px var(--rose-soft);
}

.field-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 10px;
}

.seg {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 18px;
  background: var(--beige);
}

.seg-2x2 {
  grid-auto-flow: row;
  grid-template-columns: repeat(2, 1fr);
}

.seg-3x2 {
  grid-auto-flow: row;
  grid-template-columns: repeat(3, 1fr);
}

.seg-stack {
  grid-auto-flow: row;
  grid-template-columns: 1fr;
}

.seg-option {
  position: relative;
  display: block;
}

.seg-option input {
  position: absolute;
  opacity: 0;
  inset: 0;
}

.seg-option span {
  display: grid;
  place-items: center;
  min-height: 50px;
  padding: 4px 6px;
  border-radius: 14px;
  color: var(--ink-soft);
  font-size: 17px;
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
}

.seg-option input:checked + span {
  background: var(--tile);
  color: var(--ink);
  font-weight: 700;
  box-shadow: inset 0 0 0 2px var(--rose);
}

.seg-option input:focus-visible + span {
  outline: 3px solid var(--rose);
}

.hint {
  margin: 12px 2px 0;
  color: var(--ink-soft);
  font-size: 16px;
}

.preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  margin-top: 12px;
}

.form-error {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--powder);
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
}

.sheet-actions {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.sheet-actions .btn {
  width: 100%;
}

/* ---------- Hinweis unten (ohne Animation) ---------- */

.toast {
  position: fixed;
  z-index: 30;
  left: max(16px, calc((100vw - var(--max)) / 2 + 16px));
  right: max(16px, calc((100vw - var(--max)) / 2 + 16px));
  bottom: calc(var(--tabbar-h) + 100px + env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 10px;
  min-height: 60px;
  padding: 8px 8px 8px 18px;
  border-radius: 18px;
  background: var(--ink);
  color: #ffffff;
  font-size: 17px;
}

.toast-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.toast-btn {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: var(--powder);
  color: var(--ink);
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
}

/* ---------- iPad / größere Bildschirme ---------- */

@media (min-width: 900px) {
  :root {
    --max: 760px;
  }

  .hero-title {
    font-size: 34px;
  }
}
