:root {
  color-scheme: dark;
  --bg: #07111d;
  --panel: #132334;
  --line: rgba(128, 164, 204, 0.34);
  --text: #f4f8ff;
  --muted: #a9b8c9;
  --blue: #2f8cff;
  --cyan: #26d8ff;
  --green: #2ac67a;
  --gold: #f0c978;
  --danger: #ff5967;
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.3);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  min-width: 100%;
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: #02060d;
  color: var(--text);
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

a,
input,
textarea,
select {
  touch-action: manipulation;
}

input,
button {
  appearance: none;
  -webkit-appearance: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.mobile-app {
  width: 100%;
  max-width: 430px;
  min-height: 100svh;
  margin: 0 auto;
  background:
    radial-gradient(circle at 72% 0%, rgba(47, 140, 255, 0.18), transparent 14rem),
    linear-gradient(180deg, #091829 0%, #06111d 48%, #07111d 100%);
  overflow-x: hidden;
}

.login-screen {
  display: none;
  min-height: 100svh;
  width: 100%;
  padding: max(22px, env(safe-area-inset-top)) 20px max(22px, env(safe-area-inset-bottom));
  background:
    linear-gradient(135deg, rgba(15, 23, 34, 0.98) 0%, rgba(20, 32, 51, 0.98) 58%, rgba(26, 45, 71, 0.98) 100%);
}

.login-screen.is-active {
  display: grid;
  place-items: center;
}

.login-center {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 28px;
  width: 100%;
  min-height: calc(100svh - 54px);
  margin-inline: auto;
}

.login-logo {
  width: min(340px, 84vw);
  height: auto;
  filter: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.25));
}

.login-form {
  display: grid;
  gap: 12px;
  justify-items: center;
  width: 100%;
  max-width: 380px;
  margin-inline: auto;
  padding-inline: 2px;
}

.login-form label,
.password-change-fields label {
  display: block;
  width: 100%;
}

.login-form label > span,
.password-change-fields label > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.login-form input {
  min-height: 50px;
  width: 100%;
  border: 1px solid rgba(114, 148, 188, 0.58);
  border-radius: 12px;
  background: rgba(22, 34, 50, 0.74);
  color: #eef5ff;
  padding: 0 14px;
  font: inherit;
  font-size: 16px;
  line-height: 1.2;
  outline: none;
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.login-form input::placeholder {
  color: rgba(223, 231, 242, 0.66);
}

.login-form input:focus {
  border-color: #82b4ff;
  background: rgba(27, 43, 64, 0.85);
  box-shadow:
    0 0 0 3px rgba(47, 140, 255, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.login-form input:-webkit-autofill,
.login-form input:-webkit-autofill:hover,
.login-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: #eef5ff;
  box-shadow: 0 0 0 1000px rgba(22, 34, 50, 0.96) inset;
  caret-color: #eef5ff;
}

.login-device-state {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid rgba(80, 207, 255, 0.34);
  border-radius: 10px;
  background: rgba(47, 140, 255, 0.11);
  color: #b7dcff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
}

.login-error {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid rgba(212, 89, 101, 0.62);
  border-radius: 10px;
  background: rgba(94, 31, 42, 0.53);
  color: #ffb7bd;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.password-change-fields {
  display: grid;
  gap: 12px;
  width: 100%;
}

.login-actions {
  display: block;
  width: 100%;
  padding-top: 6px;
}

.login-actions .primary-button {
  min-height: 48px;
  border-radius: 10px;
  padding: 0 14px;
  font-weight: 900;
  width: 100%;
}

.forgot-password-button,
.change-access-button {
  justify-self: center;
  width: fit-content;
  min-height: 32px;
  margin-top: 2px;
  padding: 2px 6px;
  border-radius: 6px;
  background: transparent;
  color: #a9ccff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
}

.change-access-button {
  margin-top: 0;
  color: #b7dcff;
}

.app-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: max(18px, env(safe-area-inset-top)) 18px 8px;
}

.brand-logo {
  display: block;
  width: min(250px, 72vw);
  height: auto;
}

.icon-button {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 18, 30, 0.72);
  color: #dcecff;
}

svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.badge {
  position: absolute;
  top: -5px;
  right: -4px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 14px;
  left: auto;
  z-index: 40;
  display: grid;
  gap: 10px;
  width: min(340px, calc(100vw - 28px));
  padding: 12px;
  border: 1px solid rgba(128, 164, 204, 0.34);
  border-radius: 12px;
  background: rgba(8, 18, 30, 0.98);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}

.notification-panel::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 20px;
  width: 14px;
  height: 14px;
  border-left: 1px solid rgba(128, 164, 204, 0.34);
  border-top: 1px solid rgba(128, 164, 204, 0.34);
  background: rgba(8, 18, 30, 0.98);
  transform: rotate(45deg);
}

.notification-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.notification-head h2 {
  color: #fff;
  font-size: 14px;
  text-transform: none;
}

.notification-head button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(128, 164, 204, 0.12);
  color: #dcecff;
  font-size: 18px;
  font-weight: 900;
}

.notification-list {
  display: grid;
  gap: 8px;
}

.notification-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  width: 100%;
  min-height: 64px;
  padding: 10px;
  border: 1px solid rgba(128, 164, 204, 0.2);
  border-radius: 10px;
  background: rgba(5, 13, 22, 0.5);
  color: inherit;
  text-align: left;
}

.notification-item > span {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
}

.notification-item strong {
  color: #fff;
  font-size: 13px;
}

.notification-item p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.screen {
  display: none;
}

.screen.is-active {
  display: grid;
}

.home-content,
.tasks-screen {
  display: grid;
  gap: 15px;
  padding: 12px 18px max(102px, calc(90px + env(safe-area-inset-bottom)));
}

.tasks-screen {
  gap: 10px;
  padding-top: 4px;
}

.screen:not(.is-active) {
  display: none;
}

.greeting-card {
  padding-top: 4px;
}

.eyebrow {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

h1 {
  margin-top: 7px;
  color: #fff;
  font-size: 25px;
  line-height: 1.12;
  letter-spacing: 0;
}

.date-line {
  margin-top: 7px;
  color: #dbe7f5;
  font-size: 15px;
}

.today-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.today-stats article,
.next-task,
.upcoming-task {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(20, 39, 58, 0.95), rgba(8, 18, 30, 0.92));
  box-shadow: var(--shadow);
}

.today-stats article {
  min-height: 84px;
  padding: 12px;
  border-radius: 10px;
}

.today-stats span {
  display: block;
  min-height: 30px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.today-stats strong {
  display: block;
  margin-top: 8px;
  color: #fff;
  font-size: 27px;
  line-height: 1;
}

.next-task-section,
.upcoming-section {
  display: grid;
  gap: 10px;
}

h2 {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.next-task {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 12px;
}

.task-header,
.section-title,
.upcoming-task {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.participant-avatars {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 30px;
}

.participant-avatar {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-left: -7px;
  border: 1px solid rgba(128, 164, 204, 0.48);
  border-radius: 999px;
  background: #17395d;
  color: #dcecff;
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
}

.participant-avatar:first-child {
  margin-left: 0;
}

.participant-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.participant-more {
  background: rgba(47, 140, 255, 0.18);
  color: #9ccbff;
}

.task-time {
  color: var(--cyan);
  font-size: 20px;
  font-weight: 900;
}

.pill {
  border: 1px solid rgba(128, 164, 204, 0.34);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(128, 164, 204, 0.1);
  color: #dcecff;
  font-size: 12px;
  font-weight: 900;
}

.pill.high {
  border-color: rgba(240, 201, 120, 0.52);
  background: rgba(240, 201, 120, 0.14);
  color: #ffe0a1;
}

.pill.medium {
  border-color: rgba(47, 140, 255, 0.5);
  background: rgba(47, 140, 255, 0.14);
  color: #9ccbff;
}

.pill.low {
  border-color: rgba(42, 198, 122, 0.5);
  background: rgba(42, 198, 122, 0.14);
  color: #a9f3cb;
}

.next-task h3 {
  color: #fff;
  font-size: 19px;
  line-height: 1.2;
}

.next-task p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.home-task-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.home-task-meta span {
  min-height: 47px;
  padding: 8px;
  border: 1px solid rgba(128, 164, 204, 0.2);
  border-radius: 9px;
  background: rgba(5, 13, 22, 0.34);
  color: #fff;
  font-size: 12px;
}

.home-task-meta strong {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

.home-task-meta b {
  display: block;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.primary-button {
  min-height: 46px;
  border: 1px solid rgba(90, 165, 255, 0.7);
  border-radius: 10px;
  background: linear-gradient(135deg, #0d8cff, #075ed9);
  color: #fff;
  font-weight: 900;
}

.section-title button {
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(47, 140, 255, 0.14);
  color: #91c8ff;
  font-size: 12px;
  font-weight: 900;
}

.upcoming-list {
  display: grid;
  gap: 8px;
}

.empty-state {
  padding: 12px;
  border: 1px solid rgba(128, 164, 204, 0.18);
  border-radius: 10px;
  background: rgba(5, 13, 22, 0.28);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.upcoming-task {
  min-height: 72px;
  padding: 11px 12px;
  border-radius: 10px;
}

.upcoming-task {
  cursor: pointer;
}

.upcoming-main {
  min-width: 0;
}

.upcoming-main strong {
  display: block;
  color: #fff;
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.upcoming-main p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.upcoming-time {
  color: var(--cyan);
  font-size: 13px;
  font-weight: 900;
}

.task-status {
  flex: 0 0 auto;
  min-width: 64px;
  border: 1px solid rgba(128, 164, 204, 0.34);
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(128, 164, 204, 0.1);
  color: #dcecff;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.task-status.open {
  border-color: rgba(47, 140, 255, 0.5);
  background: rgba(47, 140, 255, 0.14);
  color: #9ccbff;
}

.task-status.done {
  border-color: rgba(42, 198, 122, 0.5);
  background: rgba(42, 198, 122, 0.14);
  color: #a9f3cb;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: min(100%, 430px);
  transform: translateX(-50%);
  padding: 8px 10px max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid rgba(128, 164, 204, 0.18);
  background: rgba(5, 13, 22, 0.96);
  backdrop-filter: blur(18px);
}

.bottom-nav button {
  display: grid;
  gap: 4px;
  place-items: center;
  min-height: 54px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.bottom-nav svg {
  width: 20px;
  height: 20px;
}

.bottom-nav button.is-active {
  color: #50cfff;
  background: rgba(47, 140, 255, 0.12);
}

.task-detail-topbar {
  display: block;
}

.detail-card,
.detail-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(20, 39, 58, 0.95), rgba(8, 18, 30, 0.92));
  box-shadow: var(--shadow);
}

.detail-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.detail-card h2 {
  color: #fff;
  font-size: 19px;
  line-height: 1.18;
  text-transform: none;
}

.description {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.description {
  padding-top: 2px;
  color: #dce7f4;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.info-grid div,
.info-tile {
  min-height: 54px;
  padding: 9px;
  border: 1px solid rgba(128, 164, 204, 0.2);
  border-radius: 9px;
  background: rgba(5, 13, 22, 0.34);
  text-align: left;
}

.info-grid span,
.info-tile span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.info-grid strong,
.info-tile strong {
  display: block;
  margin-top: 6px;
  color: #fff;
  font-size: 12px;
  line-height: 1.25;
}

.info-tile {
  touch-action: manipulation;
}

.attachment-tile strong {
  display: flex;
  align-items: center;
  gap: 7px;
}

.attachment-tile svg {
  width: 17px;
  height: 17px;
  color: #dcecff;
}

.subtask-inline-list {
  display: grid;
  gap: 7px;
}

.attachment-panel {
  display: grid;
  gap: 8px;
}

.subtask-inline-list,
.attachment-panel {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    max-height 220ms ease,
    opacity 180ms ease,
    transform 220ms ease;
}

.subtask-inline-list.is-open,
.attachment-panel.is-open {
  max-height: 460px;
  opacity: 1;
  transform: translateY(0);
}

.info-tile[aria-expanded="true"] {
  border-color: rgba(47, 140, 255, 0.48);
  background: rgba(47, 140, 255, 0.12);
}

.schedule-tile {
  position: relative;
}

.schedule-tile:not(.is-disabled)::after {
  content: "Ändern";
  position: absolute;
  top: 8px;
  right: 9px;
  color: #91c8ff;
  font-size: 10px;
  font-weight: 900;
}

.schedule-tile.is-disabled {
  opacity: 0.72;
}

.locked-info {
  position: relative;
}

.locked-info::after {
  content: "Gesperrt";
  position: absolute;
  top: 8px;
  right: 9px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.attachment-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.attachment-actions button {
  min-height: 40px;
  border: 1px solid rgba(47, 140, 255, 0.34);
  border-radius: 9px;
  background: rgba(47, 140, 255, 0.13);
  color: #b7dcff;
  font-size: 12px;
  font-weight: 900;
}

.detail-section {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
}

.accordion-trigger {
  width: 100%;
  min-height: 42px;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.accordion-trigger::after {
  content: "Aufklappen";
  color: #91c8ff;
  font-size: 12px;
  font-weight: 900;
}

.detail-section:not(.is-collapsed) .accordion-trigger::after {
  content: "Zuklappen";
}

.section-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.detail-section.is-collapsed .subtask-list,
.detail-section.is-collapsed .attachment-list,
.detail-section.is-collapsed .participant-list {
  display: none;
}

.attachment-list,
.participant-list {
  display: grid;
  gap: 8px;
}

.subtask-item,
.attachment-item,
.participant-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 9px 10px;
  border: 1px solid rgba(128, 164, 204, 0.18);
  border-radius: 9px;
  background: rgba(5, 13, 22, 0.32);
}

.subtask-item strong,
.attachment-item strong,
.participant-item strong {
  color: #fff;
  font-size: 13px;
  line-height: 1.25;
}

.attachment-item p,
.participant-item p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.check,
.attachment-item > span,
.participant-item > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #dcecff;
  font-size: 11px;
  font-weight: 900;
}

.check {
  background: transparent;
}

.check.is-done {
  border-color: rgba(42, 198, 122, 0.5);
  background: rgba(42, 198, 122, 0.16);
  color: #a9f3cb;
}

.participant-item > span {
  border-radius: 999px;
  background: rgba(47, 140, 255, 0.16);
  color: #9ccbff;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  align-items: end;
  width: min(100%, 430px);
  margin: 0 auto;
  background: rgba(0, 0, 0, 0.42);
}

.schedule-sheet {
  display: grid;
  gap: 12px;
  padding: 16px 18px max(18px, env(safe-area-inset-bottom));
  border: 1px solid rgba(128, 164, 204, 0.34);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  background: rgba(8, 18, 30, 0.98);
  box-shadow: 0 -18px 45px rgba(0, 0, 0, 0.42);
}

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

.sheet-head h2 {
  color: #fff;
  font-size: 16px;
  text-transform: none;
}

.sheet-head button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(128, 164, 204, 0.12);
  color: #dcecff;
  font-size: 20px;
  font-weight: 900;
}

.sheet-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.schedule-sheet label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.schedule-sheet input {
  min-height: 44px;
  border: 1px solid rgba(128, 164, 204, 0.28);
  border-radius: 10px;
  background: rgba(5, 13, 22, 0.58);
  color: #fff;
  padding: 0 11px;
  font: inherit;
}

.schedule-sheet input:disabled,
.schedule-sheet button:disabled {
  opacity: 0.55;
}

@media (max-width: 374px) {
  .app-header {
    padding-inline: 14px;
  }

  .brand-logo {
    width: min(218px, 70vw);
  }

  .home-content {
    padding-inline: 14px;
  }

  h1 {
    font-size: 23px;
  }
}

@media (max-height: 720px) {
  .login-center {
    gap: 20px;
  }

  .login-logo {
    width: min(292px, 78vw);
  }

  .login-form {
    gap: 10px;
  }

  .login-form input {
    min-height: 47px;
  }
}
