/* Aufgaben-Board — Grundlagen (Farben, Rahmen, Knöpfe, Formulare) kommen aus base.css. */

.main.board-main { max-width: none; }

.board-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.board-filters input[type=search], .board-filters select,
.task-form input[type=text], .task-form input[type=date], .task-form select, .task-form textarea,
.comment-form textarea {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
}
.board-filters input[type=search] { width: 200px; }
.board-filters input:focus, .board-filters select:focus,
.task-form input:focus, .task-form select:focus, .task-form textarea:focus, .comment-form textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow-soft);
}

/* ---- Board ---- */
.board {
  display: grid;
  /* minmax(0, …): sonst scrollt die ganze Seite zwischen 1101 und ~1330px seitlich. */
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
  animation: fadeSlideIn 0.5s ease both;
}
.column {
  background: #0F0F0F;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 12px;
  min-height: 240px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.column.drop-target { border-color: var(--brand); background: var(--brand-glow-soft); }
.column-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 12px; }
.column-head h3 { font-family: var(--font-display); font-weight: 600; font-size: 15px; margin: 0; }
.column-count {
  font-size: 12px; color: var(--text-tertiary); background: var(--surface);
  border-radius: 9999px; padding: 1px 8px; font-variant-numeric: tabular-nums;
}
.column-dot { width: 8px; height: 8px; border-radius: 50%; }
.column-add {
  margin-left: auto; background: none; border: none; color: var(--text-tertiary);
  font-size: 20px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.column-add:hover { color: var(--text-primary); background: var(--surface); }
.column-cards { display: flex; flex-direction: column; gap: 8px; }
.column-empty { color: var(--text-tertiary); font-size: 13px; text-align: center; padding: 18px 0; }

.task-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 12px 13px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.1s ease, opacity 0.15s ease;
  text-align: left;
  color: inherit;
  font: inherit;
  width: 100%;
}
.task-card:hover { border-color: var(--border); }
.task-card { position: relative; }
.card-delete {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 6px;
  background: #1E1E1E; border: 1px solid var(--border); color: var(--text-tertiary);
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
  opacity: 0; transition: opacity 0.15s ease, color 0.15s ease;
}
.card-delete svg { width: 14px; height: 14px; }
.task-card:hover .card-delete, .task-card:focus-within .card-delete { opacity: 1; }
.card-delete:hover { color: #FF6B52; border-color: rgba(255, 67, 38, 0.5); }
@media (hover: none) { .card-delete { opacity: 1; } }
.task-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.task-card.dragging { opacity: 0.4; }
.task-card-top { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-tertiary); margin-bottom: 6px; }
.task-key { font-variant-numeric: tabular-nums; font-weight: 600; }
.task-title { font-size: 14px; font-weight: 500; line-height: 1.4; margin: 0 0 10px; overflow-wrap: anywhere; }
.task-waiting {
  margin: -4px 0 10px; font-size: 12px; line-height: 1.4; color: var(--warning);
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.task-waiting.ready { color: var(--success); }
.waiting-refs { display: flex; flex-direction: column; gap: 3px; margin: 2px 0 0; font-size: 12px; color: var(--text-secondary); }
/* display aus der Klasse schlägt sonst das hidden-Attribut (FLYD-325). */
.waiting-refs[hidden] { display: none; }
.waiting-refs .ref { overflow-wrap: anywhere; }
.waiting-refs .ref.done { color: var(--success); }
.waiting-refs .ref.missing { color: var(--danger); }
.waiting-refs .ref.person { color: var(--brand-text); }

/* ---- @-Erwähnungen (FLYD-367) ---- */
.mention-wrap { position: relative; display: flex; flex-direction: column; }
.mention-wrap > input, .mention-wrap > textarea { width: 100%; box-sizing: border-box; }
.mention-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30;
  margin: 0; padding: 4px; list-style: none; max-height: 220px; overflow-y: auto;
  background: var(--surface-raised); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.mention-list.above { top: auto; bottom: calc(100% + 4px); }
/* display aus der Klasse schlägt sonst das hidden-Attribut (FLYD-325). */
.mention-list[hidden] { display: none; }
.mention-option {
  display: flex; align-items: baseline; gap: 8px; min-height: 40px; padding: 8px 10px; box-sizing: border-box;
  border-radius: 6px; cursor: pointer; font-size: 14px; color: var(--text-primary);
}
.mention-option.active, .mention-option:hover { background: var(--brand-glow-soft); }
.mention-option.active { box-shadow: inset 2px 0 0 var(--brand); }
/* Der Name ist, was man liest – gekürzt wird zuerst der @Name daneben. */
.mention-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; min-width: 0; max-width: 75%; }
.mention-handle { color: var(--text-secondary); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 0; min-width: 0; }
.mention { color: var(--brand-text); font-weight: 600; }
.mention-me { background: var(--brand-tint); border-radius: 4px; padding: 0 3px; }
.task-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-secondary); flex-wrap: wrap; }
.task-meta .overdue { color: #FF6B52; font-weight: 600; }
.avatar {
  width: 22px; height: 22px; border-radius: 50%; background: #262626; color: var(--text-primary);
  font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.avatar.unassigned { background: none; border: 1px dashed var(--border); color: var(--text-tertiary); }
.prio { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-left: auto; }
.prio-low { background: #4A4A4A; }
.prio-medium { background: var(--series-2); }
.prio-high { background: var(--warning); }
.prio-urgent { background: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow); }
.cat-tag { border-radius: 6px; padding: 1px 7px; background: #1E1E1E; color: var(--text-secondary); }
/* FLYD-352: Projekt – umrandet, damit es sich von der Kategorie abhebt */
.project-tag { border-radius: 6px; padding: 0 6px; border: 1px solid var(--border); color: var(--text-primary); }
.task-card-top .task-key { white-space: nowrap; flex-shrink: 0; }
.task-card-top .project-tag { white-space: nowrap; flex-shrink: 0; }
.task-card-top .cat-tag { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* Schmale Spalten (z. B. mit „Später“ daneben): Kategorie lieber in die zweite Zeile als auf „F…“ gekürzt. */
.task-card-top { flex-wrap: wrap; row-gap: 4px; }
.task-card-top .prio { flex-shrink: 0; }

/* ---- Modal ---- */
.modal {
  background: #111; border: 1px solid var(--border); border-radius: var(--radius-lg);
  width: 100%; max-width: 720px; padding: 24px; position: relative;
}
.modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; color: var(--text-tertiary); font-size: 13px; }
.branch-copy {
  background: var(--surface); border: 1px solid var(--border); color: var(--text-secondary);
  border-radius: 6px; padding: 3px 8px; font-size: 12px; cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.branch-copy:hover { color: var(--text-primary); }

.task-form { display: flex; flex-direction: column; gap: 14px; }
.task-form .title-input {
  font-family: var(--font-display); font-size: 22px !important; font-weight: 600;
  background: none !important; border-color: transparent !important; padding: 4px 6px !important; margin: 0 -6px;
}
.task-form .title-input:focus { border-color: var(--border) !important; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
/* FLYD-140: Auswahlfelder nie breiter als ihre Spalte (lange Namen sprengten am Handy das Fenster). */
.field select { width: 100%; min-width: 0; }
.field label { font-size: 12px; color: var(--text-tertiary); font-weight: 600; letter-spacing: 0.02em; }
.task-form textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.form-actions { display: flex; gap: 10px; align-items: center; }
.form-actions .spacer { flex: 1; }
.pr-link { font-size: 13px; color: var(--text-secondary); }
.pr-link a { color: var(--brand); }

.history { margin-top: 26px; border-top: 1px solid var(--border-soft); padding-top: 18px; }
.history h4 { font-family: var(--font-display); font-weight: 600; font-size: 15px; margin: 0 0 12px; }
.history-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.h-event { font-size: 13px; color: var(--text-tertiary); }
.h-event strong { color: var(--text-secondary); font-weight: 600; }
.h-comment { background: var(--surface); border-radius: var(--radius-sm); padding: 10px 12px; }
.h-comment-head { font-size: 12px; color: var(--text-tertiary); margin-bottom: 4px; }
.h-comment-head strong { color: var(--text-primary); }
.h-comment-body { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.comment-form { display: flex; flex-direction: column; gap: 8px; }
.comment-form textarea { min-height: 70px; resize: vertical; }
.comment-form button { align-self: flex-end; }

@media (max-width: 1100px) {
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .board { grid-template-columns: 1fr; }
  .board-filters { width: 100%; }
  .board-filters input[type=search] { flex: 1; width: auto; min-width: 0; }
  /* FLYD-141: mit dem Inhalt wachsen statt auf Bildschirmhöhe gestreckt (sonst unten durchsichtig). */
  .modal { padding: 16px; border-radius: 0; border: none; min-height: 100vh; max-width: none; align-self: flex-start; }
  .field-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .form-actions { flex-wrap: wrap; }
  .form-actions .btn-primary, .form-actions .btn-ghost { flex: 1; }
}

.task-card-top { padding-right: 30px; }

/* ---- Claude verbinden ---- */
.claude-body { display: flex; flex-direction: column; gap: 12px; }
.claude-body h4 { font-family: var(--font-display); font-weight: 600; font-size: 15px; margin: 10px 0 0; }
.claude-lead, .claude-step { color: var(--text-secondary); font-size: 14px; line-height: 1.55; margin: 0; }
.claude-lead strong { color: var(--text-primary); }
.claude-step code { background: var(--surface); border-radius: 4px; padding: 1px 5px; font-size: 13px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input {
  flex: 1; min-width: 0; background: var(--surface); color: var(--text-primary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 12px; font-size: 13px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.connection-row {
  display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 14px;
}
.connection-row .meta { color: var(--text-tertiary); font-size: 12px; }
.connection-row button { margin-left: auto; }
.connection-list { display: flex; flex-direction: column; gap: 8px; }

.discord-modal { max-width: 520px; }
#discordId { background: var(--surface); color: var(--text-primary); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 15px; font-variant-numeric: tabular-nums; }
#discordId:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-glow-soft); }

/* ---- Review nach Pull Request ---- */
.pr-group { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 8px; display: flex; flex-direction: column; gap: 8px; background: rgba(255, 149, 0, 0.04); }
.pr-group-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--text-primary); text-decoration: none; padding: 4px 6px 2px;
}
.pr-group-head:hover { color: var(--brand); }
.pr-group-count { font-weight: 500; color: var(--text-tertiary); font-size: 12px; }

/* ---- Handy: Status-Tabs statt vier Spalten ---- */
.board-tabs { display: none; }
@media (max-width: 860px) {
  .board-tabs {
    display: flex; gap: 4px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none;
    position: sticky; top: var(--mobile-bar-h); z-index: 5; background: var(--bg); padding: 6px 0;
  }
  .board-tabs::-webkit-scrollbar { display: none; }
  .board-tab {
    flex: 1 1 0; min-width: 0; min-height: 40px; padding: 8px 4px; border-radius: var(--radius-sm);
    background: var(--surface); border: 1px solid var(--border-soft); color: var(--text-secondary);
    font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
  }
  .board-tab span { color: var(--text-tertiary); font-weight: 500; margin-left: 4px; }
  .board-tab.active { background: var(--brand-glow-soft); border-color: rgba(255, 67, 38, 0.4); color: var(--brand); }
  .board .column { display: none; }
  .board .column.is-current { display: block; border: none; background: none; padding: 0; }
  .board .column.is-current .column-head { display: none; }
  .task-card { padding: 14px; }
  .card-delete { width: 36px; height: 36px; top: 8px; right: 8px; }
  .task-card-top { padding-right: 40px; }
  .topbar .board-filters { width: 100%; }
  .board-filters select, .board-filters #newTaskBtn { flex: 1 1 45%; }
}

/* ---- Aktiv-Anzeige (FLYD-122) ---- */
.active-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.6); animation: activePulse 1.8s ease-out infinite; flex-shrink: 0;
}
@keyframes activePulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(52, 199, 89, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0); }
}
.task-active {
  display: flex; align-items: center; gap: 7px; margin: -4px 0 10px;
  font-size: 12px; font-weight: 600; color: var(--success); overflow-wrap: anywhere;
}
.active-toggle {
  display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 5px 12px;
  border-radius: var(--radius-round); border: 1px solid var(--border); background: var(--surface);
  color: var(--text-secondary); font-size: 13px; font-weight: 600; cursor: pointer;
}
.active-toggle:hover { color: var(--text-primary); border-color: var(--text-tertiary); }
.active-toggle.on { color: var(--success); border-color: rgba(52, 199, 89, 0.45); background: rgba(52, 199, 89, 0.08); }
.active-dot.idle { animation: none; box-shadow: none; background: rgba(52, 199, 89, 0.55); }
.task-active.idle { color: rgba(52, 199, 89, 0.8); font-weight: 500; }
.active-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.active-row + .active-row { margin-top: 6px; }
.active-row strong { color: var(--text-primary); }
.active-row .btn-small { margin-left: auto; }
.active-list {
  display: block; margin: 0 0 14px; padding: 9px 12px;
  border-radius: var(--radius-sm); background: rgba(52, 199, 89, 0.07); border: 1px solid rgba(52, 199, 89, 0.25);
  font-size: 13px; color: var(--text-secondary); line-height: 1.45;
}
.active-list .active-dot { transform: translateY(-1px); }
/* Wie bei .waiting-refs: ohne das bliebe hidden wirkungslos (FLYD-325). */
.active-toggle[hidden], .active-list[hidden] { display: none; }

/* Konflikt: jemand hat gespeichert, während das Fenster offen war */
.conflict-box {
  border: 1px solid rgba(255, 149, 0, 0.5); background: rgba(255, 149, 0, 0.08);
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; line-height: 1.5; color: var(--text-secondary);
}
.conflict-box p { margin: 0 0 10px; }
.conflict-box strong { color: var(--text-primary); }
.conflict-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- Archiv (FLYD-112) ---- */
.archive {
  margin-top: 22px; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); background: #0F0F0F;
}
.archive summary {
  display: flex; align-items: baseline; gap: 10px; padding: 14px 18px; cursor: pointer; list-style: none;
  font-family: var(--font-display); font-weight: 600; font-size: 15px; min-height: 44px;
}
.archive summary::-webkit-details-marker { display: none; }
.archive summary::before { content: '▸'; color: var(--text-tertiary); font-size: 12px; transition: transform 0.15s ease; }
.archive[open] summary::before { transform: rotate(90deg); }
.archive-count { font-family: var(--font-body); font-size: 12px; color: var(--text-tertiary); background: var(--surface); border-radius: 9999px; padding: 1px 8px; }
.archive-hint { margin-left: auto; font-family: var(--font-body); font-weight: 400; font-size: 12px; color: var(--text-tertiary); }
.archive-body { padding: 0 18px 16px; }
.archive-body input[type=search] { width: 100%; max-width: 360px; margin-bottom: 10px; }
.archive-list { list-style: none; margin: 0; padding: 0; }
.archive-row {
  display: flex; align-items: baseline; gap: 10px; width: 100%; padding: 9px 4px; min-height: 40px;
  background: none; border: none; border-top: 1px solid var(--border-soft); color: var(--text-primary);
  font: inherit; font-size: 13.5px; text-align: left; cursor: pointer;
}
.archive-list li:first-child .archive-row { border-top: none; }
.archive-row:hover .archive-title { color: var(--brand); }
.archive-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.archive-meta { color: var(--text-tertiary); font-size: 12px; white-space: nowrap; }

@media (max-width: 860px) {
  .archive-hint { display: none; }
  .archive-row { flex-wrap: wrap; }
  .archive-meta { flex-basis: 100%; padding-left: 0; }
  .modal-head { flex-wrap: wrap; }
}

/* ---- Papierkorb (FLYD-300) ---- */
.trash { margin-top: 12px; }
.trash-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 4px; min-height: 44px;
  border-top: 1px solid var(--border-soft); font-size: 13.5px;
}
.archive-list li.trash-row:first-child { border-top: none; }
.archive-key { color: var(--text-tertiary); font-size: 12px; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.trash-actions { display: flex; gap: 6px; flex-shrink: 0; }
.toast-action {
  margin-left: 8px; background: none; border: none; padding: 4px 2px; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer;
}
.toast-action:hover { text-decoration: underline; }
@media (max-width: 860px) {
  .trash-row { flex-wrap: wrap; }
  .trash-row .archive-meta { flex-basis: 100%; }
  .trash-actions { flex-basis: 100%; }
  .trash-actions button { flex: 1; min-height: 40px; }
}

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200;
  /* max-content: sonst bricht left:50% den Hinweis am Handy schon bei halber Breite um */
  width: max-content; max-width: min(560px, calc(100vw - 32px)); padding: 12px 16px; border-radius: var(--radius-md);
  background: #1A1A1A; border: 1px solid var(--border); color: var(--text-primary); font-size: 14px; line-height: 1.45;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5); transition: opacity 0.5s ease;
}
.toast.out { opacity: 0; }
/* Handy: „Rückgängig“ als Tippfläche (40px), ohne den Hinweis höher zu machen als nötig */
@media (max-width: 860px) {
  .toast { display: flex; align-items: center; padding-top: 6px; padding-bottom: 6px; }
  .toast-action { min-height: 40px; padding: 4px 8px; }
}

/* ---- Fortschritt (FLYD-139) ---- */
.task-progress { display: flex; align-items: center; gap: 8px; margin: -2px 0 10px; }
.task-progress-track { flex: 1; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.task-progress-track span { display: block; height: 100%; border-radius: 3px; background: var(--brand); min-width: 0; transition: width .3s ease; }
.task-progress-val { font-size: 12px; color: var(--text-secondary); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }

.field-progress { grid-column: span 2; }
.field label output { color: var(--text-primary); font-weight: 600; font-variant-numeric: tabular-nums; margin-left: 4px; }
.task-form input.progress-range {
  -webkit-appearance: none; appearance: none; width: 100%; height: 38px; margin: 0; padding: 0;
  background: transparent; cursor: pointer; box-shadow: none;
}
.progress-range::-webkit-slider-runnable-track {
  height: 6px; border-radius: 3px;
  background: linear-gradient(to right, var(--brand) var(--p, 0%), var(--border) var(--p, 0%));
}
.progress-range::-moz-range-track { height: 6px; border-radius: 3px; background: var(--border); }
.progress-range::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--brand); }
.progress-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%;
  background: var(--text-primary); border: 3px solid var(--brand);
}
.progress-range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--text-primary); border: 3px solid var(--brand); }
.progress-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--brand-glow); }
.progress-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--brand-glow); }

/* FLYD-295: in Arbeit, aber lange unverändert */
.task-stale { margin: -4px 0 10px; font-size: 12px; line-height: 1.4; color: var(--warning); font-weight: 600; }

/* FLYD-297: Links unter der Beschreibung und in Kommentaren */
.desc-links { margin: 6px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--text-tertiary); overflow-wrap: anywhere; }
.desc-links a, .h-comment-body a, .h-event a { color: var(--brand); text-decoration: none; }
.desc-links a:hover, .h-comment-body a:hover, .h-event a:hover { text-decoration: underline; }

/* ---- Anhänge (FLYD-323) ---- */
.attach { border-radius: var(--radius-sm); transition: background 0.15s ease, box-shadow 0.15s ease; }
/* .field/.attach-list setzen display – ohne das bliebe hidden wirkungslos. */
.attach[hidden], .attach-list[hidden] { display: none; }
.attach.drop-files { background: var(--brand-glow-soft); box-shadow: 0 0 0 2px var(--brand), 0 0 0 8px var(--brand-glow-soft); }
.attach-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.attach-label { font-size: 12px; color: var(--text-tertiary); font-weight: 600; letter-spacing: 0.02em; }
.attach-count { color: var(--text-secondary); font-variant-numeric: tabular-nums; margin-left: 2px; }
.attach-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; }
.attach-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.attach-list {
  list-style: none; margin: 4px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px;
}
.attach-item {
  position: relative; min-width: 0; background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); overflow: hidden; transition: border-color 0.15s ease;
}
.attach-item:hover { border-color: var(--border); }
.attach-open { display: flex; flex-direction: column; gap: 2px; padding-bottom: 9px; min-width: 0; color: inherit; text-decoration: none; }
a.attach-open:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: var(--radius-sm); }
.attach-preview {
  display: flex; align-items: center; justify-content: center; height: 96px; margin-bottom: 7px;
  background: #0B0B0B; overflow: hidden;
}
.attach-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attach-ext {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px;
}
.attach-name { font-size: 13px; padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attach-meta { font-size: 11.5px; line-height: 1.4; color: var(--text-tertiary); padding: 0 10px; overflow-wrap: anywhere; }
.attach-remove {
  position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; padding: 0; border-radius: 6px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: rgba(10, 10, 10, 0.75); border: 1px solid var(--border); color: var(--text-secondary); font-size: 17px; line-height: 1;
  opacity: 0; transition: opacity 0.15s ease, color 0.15s ease;
}
.attach-item:hover .attach-remove, .attach-item:focus-within .attach-remove { opacity: 1; }
.attach-remove:hover { color: var(--danger); border-color: rgba(255, 67, 38, 0.5); }
@media (hover: none) { .attach-remove { opacity: 1; } }
.attach-item.is-pending .attach-preview { opacity: 0.5; }
.attach-item.is-uploading .attach-preview { animation: attachPulse 1.2s ease-in-out infinite; }
@keyframes attachPulse { 50% { opacity: 0.25; } }
.attach-item.is-error { border-color: rgba(255, 67, 38, 0.45); }
.attach-error { color: var(--danger); }
.attach-retry { margin: 6px 10px 0; align-self: flex-start; }
.attach-hint { margin: 2px 0 0; font-size: 12px; line-height: 1.5; color: var(--text-tertiary); }
.attach-note { font-size: 13px; color: var(--text-tertiary); grid-column: 1 / -1; }
.meta-attach { display: inline-flex; align-items: center; gap: 3px; }
.meta-attach svg { width: 12px; height: 12px; }
@media (max-width: 760px) {
  .attach-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .attach-btn { margin-left: 0; width: 100%; justify-content: center; min-height: 40px; }
  .attach-remove { width: 36px; height: 36px; }
}

/* ---- Später (FLYD-369): bewusst geparkte Aufgaben ----
   Seit FLYD-377 wie in der iPhone-App ein einklappbarer Kasten oben in der
   Spalte „Offen“ (am Handy im Tab „Offen“) statt einer eigenen Spalte. */
:root { --later: #5E5CE6; --later-soft: rgba(94, 92, 230, 0.12); }
.later-box {
  margin: 0 0 10px; padding: 0 6px 0 10px; border-radius: var(--radius-md);
  background: rgba(94, 92, 230, 0.05); border: 1px solid rgba(94, 92, 230, 0.22);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.later-box.is-open { padding-bottom: 10px; }
.later-box.drop-target { border-color: var(--later); background: var(--later-soft); }
.later-head { display: flex; align-items: center; gap: 4px; }
.later-toggle {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; min-height: 38px; padding: 0;
  background: none; border: none; border-radius: 6px; color: var(--text-primary); font: inherit; cursor: pointer; text-align: left;
}
.later-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.later-label { font-family: var(--font-display); font-weight: 600; font-size: 15px; white-space: nowrap; }
/* Eingerückt bis unter „Später“ (Punkt 8px + Abstand 8px). */
.later-ready { margin: -6px 4px 8px 16px; font-size: 12px; font-weight: 700; line-height: 1.45; color: var(--success); }
.later-chevron { margin-left: auto; width: 14px; height: 14px; flex-shrink: 0; color: var(--text-tertiary); transition: transform 0.15s ease, color 0.15s ease; }
.later-box.is-open .later-chevron { transform: rotate(180deg); }
.later-toggle:hover .later-chevron { color: var(--text-primary); }
.later-head .column-add { margin-left: 0; flex-shrink: 0; }
.later-note, .later-drop-hint { margin: 0 4px 10px 0; font-size: 12px; line-height: 1.45; color: var(--text-tertiary); }
/* Beim Drüberziehen sagt der Kasten, was Loslassen bewirkt (wie in der App). */
.later-drop-hint { display: none; color: var(--later); }
.later-box.drop-target .later-drop-hint { display: block; }
.later-box.drop-target .later-note { display: none; }
.later-box .column-empty { padding: 10px 0; }

/* Ab wann eine geparkte Aufgabe wieder dran ist (Karte) */
.task-later {
  margin: -4px 0 10px; font-size: 12px; line-height: 1.4; color: var(--text-secondary);
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.task-later.ready { color: var(--success); }

/* Feld „Später – ab …“ im Formular. .field setzt display:flex und schlägt
   damit das hidden-Attribut (wie FLYD-325). */
#laterField[hidden], .later-hint[hidden] { display: none; }
.later-hint { margin: 2px 0 0; font-size: 12px; line-height: 1.5; color: var(--text-secondary); }
.later-hint.error { color: var(--danger); }
#fLater[aria-invalid="true"] { border-color: var(--danger); }
/* Zum Parken ohne „ab …“ (FLYD-376): Speichern sieht gesperrt aus, ein Klick
   springt ins Feld (echtes disabled kollidiert mit dem Sperren beim Senden). */
#saveBtn[aria-disabled="true"], #saveBtn[aria-disabled="true"]:hover { opacity: 0.5; cursor: default; background: var(--brand); border-color: var(--brand); }
#saveBtn[aria-disabled="true"]:active { transform: none; }

@media (max-width: 860px) {
  /* Eine Spalte – sonst nimmt der aktuelle Tab zwischen 760 und 860px nur die halbe Breite ein. */
  .board { grid-template-columns: minmax(0, 1fr); }
  .later-toggle { min-height: 44px; }
  .later-head .column-add { min-width: 40px; min-height: 40px; }
}
