/* ============================================================
   u flow – Sync & Konten UI
   ============================================================ */

/* Konto-Bereich oben im U-Menü */
.u-konto {
  border-bottom: 1px solid var(--karte-rand);
  margin-bottom: 4px; padding-bottom: 4px;
}
.u-konto-info {
  font-size: 12px; color: var(--text-mittel); line-height: 1.4;
  padding: 8px 12px 2px;
}
.u-konto-info b { color: var(--text-stark); font-weight: 600; }
.u-konto-status {
  font-size: 11px; color: var(--text-leise); padding: 0 12px 6px;
}
.u-konto-status[data-s="synchronisiert"] { color: #4d7a48; }
.u-konto-status[data-s="Konflikt"] { color: var(--lamp-rot); }
.u-konto-status[data-s="offline"] { color: var(--lamp-gelb); }
.u-konto-status:empty { display: none; }

/* Modal (Login / Abgleich / Konflikt) */
.sync-overlay { position: fixed; inset: 0; z-index: 13000; display: grid; place-items: center; padding: 24px; }
.sync-backdrop { position: absolute; inset: 0; background: rgba(20, 20, 20, 0.34); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }

/* ---------- Login-Gate: ohne Konto ist die App gesperrt (nur die Login-Maske) ---------- */
body.auth-gate #fokus,
body.auth-gate #desktop,
body.auth-gate #mobil-tabs,
body.auth-gate .avatar-menu { display: none !important; }
body.auth-gate { padding-left: 0 !important; } /* Fokus-Spalten-Einzug weg, solange gesperrt */
.sync-overlay-gate { z-index: 14000; } /* über allem; nicht wegklickbar (kein Backdrop-Handler) */
.sync-overlay-gate .sync-backdrop { background: rgba(20, 20, 20, 0.52); }

/* ---------- Startmoment: Begrüßung während Sessionprüfung und Daten-Hydrierung ---------- */
.uflow-welcome {
  position: fixed; inset: 0; z-index: 16000; min-height: 100dvh;
  display: grid; place-items: center; overflow: hidden; isolation: isolate;
  color: #29241e;
  background:
    radial-gradient(circle at 18% 16%, rgba(225, 0, 42, 0.09), transparent 32%),
    radial-gradient(circle at 82% 78%, rgba(172, 121, 82, 0.14), transparent 34%),
    linear-gradient(145deg, #fbf9f5 0%, #f2ede5 54%, #e9e1d7 100%);
  opacity: 1; visibility: visible;
  transition: opacity 0.38s ease, visibility 0.38s ease;
}
.uflow-welcome::before {
  content: ""; position: absolute; z-index: -1;
  width: 54vmax; height: 54vmax; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 68%);
  animation: uw-atmen 5s ease-in-out infinite alternate;
}
.uflow-welcome.ist-aus { opacity: 0; visibility: hidden; pointer-events: none; }
.uw-orbit {
  position: absolute; border-radius: 50%; pointer-events: none;
  border: 1px solid rgba(74, 61, 47, 0.09);
}
.uw-orbit::after {
  content: ""; position: absolute; top: -4px; left: 50%;
  width: 8px; height: 8px; border-radius: 50%; background: var(--red);
  box-shadow: 0 0 0 7px rgba(225, 0, 42, 0.07);
}
.uw-orbit-eins { width: min(70vw, 680px); aspect-ratio: 1; animation: uw-kreisen 18s linear infinite; }
.uw-orbit-zwei {
  width: min(48vw, 460px); aspect-ratio: 1; border-color: rgba(74, 61, 47, 0.06);
  animation: uw-kreisen-zurueck 24s linear infinite;
}
.uw-orbit-zwei::after { width: 5px; height: 5px; top: auto; bottom: -3px; background: #8f8578; box-shadow: none; }
.uw-inhalt {
  position: relative; z-index: 1; width: min(620px, calc(100vw - 40px));
  padding: 36px 24px; text-align: center;
  animation: uw-inhalt-ein 0.7s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}
.uw-logo { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 34px; }
.uw-logopunkte { display: inline-flex; align-items: center; gap: 4px; }
.uw-logopunkte i { display: block; width: 10px; height: 10px; border-radius: 50%; background: var(--dot-dark); animation: uw-punkt 1.8s ease-in-out infinite; }
.uw-logopunkte i + i { width: 15px; height: 15px; background: var(--dot-light); animation-delay: 0.18s; }
.uw-marke {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  padding-top: 3px; background: var(--red); color: #fff;
  font-family: "Comfortaa", sans-serif; font-size: 24px; font-weight: 700; line-height: 1;
  box-shadow: 0 8px 24px rgba(225, 0, 42, 0.18);
  animation: uw-marke-ein 0.75s cubic-bezier(0.2, 0.8, 0.25, 1.2) both;
}
.uw-wort { font-family: "Comfortaa", sans-serif; font-size: 24px; font-weight: 700; letter-spacing: 0.5px; }
.uw-datum {
  margin-bottom: 10px; color: #8a7e71; font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.uw-gruss { margin: 0; font-size: clamp(30px, 5vw, 50px); line-height: 1.12; letter-spacing: -0.035em; font-weight: 560; }
.uw-zeile { margin: 12px auto 0; max-width: 480px; color: #6e6459; font-size: clamp(15px, 2vw, 18px); line-height: 1.5; }
.uw-ladelinie { width: 176px; height: 2px; margin: 34px auto 13px; overflow: hidden; border-radius: 999px; background: rgba(61, 51, 42, 0.1); }
.uw-ladelinie span {
  display: block; width: 48%; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, rgba(225, 0, 42, 0), var(--red), rgba(225, 0, 42, 0));
  animation: uw-laden 1.35s ease-in-out infinite;
}
.uw-ladetext { display: flex; justify-content: center; align-items: baseline; color: #8b8176; font-size: 12px; letter-spacing: 0.02em; }
.uw-ladepunkte { display: inline-flex; gap: 3px; margin-left: 4px; }
.uw-ladepunkte i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; animation: uw-punkt 1.15s ease-in-out infinite; }
.uw-ladepunkte i:nth-child(2) { animation-delay: 0.16s; }
.uw-ladepunkte i:nth-child(3) { animation-delay: 0.32s; }

@keyframes uw-atmen { from { transform: scale(0.94); opacity: 0.72; } to { transform: scale(1.08); opacity: 1; } }
@keyframes uw-kreisen { to { transform: rotate(360deg); } }
@keyframes uw-kreisen-zurueck { to { transform: rotate(-360deg); } }
@keyframes uw-inhalt-ein { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes uw-marke-ein { from { opacity: 0; transform: scale(0.72) rotate(-8deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes uw-laden { from { transform: translateX(-110%); } to { transform: translateX(230%); } }
@keyframes uw-punkt { 0%, 100% { opacity: 0.36; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }

@media (max-width: 600px) {
  .uw-orbit-eins { width: 116vw; }
  .uw-orbit-zwei { width: 78vw; }
  .uw-inhalt { padding: 28px 18px; }
  .uw-logo { margin-bottom: 28px; }
  .uw-gruss { font-size: clamp(29px, 9vw, 42px); }
}
@media (prefers-reduced-motion: reduce) {
  .uflow-welcome, .uw-inhalt { transition-duration: 0.08s; }
  .uflow-welcome::before, .uw-orbit, .uw-marke, .uw-logopunkte i,
  .uw-ladelinie span, .uw-ladepunkte i { animation: none !important; }
  .uw-ladelinie span { width: 100%; opacity: 0.45; }
}

.sync-card {
  position: relative; width: min(400px, 100%);
  background: linear-gradient(178deg, #ffffff, #f6f5f3);
  border: 1px solid var(--karte-rand); border-radius: 20px; box-shadow: var(--schatten-drag);
  padding: 22px 22px 18px;
}
/* Marken-Logo im Login/Gate (eigenständig – unabhängig von der Fokus-Animation) */
.sync-logo { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 16px; }
.sync-logo .sl-dots { display: inline-flex; align-items: center; gap: 4px; }
.sync-logo .sl-dot { width: 15px; height: 15px; border-radius: 999px; flex: 0 0 auto; }
.sync-logo .sl-dot-dark { width: 11px; height: 11px; background: var(--dot-dark); }
.sync-logo .sl-dot-light { background: var(--dot-light); }
.sync-logo .sl-mark {
  width: 34px; height: 34px; border-radius: 999px; background: var(--red);
  display: grid; place-items: center; color: #fff; padding-top: 3px;
  font-family: "Comfortaa", sans-serif; font-weight: 700; font-size: 20px; line-height: 1;
  box-shadow: var(--schatten-ruhe); flex: 0 0 auto;
}
.sync-logo .sl-wort {
  font-family: "Comfortaa", sans-serif; font-size: 20px; font-weight: 700;
  letter-spacing: 0.5px; color: var(--text-stark);
}

.sync-kopf { margin-bottom: 14px; }
.sync-titel { font-size: 17px; font-weight: 600; color: var(--text-stark); }
.sync-text { font-size: 13.5px; line-height: 1.5; color: var(--text-mittel); margin-bottom: 16px; }
.sync-feld { margin-bottom: 12px; }
.sync-feld label { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--text-leise); margin-bottom: 5px; }
.sync-input {
  width: 100%; border: 1px solid var(--karte-rand); border-radius: 10px; background: #fff;
  font-family: inherit; font-size: 14px; color: var(--text-stark); padding: 10px 12px; outline: none;
}
.sync-input:focus { border-color: rgba(43, 42, 40, 0.5); }
.sync-hinweis { min-height: 16px; font-size: 12px; color: var(--lamp-rot); margin: 2px 0 4px; }
.sync-fuss { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.sync-fuss.zwei { justify-content: flex-end; }
.sync-link { border: none; background: none; color: var(--akzent); font-family: inherit; font-size: 12.5px; cursor: pointer; text-decoration: underline; padding: 0; }
.sync-btn {
  border: 1px solid var(--karte-rand); background: var(--karte-bg-fest); color: var(--text-mittel);
  font-family: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; padding: 9px 16px; border-radius: 10px;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.sync-btn:hover { color: var(--text-stark); border-color: rgba(40, 39, 37, 0.4); }
.sync-btn.primary { color: #fff; background: var(--akzent); border-color: var(--akzent); }
.sync-btn.primary:hover { background: #9d6c48; color: #fff; }
.sync-btn:disabled { opacity: 0.6; cursor: default; }

/* Neue-Aufgabe-Composer: schnelle Erfassung mit sichtbarem Projektkontext. */
.na-overlay .sync-card {
  width: min(560px, 100%); max-height: min(780px, calc(100vh - 32px));
  display: flex; flex-direction: column; padding: 24px 24px 20px;
}
.na-kopf { display: flex; flex-direction: column; gap: 3px; margin-bottom: 16px; }
.na-kopf .sync-titel { font-size: 21px; letter-spacing: -0.25px; }
.na-untertitel { color: var(--text-leise); font-size: 12.5px; }
.na-inhalt { min-height: 0; overflow-y: auto; padding: 1px 2px 2px; scrollbar-width: thin; }
.na-text { min-height: 54px; border-radius: 14px; font-size: 16px; padding: 14px 15px; }
.na-text::placeholder { color: #aaa69f; }
.na-label {
  display: block; margin: 0 0 7px; color: var(--text-leise);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.65px; text-transform: uppercase;
}
.na-project-area { position: relative; margin-top: 17px; }
.na-project-trigger {
  width: 100%; min-height: 66px; display: grid; grid-template-columns: minmax(0, 1fr) 24px;
  align-items: center; gap: 12px; padding: 11px 13px; text-align: left; cursor: pointer;
  border: 1px solid var(--karte-rand); border-radius: 14px; background: rgba(255, 255, 255, 0.82);
  color: var(--text-stark); font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.na-project-trigger:hover,
.na-project-trigger[aria-expanded="true"] { border-color: rgba(43, 42, 40, 0.42); background: #fff; box-shadow: 0 4px 16px rgba(43, 42, 40, 0.08); }
.na-project-main { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.na-project-title,
.na-project-option-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 650; }
.na-project-meta { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 9px; color: var(--text-leise); font-size: 11.5px; }
.na-project-meta > span:not(:first-child)::before { content: "·"; margin-right: 9px; color: #c2beb7; }
.na-project-tag { color: var(--akzent); font-weight: 700; }
.na-project-chevron { color: var(--text-leise); font-size: 20px; text-align: center; transition: transform 0.15s ease; }
.na-project-trigger[aria-expanded="true"] .na-project-chevron { transform: rotate(180deg); }
.na-project-trigger[hidden],
.na-selected-tasks[hidden] { display: none; }
.na-selected-tasks {
  display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 9px; padding: 9px 12px 2px;
  color: var(--text-leise); font-size: 11.5px;
}
.na-selected-caption { padding-top: 2px; font-weight: 650; }
.na-project-tasks { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.na-project-task { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; color: var(--text-mittel); }
.na-project-task > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.na-project-task > span:last-child { color: var(--text-leise); }
.na-project-task > span:first-child::before { content: "○"; margin-right: 6px; color: #aaa69f; }
.na-project-empty { color: #aaa69f; font-style: italic; }
.na-project-picker {
  margin-top: 9px; overflow: hidden; border: 1px solid var(--karte-rand); border-radius: 14px;
  background: #fff; box-shadow: 0 14px 34px rgba(43, 42, 40, 0.16);
}
.na-project-picker[hidden] { display: none; }
.na-project-search {
  display: grid; grid-template-columns: 21px minmax(0, 1fr); align-items: center; gap: 5px;
  min-height: 48px; padding: 10px 12px; border: 1px solid var(--karte-rand); border-radius: 13px;
  background: #fff; color: var(--text-leise); transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.na-project-search:focus-within { border-color: rgba(43, 42, 40, 0.48); box-shadow: 0 0 0 3px rgba(43, 42, 40, 0.05); }
.na-project-picker .na-project-search { border: 0; border-bottom: 1px solid var(--karte-rand); border-radius: 0; box-shadow: none; }
.na-project-search span { font-size: 20px; line-height: 1; }
.na-project-search input { min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text-stark); font: inherit; font-size: 13.5px; }
.na-project-search input::placeholder { color: #aaa69f; }
.na-project-results { max-height: 285px; overflow-y: auto; padding: 7px; scrollbar-width: thin; }
.na-project-group { display: block; padding: 6px 8px 4px; color: var(--text-leise); font-size: 9.5px; font-weight: 750; letter-spacing: 0.65px; text-transform: uppercase; }
.na-project-option {
  width: 100%; display: flex; flex-direction: column; gap: 4px; padding: 10px 11px; border: 0;
  border-radius: 10px; background: transparent; color: var(--text-stark); font-family: inherit; text-align: left; cursor: pointer;
}
.na-project-option:hover { background: #f3f1ee; }
.na-project-option.selected { background: #eeeae5; }
.na-project-option-head { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 20px; align-items: center; gap: 8px; }
.na-project-option .na-project-tasks { margin-top: 2px; padding-left: 1px; font-size: 11px; }
.na-project-check { color: var(--akzent); font-weight: 800; text-align: center; }
.na-project-noresult { display: block; padding: 25px 12px; color: var(--text-leise); font-size: 12.5px; text-align: center; }
.na-project-create { padding: 8px 10px; border-top: 1px solid var(--karte-rand); background: #faf9f7; }
.na-project-create-toggle {
  width: 100%; min-height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--akzent);
  font: inherit; font-size: 12.5px; font-weight: 650; text-align: left; cursor: pointer;
}
.na-project-create-toggle:hover { background: #f0ede8; }
.na-project-create-form { display: grid; grid-template-columns: minmax(0, 1fr) auto 32px; align-items: center; gap: 7px; }
.na-project-create-form[hidden] { display: none; }
.na-project-create-form input {
  min-width: 0; min-height: 38px; border: 1px solid var(--karte-rand); border-radius: 9px; padding: 8px 10px;
  outline: 0; background: #fff; color: var(--text-stark); font: inherit; font-size: 13px;
}
.na-project-create-form input:focus { border-color: rgba(43, 42, 40, 0.5); }
.na-project-create-confirm,
.na-project-create-cancel { min-height: 36px; border: 0; border-radius: 9px; font: inherit; cursor: pointer; }
.na-project-create-confirm { padding: 7px 11px; background: var(--akzent); color: #fff; font-size: 11.5px; }
.na-project-create-cancel { background: transparent; color: var(--text-leise); font-size: 18px; }
.na-task-area { margin-top: 1px; }
.na-date-area { margin-top: 17px; margin-bottom: 2px; }
.na-date-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.na-date-chip {
  position: relative; min-height: 36px; border: 1px solid var(--karte-rand); border-radius: 999px;
  background: rgba(255, 255, 255, 0.74); color: var(--text-mittel); padding: 7px 12px;
  font: inherit; font-size: 12px; cursor: pointer; overflow: hidden;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.na-date-chip:hover { border-color: rgba(43, 42, 40, 0.4); color: var(--text-stark); }
.na-date-chip.active { border-color: var(--akzent); background: color-mix(in srgb, var(--akzent) 12%, white); color: var(--akzent); font-weight: 650; }
.na-date-custom { position: relative; display: inline-flex; }
.na-date-custom.active .na-date-chip { border-color: var(--akzent); background: color-mix(in srgb, var(--akzent) 12%, white); color: var(--akzent); font-weight: 650; }
.na-date-custom input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.na-calendar-icon {
  position: relative; width: 13px; height: 12px; display: inline-block; margin-right: 6px; vertical-align: -2px;
  border: 1.4px solid currentColor; border-radius: 3px; box-sizing: border-box;
  background: linear-gradient(currentColor, currentColor) 0 3px / 100% 1px no-repeat;
}
.na-calendar-icon::before,
.na-calendar-icon::after { content: ""; position: absolute; top: -3px; width: 1.5px; height: 3px; background: currentColor; border-radius: 2px; }
.na-calendar-icon::before { left: 2px; }
.na-calendar-icon::after { right: 2px; }
.na-date-value { display: block; min-height: 17px; margin: 7px 2px 0; color: var(--text-leise); font-size: 11.5px; }
.na-fuss { flex: 0 0 auto; margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--karte-rand); }
.na-fuss .sync-btn { min-height: 42px; padding-inline: 19px; }
select.sync-input { cursor: pointer; }

/* Konflikt-Vergleich: zwei Versionen mit Zeitstempel, neuere hervorgehoben */
.sync-vergleich { display: flex; flex-direction: column; gap: 9px; margin-top: 4px; }
.sync-wahl {
  display: flex; flex-direction: column; gap: 2px; text-align: left;
  border: 1px solid var(--karte-rand); background: var(--karte-bg-fest); border-radius: 12px;
  padding: 11px 13px; cursor: pointer; font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.sync-wahl:hover { border-color: rgba(43, 42, 40, 0.5); background: #fff; }
.sync-wahl.neuer { border-color: var(--akzent); box-shadow: 0 0 0 1px var(--akzent); }
.sync-wahl-t { font-size: 14px; font-weight: 600; color: var(--text-stark); }
.sync-wahl-z { font-size: 12px; color: var(--text-leise); }
.sync-neu {
  font-style: normal; font-size: 10.5px; font-weight: 700; letter-spacing: 0.3px;
  color: #fff; background: var(--akzent); border-radius: 999px; padding: 1px 7px; margin-left: 6px;
}
.sync-verb { margin-top: 12px; font-size: 12px; }
.sync-verb.on { color: #4d7a48; }
.sync-verb.off { color: var(--lamp-gelb); }
