:root {
  --color-primary: #3568a8;
  --color-lightGrey: #e8edf3;
  --color-grey: #667085;
  --color-darkGrey: #344054;
  --color-error: #b42318;
  --color-success: #247a4d;
  --grid-maxWidth: 120rem;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: #f6f8fb;
  color: #202938;
}

button,
select,
input {
  font: inherit;
}

button {
  min-height: 4.2rem;
}

.app-header {
  background: #ffffff;
  border-bottom: 1px solid #dfe5ec;
}

.app-header .container {
  padding-top: 2.4rem;
  padding-bottom: 2rem;
}

.app-title-row {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.app-title-row h1 {
  margin: 0;
  font-size: 3.2rem;
  line-height: 1.1;
}

.app-subtitle {
  margin: 0.6rem 0 0;
  color: var(--color-grey);
}

.save-state {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: #edf7f1;
  color: var(--color-success);
  font-size: 1.4rem;
  white-space: nowrap;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.list-selector {
  min-width: 22rem;
  margin: 0;
}

.list-selector span {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 1.4rem;
  font-weight: 600;
}

.list-selector select {
  margin: 0;
}

.completed-toggle {
  display: flex;
  min-height: 4.2rem;
  margin: 0;
  gap: 0.7rem;
  align-items: center;
  white-space: nowrap;
}

.completed-toggle input {
  margin: 0;
}

.toolbar-spacer {
  flex: 1 1 2rem;
}

.app-main {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.empty-state {
  max-width: 72rem;
  margin: 4rem auto;
  padding: 3rem;
  text-align: center;
}

.empty-state h2 {
  margin-top: 0;
}

.empty-state p {
  color: var(--color-grey);
}

.api-state {
  margin-top: 2rem;
  font-weight: 600;
}

.api-state.is-online {
  color: var(--color-success);
}

.api-state.is-offline {
  color: var(--color-error);
}

@media (max-width: 720px) {
  .app-header .container {
    padding-top: 1.8rem;
  }

  .app-title-row h1 {
    font-size: 2.7rem;
  }

  .toolbar {
    align-items: stretch;
  }

  .list-selector,
  .toolbar button {
    width: 100%;
  }

  .completed-toggle {
    width: 100%;
  }

  .toolbar-spacer {
    display: none;
  }

  .empty-state {
    margin-top: 1rem;
    padding: 2rem 0;
  }
}

.message-area {
  max-width: 72rem;
  margin: 0 auto 2rem;
  padding: 1.2rem 1.5rem;
  border-radius: 0.6rem;
}

.message-area[hidden] {
  display: none;
}

.message-area.is-error {
  background: #fef3f2;
  color: var(--color-error);
}

.message-area.is-success {
  background: #edf7f1;
  color: var(--color-success);
}

.list-view {
  width: 100%;
  max-width: none;
  margin: 0;
}

.list-heading {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.list-heading h2 {
  margin: 0;
  font-size: 2.8rem;
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--color-grey);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.list-meta {
  color: var(--color-grey);
  font-size: 1.4rem;
  white-space: nowrap;
}

.list-placeholder {
  padding: 3rem 0;
  border-top: 1px solid #dfe5ec;
}

.list-placeholder h3 {
  margin-top: 0;
}

.list-placeholder p {
  color: var(--color-grey);
}

.app-dialog {
  width: min(48rem, calc(100vw - 3rem));
  padding: 0;
  border: 0;
  border-radius: 0.8rem;
  box-shadow: 0 2rem 6rem rgb(16 24 40 / 22%);
}

.app-dialog::backdrop {
  background: rgb(16 24 40 / 55%);
}

.app-dialog form {
  margin: 0;
  padding: 2.4rem;
}

.app-dialog h2 {
  margin-top: 0;
}

.app-dialog input {
  width: 100%;
  margin-top: 0.6rem;
}

.dialog-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
}

.form-error {
  min-height: 2.2rem;
  margin: 0.5rem 0 0;
  color: var(--color-error);
  font-size: 1.4rem;
}

@media (max-width: 720px) {
  .list-heading {
    display: block;
  }

  .list-meta {
    display: block;
    margin-top: 0.8rem;
    white-space: normal;
  }

  .dialog-actions {
    flex-direction: column-reverse;
  }

  .dialog-actions button {
    width: 100%;
  }
}

/* Project/task UI v2.1 */

.save-state.is-dirty {
  background: #fff4e5;
  color: #9a5b13;
}

.projects-container {
  display: grid;
  gap: 2rem;
  padding-top: 1rem;
}

.projects-empty {
  padding: 3rem 0;
  border-top: 1px solid #dfe5ec;
}

.projects-empty h3 {
  margin-top: 0;
}

.projects-empty p {
  color: var(--color-grey);
}

.project-card {
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #dfe5ec;
  border-radius: 0.8rem;
}

.project-summary {
  display: flex;
  min-height: 6rem;
  padding: 1.5rem 1.8rem;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 700;
}

.project-summary:hover {
  background: #f8fafc;
}

.project-summary-title {
  overflow-wrap: anywhere;
}

.project-status {
  flex: 0 0 auto;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 1.3rem;
  font-weight: 700;
}

.project-status.is-open {
  background: #eef2f6;
  color: #475467;
}

.project-status.is-progress {
  background: #fff4e5;
  color: #9a5b13;
}

.project-status.is-completed {
  background: #edf7f1;
  color: var(--color-success);
}

.project-body {
  padding: 2rem;
  border-top: 1px solid #e4e8ee;
}

.item-fields {
  display: grid;
  grid-template-columns: minmax(18rem, 1fr) minmax(14rem, 18rem) minmax(14rem, 18rem);
  gap: 1.2rem;
}

.item-field {
  margin: 0;
}

.item-field-label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--color-darkGrey);
  font-size: 1.3rem;
  font-weight: 700;
}

.item-field input,
.item-field select {
  width: 100%;
  margin: 0;
}

.note-placeholder {
  margin-top: 1.5rem;
}

.note-placeholder-heading {
  margin-bottom: 0.4rem;
  color: var(--color-darkGrey);
  font-size: 1.3rem;
  font-weight: 700;
}

.note-placeholder-content {
  min-height: 2.6rem;
  color: var(--color-grey);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.project-actions,
.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.button.danger {
  border-color: #f0b8b4;
  color: var(--color-error);
}

.button.danger:hover {
  background: #fef3f2;
}

.tasks-container {
  display: grid;
  gap: 1.2rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e4e8ee;
}

.task-item {
  padding: 1.6rem;
  background: #f8fafc;
  border: 1px solid #e4e8ee;
  border-radius: 0.7rem;
}

.task-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.task-checkbox {
  display: inline-flex;
  margin: 0;
  gap: 0.7rem;
  align-items: center;
  font-weight: 700;
}

.task-checkbox input {
  margin: 0;
}

.task-item.is-completed {
  background: #f3f4f6;
  color: var(--color-grey);
}

.task-item.is-completed input[type="text"] {
  color: var(--color-grey);
  text-decoration: line-through;
}

.tasks-empty {
  margin: 0;
  padding: 1rem 0;
  color: var(--color-grey);
}

@media (max-width: 800px) {
  .item-fields {
    grid-template-columns: 1fr;
  }

  .project-body {
    padding: 1.5rem;
  }

  .project-actions,
  .item-actions {
    flex-direction: column;
  }

  .project-actions button,
  .item-actions button {
    width: 100%;
  }
}

/* Markdown note editor v2.1 */

.note-editor {
  margin-top: 1.5rem;
}

.note-editor-header {
  display: flex;
  min-height: 3.8rem;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.note-editor-heading {
  color: var(--color-darkGrey);
  font-size: 1.3rem;
  font-weight: 700;
}

.note-edit-button {
  min-height: 3.2rem;
  padding: 0.4rem 1.1rem;
  font-size: 1.3rem;
}

.note-editor-body {
  min-width: 0;
}

.markdown-view {
  min-height: 3rem;
  padding: 1rem 0;
  color: #344054;
  overflow-wrap: anywhere;
}

.markdown-view > :first-child {
  margin-top: 0;
}

.markdown-view > :last-child {
  margin-bottom: 0;
}

.markdown-view h1 {
  font-size: 2.2rem;
}

.markdown-view h2 {
  font-size: 1.9rem;
}

.markdown-view h3 {
  font-size: 1.7rem;
}

.markdown-view h4,
.markdown-view h5,
.markdown-view h6 {
  font-size: 1.5rem;
}

.markdown-view blockquote {
  margin-left: 0;
  padding-left: 1.4rem;
  border-left: 0.4rem solid #d0d5dd;
  color: var(--color-grey);
}

.markdown-view pre {
  max-width: 100%;
  padding: 1.2rem;
  overflow-x: auto;
  background: #f2f4f7;
  border-radius: 0.5rem;
  white-space: pre;
}

.markdown-view code {
  font-size: 0.92em;
}

.markdown-view :not(pre) > code {
  padding: 0.15rem 0.4rem;
  background: #f2f4f7;
  border-radius: 0.3rem;
}

.markdown-view table {
  width: 100%;
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
}

.markdown-view th,
.markdown-view td {
  padding: 0.7rem 1rem;
  border: 1px solid #d0d5dd;
  text-align: left;
}

.markdown-view a {
  overflow-wrap: anywhere;
}

.note-empty {
  margin: 0;
  color: var(--color-grey);
  font-style: italic;
}

.note-render-error {
  margin: 0;
  color: var(--color-error);
  white-space: pre-wrap;
}

.note-textarea {
  width: 100%;
  min-height: 16rem;
  margin: 0;
  resize: vertical;
  font-family:
    ui-monospace,
    SFMono-Regular,
    Consolas,
    "Liberation Mono",
    monospace;
  line-height: 1.5;
}

.note-editor-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

@media (max-width: 720px) {
  .note-editor-actions {
    flex-direction: column-reverse;
  }

  .note-editor-actions button {
    width: 100%;
  }
}

/* ADR-013 bis ADR-016 */

/* Projektname: größer, normalgewichtig, dunkles Blau */
.project-summary {
  font-weight: 400;
}

.project-summary-title {
  color: #234f78;
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.3;
}

/* Separat klappbarer Aufgabenbereich */
.tasks-section {
  margin-top: 2rem;
  border-top: 1px solid #dfe5ec;
}

.tasks-summary {
  display: flex;
  min-height: 5rem;
  padding: 1.2rem 0.4rem;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: #344054;
}

.tasks-summary:hover {
  color: #234f78;
}

.tasks-summary-title {
  font-size: 1.6rem;
  font-weight: 600;
}

.tasks-summary-count {
  padding: 0.3rem 0.8rem;
  background: #eef2f6;
  border-radius: 999px;
  color: #667085;
  font-size: 1.25rem;
  font-weight: 600;
  white-space: nowrap;
}

.tasks-container {
  margin-top: 0;
  padding-top: 1.4rem;
  border-top: 1px solid #eef1f4;
}

/* Dezente Prioritätsfarben */
.priority-select.priority-low {
  background-color: #eef8f0;
  border-color: #c9dfce;
}

.priority-select.priority-medium {
  background-color: #fff9e8;
  border-color: #e7d9a8;
}

.priority-select.priority-high {
  background-color: #fff0ef;
  border-color: #ebc4c1;
}

/* Überfällige offene Termine */
.due-date.is-overdue {
  background-color: #fff0ef;
  border-color: #dfa6a2;
  color: #8b2c25;
}

.due-date.is-overdue:focus {
  border-color: #c66d66;
}

/* Erledigte Aufgaben sollen nicht als überfällig wirken */
.task-item.is-completed .due-date {
  background-color: #f3f4f6;
  border-color: #d0d5dd;
  color: #667085;
}

@media (max-width: 720px) {
  .project-summary-title {
    font-size: 1.8rem;
  }

  .tasks-summary {
    min-height: 4.6rem;
  }
}

/* ADR-023 – einzelne Aufgaben auf- und zuklappbar */

.tasks-section {
  margin-top: 2rem;
  border-top: 1px solid #dfe5ec;
}

.tasks-heading {
  display: flex;
  min-height: 5rem;
  padding: 1.2rem 0.4rem;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
}

.tasks-heading-title {
  color: #344054;
  font-size: 1.6rem;
  font-weight: 600;
}

.tasks-heading-count {
  padding: 0.3rem 0.8rem;
  background: #eef2f6;
  border-radius: 999px;
  color: #667085;
  font-size: 1.25rem;
  font-weight: 600;
  white-space: nowrap;
}

.task-item {
  padding: 0;
}

.task-summary {
  min-height: 5.2rem;
  padding: 1.4rem 1.6rem;
  cursor: pointer;
  list-style-position: inside;
}

.task-summary:hover {
  background: #f2f5f8;
}

.task-summary-title {
  color: #344054;
  font-size: 1.55rem;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.task-body {
  padding: 0 1.6rem 1.6rem;
  border-top: 1px solid #e4e8ee;
}

.task-body .task-header {
  padding-top: 1.4rem;
}

.task-item.is-completed .task-summary-title {
  color: #7a8492;
  text-decoration: line-through;
}

.task-item.is-completed .task-summary {
  background: #f3f4f6;
}

.task-item:not([open]) .task-summary {
  border-radius: 0.7rem;
}

@media (max-width: 720px) {
  .task-summary {
    min-height: 4.8rem;
    padding: 1.2rem 1.3rem;
  }

  .task-body {
    padding: 0 1.3rem 1.3rem;
  }
}

/* ADR-024 – Kopfinformationen für Priorität und Zieltermin */

.project-summary-title,
.task-summary-title {
  min-width: 0;
  flex: 1 1 20rem;
}

.summary-info {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  justify-content: flex-end;
}

.task-summary-content {
  display: inline-flex;
  width: calc(100% - 2.4rem);
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  vertical-align: middle;
}

.summary-badge {
  display: inline-flex;
  min-height: 2.7rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid transparent;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.priority-summary-badge.priority-low {
  background-color: #eef8f0;
  border-color: #c9dfce;
  color: #35623f;
}

.priority-summary-badge.priority-medium {
  background-color: #fff9e8;
  border-color: #e7d9a8;
  color: #765d13;
}

.priority-summary-badge.priority-high {
  background-color: #fff0ef;
  border-color: #ebc4c1;
  color: #8b2c25;
}

.priority-summary-badge.priority-unknown {
  background-color: #eef2f6;
  border-color: #d0d5dd;
  color: #667085;
}

.due-summary-badge {
  background-color: #eef2f6;
  border-color: #d0d5dd;
  color: #475467;
}

.due-summary-badge.has-no-date {
  color: #7a8492;
}

.due-summary-badge.is-overdue {
  background-color: #fff0ef;
  border-color: #dfa6a2;
  color: #8b2c25;
}

.task-item.is-completed .due-summary-badge {
  background-color: #eef2f6;
  border-color: #d0d5dd;
  color: #667085;
  text-decoration: none;
}

.task-item.is-completed .priority-summary-badge {
  text-decoration: none;
  opacity: 0.78;
}

@media (max-width: 720px) {
  .project-summary {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .project-summary-title {
    flex-basis: 100%;
  }

  .project-summary-info {
    width: 100%;
    justify-content: flex-start;
  }

  .task-summary-content {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .task-summary-title {
    flex-basis: 100%;
  }

  .task-summary-info {
    width: 100%;
    justify-content: flex-start;
  }

  .summary-badge {
    min-height: 2.6rem;
    font-size: 1.15rem;
  }
}

/* ADR-025 – Projektköpfe visuell stärker abgrenzen */

.project-card {
  border-color: #c7d3df;
  box-shadow:
    0 0.2rem 0.5rem rgb(35 79 120 / 8%),
    0 0.8rem 2rem rgb(35 79 120 / 5%);
}

.project-summary {
  padding: 1.6rem 1.8rem 1.6rem 1.5rem;
  background:
    linear-gradient(
      180deg,
      #f0f5fa 0%,
      #e7eef5 100%
    );
  border-left: 0.5rem solid #315f86;
  border-bottom: 1px solid #bdcad6;
  box-shadow:
    inset 0 -0.1rem 0 rgb(255 255 255 / 70%);
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.project-summary:hover {
  background:
    linear-gradient(
      180deg,
      #e9f1f8 0%,
      #dfe9f2 100%
    );
  border-left-color: #234f78;
}

.project-summary:focus-visible {
  outline: 0.3rem solid rgb(53 104 168 / 30%);
  outline-offset: -0.3rem;
}

.project-card[open] > .project-summary {
  border-bottom-color: #b5c4d2;
  box-shadow:
    inset 0 -0.1rem 0 rgb(255 255 255 / 65%),
    0 0.3rem 0.8rem rgb(35 79 120 / 6%);
}

.project-card[open] > .project-body {
  background: #ffffff;
}

.project-summary-title {
  color: #1f4b73;
}

@media (max-width: 720px) {
  .project-summary {
    padding:
      1.4rem
      1.3rem
      1.4rem
      1.1rem;
    border-left-width: 0.4rem;
  }
}

/* ADR-026 – Dezente Akzentlinie für einzelne Unteraufgaben */

.task-item {
  border-left-width: 0.35rem;
  border-left-style: solid;
  border-left-color: #9eb2c2;
  transition:
    border-left-color 160ms ease,
    box-shadow 160ms ease;
}

/*
 * Die bestehende Hintergrundfarbe der Aufgabe bleibt unverändert.
 * Nur die Akzentlinie wird bei Interaktion etwas deutlicher.
 */
.task-item:hover {
  border-left-color: #829daf;
}

.task-item:has(> .task-summary:focus-visible) {
  border-left-color: #6f8da4;
  box-shadow:
    0 0 0 0.25rem rgb(111 141 164 / 16%);
}

.task-summary:focus-visible {
  outline: none;
}

/*
 * Erledigte Aufgaben behalten ihre graue Darstellung.
 * Die Akzentlinie wird zusätzlich abgeschwächt.
 */
.task-item.is-completed {
  border-left-color: #c3ccd4;
}

.task-item.is-completed:hover {
  border-left-color: #aebac4;
}

.task-item.is-completed:has(> .task-summary:focus-visible) {
  border-left-color: #98a8b5;
}

@media (max-width: 720px) {
  .task-item {
    border-left-width: 0.3rem;
  }
}

/* ADR-027 – Akzentlinie nur im Aufgabenkopf */

/*
 * ADR-026 setzte die Akzentlinie auf den gesamten Aufgabencontainer.
 * Der Container erhält wieder seinen normalen umlaufenden Rahmen.
 */
.task-item,
.task-item:hover,
.task-item.is-completed,
.task-item.is-completed:hover {
  border-left-width: 1px;
  border-left-style: solid;
  border-left-color: #e4e8ee;
}

/*
 * Die Akzentlinie wird als innerer Schatten ausschließlich
 * im Kopfbereich der Aufgabe dargestellt.
 *
 * Die vorhandene Hintergrundfarbe bleibt unverändert.
 */
.task-summary {
  box-shadow:
    inset 0.35rem 0 0 #9eb2c2;
  transition:
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.task-summary:hover {
  box-shadow:
    inset 0.35rem 0 0 #829daf;
}

/*
 * Tastaturfokus: Akzentlinie leicht verstärken und
 * den gesamten Kopf zugänglich hervorheben.
 */
.task-summary:focus-visible {
  outline:
    0.25rem solid
    rgb(111 141 164 / 20%);
  outline-offset: -0.25rem;
  box-shadow:
    inset 0.35rem 0 0 #6f8da4;
}

/*
 * Ein eventuell aus ADR-026 vorhandener Fokus-Schatten
 * am vollständigen Aufgabencontainer wird neutralisiert.
 */
.task-item:has(> .task-summary:focus-visible) {
  border-left-color: #e4e8ee;
  box-shadow: none;
}

/*
 * Erledigte Aufgaben behalten ihren bisherigen Hintergrund.
 * Nur die Akzentlinie im Kopf wird abgeschwächt.
 */
.task-item.is-completed > .task-summary {
  box-shadow:
    inset 0.35rem 0 0 #c3ccd4;
}

.task-item.is-completed > .task-summary:hover {
  box-shadow:
    inset 0.35rem 0 0 #aebac4;
}

.task-item.is-completed > .task-summary:focus-visible {
  box-shadow:
    inset 0.35rem 0 0 #98a8b5;
}

@media (max-width: 720px) {
  .task-summary {
    box-shadow:
      inset 0.3rem 0 0 #9eb2c2;
  }

  .task-summary:hover {
    box-shadow:
      inset 0.3rem 0 0 #829daf;
  }

  .task-summary:focus-visible {
    box-shadow:
      inset 0.3rem 0 0 #6f8da4;
  }

  .task-item.is-completed > .task-summary {
    box-shadow:
      inset 0.3rem 0 0 #c3ccd4;
  }

  .task-item.is-completed > .task-summary:hover {
    box-shadow:
      inset 0.3rem 0 0 #aebac4;
  }

  .task-item.is-completed > .task-summary:focus-visible {
    box-shadow:
      inset 0.3rem 0 0 #98a8b5;
  }
}

/* AUTH-UI – Login und Passwortwechsel */

body.auth-pending {
  min-height: 100vh;
  background: #eef3f7;
}

.auth-gate {
  display: grid;
  min-height: 100vh;
  padding: 2rem;
  place-items: center;
  background:
    linear-gradient(
      145deg,
      #e9f0f6 0%,
      #f7f9fb 55%,
      #e4edf5 100%
    );
}

.auth-gate[hidden] {
  display: none;
}

.auth-card {
  width: min(100%, 44rem);
  padding: 3rem;
  background: #ffffff;
  border: 1px solid #c9d5df;
  border-left: 0.5rem solid #315f86;
  border-radius: 0.8rem;
  box-shadow:
    0 1.2rem 4rem
    rgb(31 75 115 / 14%);
}

.auth-brand {
  padding-bottom: 1.8rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid #dce4eb;
}

.auth-brand h1 {
  margin-bottom: 0.4rem;
  color: #1f4b73;
}

.auth-brand p {
  margin: 0;
  color: #667085;
}

.auth-card h2 {
  color: #344054;
}

.auth-card form {
  display: grid;
  gap: 0.8rem;
}

.auth-card label {
  margin-top: 0.6rem;
  font-weight: 600;
}

.auth-card input {
  min-height: 4.4rem;
}

.auth-submit {
  width: 100%;
  margin-top: 1rem;
}

.auth-user-hint {
  padding: 0.8rem 1rem;
  background: #eef3f7;
  border-radius: 0.5rem;
  color: #475467;
}

.auth-password-rule {
  margin: 0.2rem 0 0;
  color: #667085;
  font-size: 1.3rem;
}

.app-session-area {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  justify-content: flex-end;
}

.current-user {
  display: inline-flex;
  min-height: 3rem;
  padding: 0.45rem 0.9rem;
  background: #eef3f7;
  border: 1px solid #cbd7e1;
  border-radius: 999px;
  align-items: center;
  color: #344054;
  font-size: 1.25rem;
  font-weight: 600;
}

.logout-button {
  min-height: 3rem;
  padding: 0.4rem 0.9rem;
}

@media (max-width: 720px) {
  .auth-gate {
    padding: 1rem;
  }

  .auth-card {
    padding: 2rem 1.6rem;
  }

  .app-session-area {
    width: 100%;
    justify-content: flex-start;
  }
}

/* TOTP-CODEFELD */

.totp-code-input {
  max-width: 18rem;
  font-family:
    ui-monospace,
    SFMono-Regular,
    Consolas,
    "Liberation Mono",
    monospace;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.45rem;
  text-align: center;
}

/* FOKUS NEU ANGELEGTER ELEMENTE */

[data-todo-element] {
  scroll-margin-block:
    8rem;
}

[data-todo-element].is-newly-added {
  animation:
    todo-new-item-highlight
    1.8s
    ease-out;
}

@keyframes todo-new-item-highlight {
  0% {
    box-shadow:
      0 0 0 0.45rem
      rgb(49 95 134 / 28%);
  }

  45% {
    box-shadow:
      0 0 0 0.3rem
      rgb(49 95 134 / 18%);
  }

  100% {
    box-shadow:
      0 0 0 0
      rgb(49 95 134 / 0%);
  }
}

@media (
  prefers-reduced-motion:
  reduce
) {
  [data-todo-element].is-newly-added {
    animation: none;

    outline:
      0.2rem solid
      rgb(49 95 134 / 45%);

    outline-offset:
      0.2rem;
  }
}

/* GEMERKTER BENUTZERNAME */

.remembered-login {
  display:
    flex;
  flex-direction:
    column;
  gap:
    0.35rem;
  margin-bottom:
    1.25rem;
  padding:
    0.9rem 1rem;
  border:
    1px solid
    rgb(0 0 0 / 16%);
  border-radius:
    0.35rem;
}

.remembered-login[hidden] {
  display:
    none;
}

.remembered-login-label {
  font-size:
    0.88rem;
  opacity:
    0.72;
}

.remembered-login-name {
  font-size:
    1.15rem;
  overflow-wrap:
    anywhere;
}

.change-user-button {
  align-self:
    flex-start;
  margin-top:
    0.35rem;
}

.remember-user-option {
  display:
    flex;
  align-items:
    center;
  gap:
    0.55rem;
  margin-top:
    0.9rem;
  font-weight:
    400;
}

.remember-user-option input {
  width:
    auto;
  margin:
    0;
}

.remember-username-hint {
  margin-top:
    0.3rem;
  font-size:
    0.82rem;
  line-height:
    1.4;
  opacity:
    0.72;
}

/* TOTP-REPLAY-COUNTDOWN */

.login-replay-hint {
  margin:
    0.25rem 0 0.85rem;
  padding:
    0.65rem 0.8rem;
  border:
    1px solid
    rgb(0 0 0 / 14%);
  border-radius:
    0.35rem;
  font-size:
    0.9rem;
  line-height:
    1.4;
}

.login-replay-hint[hidden] {
  display:
    none;
}

#login-button:disabled {
  cursor:
    not-allowed;
  opacity:
    0.62;
}

/* Breiter Arbeitsbereich für Master-Detail auf Desktop */

.app-header .container,
.app-main {
  width: min(96vw, 1800px);
  max-width: none;
  margin-inline: auto;
}

/* ==========================================================
   MASTER-DETAIL-GRUNDLAYOUT MD-1
   ========================================================== */

.master-detail-layout {
  display: grid;
  grid-template-columns:
    minmax(22rem, 38fr)
    minmax(0, 62fr);
  gap: 1.25rem;
  align-items: start;
}

.master-navigation-pane,
.detail-pane {
  min-width: 0;
}

.master-navigation-pane {
  overflow: hidden;
}

.master-pane-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.master-pane-heading h3,
.detail-pane h3 {
  margin-top: 0;
}

.detail-pane {
  border: 1px solid
    var(
      --color-lightGrey,
      #d8d8d8
    );
  border-radius: 0.4rem;
  padding: 1.25rem;
  background: var(
    --color-white,
    #ffffff
  );
}

.detail-placeholder {
  min-height: 18rem;
}

.detail-placeholder p:last-child {
  max-width: 42rem;
}

@media (max-width: 900px) {
  .master-detail-layout {
    grid-template-columns:
      minmax(0, 1fr);
  }

  .detail-placeholder {
    min-height: 0;
  }
}

/* ==========================================================
   MASTER-DETAIL-NAVIGATION MD-2
   ========================================================== */

.projects-container {
  display: block;
  padding-top: 0;
}

.master-project {
  overflow: hidden;
  margin-bottom: 0.75rem;
  border: 1px solid #d6dfe8;
  border-radius: 0.55rem;
  background: #ffffff;
}

.master-project-summary {
  display: flex;
  min-height: 4.6rem;
  padding: 0.9rem 1rem;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  background: #edf3f8;
}

.master-project-summary:hover {
  background: #e5eef6;
}

.master-project.is-selected >
.master-project-summary {
  background: #dce9f4;
  box-shadow:
    inset 0.35rem 0 0 #315f86;
}

.master-project-title {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #1f4b73;
  font-size: 1.6rem;
  font-weight: 600;
}

.master-project-status {
  flex: 0 0 auto;
  font-size: 1.15rem;
  color: #667085;
}

.master-task-list {
  padding:
    0.35rem
    0.45rem
    0.45rem
    1.6rem;
  background: #ffffff;
}

.master-task-row {
  display: grid;
  grid-template-columns:
    auto
    minmax(0, 1fr)
    0.45rem;
  min-height: 3.8rem;
  gap: 0.75rem;
  align-items: center;
  padding: 0.4rem 0.55rem;
  border-radius: 0.4rem;
}

.master-task-row:hover {
  background: #f3f6f9;
}

.master-task-row.is-selected {
  background: #e8f0f7;
}

.master-task-checkbox {
  margin: 0;
}

.master-item-select {
  width: 100%;
  min-height: 3rem;
  margin: 0;
  padding: 0.25rem 0.35rem;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
  text-transform: none;
}

.master-item-select:hover,
.master-item-select:focus {
  background: transparent;
  box-shadow: none;
}

.master-task-title {
  overflow: hidden;
  color: #344054;
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.master-task-row.is-completed
.master-task-title {
  color: #7a8492;
  text-decoration: line-through;
}

.master-priority-marker {
  display: block;
  width: 0.4rem;
  height: 2.4rem;
  border-radius: 999px;
  background: #98a2b3;
}

.master-priority-marker.priority-low {
  background: #769b7b;
}

.master-priority-marker.priority-medium {
  background: #c7953c;
}

.master-priority-marker.priority-high {
  background: #b85c5c;
}

.master-tasks-empty {
  margin: 0;
  padding: 0.8rem 0.7rem;
  color: #7a8492;
  font-size: 1.3rem;
}

.detail-content {
  min-height: 18rem;
}

.detail-selection-summary {
  margin-bottom: 0.8rem;
  color: #475467;
  font-weight: 600;
}

.detail-selection-hint {
  max-width: 50rem;
  color: #667085;
}

.detail-back-button {
  display: none;
  margin-bottom: 1rem;
}

@media (max-width: 900px) {
  .master-detail-layout {
    display: block;
  }

  .master-detail-layout
  .detail-pane {
    display: none;
  }

  .master-detail-layout.is-mobile-detail
  .master-navigation-pane {
    display: none;
  }

  .master-detail-layout.is-mobile-detail
  .detail-pane {
    display: block;
  }

  .detail-back-button {
    display: inline-flex;
  }

  .detail-content {
    min-height: 0;
  }
}

/* ==========================================================
   MASTER-DETAIL MD-2 VISUELLE ABNAHMEKORREKTUR
   ========================================================== */

/*
 * Desktop:
 *
 * Der linke Navigationsbereich wird per display: contents in das
 * äußere Master-Detail-Grid integriert.
 *
 * Grid-Zeile 1:
 *   Überschrift links
 *
 * Grid-Zeile 2:
 *   Projekt-/Aufgabenliste links | Detailansicht rechts
 *
 * Dadurch beginnt die Detailansicht exakt auf Höhe des ersten
 * Projekteintrags, ohne einen fest codierten vertikalen Abstand.
 */

@media (min-width: 901px) {
  .master-detail-layout {
    grid-template-rows:
      auto
      auto;
    column-gap: 1.25rem;
    row-gap: 1rem;
  }

  .master-navigation-pane {
    display: contents;
  }

  .master-pane-heading {
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 0;
  }

  .projects-container {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
  }

  .detail-pane {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
  }
}

/*
 * Aktuell ausgewähltes Projekt:
 * stärker vom normalen Projektkopf unterscheiden.
 */

.master-project.is-selected >
.master-project-summary {
  background: #d4e6f4;
  box-shadow:
    inset 0.4rem 0 0 #315f86;
}

/*
 * Aktuell ausgewählte Aufgabe:
 * klarere Hintergrundfarbe plus linke Akzentlinie.
 */

.master-task-row.is-selected {
  background: #d4e6f4;
  box-shadow:
    inset 0.3rem 0 0 #315f86;
}

.master-task-row.is-selected:hover {
  background: #ccdfef;
}

.master-task-row.is-selected
.master-task-title {
  color: #173f63;
  font-weight: 600;
}

/*
 * Tastaturfokus bleibt sichtbar, verwendet aber dieselbe
 * visuelle Sprache wie die Auswahlmarkierung.
 */

.master-item-select:focus-visible {
  outline:
    0.2rem solid
    rgb(49 95 134 / 35%);
  outline-offset: -0.2rem;
}
