/* =========================================================
   Kanban — styles
   Light theme = CSS custom properties on :root.
   Dark theme  = overrides on [data-theme='dark'].
   ========================================================= */

*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --column-bg: #ebedf1;
  --card-bg: #ffffff;
  --text: #1d2430;
  --text-muted: #667085;
  --border: #d9dde4;
  --border-strong: #b7bfcc;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-soft: rgba(79, 70, 229, 0.12);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.1);
  --warn: #d97706;
  --warn-soft: rgba(217, 119, 6, 0.14);
  --success: #16a34a;
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.08);
  --shadow-card-hover: 0 4px 14px rgba(15, 23, 42, 0.14);
  --shadow-pop: 0 12px 32px rgba(15, 23, 42, 0.2);
  --radius-md: 12px;
}

[data-theme='dark'] {
  --bg: #0f1216;
  --surface: #1a1f27;
  --column-bg: #151a21;
  --card-bg: #212836;
  --text: #e8ebf0;
  --text-muted: #96a0b5;
  --border: #2c3441;
  --border-strong: #434e61;
  --accent: #818cf8;
  --accent-hover: #9aa3fb;
  --accent-soft: rgba(129, 140, 248, 0.16);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.14);
  --success: #4ade80;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-card-hover: 0 4px 14px rgba(0, 0, 0, 0.55);
  --shadow-pop: 0 16px 40px rgba(0, 0, 0, 0.6);
}

html, body { height: 100%; }

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }

h1, h2, h3, p { margin: 0; }
button { font: inherit; }

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

.icon { display: inline-flex; align-items: center; }
.icon svg { display: block; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn:hover { border-color: var(--border-strong); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
/* Ghost used to be fully transparent → looked like a bare text link. Give it a
   soft fill so it reads as an actual button. */
.btn.ghost {
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border-color: color-mix(in srgb, var(--text) 12%, transparent);
  color: var(--text);
}
.btn.ghost:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { filter: brightness(0.95); }
.btn.danger-ghost {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
  color: var(--danger);
}
.btn.danger-ghost:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.small { padding: 5px 10px; font-size: 12.5px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--accent-soft); color: var(--text); }
.icon-btn.small { width: 22px; height: 22px; }
.icon-btn.danger { color: var(--danger); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------- header ---------- */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-icon { flex-shrink: 0; }
.brand h1 { font-size: 15px; font-weight: 700; letter-spacing: 0.02em; }

.header-actions { display: flex; align-items: center; gap: 6px; }

.badge {
  background: var(--accent);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 0 6px;
  min-width: 17px;
  height: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

[data-theme='light'] .icon-moon { display: none; }
[data-theme='dark'] .icon-sun { display: none; }

/* ---------- filter bar ---------- */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 220px;
  max-width: 380px;
}
.search-icon {
  position: absolute;
  left: 11px;
  color: var(--text-muted);
  pointer-events: none;
}
.search input {
  width: 100%;
  padding: 7px 30px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.search input::placeholder { color: var(--text-muted); }
.search input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
#search-clear { position: absolute; right: 5px; }

.select {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 28px 7px 10px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888f9c' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 13px;
  cursor: pointer;
  max-width: 190px;
  text-overflow: ellipsis;
}

.filter-status {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ---------- board ---------- */

.board-wrap { flex: 1; min-height: 0; padding: 16px 20px; }

.board {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
}

/* ---------- column ---------- */

.column {
  position: relative;
  flex: 0 0 300px;
  width: 300px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--column-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.column-dragging { opacity: 0.5; }

.column[data-drop-side='before']::before,
.column[data-drop-side='after']::after {
  content: '';
  position: absolute;
  top: 10px;
  bottom: 10px;
  width: 4px;
  border-radius: 4px;
  background: var(--accent);
  z-index: 5;
}
.column[data-drop-side='before']::before { left: -10px; }
.column[data-drop-side='after']::after { right: -10px; }

.column-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding: 10px 8px 10px 12px;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.column-header:active { cursor: grabbing; }

.column-header .grip {
  color: var(--text-muted);
  opacity: 0.75;
  flex-shrink: 0;
}

/* Row 1 of the header: title, count, WIP badge, "⋯" menu. The title row is
   its own line inside the column-stacked header, so a long name costs a row
   of its own instead of squeezing the badges to a single letter. */
.column-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.column-title {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  /* Never truncated: a viewer sees the whole name, wrapped over two lines
     if it has to. An ellipsised column name is a column nobody can find. */
  white-space: normal;
  overflow-wrap: anywhere;
}

.column-count {
  font-size: 11.5px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}

.rename-input {
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 2px 6px;
  flex: 1;
  min-width: 0;
}

.column-body {
  flex: 1;
  min-height: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding: 4px 10px 6px;
}

.column-footer { padding: 2px 10px 10px; }

.add-card-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  text-align: left;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.add-card-btn:hover { background: var(--accent-soft); color: var(--text); }

.empty-col {
  border: 1.5px dashed var(--border-strong);
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
}

/* ---------- card ---------- */

.card {
  position: relative; /* anchor for the stretched title link (see below) */
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: var(--shadow-card);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  flex-shrink: 0;
  transition: box-shadow 0.15s, opacity 0.15s;
}
.card:hover { box-shadow: var(--shadow-card-hover); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card.dragging { opacity: 0.45; cursor: grabbing; }

.card-top { display: flex; align-items: flex-start; gap: 8px; }
.card-title {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  word-break: break-word;
}
.card-done-badge { color: var(--success); flex-shrink: 0; margin-top: 1px; }
.card--done .card-title { color: var(--text-muted); }

.card-desc {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px 8px;
  /* Long German labels ("Bearbeiten") + full meta row exceed the card
     width; wrap instead of clipping the button at the card edge. */
  flex-wrap: wrap;
  margin-top: 9px;
}

.card-labels { display: flex; flex-wrap: wrap; gap: 4px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

.assignee {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  max-width: 110px;
  border: none;
  background: none;
  padding: 2px 5px 2px 3px;
  border-radius: 6px;
  cursor: pointer;
  margin-left: auto; /* stays right-aligned even when the card has no labels */
  transition: background 0.15s, color 0.15s;
}
.assignee:hover { background: var(--accent-soft); color: var(--text); }
.assignee--ghost { opacity: 0.7; }
.assignee--ghost:hover { opacity: 1; }
.assignee-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.avatar--empty {
  background: transparent;
  border: 1.5px dashed var(--border-strong);
}

.assignee-popover {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 45;
  min-width: 180px;
  max-width: 240px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
  padding: 4px;
}
.assignee-pop-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: none;
  border-radius: 7px;
  background: none;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.assignee-pop-row:hover { background: var(--accent-soft); }
.assignee-pop-row .avatar { width: 22px; height: 22px; font-size: 10px; }
.assignee-pop-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.assignee-pop-row.active .assignee-pop-name { font-weight: 600; }
.assignee-pop-hint {
  margin: 2px 0;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
}

.card-placeholder {
  border: 2px dashed var(--border-strong);
  border-radius: 10px;
  background: var(--accent-soft);
  flex-shrink: 0;
}

/* ---------- composers (inline add forms) ---------- */

.card-composer {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.composer-input {
  width: 100%;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  resize: vertical;
  min-height: 52px;
}
.composer-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

.composer-actions { display: flex; align-items: center; gap: 8px; }
.composer-actions .icon-btn { margin-left: auto; }

/* ---------- add column ---------- */

.add-column-slot { flex: 0 0 280px; width: 280px; }

.add-column-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1.5px dashed var(--border-strong);
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.add-column-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.column-composer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-card);
}
.composer-text {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
}
.composer-text:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

/* ---------- empty board ---------- */

.empty-board {
  flex: 0 0 300px;
  width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 30px 20px;
  border: 1.5px dashed var(--border-strong);
  border-radius: 14px;
  background: var(--column-bg);
  text-align: center;
}
.empty-board-icon { color: var(--text-muted); opacity: 0.8; }
.empty-board h2 { font-size: 14.5px; }
.empty-board p { font-size: 12.5px; color: var(--text-muted); }

/* ---------- modals ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(10, 14, 20, 0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 16px 16px;
  overflow-y: auto;
}
#confirm-backdrop { z-index: 60; }

.modal {
  width: min(540px, 100%);
  max-height: 84vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-pop);
  padding: 20px;
}
.modal--wide { width: min(680px, 100%); }
.modal--narrow { width: min(430px, 100%); }
.modal h2 { font-size: 17px; }
.modal-sub { color: var(--text-muted); font-size: 12.5px; margin-top: -6px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label,
.field-label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.field .optional { font-weight: 400; opacity: 0.8; }
.field input,
.field textarea {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
}
.field select.select { width: 100%; max-width: none; padding: 8px 28px 8px 10px; }
.field input:focus,
.field textarea:focus,
.field select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.field textarea { resize: vertical; min-height: 90px; }
.field-error { color: var(--danger); font-size: 12px; }

.modal-footer { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.spacer { flex: 1; }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* Label picker chips. The native checkbox stays in the accessibility tree
   (Tab + Space keep working) but never renders — the pill itself is the
   control: color dot, name, and a checkmark when selected. --label-color
   is set inline per chip from the label's own color. */
.chip-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.chip-toggle input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  margin: 0;
  pointer-events: none;
}
.chip-toggle .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--label-color, var(--border-strong)); opacity: 0.4; }
.chip-toggle:hover { border-color: var(--border-strong); color: var(--text); }
.chip-toggle:has(input:checked) {
  border-color: transparent;
  background: var(--accent-soft); /* fallback when color-mix() is unsupported */
  background: color-mix(in srgb, var(--label-color, var(--accent)) 16%, transparent);
  color: var(--text);
}
.chip-toggle:has(input:checked) .dot { opacity: 1; }
.chip-toggle:has(input:checked)::after {
  content: "";
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  background: currentColor;
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="3.4" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 12.5 9.5 18 20 5.5"/></svg>') center / contain no-repeat;
          mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="3.4" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 12.5 9.5 18 20 5.5"/></svg>') center / contain no-repeat;
}
.chip-toggle:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.hint { font-size: 12.5px; color: var(--text-muted); }

/* ---------- label manager ---------- */

.labels-list { display: flex; flex-direction: column; gap: 6px; }

.label-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.label-row .swatch { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; }
.label-row .name { flex: 1; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.label-row .count { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }

.label-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.label-form-row { display: flex; gap: 8px; }
.label-form-row input { flex: 1; }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch-btn {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.swatch-btn.selected { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }

/* ---------- users ---------- */

.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.user-row .user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
.user-row .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.user-row .sub { font-size: 11.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row .name { flex: 1; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row .count { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.user-row .icon-btn { opacity: 0.65; }
.user-row .icon-btn:hover { opacity: 1; }

/* ---------- archive ---------- */

.archive-content { display: flex; flex-direction: column; gap: 14px; }
.archive-section { display: flex; flex-direction: column; gap: 8px; }
.archive-section h3 {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.archive-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.archive-item .info { flex: 1; min-width: 0; }
.archive-item .title { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.archive-item .sub { font-size: 11.5px; color: var(--text-muted); }
.item-actions { display: flex; gap: 4px; flex-shrink: 0; }

.archive-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 30px 12px;
  text-align: center;
  color: var(--text-muted);
}
.archive-empty-icon { color: var(--border-strong); }
.archive-empty h3 { color: var(--text); font-size: 14px; }
.archive-empty p { font-size: 12.5px; max-width: 320px; }

/* ---------- confirm ---------- */

.confirm-message { color: var(--text-muted); }
.confirm-extra { display: flex; margin-top: 12px; }
.confirm-extra .select { width: 100%; }

/* ---------- toasts ---------- */

.toasts {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 100;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(480px, calc(100vw - 32px));
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-pop);
  padding: 8px 14px;
  font-weight: 500;
  font-size: 13px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: none; }
.toast-icon { display: inline-flex; }
.toast--success .toast-icon { color: var(--success); }
.toast--danger .toast-icon { color: var(--danger); }
.toast--info .toast-icon { color: var(--accent); }

/* ---------- scrollbars ---------- */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); background-clip: content-box; }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

/* ---------- board switcher & permissions ---------- */

/* Board switcher dropdown: pill summary + absolute panel (favourites first,
   then recent; the open board is highlighted). */
.board-switcher { position: relative; min-width: 0; max-width: 300px; }
.board-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  transition: border-color 0.15s, background 0.15s;
}
.board-switcher-btn::-webkit-details-marker { display: none; }
.board-switcher-btn:hover { border-color: var(--border-strong); background: var(--accent-soft); }
.board-switcher[open] .board-switcher-btn { border-color: var(--accent); background: var(--accent-soft); }
.board-switcher-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.board-switcher-caret { flex-shrink: 0; opacity: 0.6; transition: transform 0.15s; }
.board-switcher[open] .board-switcher-caret { transform: rotate(180deg); }

.board-switcher-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 300px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
}
.board-switcher-heading {
  padding: 4px 8px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.board-switcher-row {
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 8px;
}
.board-switcher-row:hover { background: var(--accent-soft); }
.board-switcher-row.is-current {
  background: var(--accent-soft);
  outline: 1px solid var(--accent);
}
.board-switcher-link {
  flex: 1;
  min-width: 0;
  padding: 7px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.board-switcher-link:hover { color: var(--accent); }
.board-switcher-star-form { flex-shrink: 0; }
.board-switcher-star {
  display: inline-flex;
  padding: 5px;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
}
.board-switcher-star:hover { background: var(--column-bg); color: #d97706; }
.board-switcher-star.is-fav { color: #f59e0b; }
.board-switcher-empty { padding: 4px 8px; }
.board-switcher-all {
  margin-top: 4px;
  padding: 7px 8px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
}
.board-switcher-all:hover { color: var(--accent); }

.perm-badge {
  flex-shrink: 0;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  text-transform: lowercase;
}
.perm-badge--muted {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.readonly-banner {
  padding: 7px 20px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
}

.board-loading {
  padding: 32px 8px;
  color: var(--text-muted);
  font-size: 13.5px;
  text-align: center;
}

/* ---------- board picker ---------- */

.board-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.board-row + .board-row { margin-top: 6px; }
.board-row:hover { border-color: var(--accent); background: var(--accent-soft); }
.board-row .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.board-row .name {
  font-weight: 600;
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.board-row .sub { color: var(--text-muted); font-size: 12px; }

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}
.checkbox-row input { accent-color: var(--accent); }

/* ---------- member rows ---------- */

.member-perm {
  flex-shrink: 0;
  padding: 3px 8px;
  font-size: 12.5px;
}

.search-results { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.search-result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.search-result-row .name {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- small screens ---------- */

@media (max-width: 640px) {
  .app-header { padding: 10px 12px; }
  .filter-bar { padding: 10px 12px; }
  .board-wrap { padding: 12px; }
  .column,
  .empty-board,
  .add-column-slot { flex-basis: 82vw; width: 82vw; }
  .filter-status { margin-left: 0; width: 100%; order: 5; }
  .board-switcher { max-width: 140px; }
}

/* =========================================================
   Board backgrounds (per-board, admin-set). Preset ids are
   whitelisted in backend/schemas.py and mirrored in js/ui.js.
   ========================================================= */

.board-wrap { border-radius: var(--radius-md); transition: background 0.25s ease; }

.board-wrap[data-bg='bg-aurora'] { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.board-wrap[data-bg='bg-dusk']   { background: linear-gradient(135deg, #2b1055 0%, #7597de 100%); }
.board-wrap[data-bg='bg-forest'] { background: linear-gradient(135deg, #134e5e 0%, #71b280 100%); }
.board-wrap[data-bg='bg-sunset'] { background: linear-gradient(135deg, #f12711 0%, #f5af19 100%); }
.board-wrap[data-bg='bg-ocean']  { background: linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%); }
.board-wrap[data-bg='bg-slate']  { background: linear-gradient(160deg, #374151 0%, #6b7280 100%); }
.board-wrap[data-bg='bg-paper']  { background: linear-gradient(160deg, #ede9dd 0%, #d6cbaa 100%); }
.board-wrap[data-bg='bg-mint']   { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
.board-wrap[data-bg='bg-blush']  { background: linear-gradient(135deg, #fbc2eb 0%, #a6c1ee 100%); }

/* Keep columns readable on top of any preset. */
.board-wrap:not([data-bg='none']) .column { background: color-mix(in srgb, var(--column-bg) 92%, transparent); }

/* --- background picker grid --- */
.bg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin: 12px 0 4px;
}
.bg-swatch {
  position: relative;
  height: 72px;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
  padding: 6px 8px;
  background: var(--column-bg);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
}
.bg-swatch:hover { border-color: var(--border-strong); }
.bg-swatch.selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.bg-swatch-label {
  background: rgba(255, 255, 255, 0.82);
  color: #1d2430;
  border-radius: 6px;
  padding: 1px 7px;
}
.bg-swatch.bg-none { background: repeating-linear-gradient(45deg, var(--column-bg), var(--column-bg) 8px, var(--surface) 8px, var(--surface) 16px); }

/* --- admin users form --- */
.admin-user-form-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-user-form-row input { flex: 1 1 160px; min-width: 0; }
.admin-user-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
#admin-users-search { width: 100%; margin: 10px 0; }

/* =========================================================
   Landing (signed out): opaque dark-navy screen above the
   app chrome, with a big Kanban banner. Deliberately uses
   fixed colors (not theme vars) — it is always dark.
   ========================================================= */

.landing {
  position: fixed;
  inset: 0;
  z-index: 40; /* above header/board, below modals (z-50) */
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(1200px 700px at 50% -10%, #16224a 0%, #0b1026 55%, #070b18 100%);
  color: #e8ebf0;
  padding: 24px;
}
.landing-card { text-align: center; max-width: 420px; }
.landing-logo { margin-bottom: 6px; }
.landing-title {
  font-size: 64px;
  font-weight: 800;
  letter-spacing: -1.5px;
  background: linear-gradient(135deg, #a5b4fc 0%, #818cf8 50%, #6366f1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.landing-sub { color: #96a0b5; margin: 8px 0 28px; font-size: 16px; }
.landing-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.landing-actions .btn { min-width: 150px; padding: 10px 22px; font-size: 15px; }
.landing-ghost {
  background: transparent;
  border: 1px solid #3b4668;
  color: #c7d2fe;
}
.landing-ghost:hover { border-color: #818cf8; background: rgba(129, 140, 248, 0.1); }
.landing-hint { margin-top: 18px; font-size: 13px; color: #96a0b5; }

.field-hint { font-size: 12.5px; color: var(--text-muted); margin: 6px 0 10px; }

/* --- invites section (inside the admin users modal) --- */
.admin-invites { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 14px; }
.admin-invites .hint { margin: 4px 0 10px; }
.invite-days { flex: 0 0 90px !important; }

@media (max-width: 640px) {
  .landing-title { font-size: 48px; }
}

/* =========================================================
   kanban-rails additions (layouts, panels, forms)
   ========================================================= */

body.auth-body {
  background: radial-gradient(1200px 700px at 50% -10%, #16224a 0%, #0b1026 55%, #070b18 100%);
  /* center the landing card in the viewport (base body is a flex column) */
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-body .landing-card { background: rgba(16, 22, 44, 0.72); border: 1px solid #24305a; border-radius: 16px; padding: 32px; max-width: 420px; width: 100%; }
.auth-body h2 { color: #e8ebf0; margin-bottom: 16px; }
.auth-body .hint { color: #96a0b5; margin-bottom: 14px; }
.auth-body .invite-ok { color: #86efac; }
.auth-body .invite-bad { color: #fca5a5; }

.landing-body { background: radial-gradient(1200px 700px at 50% -10%, #16224a 0%, #0b1026 55%, #070b18 100%); }

.auth-form .field { margin-bottom: 14px; }
.auth-form label { display: block; font-size: 12.5px; color: #96a0b5; margin-bottom: 4px; }
.auth-form input, .auth-form textarea, .auth-form select { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid #2c3441; background: #10141f; color: #e8ebf0; font: inherit; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.form-actions .spacer { flex: 1; }

.brand-link { color: inherit; text-decoration: none; }
.who { color: var(--text-muted); font-size: 13px; padding: 0 4px; }

.flash { padding: 8px 16px; font-size: 13px; }
.flash--notice { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.flash--alert  { background: var(--danger-soft); color: var(--danger); }

.boards-page { max-width: 760px; margin: 24px auto; padding: 0 20px; }
.boards-page hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }

.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.inline-form input[type=text], .inline-form input[type=search], .inline-form input[type=email],
.inline-form input[type=password], .inline-form input[type=number], .inline-form textarea, .inline-form select {
  padding: 6px 9px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit;
}

.board-wrap[data-bg] { min-height: 40vh; padding: 16px; }
.side-panel { padding: 12px 20px 32px; display: flex; flex-direction: column; gap: 14px; }
.panel-block { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: var(--surface); }
.panel-block h3 { margin-bottom: 8px; font-size: 14px; }
.member-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.member-row:last-child { border-bottom: none; }
.member-row .name { font-weight: 600; }
.member-row .sub { color: var(--text-muted); font-size: 12px; }

.archive-row { display: flex; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px dashed var(--border); }
.archive-row span:first-child { flex: 1; }

.invite-token { font-size: 11px; background: var(--column-bg); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
.swatch { width: 34px; height: 30px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.card-placeholder { outline: 2px dashed var(--accent); border-radius: 10px; background: var(--accent-soft); opacity: 0.5; }

/* =========================================================
   Redesign: app shell (board + side panel), richer header,
   toast flash, card todos checklist, markdown, board grid.
   All colors via theme vars → dark theme parity for free.
   ========================================================= */

/* ---------- app shell: board (single column) ---------- */

.app-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.app-main--full { grid-template-columns: minmax(0, 1fr); }

.app-main .board-wrap { min-width: 0; overflow: hidden; }

/* ---------- settings modal ---------- */

.settings-modal { max-height: 88vh; }
.settings-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 4px 2px 2px;
}
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.settings-section--danger {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
  background: color-mix(in srgb, var(--danger) 6%, var(--surface));
}
.settings-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.settings-section-title {
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.settings-section-hint { margin-left: auto; font-size: 11.5px; color: var(--text-muted); }
.settings-inline-form { margin-top: 4px; }

.labels-manage-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.labels-manage-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}
.labels-manage-row .chip { flex: 1; min-width: 0; justify-content: flex-start; }

.archive-manage {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.archive-manage-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.archive-kind {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 2px 8px;
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border-radius: 4px;
}
.archive-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.archive-actions { display: inline-flex; gap: 6px; flex-shrink: 0; }

/* ---------- header ---------- */

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  text-decoration: none;
  transition: background 0.15s;
}
.brand-pill:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.brand-pill h1 { font-size: 15px; }

.theme-toggle { color: var(--text-muted); }

.who {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  color: var(--text);
}
.avatar--header { width: 26px; height: 26px; font-size: 10.5px; }

/* ---------- flash toasts ---------- */

.flash-stack {
  position: fixed;
  top: 58px;
  right: 16px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.flash-stack .flash {
  pointer-events: auto;
  min-width: 220px;
  max-width: 340px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  font-weight: 500;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.flash-stack .flash--notice {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 45%, var(--border));
  background: color-mix(in srgb, var(--success) 8%, var(--surface));
}
.flash-stack .flash--alert {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
  background: color-mix(in srgb, var(--danger) 7%, var(--surface));
}
/* Undo button next to a run flash: inline after the sentence, not a block. */
.flash-stack .flash--notice { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.flash-undo { flex: none; }

/* ---------- reduced motion (senses follow the person) ---------- */

/* Durations collapse to almost nothing instead of deleting animations:
   completion handlers (animationend) still fire, so nothing gets stuck
   mid-flight — the movement just stops chasing the eye. The OS-level
   "reduce motion" preference is honoured even without the account setting. */
[data-reduce-motion="true"] *,
[data-reduce-motion="true"] *::before,
[data-reduce-motion="true"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
.flash.is-hiding { opacity: 0; transform: translateY(-8px); }

/* ---------- cards (upgrade) ---------- */

.card { transition: box-shadow 0.15s, opacity 0.15s, transform 0.12s; }
.card:hover { transform: translateY(-1px); }

/* Interactive zones inside a draggable card: allow selecting/clicking. */
.card .no-drag,
.card .no-drag * { user-select: text; -webkit-user-select: text; }

.card-labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }

/* Shrinkable slot so the name ellipsizes instead of pushing the meta row
   past the card border. */
.assignee { flex: 0 1 auto; min-width: 0; }

/* Frames are inline by default; the checklist (and any future frame) is a block. */
turbo-frame { display: block; }

/* ---------- checklist badge on the board card (Trello-style pill) ---------- */

.card-checklist {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.card-checklist svg { flex-shrink: 0; }
.card-checklist:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.card-checklist.is-complete {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 40%, var(--border));
}
.card-checklist.is-complete:hover {
  background: color-mix(in srgb, var(--success) 12%, var(--bg));
  border-color: var(--success);
  color: var(--success);
}

/* ---------- checklist (lives inside the card modal only) ---------- */

.checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checklist-summary { display: flex; align-items: center; gap: 10px; }
.checklist-progress {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--column-bg);
  border: 1px solid var(--border);
  overflow: hidden;
}
.checklist-progress__fill {
  height: 100%;
  background: var(--success);
  border-radius: 999px;
  transition: width 0.25s ease;
}
.checklist-progress__count { font-size: 12px; font-weight: 700; color: var(--text-muted); flex-shrink: 0; }

.checklist-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 2px;
  border-radius: 8px;
  transition: background 0.12s;
}
.checklist-item:hover { background: var(--accent-soft); }
.checklist-toggle-form { margin: 0; flex: 1; min-width: 0; display: flex; }
.checklist-remove-form { margin: 0; flex-shrink: 0; display: flex; }

.checklist-toggle {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  min-width: 0;
  border: none;
  background: none;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
}

.checklist-check {
  position: relative;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface);
  flex-shrink: 0;
  transition: background 0.12s, border-color 0.12s;
}
.checklist-item.is-done .checklist-check { background: var(--success); border-color: var(--success); }
.checklist-item.is-done .checklist-check::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.checklist-title { min-width: 0; word-break: break-word; }
.checklist-item.is-done .checklist-title { text-decoration: line-through; color: var(--text-muted); }

.checklist-remove {
  align-self: center;
  border: none;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 18px;
  line-height: 1;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.12s, background 0.12s, color 0.12s;
}
.checklist-remove:hover { opacity: 1; background: var(--danger-soft); color: var(--danger); }

.checklist-empty {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
  padding: 8px 10px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.checklist-add { display: flex; gap: 6px; margin-top: 2px; }
.checklist-add input[type=text] {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
}
.checklist-add input[type=text]:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* ---------- card edit modal layout ---------- */

.card-edit-body { display: flex; flex-direction: column; gap: 4px; }
/* Card edit modal — Trello anatomy: title + description + checklist in the
   main column, dates/assignee/labels/actions in a right sidebar. The edit
   form is display:contents so its children participate in this grid while
   the checklist (with its own nested forms) stays outside it as a sibling. */
.card-edit-body--split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 272px;
  grid-template-areas:
    "main      side"
    "checklist side";
  column-gap: 26px;
  align-items: start;
}
.card-edit-form { display: contents; }

.card-edit-main { grid-area: main; display: flex; flex-direction: column; gap: 18px; }

.card-edit-title { display: flex; flex-direction: column; gap: 4px; }
.card-in { font-size: 12.5px; color: var(--text-muted); }
.card-in strong { color: var(--text); font-weight: 600; }
.card-title-input {
  font: inherit;
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 8px;
  width: 100%;
  margin-left: -8px;
  transition: border-color 0.15s, background 0.15s;
}
.card-title-input::placeholder { color: var(--text-muted); font-weight: 600; }
.card-title-input:hover { border-color: var(--border); }
.card-title-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: transparent;
  background: var(--bg);
}
.card-title-readonly { font-size: 19px; font-weight: 700; color: var(--text); }

.card-edit-side {
  grid-area: side;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-left: 1px solid var(--border);
  padding-left: 22px;
}
.side-sec { display: flex; flex-direction: column; gap: 8px; }
/* A second question inside one side section (energy under the estimate):
   separated by a rule, otherwise it just looks like more of the same list. */
.side-sec .side-sec-sub {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.side-sec-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.side-sec-title svg { color: var(--text-muted); }
.side-readonly { font-size: 13.5px; color: var(--text); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.side-hint { font-size: 11.5px; }
.card-edit-side select {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
}
.card-edit-side select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.card-edit-side .date-row { flex-direction: column; gap: 8px; }
.card-archive { width: 100%; justify-content: center; margin-top: 2px; }

@media (max-width: 860px) {
  .card-edit-body--split {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "main" "side" "checklist";
    row-gap: 18px;
  }
  .card-edit-side { border-left: none; padding-left: 0; }
}

.card-edit-checklist {
  grid-area: checklist;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.section-title svg { color: var(--text-muted); }

.readonly-value {
  font-size: 14px;
  color: var(--text);
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 38px;
  word-break: break-word;
}
.readonly-value.md { background: transparent; border: none; padding: 0; }

/* Lock scroll behind any full-viewport modal. */
body.modal-open { overflow: hidden; }

/* Card edit modal — proper Trello-like surface. */
.card-edit-modal {
  width: min(940px, 96vw);
  max-height: 88vh;
  gap: 16px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(10, 14, 20, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}
.card-edit-modal .modal-head {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}
.card-edit-modal .modal-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
}

.card-edit-main .auth-form .field { gap: 6px; }
.card-edit-main .auth-form label,
.card-edit-main .auth-form .field-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Description section — Trello-like view/edit toggle. */
.field--description { gap: 6px; }
.desc-view {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 44px;
  transition: border-color 0.15s, background 0.15s;
}
.desc-view:hover { border-color: var(--border-strong); background: var(--surface); }
.desc-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
}
.desc-edit-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  font-size: 11.5px;
  border-radius: 6px;
}

.desc-edit { display: flex; flex-direction: column; gap: 8px; }
.desc-edit textarea {
  font: inherit;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--accent);
  border-radius: 10px;
  padding: 10px 12px;
  resize: vertical;
  min-height: 140px;
  outline: none;
}
.desc-edit-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.desc-hint {
  margin-right: auto;
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Form actions row (Archive / Discard / Save). */
.card-edit-modal .form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* ---------- rendered markdown (.md) ---------- */

.md { font-size: 13px; line-height: 1.55; overflow-wrap: break-word; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3, .md h4, .md h5, .md h6 { margin: 14px 0 6px; line-height: 1.3; }
.md h1 { font-size: 18px; }
.md h2 { font-size: 16px; }
.md h3 { font-size: 14.5px; }
.md h4, .md h5, .md h6 { font-size: 13px; }
.md p { margin: 0 0 8px; }
.md ul, .md ol { margin: 0 0 8px; padding-left: 22px; }
.md li { margin: 2px 0; }
.md a { color: var(--accent); text-decoration: none; }
.md a:hover { text-decoration: underline; }
.md code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--column-bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 5px;
}
.md pre {
  margin: 0 0 10px;
  padding: 10px 12px;
  background: var(--column-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow-x: auto;
}
.md pre > code { background: none; border: none; padding: 0; font-size: 12px; }
.md blockquote {
  margin: 0 0 10px;
  padding: 2px 12px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 8px 8px 0;
  color: var(--text-muted);
}
.md table { border-collapse: collapse; margin: 0 0 10px; width: 100%; font-size: 12.5px; }
.md th, .md td { border: 1px solid var(--border); padding: 5px 9px; text-align: left; }
.md th { background: var(--column-bg); font-weight: 600; }
.md hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.md img { max-width: 100%; border-radius: 8px; }
.md del { color: var(--text-muted); }
.md kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 5px;
  background: var(--surface);
}

/* ---------- card editor dialog ---------- */

.modal-head { display: flex; align-items: center; gap: 10px; }
.modal h3 { font-size: 14.5px; }
.field-head { display: flex; align-items: center; gap: 8px; }
.field-head label, .field-head .field-label { margin: 0; }
.md-preview {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  padding: 10px 13px;
  margin-top: 4px;
  min-height: 56px;
  max-height: 320px;
  overflow-y: auto;
}

/* ---------- boards index grid ---------- */

.boards-page { flex: 1; min-height: 0; overflow-y: auto; }
.boards-head { display: flex; align-items: baseline; gap: 12px; margin-top: 6px; }
.boards-head h2 { font-size: 19px; }

.boards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin: 16px 0 26px;
}
.board-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.board-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-strong);
}
.board-card-preview { display: block; height: 64px; background: var(--column-bg); }
.board-card-preview-bg-aurora { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.board-card-preview-bg-dusk   { background: linear-gradient(135deg, #2b1055 0%, #7597de 100%); }
.board-card-preview-bg-forest { background: linear-gradient(135deg, #134e5e 0%, #71b280 100%); }
.board-card-preview-bg-sunset { background: linear-gradient(135deg, #f12711 0%, #f5af19 100%); }
.board-card-preview-bg-ocean  { background: linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%); }
.board-card-preview-bg-slate  { background: linear-gradient(160deg, #374151 0%, #6b7280 100%); }
.board-card-preview-bg-paper  { background: linear-gradient(160deg, #ede9dd 0%, #d6cbaa 100%); }
.board-card-preview-bg-mint   { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
.board-card-preview-bg-blush  { background: linear-gradient(135deg, #fbc2eb 0%, #a6c1ee 100%); }
.board-card-preview-none {
  background: repeating-linear-gradient(45deg, var(--column-bg), var(--column-bg) 8px, var(--surface) 8px, var(--surface) 16px);
}
.board-card-info { display: flex; flex-direction: column; gap: 7px; padding: 11px 13px 13px; }
.board-card .name {
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.board-card-chips { display: flex; flex-wrap: wrap; gap: 5px; }

/* auth-form's dark palette targets the landing/auth screens; inside regular
   modals it must follow the current theme instead. */
.modal .auth-form label { color: var(--text-muted); }
.modal .auth-form input,
.modal .auth-form textarea,
.modal .auth-form select {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
}

.boards-page { max-width: 980px; }

.boards-create { max-width: 460px; }
.boards-create .row { display: flex; gap: 8px; flex-wrap: wrap; }
.boards-create .row input[type=text] {
  flex: 1;
  min-width: 180px;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}
.boards-create .row input[type=text]:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* =========================================================
   Dates: due chip on cards, schedule inputs, CSS Gantt.
   Gantt geometry: JS-free. --gantt-day-w comes from GanttHelper
   (single source of truth); bars/grid use calc() on it.
   ========================================================= */

.due-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--text-muted);
}
.due-chip--soon { background: var(--warn-soft); color: var(--warn); }
/* A date that has passed is a fact, not a verdict: neutral fill, a dashed edge
   to say "this is still open", and the one-click fix sits right beside it.
   Red is reserved for things that are actually broken. */
.due-chip--needs-date {
  background: var(--column-bg);
  color: var(--text);
  border: 1px dashed var(--border-strong);
}
.due-chip-flag { font-weight: 600; opacity: 0.8; }

.date-row { display: flex; gap: 12px; flex-wrap: wrap; }
.date-cell { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 150px; }
.date-cell-label { font-size: 12px; color: var(--text-muted); }
.date-cell input[type=date] {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 9px;
}
.date-cell input[type=date]:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
/* The optional clock under the date: a notch quieter, because it is the
   exception — most cards are planned by the day, and this field says so. */
.date-cell input[type=time] {
  font: inherit;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 9px;
}
.date-cell input[type=time]:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* ---------- gantt page ---------- */

.gantt-wrap {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  gap: 12px;
}

.gantt-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.gantt-heading { font-size: 16px; font-weight: 700; }

.gantt-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.gantt-status--clash { background: var(--warn-soft); color: var(--warn); }
.gantt-status--ok { background: var(--accent-soft); color: var(--accent); }

.gantt-legend { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.gantt-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.gantt-swatch { width: 14px; height: 10px; border-radius: 4px; background: var(--accent); }
.gantt-swatch--needs-date {
  background: color-mix(in srgb, var(--text) 22%, var(--surface));
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0 3px, transparent 3px 6px);
}
.gantt-swatch--collision { outline: 2px solid var(--warn); outline-offset: 1px; }
.gantt-swatch--done { background: var(--success); }

.gantt-empty {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 40px;
}
.gantt-foot { padding: 0 2px 4px; }

/* ---------- the grid itself ---------- */

.gantt-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.gantt-inner {
  position: relative;
  width: max-content;
  min-width: 100%;
  --gantt-label-w: 240px;
}

.gantt-head {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--border-strong);
}

.gantt-corner,
.gantt-group-label,
.gantt-row-label {
  position: sticky;
  left: 0;
  z-index: 2;
  flex: 0 0 var(--gantt-label-w);
  width: var(--gantt-label-w);
  background: var(--surface);
  padding: 6px 10px;
  overflow: hidden;
}

.gantt-corner {
  display: flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-right: 1px solid var(--border);
  z-index: 3;
}

.gantt-head-days { display: flex; flex-direction: column; }
.gantt-months { display: flex; border-bottom: 1px solid var(--border); }
.gantt-month {
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text);
  border-left: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
}
.gantt-days { display: flex; }
.gantt-day {
  flex: 0 0 var(--gantt-day-w);
  width: var(--gantt-day-w);
  text-align: center;
  font-size: 10.5px;
  padding: 3px 0;
  color: var(--text-muted);
  border-left: 1px solid transparent;
}
.gantt-day.is-today { color: var(--danger); font-weight: 800; }
/* Saturday and Sunday read as weekend at a glance — neutral grey, the
   weekend is rest, not a warning. */
.gantt-day.is-weekend {
  background: color-mix(in srgb, var(--text-muted) 10%, transparent);
  border-radius: 4px;
}

.gantt-weeks {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.gantt-week-seg {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.gantt-week-seg:hover { color: var(--text); background: var(--accent-soft); }
.gantt-week-seg.is-active { background: var(--accent); color: #fff; }

.gantt-body { position: relative; }

/* Weekend columns shaded behind the rows, so a Saturday never looks like a
   workday and every bar reads the right length. One band per weekend day,
   positioned with the same --gantt-day-w arithmetic as everything else. */
.gantt-weekends {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.gantt-weekend {
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--gantt-day-w);
  background: color-mix(in srgb, var(--text-muted) 7%, transparent);
}

.gantt-today {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0;
  border-left: 2px dashed var(--danger);
  z-index: 1;
  pointer-events: none;
}
.gantt-today-flag {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--danger);
  background: var(--surface);
  padding: 0 3px;
  border-radius: 4px;
}

.gantt-group-row,
.gantt-row { display: flex; align-items: stretch; }

.gantt-group-row {
  background: var(--column-bg);
  border-top: 1px solid var(--border);
}
.gantt-group-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: var(--column-bg);
  border-right: 1px solid var(--border);
}
.gantt-group-name {
  font-size: 12.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gantt-group-name--unassigned { color: var(--text-muted); font-style: italic; }
.gantt-clash-badge {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--danger);
  background: var(--danger-soft);
  padding: 1px 7px;
  border-radius: 999px;
}
.gantt-track--group { background: var(--column-bg); }

.gantt-row { border-top: 1px solid var(--border); min-height: 38px; }
/* background-color (not the shorthand) so the day grid on the track survives */
.gantt-row:hover .gantt-row-label,
.gantt-row:hover .gantt-track { background-color: var(--accent-soft); }

.gantt-row-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  border-right: 1px solid var(--border);
}
.gantt-row-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gantt-row-title:hover { color: var(--accent); }
.gantt-row-column { font-size: 10.5px; color: var(--text-muted); }

.gantt-track {
  position: relative;
  flex: 0 0 calc(var(--gantt-days) * var(--gantt-day-w));
  width: calc(var(--gantt-days) * var(--gantt-day-w));
  background-image: repeating-linear-gradient(
    to right,
    transparent 0 calc(var(--gantt-day-w) - 1px),
    var(--border) calc(var(--gantt-day-w) - 1px) var(--gantt-day-w)
  );
  background-position: 0 0;
}

.gantt-bar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 22px;
  display: flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  text-decoration: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  box-shadow: var(--shadow-card);
  container-type: inline-size;
  container-name: ganttbar;
}
.gantt-bar-text {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* A bar too short for its title prints the title to its right instead of
   cutting the word mid-letter ("Acemagic" → "Acem…"). The container query
   asks the bar itself how wide it is — which, with --gantt-day-w dynamic,
   only CSS can answer at render time. */
@container ganttbar (max-width: 150px) {
  .gantt-bar { overflow: visible; }
  .gantt-bar-text {
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 7px;
    max-width: none;
    overflow: visible;
    color: var(--text);
  }
}
.gantt-bar:hover { filter: brightness(1.08); }
/* A passed window is drawn neutral and hatched, never orange: it reads as
   "unfinished", not as "you failed". */
.gantt-bar--needs-date {
  background-color: color-mix(in srgb, var(--text) 22%, var(--surface));
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0 5px, transparent 5px 10px);
  color: var(--text);
}
.gantt-bar--done { background: var(--success); opacity: 0.75; }
/* A collision is a scheduling fact worth flagging, so it keeps an outline —
   but not an alarm-red fill. */
.gantt-bar--collision {
  outline: 2px solid var(--warn);
  outline-offset: 2px;
}
/* Drag preview: the bar slides along the grid to where it would land, so the
   new dates are readable before the drop. --drop-delta is whole days, set by
   the gantt controller from the pointer position. */
.gantt-bar.is-dragging {
  opacity: 0.65;
  cursor: grabbing;
  transform: translateY(-50%) translateX(calc(var(--drop-delta, 0) * var(--gantt-day-w)));
}
.gantt-drag-hint { font-size: 11.5px; }

/* ---------- floating board/timeline view switch ---------- */

.view-switch {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  gap: 2px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-pop);
  z-index: 30; /* above board & flash, below modals (z-100) */
}

.view-switch-seg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.view-switch-seg:hover { color: var(--text); background: var(--accent-soft); }
.view-switch-seg.is-active {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-card);
}

/* keep the timeline's last rows clear of the floating switch */
.gantt-scroll { margin-bottom: 58px; }

/* ---------- language switch (auth pages) ---------- */

.auth-locale-switch {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  width: 100%;
  margin-bottom: 2px;
}
.auth-locale-switch a { font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, 0.7); text-decoration: none; }
.auth-locale-switch a:hover { color: #fff; }

/* ---------- inline column rename (looks like .column-title until touched) ---------- */

.column-rename { flex: 1; min-width: 0; display: flex; }
.column-rename-input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 6px;
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
}
.column-rename-input:hover { border-color: var(--border); }
.column-rename-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: transparent;
  background: var(--card-bg);
}

/* ---------- account page ---------- */

.account-page { max-width: 520px; }
.account-page .panel-block { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.account-page select {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
}
.account-page select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

/* =========================================================
   Users management, invites polish, account identity.
   ========================================================= */

/* user chip in the header opens account settings */
.who--link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.15s;
}
.who--link:hover { background: var(--accent-soft); }

.avatar--xl { width: 44px; height: 44px; font-size: 16px; }

/* users list */
.users-search { margin: 4px 0 14px; }
.users-list { display: flex; flex-direction: column; gap: 6px; }
.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.user-row-ident { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.user-row-ident .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row-ident .sub, .user-row-email { font-size: 12px; color: var(--text-muted); }
.user-row-badges { display: flex; gap: 4px; flex-shrink: 0; }
.perm-badge--danger { background: var(--danger-soft); color: var(--danger); }

.user-edit-modal .auth-form { display: flex; flex-direction: column; gap: 12px; }
.user-edit-toggles { display: flex; gap: 16px; flex-wrap: wrap; }

/* The delete button carries its own <form>, which cannot sit inside the edit
   form (see users/index.html.erb), so it gets its own separated row below it. */
.user-edit-danger {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid color-mix(in srgb, var(--danger) 30%, var(--border));
}
.user-edit-danger-hint { flex: 1; min-width: 0; font-size: 12px; color: var(--text-muted); }

/* invites */
.invite-create { margin: 10px 0 16px; }
.invite-list { display: flex; flex-direction: column; gap: 6px; }
.invite-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.invite-row-main { flex: 1; min-width: 160px; display: flex; flex-direction: column; }
.invite-row-main .name { font-weight: 600; }
.invite-row-main .sub { font-size: 12px; color: var(--text-muted); }
.invite-status {
  flex-shrink: 0;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}
.invite-status--open { background: rgba(22, 163, 74, 0.12); color: var(--success); }
.invite-status--expired { background: var(--warn-soft); color: var(--warn); }
.invite-status--used { background: var(--column-bg); color: var(--text-muted); }

/* account identity header */
.account-id { display: flex; align-items: center; gap: 14px; margin: 6px 0 16px; }
.account-id-name { font-size: 16px; font-weight: 700; }
.account-id .sub { font-size: 12.5px; color: var(--text-muted); }

/* =========================================================
   Background picker (settings) + inline todo rename.
   ========================================================= */

.bg-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 2px;
}
.bg-swatch { position: relative; display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.bg-swatch input[type=radio] { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; pointer-events: none; }
.bg-swatch-prev {
  position: relative;
  display: block;
  height: 46px;
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: border-color 0.15s, transform 0.1s;
}
.bg-swatch:hover .bg-swatch-prev { border-color: var(--border-strong); transform: translateY(-1px); }
.bg-swatch-name { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.bg-swatch:has(input:checked) .bg-swatch-prev { outline: 2px solid var(--accent); outline-offset: 2px; }
.bg-swatch:has(input:checked) .bg-swatch-name { color: var(--text); }
.bg-swatch:has(input:checked) .bg-swatch-prev::after {
  content: "✓";
  position: absolute;
  top: 4px;
  right: 8px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.bg-swatch:has(input:focus-visible) .bg-swatch-prev { outline: 2px solid var(--accent); outline-offset: 2px; }

/* inline checklist rename — looks like the plain title until touched */
.checklist-toggle-form--check { flex: 0 0 auto; }
.checklist-toggle--check { width: auto; }
.checklist-rename { flex: 1; min-width: 0; display: flex; }
.checklist-title-input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 5px 6px;
  word-break: break-word;
}
.checklist-title-input:hover { border-color: var(--border); }
.checklist-title-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-color: transparent;
  background: var(--card-bg);
}
.checklist-item.is-done .checklist-title-input { text-decoration: line-through; color: var(--text-muted); }

/* label row edit disclosure: summary is a button, the editor opens as a
   small panel under the row (JS-free, details-based) */
.label-edit { position: relative; }
.label-edit summary { list-style: none; cursor: pointer; }
.label-edit summary::-webkit-details-marker { display: none; }
.label-edit[open] .label-edit-form {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
}
.label-edit-form { display: none; }
.label-edit[open] .label-edit-form { display: flex; }
.label-edit-form input[type=text] {
  flex: 1 1 120px;
  min-width: 0;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 9px;
}
/* clamp + wrap so the popover can never outgrow the settings modal box */
.label-edit[open] .label-edit-form { max-width: min(340px, calc(100vw - 48px)); flex-wrap: wrap; }

/* =========================================================
   Compact card composer + datetime inputs.
   ========================================================= */
.card-add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 10px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  list-style: none;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.card-add-btn::-webkit-details-marker { display: none; }
.card-add-btn:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.column-footer .card-composer { margin-top: 8px; }
.date-cell input[type=datetime-local] {
  width: 100%;
  /* The picker's segments + spinners + calendar indicator have a large
     intrinsic min-width; without zeroing it the input outgrows the 272px
     sidebar and its buttons spill out of the box. */
  min-width: 0;
  max-width: 100%;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 4px;
}
.date-cell input[type=datetime-local]:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.date-cell input[type=datetime-local]::-webkit-inner-spin-button { width: 12px; margin: 0; }
.date-cell input[type=datetime-local]::-webkit-calendar-picker-indicator { padding: 0 1px; margin: 0; opacity: 0.75; }
.date-row--datetimes .date-cell { min-width: 0; }

/* =========================================================
   Header revamp: pill language, permission colors, icons.
   ========================================================= */
.app-header {
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--text) 6%, transparent);
  position: relative;
  z-index: 40;
}
/* Everything in the header speaks the app's pill language (switcher, brand,
   perm chip, user chip) — square buttons were the main mismatch. */
.app-header .btn { border-radius: 999px; padding: 7px 14px; font-size: 13px; }
.app-header .btn svg { opacity: 0.8; flex-shrink: 0; }
/* ---------- the top bar's avatar menu ---------- */

/* Everything that is not work (account, boards, settings, theme, sign-out)
   hides behind the user chip; the top bar keeps board switcher, capture,
   sound and avatar and nothing else. */
.avatar-menu { position: relative; }
.avatar-menu > summary { list-style: none; cursor: pointer; }
.avatar-menu > summary::-webkit-details-marker { display: none; }
.avatar-menu[open] .who--link { background: var(--accent-soft); }
.who-name { max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 80;
  min-width: 224px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
}
.avatar-menu-panel form { margin: 0; }
.avatar-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 9px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.avatar-menu-item:hover { background: var(--accent-soft); color: var(--accent); }
.avatar-menu-item--quiet { color: var(--text-muted); }
.avatar-menu-sep { display: block; height: 1px; margin: 4px 2px; background: var(--border); }

/* Permission chip colored by level, like the status chips on the board. */
.perm-badge--view  { background: color-mix(in srgb, var(--text-muted) 14%, transparent); color: var(--text-muted); }
.perm-badge--edit  { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.perm-badge--admin { background: var(--accent-soft); color: var(--accent); }

.btn--quiet { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn--quiet:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }

.theme-toggle { border-radius: 999px; }
.theme-toggle:hover { background: var(--accent-soft); color: var(--accent); }

/* =========================================================
   Card templates: composer chips, settings rows, modal btn.
   ========================================================= */
.composer-templates { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); }
.composer-templates-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.composer-templates-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.template-chip { max-width: 100%; }
.template-chip .template-chip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.template-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--text); }
.template-meta { font-size: 11.5px; flex-shrink: 0; }
.template-hint { display: block; margin-top: 6px; font-size: 11.5px; }
.card-save-template-form { margin: 0; }
.card-save-template { width: 100%; justify-content: center; margin-bottom: 6px; }

/* ---------- the one "⋯" menu per column ---------- */

/* Everything that is not the column's identity — limit, rule, templates,
   pipelines, folding, archiving — hides behind a single button. The old
   header showed all of it at once and the title lost. */
.column-menu { position: relative; flex-shrink: 0; }
.column-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  transition: background 0.12s, color 0.12s;
}
.column-menu-btn::-webkit-details-marker { display: none; }
.column-menu-btn:hover, .column-menu[open] .column-menu-btn {
  background: var(--accent-soft);
  color: var(--accent);
}
.column-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 2px);
  z-index: 30;
  width: 240px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
}
.column-menu-panel form { margin: 0; }
.column-menu-title {
  font-size: 12.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 2px 2px;
}
.column-menu-section {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 2px;
}
.column-menu-sep { display: block; height: 1px; margin: 4px 2px; background: var(--border); }

.column-tpl-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 9px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.column-tpl-item:hover { background: var(--accent-soft); color: var(--accent); }
.column-tpl-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.column-tpl-meta {
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--text) 8%, transparent);
  border-radius: 999px;
  padding: 1px 7px;
}

/* forms referenced via form= attributes; participate in submission, not layout */
.hidden-form { display: none; }

/* =========================================================
   Keeping the board safe to open: neutral "needs a new date"
   controls, the Now view, focus mode, WIP limits, folded
   columns. Colour rule for all of it: danger-red only for
   things that are actually broken.
   ========================================================= */

/* ---------- header counters ---------- */

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.stat-chip--done {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 35%, var(--border));
  background: color-mix(in srgb, var(--success) 8%, var(--card-bg));
}
.stat-chip--needs-date {
  border-style: dashed;
  border-color: var(--border-strong);
  color: var(--text);
  cursor: pointer;
  list-style: none;
}
.stat-chip--needs-date::-webkit-details-marker { display: none; }

/* details/summary dropdown for the bulk reschedule (same idiom as the board
   switcher: no JS, Turbo navigation closes it) */
.needs-dates-menu { position: relative; }
.needs-dates-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 60;
  width: 250px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
}
.needs-dates-hint { font-size: 12px; color: var(--text-muted); line-height: 1.45; }

/* A bounced drag is explained in place, calmly. */
.wip-banner {
  padding: 7px 20px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
}

/* ---------- one-click reschedule on the card ---------- */

.reschedule { display: inline-flex; align-items: center; gap: 4px; }
.btn.tiny { padding: 3px 8px; font-size: 11.5px; border-radius: 6px; }
.reschedule-pick { position: relative; }
.reschedule-pick > summary { list-style: none; }
.reschedule-pick > summary::-webkit-details-marker { display: none; }
.reschedule-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
}
.reschedule-date-form { display: flex; align-items: center; gap: 6px; }
.reschedule-date-form input[type=date] {
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 6px;
}

/* ---------- finishing has a visible result ---------- */

.checklist-summary.is-complete .checklist-progress__count { color: var(--success); }
.checklist-summary.is-complete .checklist-progress__fill {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--success) 45%, transparent);
}
/* One short nod when the last box is ticked. Not a fireworks show, and it is
   silenced entirely for anyone who asked for less motion. */
@keyframes checklist-complete-nod {
  0% { transform: scale(0.985); }
  45% { transform: scale(1.015); }
  100% { transform: scale(1); }
}
.checklist-summary.is-complete { animation: checklist-complete-nod 0.45s ease; }
@media (prefers-reduced-motion: reduce) {
  .checklist-summary.is-complete { animation: none; }
  /* The timer dot still shows its state by colour; the breathing is the
     part that moves, so only that goes away. */
  .timer-dot.is-running { animation: none; }
  .card.pulse-done, .checklist-item.pulse-check { animation: none; }
}
.checklist-complete {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--success) 35%, var(--border));
  background: color-mix(in srgb, var(--success) 8%, var(--surface));
  border-radius: 10px;
}
.checklist-complete-msg { font-size: 13px; font-weight: 600; color: var(--success); }

/* ---------- folded columns and WIP limits ---------- */

.column-collapsed-summary { padding: 0 12px 12px; font-size: 12px; }
.column-collapsed-note { font-size: 11.5px; white-space: nowrap; }

/* WIP badge: pure report ("1/2"), the editing lives in the "⋯" menu. */
.column-wip-badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 2px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
}
/* Capacity reached — an amber "full", not a red "wrong". */
.column-wip-badge.is-full {
  background: var(--warn-soft);
  border-color: var(--warn);
  color: var(--warn);
}

/* The limit + rule form lives inside the "⋯" menu — the menu panel is its
   surface, so the form itself only stacks its fields. */
.column-wip-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.column-wip-form input[type=number] {
  width: 62px;
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 6px;
}
.column-wip-form input[type=text] {
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 6px;
}
.column-wip-form input[type=submit] { align-self: flex-start; }
.column-wip-full { padding: 0 12px 8px; font-size: 11.5px; line-height: 1.45; }

/* ---------- the Now view ---------- */

.now-wrap {
  min-height: 0;
  overflow-y: auto;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 22px 24px 72px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.now-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.now-heading { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: 0.01em; }
.now-board { font-size: 13px; color: var(--text-muted); }

.now-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.now-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}
/* The first one is the next action, so it is the one thing on the page that
   asks for attention. */
.now-card--lead {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-card);
}
.now-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.now-card-column {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.now-card-title { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.25; }
.now-card-title a { color: inherit; text-decoration: none; }
.now-card-title a:hover { color: var(--accent); }
.now-card-step { display: flex; flex-direction: column; gap: 2px; margin: 0; }
.now-card-step-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}
.now-card-step-text { font-size: 19px; font-weight: 600; line-height: 1.3; }
.now-card--lead .now-card-step-text { font-size: 24px; }
.now-card-step--plain .now-card-step-text { font-weight: 400; color: var(--text-muted); }
.now-card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.now-foot { margin: 2px 0 0; }

.now-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 48px 20px;
  text-align: center;
}
.now-empty-title { margin: 0; font-size: 22px; font-weight: 700; }
.now-empty-actions { display: flex; gap: 8px; margin-top: 10px; }

/* ---------- focus mode ---------- */

.focus-wrap {
  min-height: 0;
  overflow-y: auto;
  width: 100%;
  max-width: 740px;
  margin: 0 auto;
  padding: 18px 22px 60px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.focus-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.focus-title { margin: 0; font-size: 27px; font-weight: 800; line-height: 1.2; }
.focus-step-label {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.focus-step { margin: -6px 0 0; font-size: 33px; font-weight: 700; line-height: 1.25; color: var(--accent); }
.focus-step--plain { font-size: 19px; font-weight: 500; color: var(--text-muted); }
.focus-desc {
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.focus-timer {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
/* The readout (ring, or numbers when there is no estimate) and the controls in
   one group: the buttons belong to the numbers, so their alignment has to be
   computed against them and not against the tallest thing in the panel. The
   ring is 78px and the metrics about half that; centred against the ring the
   buttons landed wherever the estimate happened to leave them. */
.focus-timer-body {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  flex: 1;
  min-width: min(100%, 250px);
}
.focus-timer-display {
  font-size: 30px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
/* Right edge of the panel, the edge .focus-over's buttons and the note's save
   button already use — one vertical line for the controls of the three panels
   down the page instead of one that moves with the content. Both buttons are
   the same height: Start is the filled one and Reset is the outline, and that
   is the whole hierarchy. A smaller Reset next to a full-height Start read as
   a different kind of thing rather than a less important one. */
.focus-timer-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.focus-timer-actions .btn { min-height: 40px; }
/* The armed reset: same button, unmistakably in its second-press state, so
   the question "did I just arm it or do it?" cannot even be asked. */
.focus-timer-actions .btn.is-armed {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* Two labelled values, not one ambiguous number: the big display counts the
   current session, the smaller one everything logged on the card before and
   during it. */
.focus-timer-metrics {
  display: flex;
  align-items: flex-end;
  gap: 22px;
  flex-wrap: wrap;
}
.focus-timer-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 88px;
}
.focus-timer-metric-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.focus-timer-value {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

/* The running state at a glance: a dot that breathes while the clock ticks
   and sits still when it does not — readable from across the room without
   watching digits change. */
.timer-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.35;
}
.timer-dot.is-running {
  opacity: 1;
  background: var(--accent);
  animation: timer-pulse 1.4s ease-out infinite;
}
@keyframes timer-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
  70% { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* The first-step prompt: a card without a checklist asks for the next
   two-minute action instead of stating that it has no checklist.
   The form fills its parent's width but must never grow into it: both places it
   is used (the Now card, the focus screen) stack their children in a flex
   column, and there `flex: 1` means "take the leftover height" — which turns one
   line of typing into a box the height of the screen. */
.first-step-form { display: flex; width: 100%; min-width: 0; }
.first-step-input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  padding: 7px 10px;
}
.first-step-input::placeholder { color: var(--text-muted); }
.first-step-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  border-style: solid;
}
/* On the focus screen this line is the step — the thing it replaces is large
   type, so the field is sized like it too. A 15px input under a 33px step reads
   as a footnote on a screen whose whole job is one next action. */
.focus-wrap .first-step-form { margin-top: -6px; }
.focus-wrap .first-step-input { font-size: 24px; line-height: 1.25; padding: 10px 12px; }
.focus-checklist {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

/* Starting the board's plan from this card: the words say what appears, the
   button sits on the same right edge as the timer's controls and the note's. */
.focus-plan {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.focus-plan-text { flex: 1; min-width: 220px; }
.focus-plan-title { font-size: 15px; font-weight: 700; }
.focus-plan-hint { margin: 3px 0 0; }

/* ============================================================================
   lower the cost of starting
   ========================================================================== */

/* Click anywhere on a card opens it: the title's link stretches over the
   whole card via an ::after overlay, so there is no "Edit" button hunting
   for. Interactive bits in the meta row are lifted above the overlay; the
   overlay itself stays draggable-with-the-card (the dnd controller decides
   per press), so a press without movement is the click that opens. */
.card-title-link {
  color: inherit;
  text-decoration: none;
}
.card-title-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: inherit;
}
.card .no-drag { position: relative; z-index: 2; }

/* The next checklist step, stated on the card face: the title is a noun,
   this is the verb. */
.card-step {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
  word-break: break-word;
}
.card-step-label {
  font-weight: 600;
  color: var(--accent);
  margin-right: 6px;
}

/* "Done looks like …" — the finish line in the card's own words. Muted and
   one line: it informs, it does not nag. */
.card-done-like {
  margin: 5px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  word-break: break-word;
}
.card-done-like-label {
  font-style: italic;
  margin-right: 5px;
}
.card-done-like-label::after { content: "→"; margin-left: 5px; }

/* The column rule under the header: the board explains itself. */
.column-rule {
  margin: 0;
  padding: 0 2px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-muted);
  user-select: none;
}

/* The finish line, kept on screen in focus mode. */
.focus-done-like {
  margin: -10px 0 0;
  font-size: 15px;
  color: var(--text-muted);
}
.focus-done-like-label { font-style: italic; margin-right: 6px; }
.focus-done-like-label::after { content: "→"; margin-left: 6px; }

/* ---------- phase 8: time you can see ---------- */

/* The estimate as a shape. "23 minutes left" needs reading and subtraction;
   an emptying ring needs neither, and it is legible from the other side of the
   room. The circle carries pathLength=100, so the dash maths below is in plain
   percent and JS only ever sets a 0..1 progress. */
.focus-ring {
  position: relative;
  width: 78px;
  height: 78px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.focus-ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg); /* start the sweep at twelve o'clock */
}
.focus-ring circle { fill: none; stroke-width: 6; }
.focus-ring-track { stroke: var(--border); }
.focus-ring-fill {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100 * (1 - var(--ring-progress, 0)));
  transition: stroke-dashoffset 0.4s linear;
}
.focus-ring-label {
  position: relative;
  padding: 0 5px;
  font-size: 11.5px;
  font-weight: 700;
  text-align: center;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
/* Past the estimate the ring fills, thickens and goes quiet in colour. The
   words below say what happened; the shape never turns into an alarm. */
.focus-ring.is-over .focus-ring-fill { stroke: var(--border-strong); stroke-width: 9; }
.focus-ring.is-over .focus-ring-label { color: var(--text); }

/* Running over is answered with two doors, both ordinary buttons: move the
   plan, or stop on purpose. Nothing here is red and nothing is dimmed. */
.focus-over {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.focus-over .spacer { flex: 1; }
.focus-over-hint { font-size: 13px; color: var(--text-muted); }

/* The hyperfocus check-in: a question at an interval this person chose, inside
   the panel they are already looking at. Soft edges on purpose — it interrupts
   the drift, not the person. */
.focus-checkin {
  width: 100%;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--column-bg);
  animation: checkin-in 0.25s ease-out;
}
@keyframes checkin-in {
  from { opacity: 0; transform: translateY(4px); }
}
.focus-checkin-title { margin: 0; font-size: 16px; font-weight: 700; }
.focus-checkin-body { margin: 4px 0 10px; font-size: 14px; color: var(--text-muted); }
.focus-checkin-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Standing up on purpose. One sentence here buys the next visit its time back,
   which is the whole point of asking as part of leaving. */
.focus-stop {
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.focus-stop-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.focus-stop-title { font-size: 15px; font-weight: 700; }
.focus-stop-input { width: 100%; resize: vertical; font: inherit; }
.focus-stop-actions { display: flex; justify-content: flex-end; margin-top: 8px; }

/* The sentence from the way out, wherever a card gets picked up again. */
.card-stopped {
  padding: 10px 13px;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--accent-soft);
}
.card-stopped-label { font-style: italic; font-size: 13px; color: var(--text-muted); }
.card-stopped-label::after { content: "→"; margin-left: 6px; }
.card-stopped-text { margin: 2px 0 0; font-size: 15px; font-weight: 600; white-space: pre-line; }
.card-stopped-when { font-size: 11px; color: var(--text-muted); }
.card-stopped-hint { margin: 6px 0 0; }
/* The same sentence as one line on a card face and on the Jetzt shortlist. */
.card-stopped-line,
.now-card-stopped {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}
.now-card-stopped .card-stopped-label { font-size: 11px; }
.now-card-stopped-text { font-weight: 600; color: var(--text); }

/* Estimates as five sizes instead of a number to invent. */
.estimate-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.estimate-chip {
  padding: 4px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.estimate-chip:hover { border-color: var(--accent); color: var(--accent); }
.estimate-chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.estimate-chip--suggest { border-style: dashed; }
.estimate-suggestion { margin-top: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Quick capture in the header: a tangent costs one keystroke ("n", see
   capture_controller.js) and one line of typing. */
.capture-menu { position: relative; }
.capture-summary { display: inline-flex; align-items: center; gap: 6px; }
.capture-kbd {
  font: inherit;
  font-size: 10.5px;
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
}
.capture-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 60;
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-pop);
}
.capture-form { display: flex; align-items: center; gap: 6px; }
.capture-input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 9px;
}
.capture-hint { font-size: 11.5px; line-height: 1.45; }

/* ============================================================================
   pipelines and time estimates
   ========================================================================== */

/* Pipeline entries in the column template menu: same shape as a template
   chip, separated from it, the badge counts cards (not todos). */
.column-tpl-item--pipeline .column-tpl-name { font-style: italic; }

/* Pipelines editor in board settings: template rows with a day offset each. */
.pipeline-form { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.pipeline-steps { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.pipeline-steps legend { padding: 0 4px; }
.pipeline-step-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}
.pipeline-step-name { flex: 1; min-width: 0; font-size: 13px; }
.pipeline-step-offset { display: flex; align-items: center; gap: 6px; }
.pipeline-step-offset input[type=number] {
  width: 56px;
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 6px;
}

/* Estimate against actual on finished cards — an observation, so muted. */
.card-time-note {
  margin: 6px 0 0;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* A week holding more estimated hours than it has. Neutral by design: this
   is a number to look at, not a failure to feel. */
.gantt-status--load {
  background: var(--warn-soft);
  color: var(--warn);
  font-weight: 600;
}

/* ============================================================================
   energy and novelty
   ========================================================================== */

/* The Now view's answer to a bad day: filter to what asks for little, or
   let the board choose. Chips, not tabs — they filter, they do not navigate
   anywhere the page was not already. */
.now-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
}
.filter-chip {
  font-size: 12.5px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  text-decoration: none;
}
.filter-chip:hover { color: var(--text); }
/* The "Nur Arbeit" chip is a button that writes a preference, not a link:
   the wrapper form has to disappear into the flex row, and the button has
   to wear the chip's typography instead of the browser default. */
form.work-only-form { display: inline-flex; }
button.filter-chip { font: inherit; cursor: pointer; background: transparent; }
.filter-chip.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.now-pick { margin-left: auto; }

/* ============================================================================
   Draggable checklist items + reward feedback
   ========================================================================== */

/* The grip is the only drag handle in a checklist row — the row itself holds
   a rename input, so grabbing the row would break text selection (see
   todosort_controller.js for the per-press arming). */
.checklist-grip {
  display: flex;
  align-items: center;
  align-self: center;
  padding: 4px 2px;
  color: var(--text-muted);
  opacity: 0.45;
  cursor: grab;
  flex-shrink: 0;
}
.checklist-item:hover .checklist-grip { opacity: 1; }
.checklist-grip:active { cursor: grabbing; }
.checklist-item.dragging { opacity: 0.35; }
.checklist-placeholder {
  list-style: none;
  border: 1.5px dashed var(--accent);
  border-radius: 8px;
  background: var(--accent-soft);
}

/* The green pulse: the sound says "that worked", the pulse says where. Once
   per success, expanding ring plus a brief tint of --success — positive
   only, never a red mirror. */
@keyframes reward-pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 50%, transparent);
    background-color: color-mix(in srgb, var(--success) 16%, transparent);
  }
  100% {
    box-shadow: 0 0 0 16px transparent;
    background-color: transparent;
  }
}
.card.pulse-done,
.checklist-item.pulse-check { animation: reward-pulse 0.8s ease-out; }

/* Sound toggle: same icon-swap idiom as the theme button, but the state is
   the button's own (is-off), not the page's. */
.sound-toggle { border-radius: 999px; color: var(--text-muted); }
.sound-toggle:hover { background: var(--accent-soft); color: var(--accent); }
.sound-toggle.is-off .icon-sound-on { display: none; }
.sound-toggle:not(.is-off) .icon-sound-off { display: none; }

/* ---------- waiting on people (who is waiting for me?) ---------- */

/* Nothing in this block is red. A wait is nobody's fault, and the age of a wait
   is information about the wait, not a verdict about the person sitting on it. */

/* The state on the card face: whose turn it is, without opening the card. */
.card-waiting-line {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.card-waiting-label { font-style: italic; }
.card-waiting-label::after { content: "→"; margin-left: 6px; }
.card-waiting-name { font-weight: 700; color: var(--text); }
.card-waiting-age { font-size: 11px; }
.card-waiting-note-line {
  margin: 2px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: pre-line;
}

/* The full readout, where a card is looked at (focus mode, a read-only modal). */
.card-waiting {
  padding: 10px 13px;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--accent-soft);
}
.card-waiting-head {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 14px;
}
.card-waiting-label { color: var(--text-muted); }
.card-waiting .card-waiting-name { font-size: 15px; }
.card-waiting .card-waiting-age { font-size: 12px; }
.card-waiting-note { margin: 4px 0 0; font-size: 15px; font-weight: 600; white-space: pre-line; }
.card-waiting-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

/* The modal's ask: a select plus the one line that makes it actionable. */
.waiting-note { width: 100%; resize: vertical; font: inherit; margin-top: 6px; }

/* Jetzt: the band above my own cards. A card I unblock is usually the shortest
   thing on the screen and the one that stops somebody else waiting. */
.now-waiting {
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.now-waiting-heading { margin: 0 0 8px; font-size: 16px; font-weight: 800; }
.now-waiting-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.now-waiting-item {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--column-bg);
}
.now-waiting-head {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-muted);
}
.now-waiting-head .spacer { flex: 1; }
.now-waiting-asker { font-weight: 600; }
.now-waiting-age { font-size: 11px; }
.now-waiting-title { margin: 4px 0 0; font-size: 17px; font-weight: 700; }
.now-waiting-title a { color: inherit; text-decoration: none; }
.now-waiting-title a:hover { text-decoration: underline; }
.now-waiting-note {
  margin: 3px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: pre-line;
}
.now-waiting-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

/* My own work that is parked elsewhere — off the shortlist, not gone. */
.now-parked { margin: 14px 0 0; }
.now-parked-item { font-weight: 600; color: var(--text); }

/* The board a card lives on, named on every row of a cross-board list.
   Neutral accent — where a card lives says nothing about its urgency. */
.now-card-board {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- my timeline (the person's Zeitplan, across boards) ---------- */

.tl-wrap { max-width: 760px; margin: 24px auto; padding: 0 20px; }
.tl-head { display: flex; align-items: center; gap: 10px; }
.tl-heading { margin: 0; font-size: 22px; font-weight: 800; }
.tl-day { margin: 18px 0 0; }
.tl-day-heading { margin: 0 0 8px; font-size: 15px; font-weight: 800; color: var(--text); }
.tl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tl-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.tl-when { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.tl-title { margin: 0; font-size: 16px; font-weight: 700; }
.tl-title a { color: inherit; text-decoration: none; }
.tl-title a:hover { text-decoration: underline; }
.tl-column { font-size: 12px; color: var(--text-muted); }
.tl-waiting { font-size: 12px; font-style: italic; color: var(--text-muted); }
.tl-foot { margin-top: 16px; }

/* ---------- weekly review (five minutes, one page) ---------- */

/* The review reuses the timeline's rows on purpose: the same card line in a
   different question should not look like a different kind of thing. */
.rv-wrap { max-width: 760px; margin: 24px auto; padding: 0 20px; }
.rv-section { margin: 22px 0 0; padding: 0 0 4px; border-top: 1px solid var(--border); }
.rv-count { margin: 8px 0 0; font-size: 15px; font-weight: 700; }
.rv-foot { margin-top: 24px; }

/* A week away, stated neutrally: neutral surface, no red, no badge. */
.now-welcome {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 14px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.now-welcome-text { margin: 0; font-size: 14px; }

/* Unread count on the avatar menu's inbox entry. */
.menu-badge {
  margin-left: auto;
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

/* ---------- the inbox ---------- */

.inbox-wrap {
  min-height: 0;
  overflow-y: auto;
  width: 100%;
  max-width: 740px;
  margin: 0 auto;
  padding: 18px 22px 60px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.inbox-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* The shared .now-empty centres itself in whatever space is left — fine on
   a board, wrong here: the inbox is a short column, and a message centred
   in the rest of the page reads like it belongs to the bottom of it.
   Straight under the title is where an "nothing happened" answer belongs. */
.inbox-wrap .now-empty {
  flex: 0 0 auto;
  justify-content: flex-start;
  padding: 12px 0 0;
}
.inbox-heading { margin: 0; font-size: 26px; font-weight: 800; }
.inbox-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.inbox-item {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
/* The lines that were unread when the page was opened stay marked — clearing a
   badge should not erase what was new. */
.inbox-item.is-unread { border-left: 3px solid var(--accent); }
.inbox-item-head {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
}
.inbox-item-head .spacer { flex: 1; }
.inbox-item-actor { font-size: 14px; color: var(--text); }
.inbox-item-when { font-size: 11.5px; }
.inbox-item-card { margin: 6px 0 0; font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inbox-item-card a { color: inherit; text-decoration: none; }
.inbox-item-card a:hover { text-decoration: underline; }
.inbox-item-note { margin: 3px 0 0; font-size: 14px; color: var(--text); white-space: pre-line; }
.inbox-item-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
