/* ==================================================================================================
   Feature styles: projects — owner: projects agent. Tokens only (var(--…)); scoped under page /
   component root classes.

   Project header       .topbar--project (container queries: the title keeps priority)
   Components           .task-card (stretched link, menu, drag, enter) · .task-row (editable cells,
                        selection) — both used across the app
   Index                .projects-index, .projects-toolbar, .project-grid/.project-card, .project-table
   New project modal    .project-create, .template-picker/.template-card, .visibility-picker
   Filters              .task-toolbar, .toggle-chip, .person-toggle, .filter-button, .filter-panel,
                        .filter-option, .filter-summary
   Board                .page--board, .board-root, .board, .board-column, .quick-add, .card-menu
   List                 .list-root, .list-view, .list-head, .list-section, .bulk-bar, .row-editor
   Overview             .overview, .overview-hero, .overview-card, .update-composer, .status-update,
                        .distribution, .deadline-list, .member-list
   Settings             .project-settings, .danger-zone, .workflow, .project-members
   ================================================================================================== */

/* -- Project header ------------------------------------------------------------------------------ */
.topbar--project .topbar__row {
  container: project-topbar / inline-size;
}
.topbar--project .topbar__titles {
  flex: 0 1 auto;
}
.topbar--project .breadcrumbs {
  flex-shrink: 6;
}
.topbar--project .topbar__title {
  flex-shrink: 1;
  min-width: 6ch;
}
.project-ident__meta {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
}
.project-ident__key {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.project-ident__archived {
  gap: 4px;
}
.project-status {
  display: inline-flex;
  align-items: center;
}
.project-status__button {
  gap: 4px;
  border: 0;
  cursor: pointer;
  transition:
    filter var(--dur-1) ease,
    transform var(--dur-1) ease;
}
.project-status__button:hover {
  filter: brightness(0.97) saturate(1.1);
}
.project-status__button:active {
  transform: scale(0.97);
}
.project-status__button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.project-status__chevron {
  margin-left: 1px;
  opacity: 0.7;
}
.project-members {
  display: inline-flex;
  align-items: center;
  height: var(--control-h);
  padding: 0 4px;
  border: 0;
  border-radius: var(--radius-full);
  background: none;
  color: var(--text-2);
  cursor: pointer;
  transition: background-color var(--dur-1) ease;
}
.project-members:hover {
  background: var(--fill-1);
}
.project-members:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.project-members__empty {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
}
/* Settings tab sits at the far end of the view tabs. */
.view-tabs > .view-tab:has(use[href$="#settings"]) {
  margin-left: auto;
}

/* The search field collapses to an icon on project pages until there is room (title first). */
@media (max-width: 1439px) {
  .topbar--project .search-trigger {
    width: var(--control-h);
    padding: 0;
    justify-content: center;
    background: transparent;
    color: var(--text-2);
  }
  .topbar--project .search-trigger:hover {
    background: var(--fill-1);
  }
  .topbar--project .search-trigger__label,
  .topbar--project .search-trigger .kbd {
    display: none;
  }
}
@media (min-width: 768px) {
  @container project-topbar (max-width: 1080px) {
    .topbar--project .breadcrumbs {
      display: none;
    }
  }
  @container project-topbar (max-width: 940px) {
    .project-ident__key,
    .topbar--project .topbar__new .btn__label {
      display: none;
    }
  }
  @container project-topbar (max-width: 840px) {
    .project-members {
      display: none;
    }
  }
}
@media (max-width: 767px) {
  .project-members,
  .project-ident__key,
  .project-ident__archived {
    display: none;
  }
}
@media (min-width: 841px) {
  .project-menu__members {
    display: none;
  }
}

.project-page {
  min-width: 0;
}
.project-archived {
  margin-bottom: var(--space-4);
}
.project-archived .btn {
  align-self: center;
  margin-left: auto;
}

/* -- Task card (components/task_card.html) ------------------------------------------------------- */
.task-card {
  -webkit-user-select: none;
  user-select: none;
}
.task-card__link {
  color: inherit;
  outline: none;
}
.task-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
}
.task-card:has(.task-card__link:focus-visible) {
  box-shadow:
    0 0 0 2px var(--accent),
    0 0 0 5px var(--focus-ring);
}
.task-card.has-menu > :first-child {
  margin-right: 22px;
}
.task-card__menu {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow:
    0 0 0 1px var(--card-ring),
    var(--shadow-xs);
  color: var(--text-2);
  cursor: pointer;
  opacity: 0;
  transform: scale(0.9);
  transition:
    opacity var(--dur-1) ease,
    transform var(--dur-1) var(--ease-out),
    background-color var(--dur-1) ease;
}
.task-card__menu:hover {
  background: var(--surface-2);
  color: var(--text);
}
.task-card__menu:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
@media (hover: hover) {
  .task-card:hover .task-card__menu {
    opacity: 1;
    transform: none;
  }
}
.task-card:focus-within .task-card__menu,
.task-card__menu[aria-expanded="true"] {
  opacity: 1;
  transform: none;
}
@media (hover: none) {
  .task-card__menu {
    display: none;
  }
  .task-card.has-menu > :first-child {
    margin-right: 0;
  }
}
.task-card.is-saving {
  opacity: 0.75;
}
@media (prefers-reduced-motion: no-preference) {
  .task-card.is-new {
    animation: projects-card-in var(--dur-3) var(--ease-spring) both;
  }
  .task-card.is-landed {
    animation: projects-card-land 520ms var(--ease-out);
  }
}
@keyframes projects-card-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
}
@keyframes projects-card-land {
  0% {
    box-shadow:
      0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent),
      var(--shadow-md);
  }
}

/* Drag & drop (SortableJS fallback mode: the lifted clone lives in <body>) */
.task-card.sortable-fallback,
.task-row.sortable-fallback {
  transform: none;
  rotate: 2.2deg;
  scale: 1.035;
  transition: none !important;
  cursor: grabbing;
  will-change: transform;
}
.task-row.sortable-fallback {
  rotate: 0.6deg;
  scale: 1.01;
  border-radius: 12px;
  box-shadow:
    0 0 0 1px var(--card-ring),
    var(--shadow-lg) !important;
}
@media (prefers-reduced-motion: no-preference) {
  .task-card.sortable-fallback {
    animation: projects-lift 180ms var(--ease-out);
  }
}
@keyframes projects-lift {
  from {
    rotate: 0deg;
    scale: 1;
  }
}
.task-card.sortable-ghost {
  border-radius: 12px;
}
html.is-dragging-card,
html.is-dragging-card * {
  cursor: grabbing !important;
  -webkit-user-select: none;
  user-select: none;
}

/* -- Task row (components/task_row.html) --------------------------------------------------------- */
.task-row__edit {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  min-height: 28px;
  padding: 2px 4px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: background-color var(--dur-1) ease;
}
.task-row__edit:hover {
  background: var(--fill-1);
}
.task-row__edit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.task-row__edit[aria-expanded="true"] {
  background: var(--fill-2);
}
.task-row__ghost {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  color: var(--text-3);
  opacity: 0;
  transition: opacity var(--dur-1) ease;
}
.task-row:hover .task-row__ghost,
.task-row:focus-within .task-row__ghost,
.task-row__edit[aria-expanded="true"] .task-row__ghost {
  opacity: 1;
}
@media (hover: none) {
  .task-row__ghost {
    opacity: 0.7;
  }
}
.task-row__labels.task-row__edit {
  gap: 4px;
  padding-inline: 2px;
}
.task-row__cell {
  display: inline-flex;
  align-items: center;
}
.task-row.is-saving {
  opacity: 0.7;
}
.task-row__select {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  opacity: 0;
  transition: opacity var(--dur-1) ease;
}
.task-row__select input {
  margin: 0;
}
.task-row:hover .task-row__select,
.task-row:focus-within .task-row__select,
.task-row.is-selected .task-row__select,
.has-selection .task-row__select {
  opacity: 1;
}
.task-row.is-selected {
  background: var(--accent-softer);
}
@media (prefers-reduced-motion: no-preference) {
  .task-row.is-new {
    animation: projects-row-in var(--dur-3) var(--ease-out) both;
  }
}
@keyframes projects-row-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
    background: var(--accent-softer);
  }
}
@media (max-width: 767px) {
  .task-row__cell--assignee {
    margin-left: auto;
  }
  .task-row__cell--priority:empty,
  .task-row__cell--due:empty {
    display: none;
  }
}

/* -- Shared bits --------------------------------------------------------------------------------- */
.toggle-chip {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  height: var(--control-h-sm);
  padding: 0 12px;
  border-radius: var(--radius-full);
  background: var(--fill-1);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  white-space: nowrap;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition:
    background-color var(--dur-1) ease,
    color var(--dur-1) ease;
}
.toggle-chip:hover {
  background: var(--fill-2);
}
.toggle-chip > input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.toggle-chip:has(> input:checked) {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.toggle-chip:has(> input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.toggle-chip__count {
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.filter-button {
  flex-shrink: 0;
  gap: 6px;
}
.filter-button .counter {
  margin-left: 2px;
}
.filter-button.is-active {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.filter-panel {
  min-width: 240px;
  padding: 8px;
}
.filter-panel--wide {
  width: min(720px, calc(100vw - 16px));
  max-width: min(720px, calc(100vw - 16px));
}
.filter-panel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 4px 12px;
}
.filter-panel__section {
  min-width: 0;
}
.filter-panel__title {
  padding: 8px 8px 4px;
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}
.filter-panel__list {
  display: flex;
  flex-direction: column;
  max-height: 248px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.filter-panel__empty {
  padding: 4px 8px 8px;
  color: var(--text-3);
  font-size: var(--fs-sm);
}
.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 32px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: background-color var(--dur-1) ease;
}
.filter-option:hover {
  background: var(--fill-1);
}
.filter-option > input {
  margin: 0;
}
.filter-option__text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filter-option__count {
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
}

/* -- Projects index ------------------------------------------------------------------------------ */
.projects-index__header {
  margin-bottom: var(--space-5);
}
.projects-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.projects-toolbar__search {
  flex: 1 1 200px;
  max-width: 300px;
}
.projects-toolbar__menus {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.projects-toolbar__view .segmented__item {
  min-width: 36px;
}
.projects-toolbar .menu__item > input {
  position: absolute;
}
@media (max-width: 639px) {
  .projects-toolbar__search {
    flex-basis: 100%;
    max-width: none;
  }
  .projects-toolbar__scope {
    order: 1;
  }
}
.project-results__count {
  margin-bottom: var(--space-3);
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.project-results__count .link {
  color: var(--accent-ink);
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: var(--space-4);
}
.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 18px 18px 16px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 70% at 0% 0%, var(--tone-softer), transparent 60%),
    var(--surface);
  box-shadow:
    0 0 0 1px var(--card-ring),
    var(--shadow-sm);
  transition:
    transform var(--dur-3) var(--ease-out),
    box-shadow var(--dur-3) var(--ease-out);
}
@media (hover: hover) {
  .project-card:hover {
    transform: translateY(-2px);
    box-shadow:
      0 0 0 1px var(--card-ring),
      var(--shadow-md);
  }
}
.project-card:active {
  transform: scale(0.995);
}
.project-card:has(.project-card__link:focus-visible) {
  box-shadow:
    0 0 0 2px var(--accent),
    0 0 0 5px var(--focus-ring);
}
.project-card__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}
.project-card__titles {
  flex: 1;
  min-width: 0;
}
.project-card__name {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.project-card__link {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  outline: none;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.project-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
}
.project-card__sub {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-top: 2px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  white-space: nowrap;
}
.project-card__team {
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-card__dot {
  color: var(--text-3);
}
.project-card__star,
.project-card__people,
.project-card .due {
  position: relative;
  z-index: 1;
}
.project-card__star {
  margin: -6px -8px 0 0;
}
.project-card__desc {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.project-card__progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
}
.project-card__pct {
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
}
.project-card__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  min-height: 24px;
}
.project-card__overdue,
.project-card__overdue .icon {
  color: var(--c-red-ink);
}
.project-card__people {
  margin-left: auto;
}

.project-table {
  --cols: minmax(0, 2.4fr) minmax(0, 1.1fr) 108px minmax(120px, 1fr) minmax(0, 1.2fr) 96px 40px;
}
.project-table__head,
.project-table__row {
  display: grid;
  grid-template-columns: var(--cols);
  align-items: center;
  gap: 12px;
  padding: 0 12px 0 16px;
}
.project-table__head {
  min-height: 36px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}
.project-table__row {
  position: relative;
  min-height: 56px;
  transition: background-color var(--dur-1) ease;
}
.project-table__row + .project-table__row {
  box-shadow: inset 0 1px 0 var(--line);
}
.project-table__row:hover {
  background: var(--surface-2);
}
.project-table__row > * {
  min-width: 0;
}
.project-table__name {
  display: flex;
  align-items: center;
  gap: 12px;
}
.project-table__titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.project-table__link {
  overflow: hidden;
  color: var(--text);
  font-weight: var(--fw-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
  outline: none;
}
.project-table__link::after {
  content: "";
  position: absolute;
  inset: 0;
}
.project-table__row:has(.project-table__link:focus-visible) {
  box-shadow: inset 0 0 0 2px var(--accent);
}
.project-table__col--team,
.project-table__col--lead {
  overflow: hidden;
  font-size: var(--fs-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-table__star,
.project-table__col--lead .user-chip {
  position: relative;
  z-index: 1;
}
@media (max-width: 1023px) {
  .project-table {
    --cols: minmax(0, 2fr) 108px minmax(110px, 1fr) 40px;
  }
  .project-table__col--team,
  .project-table__col--lead,
  .project-table__col--due {
    display: none;
  }
}
@media (max-width: 639px) {
  .project-table {
    --cols: minmax(0, 1fr) auto 40px;
  }
  .project-table__col--progress {
    display: none;
  }
}

/* -- New project modal --------------------------------------------------------------------------- */
.project-create__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.project-create__identity {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}
.project-create__tile {
  flex-shrink: 0;
  margin-top: 26px;
  box-shadow: var(--shadow-md);
  transition: background-color var(--dur-2) ease;
}
.project-create__names {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: var(--space-3);
  min-width: 0;
}
.project-create__key .input,
.settings-key {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.project-create__key .input.is-auto {
  color: var(--text-2);
}
.project-create__key .field__help {
  font-size: var(--fs-xs);
}
@media (max-width: 559px) {
  .project-create__tile {
    display: none;
  }
  .project-create__names {
    grid-template-columns: minmax(0, 1fr) 104px;
  }
  .project-create__key .field__help {
    white-space: normal;
  }
}
.template-picker {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.template-picker__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 196px), 1fr));
  gap: 10px;
}
.template-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
  transition:
    box-shadow var(--dur-2) var(--ease-out),
    background-color var(--dur-2) ease,
    transform var(--dur-1) ease;
}
.template-card:hover {
  box-shadow:
    0 0 0 1px var(--line-strong),
    var(--shadow-sm);
}
.template-card:active {
  transform: scale(0.99);
}
.template-card:has(.template-card__input:checked) {
  background: var(--accent-softer);
  box-shadow:
    0 0 0 2px var(--accent),
    var(--shadow-sm);
}
.template-card:has(.template-card__input:focus-visible) {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}
.template-card__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.template-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.template-card__icon {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: var(--fill-1);
  color: var(--text-2);
}
.template-card:has(.template-card__input:checked) .template-card__icon {
  background: var(--accent);
  color: var(--text-on-accent);
}
.template-card__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.template-card__check {
  color: var(--accent);
  opacity: 0;
  transform: scale(0.6);
  transition:
    opacity var(--dur-2) ease,
    transform var(--dur-2) var(--ease-spring);
}
.template-card:has(.template-card__input:checked) .template-card__check {
  opacity: 1;
  transform: none;
}
.template-card__preview {
  display: flex;
  gap: 4px;
  height: 58px;
  padding: 6px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
}
.template-card__col {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.template-card__col-name {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow: hidden;
  color: var(--tone-ink);
  font-size: 9px;
  font-weight: var(--fw-semibold);
  line-height: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.template-card__col-name .icon {
  flex-shrink: 0;
}
.template-card__col i {
  display: block;
  height: 10px;
  border-radius: 3px;
  background: var(--surface);
  box-shadow:
    inset 2px 0 0 var(--tone),
    0 0 0 1px var(--card-ring);
}
.template-card__desc {
  color: var(--text-2);
  font-size: var(--fs-xs);
  line-height: 1.4;
}
.project-create__grid {
  align-items: start;
}
.project-create__looks {
  display: grid;
  gap: var(--space-4);
}
.visibility-picker .segmented__item span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.visibility-help {
  display: none;
}
.field:has(input[name="visibility"][value="workspace"]:checked) .visibility-help[data-visibility="workspace"],
.field:has(input[name="visibility"][value="team"]:checked) .visibility-help[data-visibility="team"],
.field:has(input[name="visibility"][value="private"]:checked) .visibility-help[data-visibility="private"] {
  display: block;
}

/* -- Task toolbar (board + list filters) --------------------------------------------------------- */
.task-toolbar {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}
.task-toolbar__search {
  flex: 0 1 220px;
  min-width: 140px;
}
.task-toolbar__people {
  display: flex;
  align-items: center;
  padding-left: 2px;
}
.person-toggle {
  position: relative;
  display: grid;
  place-items: center;
  margin-left: -4px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform var(--dur-2) var(--ease-spring);
}
.person-toggle:first-child {
  margin-left: 0;
}
.person-toggle .avatar {
  box-shadow: 0 0 0 2px var(--bg);
  transition:
    opacity var(--dur-2) ease,
    box-shadow var(--dur-2) ease;
}
.person-toggle:hover {
  z-index: 1;
  transform: translateY(-2px);
}
.person-toggle:has(input:checked) {
  z-index: 2;
}
.person-toggle:has(input:checked) .avatar {
  box-shadow:
    0 0 0 2px var(--bg),
    0 0 0 4px var(--accent);
}
.person-toggle:has(input:focus-visible) .avatar {
  box-shadow:
    0 0 0 2px var(--bg),
    0 0 0 4px var(--focus-ring);
}
.task-toolbar__people:has(input:checked) .person-toggle:not(:has(input:checked)) .avatar {
  opacity: 0.45;
}
@media (max-width: 1023px) {
  .task-toolbar__people {
    display: none;
  }
}
/* Phones and tablets: the filter toolbar is a horizontal scroll strip (long ky/ru labels). */
@media (max-width: 1023px) {
  .project-toolbar:has(.task-toolbar) {
    flex-wrap: nowrap;
    margin-inline: calc(var(--page-pad-x) * -1);
    margin-bottom: var(--space-3);
    padding: 2px var(--page-pad-x);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .project-toolbar:has(.task-toolbar)::-webkit-scrollbar {
    display: none;
  }
  .task-toolbar__search {
    flex: 0 0 150px;
  }
  .task-toolbar .spacer {
    display: none;
  }
}
.filter-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-bottom: var(--space-3);
}
.filter-summary__count {
  margin-right: 4px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}
.filter-chip {
  max-width: 260px;
  color: var(--text);
  transition: background-color var(--dur-1) ease;
}
.filter-chip:hover {
  background: var(--fill-2);
}
.filter-chip .chip__remove {
  display: inline-grid;
  place-items: center;
}

/* -- Board --------------------------------------------------------------------------------------- */
body.is-board-page .app__main {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
}
.page--board {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  padding-bottom: var(--space-2);
}
.app.has-tabbar .page--board {
  padding-bottom: 0;
}
.page--board > .project-page,
.page--board .board-root {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}
.board-root {
  --col-w: 292px;
  position: relative;
}
.board {
  display: flex;
  flex: 1 1 auto;
  align-items: flex-start;
  gap: var(--space-3);
  min-height: 0;
  margin-inline: calc(var(--page-pad-x) * -1);
  padding: 2px var(--page-pad-x) var(--space-3);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-padding-inline: var(--page-pad-x);
  scrollbar-width: thin;
  scrollbar-color: var(--fill-3) transparent;
}
.board-column {
  position: relative;
  display: flex;
  flex: 0 0 var(--col-w);
  flex-direction: column;
  max-height: 100%;
  min-height: 0;
  border-radius: var(--radius-lg);
  background: var(--surface-sunken);
  transition:
    background-color var(--dur-2) ease,
    box-shadow var(--dur-2) ease;
}
.board-column.is-drop-target {
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-sunken));
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 35%, transparent);
}
.board-column.is-wip-over {
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c-red) 40%, transparent);
}
.board-column__header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 6px 4px 14px;
}
.board-column__dot {
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--tone);
  box-shadow: 0 0 0 3px var(--tone-softer);
}
.board-column__name {
  min-width: 0;
  overflow: hidden;
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.005em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.board-column__name[data-column-rename-trigger] {
  cursor: text;
}
.board-column.is-renaming .board-column__name {
  display: none;
}
.board-column__rename {
  flex: 1;
  min-width: 0;
}
.board-column__rename .input {
  width: 100%;
  font-weight: var(--fw-semibold);
}
.board-column__count {
  flex-shrink: 0;
  color: var(--text-3);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
}
.board-column__wip {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 3px;
  height: 20px;
  padding: 0 7px;
  border-radius: var(--radius-full);
  background: var(--fill-1);
  color: var(--text-2);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
  transition:
    background-color var(--dur-2) ease,
    color var(--dur-2) ease;
}
.board-column.is-wip-at .board-column__wip {
  background: color-mix(in srgb, var(--c-orange) 16%, transparent);
  color: var(--c-orange-ink);
}
.board-column.is-wip-over .board-column__wip {
  background: color-mix(in srgb, var(--c-red) 15%, transparent);
  color: var(--c-red-ink);
}
.board-column__done {
  display: inline-grid;
  flex-shrink: 0;
  color: var(--success);
}
.board-column__tools {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0;
  margin-left: auto;
}
@media (hover: hover) {
  .board-column__tools > .btn {
    opacity: 0;
    transition: opacity var(--dur-1) ease;
  }
  .board-column:hover .board-column__tools > .btn,
  .board-column:focus-within .board-column__tools > .btn {
    opacity: 1;
  }
}
.board-column__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding: 4px 8px 8px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--fill-3) transparent;
}
.board-column__cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 8px;
}
.board-column__cards:not(:has(> .task-card))::before {
  content: attr(data-empty-text);
  display: grid;
  place-items: center;
  height: 72px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  color: var(--text-3);
  font-size: var(--fs-sm);
}
.board-column__footer {
  padding: 0 8px 8px;
}
.board-column.is-composing .board-column__footer {
  display: none;
}
.board-column__add {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 34px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition:
    background-color var(--dur-1) ease,
    color var(--dur-1) ease;
}
.board-column__add:hover {
  background: var(--fill-1);
  color: var(--text);
}
.board-column__add:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* Column menu */
.column-menu {
  min-width: 248px;
}
.column-menu__swatches {
  display: grid;
  grid-template-columns: repeat(7, 26px);
  gap: 6px;
  padding: 4px 10px 8px;
}
.column-menu__swatch {
  position: relative;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--tone);
  cursor: pointer;
  transition: transform var(--dur-1) var(--ease-spring);
}
.column-menu__swatch.menu__item {
  display: block;
  width: 26px;
  height: 26px;
}
.column-menu__swatch:hover {
  background: var(--tone);
  transform: scale(1.1);
}
.column-menu__swatch[aria-pressed="true"] {
  box-shadow:
    0 0 0 2px var(--surface-overlay),
    0 0 0 4px var(--tone);
}
.column-menu__swatch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.column-menu__wip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 4px 10px;
}
.column-menu__wip-label {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  color: var(--text);
  white-space: nowrap;
}
.column-menu__wip-label .icon {
  color: var(--text-2);
}
.column-menu__wip .input {
  width: 64px;
}

/* Quick add composer (board + list) */
.quick-add {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow:
    0 0 0 2px var(--accent),
    var(--shadow-md);
}
.quick-add[hidden] {
  display: none;
}
@media (prefers-reduced-motion: no-preference) {
  .quick-add:not([hidden]) {
    animation: projects-pop-in var(--dur-2) var(--ease-out);
  }
}
@keyframes projects-pop-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}
.quick-add__input {
  width: 100%;
  min-height: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: var(--fs-md);
  font-weight: var(--fw-medium);
  line-height: 1.4;
  resize: none;
  outline: none;
  field-sizing: content;
}
.quick-add__input::placeholder {
  color: var(--text-3);
  font-weight: var(--fw-regular);
}
.quick-add__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.quick-add__hint {
  margin-left: auto;
  color: var(--text-3);
  font-size: var(--fs-2xs);
  white-space: nowrap;
}
.quick-add__hint .kbd {
  min-width: 0;
}

/* Add column ghost */
.board-add-column {
  flex: 0 0 var(--col-w);
}
.board-add-column__button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: none;
  color: var(--text-2);
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition:
    background-color var(--dur-1) ease,
    border-color var(--dur-1) ease,
    color var(--dur-1) ease;
}
.board-add-column__button:hover {
  border-color: var(--accent);
  background: var(--accent-softer);
  color: var(--accent-ink);
}
.board-add-column__button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.board-add-column:has(.board-add-column__form:not([hidden])) .board-add-column__button {
  display: none;
}
.board-add-column__form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-lg);
  background: var(--surface-sunken);
}
.board-add-column__form[hidden] {
  display: none;
}
.board-add-column__actions {
  display: flex;
  gap: 6px;
}
.board__empty {
  flex: 1;
  align-self: center;
}

/* Card menu */
.card-menu {
  min-width: 232px;
}

/* Phones: one column at a time with a peek of the next; snap while scrolling. */
@media (max-width: 767px) {
  .board-root {
    --col-w: calc(100vw - 2 * var(--page-pad-x) - 34px);
  }
  .board {
    gap: 10px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .board::-webkit-scrollbar {
    display: none;
  }
  .board.is-dragging {
    scroll-snap-type: none;
  }
  .board-column,
  .board-add-column {
    scroll-snap-align: start;
  }
  .app.has-tabbar .board-column__body {
    padding-bottom: calc(var(--tabbar-h) + max(var(--safe-bottom), 10px) + 28px);
  }
  .app.has-tabbar .board-column.is-composing .board-column__body,
  .app.has-tabbar .board-column__footer {
    padding-bottom: calc(var(--tabbar-h) + max(var(--safe-bottom), 10px) + 24px);
  }
  .app.has-tabbar .board-column:has(.board-column__footer) .board-column__body {
    padding-bottom: 8px;
  }
}

/* -- List ---------------------------------------------------------------------------------------- */
.list-root {
  --cell-due: 108px;
  --cell-priority: 64px;
  --cell-assignee: 64px;
  position: relative;
  padding-bottom: var(--space-12);
}
.list-view {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.list-head {
  display: none;
}
@media (min-width: 768px) {
  .list-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--cell-due) var(--cell-priority) var(--cell-assignee);
    align-items: center;
    gap: 10px;
    margin-bottom: calc(var(--space-2) * -1);
    padding: 0 16px 0 calc(16px + 20px + 12px);
  }
  .list-view.is-selectable .list-head {
    padding-left: calc(10px + 18px + 10px + 20px + 12px);
  }
}
.list-head__sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-self: start;
  min-width: 0;
  height: 26px;
  padding: 0 6px;
  border-radius: var(--radius-xs);
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  transition:
    background-color var(--dur-1) ease,
    color var(--dur-1) ease;
}
.list-head__sort:first-child {
  margin-left: -6px;
}
.list-head__sort:not(:first-child) {
  justify-self: center;
}
.list-head__sort:hover {
  background: var(--fill-1);
  color: var(--text);
}
.list-head__sort.is-active {
  color: var(--accent-ink);
}
.list-section__header {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
}
.list-section__toggle {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 32px;
  padding: 0 10px 0 4px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text);
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: background-color var(--dur-1) ease;
}
.list-section__toggle:hover {
  background: var(--fill-1);
}
.list-section__toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.list-section__chevron {
  flex-shrink: 0;
  color: var(--text-3);
  transition: transform var(--dur-2) var(--ease-out);
}
.list-section.is-collapsed .list-section__chevron {
  transform: rotate(-90deg);
}
.list-section__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-section__count {
  color: var(--text-3);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}
.list-section__done {
  color: var(--success);
}
.list-section__plus {
  opacity: 0;
  transition: opacity var(--dur-1) ease;
}
.list-section__header:hover .list-section__plus,
.list-section__plus:focus-visible {
  opacity: 1;
}
@media (hover: none) {
  .list-section__plus {
    opacity: 1;
  }
}
.list-section__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.list-section__body[hidden] {
  display: none;
}
.list-section__rows {
  display: flex;
  flex-direction: column;
  min-height: 8px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow:
    0 0 0 1px var(--card-ring),
    var(--shadow-xs);
}
.list-section__rows:not(:has(> .task-row)) {
  background: none;
  box-shadow: none;
}
.list-section__rows:not(:has(> .task-row))::before {
  content: attr(data-empty-text);
  display: grid;
  place-items: center;
  height: 44px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  color: var(--text-3);
  font-size: var(--fs-sm);
}
.list-section.is-composing .list-section__add {
  display: none;
}
.list-section__add {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition:
    background-color var(--dur-1) ease,
    color var(--dur-1) ease;
}
.list-section__add:hover {
  background: var(--fill-1);
  color: var(--text);
}
.quick-add--row {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  padding: 8px 10px 8px 16px;
}
.quick-add--row .quick-add__circle {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 50%;
}
.quick-add--row .quick-add__input {
  flex: 1 1 200px;
  min-height: 28px;
}

/* Rows inside the list view */
.list-view .task-row__main {
  gap: 8px;
}
@media (min-width: 768px) {
  .list-view .task-row__meta {
    display: grid;
    grid-template-columns: var(--cell-due) var(--cell-priority) var(--cell-assignee);
    gap: 10px;
    justify-items: center;
  }
  .list-view .task-row__cell--due {
    justify-self: start;
  }
  .list-view.is-selectable .task-row {
    grid-template-columns: 18px auto minmax(0, 1fr) auto;
    gap: 4px 10px;
    padding-left: 10px;
  }
}
@media (max-width: 767px) {
  .list-root {
    padding-bottom: calc(var(--space-12) + var(--tabbar-h));
  }
  .list-section__rows {
    gap: 8px;
    overflow: visible;
    background: none;
    box-shadow: none;
  }
  .list-view .task-row {
    border-radius: var(--radius-lg);
    box-shadow:
      0 0 0 1px var(--card-ring),
      var(--shadow-xs);
  }
  .list-view .task-row + .task-row {
    box-shadow:
      0 0 0 1px var(--card-ring),
      var(--shadow-xs);
  }
  .list-view .task-row__select {
    display: none;
  }
  .list-view .task-row__meta {
    gap: 6px;
  }
}
.list-empty {
  padding: var(--space-8) 0;
}
.list-root .sortable-ghost.task-row {
  min-height: 44px;
}

/* Bulk action bar */
.bulk-bar {
  position: fixed;
  z-index: var(--z-sticky);
  bottom: max(24px, calc(var(--safe-bottom) + 12px));
  left: 50%;
  display: flex;
  align-items: center;
  gap: 2px;
  max-width: calc(100vw - 24px);
  padding: 6px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-full);
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  box-shadow: var(--shadow-xl);
  translate: -50% 0;
}
.bulk-bar[hidden] {
  display: none;
}
@media (prefers-reduced-motion: no-preference) {
  .bulk-bar:not([hidden]) {
    animation: projects-bar-in var(--dur-3) var(--ease-spring);
  }
  .bulk-bar.is-leaving {
    animation: projects-bar-out var(--dur-2) var(--ease-in-out) forwards;
  }
}
@keyframes projects-bar-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
}
@keyframes projects-bar-out {
  to {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
}
.bulk-bar__count {
  padding: 0 10px 0 12px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bulk-bar__sep {
  width: 1px;
  height: 20px;
  margin: 0 4px;
  background: var(--line-strong);
}
.bulk-bar__delete,
.bulk-bar__delete .icon {
  color: var(--danger-ink);
}
@media (max-width: 767px) {
  .bulk-bar {
    bottom: calc(var(--tabbar-h) + max(var(--safe-bottom), 10px) + 18px);
  }
}

/* Inline row editors */
.row-editor {
  min-width: 248px;
}
.row-editor__search {
  padding: 2px 2px 6px;
}
.row-editor__search .input {
  width: 100%;
}
.row-editor__list {
  display: flex;
  flex-direction: column;
}
.row-editor .menu__item.is-current {
  font-weight: var(--fw-semibold);
}
.row-editor .menu__item .avatar,
.row-editor .menu__item .priority {
  flex-shrink: 0;
}
.row-editor__date {
  display: block;
  padding: 2px 4px 4px;
}
.row-editor__date .input {
  width: 100%;
}

/* -- Overview ------------------------------------------------------------------------------------ */
.overview {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  max-width: 1320px;
  container: overview / inline-size;
}
.overview-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-5) var(--space-8);
  padding: 20px 24px;
}
.overview-hero__ring {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: var(--space-4);
}
.overview-hero__ring .progress-ring__label {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
}
.overview-hero__ring-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.overview-hero__label {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
}
.overview-hero__sub {
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}
.overview-hero__stats {
  display: grid;
  flex: 1 1 380px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-3);
}
.overview-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.overview-stat__value {
  font-size: var(--fs-title-2);
  font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.overview-stat__value--sm {
  font-size: var(--fs-title-3);
  line-height: 1.4;
}
.overview-stat__label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
}
.overview-stat__label .icon {
  color: var(--tone);
}
.overview-stat.is-alert {
  background: var(--tone-softer);
}
.overview-stat.is-alert .overview-stat__value {
  color: var(--tone-ink);
}
.overview-grid {
  display: grid;
  gap: var(--space-5);
  align-items: start;
}
@container overview (min-width: 860px) {
  .overview-grid {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  }
}
.overview-main,
.overview-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  min-width: 0;
}
.overview-card {
  --card-pad: 16px 20px 18px;
}
.overview-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 32px;
  margin-bottom: var(--space-3);
}
.overview-card__title {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.01em;
}
.overview-card__title .icon {
  color: var(--text-3);
}
.overview-card__header .btn {
  margin: -4px -8px -4px 0;
}
.overview-card__empty {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.overview-card__empty .icon {
  color: var(--success);
}
.overview-card__note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: var(--space-3);
  color: var(--text-2);
  font-size: var(--fs-xs);
  line-height: 1.45;
}
.overview-card__note .icon {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--text-3);
}
.overview-props dt {
  min-height: 30px;
}
.overview-props dd {
  min-height: 30px;
  font-size: var(--fs-sm);
}
.overview-props dd .link {
  color: var(--accent-ink);
}
.project-description__placeholder {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: none;
  color: var(--text-3);
  font: inherit;
  font-size: var(--fs-sm);
  text-align: left;
  cursor: text;
  transition:
    border-color var(--dur-1) ease,
    color var(--dur-1) ease;
}
.project-description__placeholder:hover {
  border-color: var(--accent);
  color: var(--text-2);
}
.project-description__form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.project-description__form textarea {
  min-height: 120px;
}

/* Status updates */
.update-composer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: var(--space-4);
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
}
.update-composer__statuses {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.status-choice {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 11px 0 9px;
  border-radius: var(--radius-full);
  background: var(--fill-1);
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition:
    background-color var(--dur-1) ease,
    color var(--dur-1) ease,
    box-shadow var(--dur-1) ease;
}
.status-choice > input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.status-choice__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tone);
}
.status-choice:hover {
  background: var(--fill-2);
}
.status-choice:has(> input:checked) {
  background: var(--tone-soft);
  color: var(--tone-ink);
  box-shadow: inset 0 0 0 1.5px var(--tone-line);
}
.status-choice:has(> input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.update-composer__body {
  min-height: 64px;
  background: var(--surface);
}
.update-composer__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}
.update-composer__hint {
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.updates-feed {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.status-update {
  display: flex;
  gap: 12px;
  min-width: 0;
}
.status-update__avatar {
  position: relative;
  flex-shrink: 0;
}
.status-update__body {
  flex: 1;
  min-width: 0;
  padding-left: 12px;
  border-left: 2px solid var(--tone-line);
}
.status-update__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 4px;
}
.status-update__author {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}
.status-update__text {
  font-size: var(--fs-sm);
}
.updates-feed__more {
  align-self: flex-start;
}

/* Distribution, deadlines, members */
.distribution {
  display: flex;
  gap: 3px;
  height: 10px;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: var(--fill-1);
}
.distribution__seg {
  flex: var(--share) 1 0;
  min-width: 6px;
  background: var(--tone);
}
@media (prefers-reduced-motion: no-preference) {
  .distribution__seg {
    transform-origin: left;
    animation: projects-grow 700ms var(--ease-out) both;
  }
}
@keyframes projects-grow {
  from {
    transform: scaleX(0);
  }
}
.distribution-legend {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 6px 14px;
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
}
.distribution-legend__item {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: var(--fs-sm);
}
.distribution-legend__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.distribution-legend__count {
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
}
.deadline-list,
.member-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}
.deadline {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 38px;
}
.deadline + .deadline {
  border-top: 1px solid var(--line);
}
.deadline .due {
  min-width: 64px;
}
.deadline__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.deadline__title:hover {
  color: var(--accent-ink);
}
.member-list__item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
}
.member-list__name {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  white-space: nowrap;
}
.member-list__lead {
  display: inline-grid;
  color: var(--c-orange);
}
.member-list__role {
  flex-shrink: 0;
}
.overview-activity {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* -- Settings ------------------------------------------------------------------------------------ */
.project-settings__header {
  margin-bottom: var(--space-5);
}
.settings-card__title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.01em;
}
.settings-identity {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}
.settings-identity > .icon-tile {
  flex-shrink: 0;
  margin-top: 24px;
  box-shadow: var(--shadow-md);
}
.settings-identity__fields {
  flex: 1;
  min-width: 0;
}
.settings-key__help {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.settings-key__help .icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--c-orange);
}
.settings-views {
  overflow-x: auto;
}
.settings-actions {
  position: sticky;
  bottom: max(12px, var(--safe-bottom));
  z-index: 2;
  padding: 10px 12px;
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-lg);
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  box-shadow: var(--shadow-md);
}
@media (max-width: 767px) {
  .app.has-tabbar .settings-actions {
    bottom: calc(var(--tabbar-h) + max(var(--safe-bottom), 10px) + 16px);
  }
  .settings-identity > .icon-tile {
    display: none;
  }
}
.danger-zone {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-8);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--danger) 28%, transparent),
    var(--shadow-sm);
}
.danger-zone .settings-card__title {
  color: var(--danger-ink);
}
.danger-zone__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-4);
}
.danger-zone__row + .danger-zone__row {
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
}
.danger-zone__text {
  flex: 1 1 260px;
  min-width: 0;
}

/* Workflow */
.workflow {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.workflow__list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.workflow-col {
  position: relative;
  display: grid;
  grid-template-columns: 20px 28px minmax(140px, 1fr) auto 104px auto auto;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 12px 8px 8px;
  background: var(--surface);
}
.workflow-col + .workflow-col {
  box-shadow: inset 0 1px 0 var(--line);
}
.workflow-col.sortable-ghost {
  background: var(--accent-softer);
}
.workflow-col.sortable-ghost > * {
  visibility: hidden;
}
.workflow-col.sortable-fallback {
  border-radius: var(--radius-md);
  box-shadow:
    0 0 0 1px var(--card-ring),
    var(--shadow-lg);
  opacity: 1 !important;
}
.workflow-col__handle {
  display: grid;
  place-items: center;
  height: 32px;
}
.workflow-col__swatch {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  cursor: pointer;
}
.workflow-col__swatch:hover {
  background: var(--fill-1);
}
.workflow-col__swatch .dot {
  width: 12px;
  height: 12px;
}
.workflow-col__name .input {
  width: 100%;
  border-color: transparent;
  background: transparent;
  font-weight: var(--fw-semibold);
}
.workflow-col__name .input:hover {
  background: var(--fill-1);
}
.workflow-col__name .input:focus {
  border-color: var(--accent);
  background: var(--input-bg, var(--surface));
}
.workflow-col__count {
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.workflow-col__wip-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
}
.workflow-col__wip-label .input {
  width: 100%;
  min-width: 0;
}
.workflow-col__done {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  cursor: pointer;
}
.workflow-col__actions {
  display: flex;
  align-items: center;
}
.workflow-col__delete:not(:disabled):hover {
  color: var(--danger-ink);
}
@media (max-width: 767px) {
  .workflow-col {
    grid-template-columns: 20px 28px minmax(0, 1fr) auto;
    row-gap: 6px;
  }
  .workflow-col__count {
    display: none;
  }
  .workflow-col__wip {
    grid-column: 3;
  }
  .workflow-col__wip-label .input {
    width: 96px;
  }
  .workflow-col__done {
    grid-column: 4;
    grid-row: 2;
  }
  .workflow-col__actions {
    grid-column: 4;
    grid-row: 1;
  }
}
.workflow__add {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
}
.workflow__add .input {
  flex: 1 1 200px;
}
.workflow__add .dot {
  width: 12px;
  height: 12px;
  margin-left: 8px;
}
.workflow__add-done {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  white-space: nowrap;
}

/* Members */
.member-add {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.member-add__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.member-add__row select:first-of-type {
  flex: 1 1 240px;
  min-width: 0;
}
.member-add__role {
  flex: 0 0 auto;
  width: auto;
}
.member-row__actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.member-row__actions .input {
  width: auto;
}
.member-row .list-item__title .chip {
  margin-left: 4px;
  vertical-align: 1px;
}
.member-inherited {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.member-inherited__text {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.member-inherited__text .icon {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--text-3);
}
.member-inherited__people {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.member-inherited__person {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px 0 3px;
  border-radius: var(--radius-full);
  background: var(--fill-1);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
}
@media (max-width: 559px) {
  .member-row {
    flex-wrap: wrap;
  }
  .member-row__actions {
    width: 100%;
    padding-left: 48px;
  }
}
.members-others {
  padding: 10px 16px 14px;
}
.members-note {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.members-note .icon {
  flex-shrink: 0;
  margin-top: 2px;
}

/* Archived project: the workflow editor is shown read-only inside a disabled fieldset (QA). */
.workflow-frozen {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.workflow-frozen .drag-handle {
  visibility: hidden;
}

/* Long columns: only the first cards render; "Show N more" expands one column (?show=<id>). */
.board-column__more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 2px 8px 8px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: var(--fill-1);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-decoration: none;
  transition:
    background-color var(--dur-1) ease,
    color var(--dur-1) ease;
}
.board-column__more:hover {
  background: var(--fill-2);
  color: var(--text);
}
.board-column__more:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.list-section__more {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
  margin: 4px 0 2px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: var(--fill-1);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-decoration: none;
}
.list-section__more:hover {
  background: var(--fill-2);
  color: var(--text);
}
.list-section__more:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Laptops with the sidebar open: "My tasks" / "Hide completed" become icon chips so the filter
   toolbar fits (long ky/ru labels); the text stays available to screen readers. */
@media (min-width: 1024px) and (max-width: 1279px) {
  .task-toolbar__completed > span,
  .task-toolbar__mine > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
/* Long header labels (ky/ru) stay inside their column instead of running into the next one. */
.list-head__sort {
  max-width: 100%;
}
.list-head__sort > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
