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

   Project header       .project-status, .project-members, .project-ident__key (layout: shell.css)
   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
   Toolbar              .task-toolbar (core toolbar.css: .toolbar, .toolbar-btn, .filter-panel,
                        .display-panel, .active-filters) + .task-display, .view-filters
   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, .project-people
   Settings             .project-settings, .danger-zone, .workflow, .project-members
   ================================================================================================== */

/* -- Project header ------------------------------------------------------------------------------ */
/* The header layout (title, breadcrumbs, search, responsive collapsing) lives in the shell
   (static/css/core/shell.css, design). Only the project-specific bits stay here. */
.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;
}

.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);
}
/* The "…" button: the glass circle of core/domain.css (r4 · 9.21). The board only adds a pop on
   reveal, a focus ring and — on touch — a 40px hit area with room kept in the head row. */
@media (prefers-reduced-motion: no-preference) {
  .task-card__menu {
    scale: 0.88;
    transition:
      opacity var(--dur-2) ease,
      scale var(--dur-snappy) var(--spring-snappy);
  }
  .task-card:is(:hover, :focus-within) .task-card__menu,
  .task-card__menu[aria-expanded="true"] {
    scale: 1;
  }
}
.task-card__menu:hover {
  color: var(--text);
}
.task-card__menu:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
@media (hover: none) {
  .task-card__menu {
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    color: var(--text-3);
    opacity: 1;
    scale: 1;
  }
  .task-card__menu::after {
    content: "";
    position: absolute;
    inset: -6px;
  }
  .task-card.has-menu .task-card__head {
    padding-right: 26px;
  }
}
.task-card.is-saving {
  opacity: 0.75;
}
@media (prefers-reduced-motion: no-preference) {
  .task-card.is-landed {
    animation: projects-card-land 520ms var(--ease-out);
  }
}
@keyframes projects-card-land {
  0% {
    transform: scale(1.025);
    box-shadow:
      0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent),
      var(--shadow-lg);
  }
  45% {
    transform: scale(0.995);
  }
  100% {
    transform: none;
  }
}

/* Drag & drop (SortableJS fallback mode: the lifted clone lives in <body>) */
.task-card.sortable-fallback,
.task-row.sortable-fallback {
  transform: none;
  rotate: 1.5deg;
  scale: 1.03;
  box-shadow: var(--shadow-lift) !important;
  transition: none !important;
  cursor: grabbing;
  will-change: transform;
}
.task-row.sortable-fallback {
  rotate: 0.5deg;
  scale: 1.01;
  border-radius: 12px;
}
@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: var(--radius-board-card);
  background: transparent !important;
  box-shadow: none !important;
  outline: 2px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: -2px;
}
.task-card.sortable-ghost > * {
  visibility: hidden;
}
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;
}
@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;
  }
}

/* -- Projects index ------------------------------------------------------------------------------
   Owner (r3 wave 2): pages agent. Toolbar = core .toolbar (search · scope · Filter ··· sort ·
   layout); cards and table are neutral — the project tile is the only identity color, overdue the
   only loud signal, a finished project's bar the only green. */
.projects-index__header {
  margin-bottom: var(--space-4);
}
.projects-toolbar {
  margin-bottom: var(--space-4);
}
.projects-toolbar .toolbar-search {
  flex-basis: 240px;
}
.projects-toolbar__view .segmented__item {
  min-width: 34px;
  padding: 0 8px;
}
.projects-toolbar .menu__item > input {
  position: absolute;
}
.projects-filter-panel {
  width: min(480px, calc(100vw - 16px));
}
.projects-filter-panel .filter-option .status-pill {
  pointer-events: none;
}
.projects-filter-panel__archive {
  justify-content: stretch;
}
.projects-filter-panel__archive .filter-option {
  flex: 1;
  color: var(--text-2);
}
.projects-filter-panel__archive .filter-option .icon {
  color: var(--text-3);
}
/* Phones: search · Filter · sort · layout on one row, the scope switch full width under it. */
@media (max-width: 639px) {
  .projects-toolbar {
    flex-wrap: wrap;
    row-gap: var(--space-2);
  }
  .projects-toolbar__main {
    display: contents;
  }
  .projects-toolbar .toolbar-search {
    flex: 1 1 auto;
    order: 0;
  }
  .projects-toolbar__main > [x-data] {
    order: 1;
  }
  .projects-toolbar > .toolbar__group:last-child {
    order: 2;
  }
  .projects-toolbar__scope {
    display: flex;
    flex: 1 1 100%;
    order: 3;
  }
  .projects-toolbar__scope .segmented__item {
    flex: 1 1 0;
  }
}
.project-results__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: calc(-1 * var(--space-1)) 0 var(--space-4);
}
.project-results__filters .active-filters {
  display: contents;
}

/* Grid of cards (r4 · 12.5, Finder icon view): a 48px squircle and the project's activity ring on
   top, the name (17px), key · status · team, two lines of description, then people and the open /
   overdue counts. Radius 22 like the widgets; the whole card is the link. */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: var(--space-4);
}
.project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 16px 16px 14px;
  border-radius: var(--radius-widget);
  background: var(--surface);
  box-shadow:
    0 0 0 0.5px var(--card-ring),
    var(--shadow-sm),
    inset 0 0.5px 0 var(--card-highlight);
}
.project-card:has(.project-card__link:focus-visible) {
  outline: 2.5px solid var(--focus-outline);
  outline-offset: 2px;
}
.project-card.is-archived .icon-tile,
.project-card.is-archived .progress-ring,
.project-table__row.is-archived .icon-tile {
  filter: grayscale(1);
  opacity: 0.7;
}
.project-card__head {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  margin-bottom: 4px;
}
.project-card__tile {
  margin-right: auto;
}
.project-card__ring {
  position: relative;
  z-index: 1;
  display: inline-grid;
}
.project-card__ring .progress-ring__label {
  font-size: 10px;
  letter-spacing: -0.03em;
}
.project-card__titles {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.project-card__name {
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.012em;
  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;
  border-radius: inherit;
}
.project-card__sub {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text-2);
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.project-card__key {
  flex-shrink: 0;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  background: var(--fill-1);
  color: var(--text-2);
}
/* Status as a dot + word (the pill without its plate). */
.status-pill.project-card__status,
.status-pill.project-table__status {
  gap: 5px;
  height: auto;
  padding: 0;
  background: none;
  color: var(--text-2);
  font-weight: var(--fw-medium);
}
.project-card__team {
  min-width: 0;
  overflow: hidden;
  color: var(--text-3);
  text-overflow: ellipsis;
}
.project-card__team::before {
  content: "·";
  margin-right: 8px;
}
.project-card__star,
.project-card__people,
.project-card__overdue,
.project-card .due,
.project-card .avatar-stack {
  position: relative;
  z-index: 1;
}
.project-card__star {
  margin-top: 2px;
}
/* The star waits on hover/focus (it stays when starred, and on touch screens). */
@media (hover: hover) {
  .project-card__star .favorite-toggle:not(.is-on) {
    opacity: 0;
    transition: opacity var(--dur-1) ease;
  }
  .project-card:hover .project-card__star .favorite-toggle,
  .project-card:focus-within .project-card__star .favorite-toggle {
    opacity: 1;
  }
}
.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__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 0.5px solid var(--line);
}
.project-card__meta {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}
.project-card__meta .due {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-card__counts {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
@media (hover: hover) {
  .project-card:hover {
    box-shadow:
      0 0 0 0.5px var(--line),
      var(--shadow-md),
      inset 0 0.5px 0 var(--card-highlight);
  }
}

/* List (r4 · 12.5, Finder list view): column labels above one inset grouped group of rows —
   28px squircle · name + key · status · 80px progress · lead · people · due · ★ ›. */
.project-table {
  --cols: minmax(0, 2.6fr) minmax(108px, 0.9fr) 128px minmax(0, 1.1fr) 92px 120px 56px;
}
.project-table .status-pill {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-table__col--due .due {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.project-table__head,
.project-table__row {
  display: grid;
  grid-template-columns: var(--cols);
  align-items: center;
  gap: 12px;
  padding: 0 8px 0 14px;
}
.project-table__head {
  min-height: 28px;
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}
.project-table__head > :first-child {
  padding-left: 40px; /* over the names, past the squircle */
}
.project-table__body {
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow:
    0 0 0 0.5px var(--card-ring),
    var(--shadow-xs);
}
.project-table__row {
  position: relative;
  min-height: 52px;
  transition: background-color var(--dur-1) ease;
}
.project-table__row + .project-table__row::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 54px; /* the separator starts at the text, like iOS */
  height: 0.5px;
  background: var(--line);
}
@media (hover: hover) {
  .project-table__row:hover {
    background: var(--fill-1);
  }
}
.project-table__row:active {
  background: var(--fill-2);
}
.project-table__row > * {
  min-width: 0;
}
.project-table__name {
  display: flex;
  align-items: center;
  gap: 12px;
}
.project-table__tile {
  --size: 28px;
}
.project-table__titles {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.project-table__link {
  overflow: hidden;
  color: var(--text);
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  text-overflow: ellipsis;
  white-space: nowrap;
  outline: none;
}
.project-table__link::after {
  content: "";
  position: absolute;
  inset: 0;
}
.project-table__sub {
  display: flex;
  gap: 5px;
  min-width: 0;
  color: var(--text-3);
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.project-table__sub .task-key {
  color: var(--text-3);
}
.project-table__sub-status {
  display: none;
}
.project-table__team {
  overflow: hidden;
  color: var(--text-2);
  text-overflow: ellipsis;
}
.project-table__row:has(.project-table__link:focus-visible) {
  box-shadow: inset 0 0 0 2px var(--focus-outline);
}
.project-table__col--progress {
  display: flex;
  align-items: center;
  gap: 8px;
}
.project-table__col--progress .progress-row {
  flex: 0 1 auto;
  min-width: 0;
}
.project-table__col--progress .progress {
  flex: 0 1 80px;
  width: 80px;
  min-width: 40px;
}
.project-table .progress .progress__bar {
  background: var(--text-3);
}
.project-table .is-complete .progress .progress__bar {
  background: var(--success);
}
.project-table__col--lead {
  overflow: hidden;
  font-size: var(--fs-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-table__star {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}
.project-table__chevron {
  flex-shrink: 0;
  color: var(--text-3);
}
@media (hover: hover) {
  .project-table__star .favorite-toggle:not(.is-on) {
    opacity: 0;
    transition: opacity var(--dur-1) ease;
  }
  .project-table__row:hover .project-table__star .favorite-toggle,
  .project-table__row:focus-within .project-table__star .favorite-toggle {
    opacity: 1;
  }
}
.project-table__star .favorite-toggle,
.project-table__overdue,
.project-table__col--lead .user-chip,
.project-table__col--members .avatar-stack,
.project-table__col--due .due {
  position: relative;
  z-index: 1;
}
@media (max-width: 1179px) {
  .project-table {
    --cols: minmax(0, 2.4fr) minmax(104px, 0.9fr) 128px 92px 120px 56px;
  }
  .project-table__col--lead {
    display: none;
  }
}
@media (max-width: 899px) {
  .project-table {
    --cols: minmax(0, 2fr) minmax(96px, auto) 128px 56px;
  }
  .project-table__col--members,
  .project-table__col--due {
    display: none;
  }
}
@media (max-width: 639px) {
  .project-table {
    --cols: minmax(0, 1fr) auto 24px;
  }
  .project-table__head {
    display: none;
  }
  .project-table__row {
    gap: 8px;
    min-height: var(--row-h-list);
    padding-left: 12px;
  }
  .project-table__row + .project-table__row::before {
    left: 52px;
  }
  .project-table__col--progress,
  .project-table__col--status,
  .project-table__star .favorite-toggle {
    display: none;
  }
  .project-table {
    --cols: minmax(0, 1fr) 24px;
  }
  .status-pill.project-table__sub-status {
    display: inline-flex;
    margin-left: 4px;
    font-size: var(--fs-xs);
  }
}

/* Archived projects: a collapsed group at the end (r4 · 12.5) — chevron › turns ⌄ when shown. */
.project-archived-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  margin-top: var(--space-6);
  padding: 0 14px 0 10px;
  border: 0;
  border-radius: var(--radius-full);
  background: none;
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: background-color var(--dur-1) ease;
}
.project-archived-toggle:hover {
  background: var(--fill-1);
  color: var(--text);
}
.project-archived-toggle:focus-visible {
  outline: 2.5px solid var(--focus-outline);
  outline-offset: 2px;
}
.project-archived-toggle__chevron {
  color: var(--text-3);
  transition: transform var(--dur-snappy) var(--spring-snappy);
}
.project-archived-toggle[aria-expanded="true"] .project-archived-toggle__chevron {
  transform: rotate(90deg);
}
.project-archived-toggle__count {
  color: var(--text-3);
  font-weight: var(--fw-medium);
  font-variant-numeric: tabular-nums;
}
.project-results:has(> .project-archived-toggle[aria-expanded="true"]) > .project-archived-toggle {
  order: -1;
  margin: 0 0 var(--space-3);
}
.project-results:has(> .project-archived-toggle) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.project-results > .project-archived-toggle {
  align-self: flex-start;
}

/* -- 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: 24px;
  box-shadow: var(--shadow-md);
  transition: background-color var(--dur-2) ease;
}
/* r4 · 12.25: the name is the sheet's big field — 20px semibold, no box until focused. */
.project-create__names .field:first-child .input {
  padding-inline: 0;
  border-color: transparent;
  border-radius: 0;
  background: none;
  box-shadow: inset 0 -0.5px 0 var(--line-strong);
  font-size: var(--fs-title-3);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.01em;
}
.project-create__names .field:first-child .input:focus,
.project-create__names .field:first-child .input:focus-visible {
  outline: none;
  box-shadow: inset 0 -2px 0 var(--accent);
}
.project-create__names .field:first-child.field--invalid .input {
  box-shadow: inset 0 -2px 0 var(--danger);
}
.project-create__key .input {
  font-family: var(--font-mono);
}
.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);
}
.project-create__key-example {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-3);
  white-space: nowrap;
}
.project-create__key-example .icon {
  flex-shrink: 0;
}
/* Team above who-can-see: the three visibility segments need the full width in ky / ru. */
.project-create__grid .visibility-picker .segmented__item span {
  white-space: nowrap;
}
@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 (r3, pages agent): compact selectable rows — glyph · name · one-line description ·
   the columns as a quiet flow line — two per row from 560px. Selection = accent ring + radio dot. */
.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%, 260px), 1fr));
  gap: 8px;
}
.template-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: 0 0 0 0.5px var(--line-strong);
  cursor: pointer;
  transition:
    box-shadow var(--dur-2) var(--ease-out),
    background-color var(--dur-2) ease;
}
.template-card:hover {
  background: var(--fill-1);
}
.template-card:has(.template-card__input:checked) {
  background: var(--accent-softer);
  box-shadow: 0 0 0 1.5px var(--accent);
}
.template-card:has(.template-card__input:focus-visible) {
  outline: 2px solid var(--focus-outline);
  outline-offset: 2px;
}
.template-card__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.template-card__icon {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--fill-1);
  color: var(--text-2);
  transition:
    background-color var(--dur-2) ease,
    color var(--dur-2) ease;
}
.template-card:has(.template-card__input:checked) .template-card__icon {
  background: var(--accent);
  color: var(--text-on-accent);
}
.template-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.template-card__name {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  line-height: 1.35;
  overflow-wrap: break-word; /* whole names: "Программалык камсыздоону иштеп чыгуу" */
}
.template-card__desc {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-2);
  font-size: var(--fs-xs);
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.template-card__preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 4px;
  margin-top: 4px;
  color: var(--text-3);
  font-size: 11px;
  line-height: 16px;
}
.template-card__col {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
  white-space: nowrap;
}
.template-card__col.is-done {
  color: var(--success-ink, var(--text-2));
}
.template-card__col .icon {
  flex-shrink: 0;
}
.template-card__arrow {
  color: var(--text-disabled, var(--text-3));
}
/* Radio dot (top right). */
.template-card__check {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 6px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
  transition: box-shadow var(--dur-2) var(--ease-out);
}
.template-card:has(.template-card__input:checked) .template-card__check {
  box-shadow:
    inset 0 0 0 4.5px var(--accent),
    inset 0 0 0 16px var(--surface);
}
.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;
}

/* -- Danger sheets (r4 · 12.25: delete project / column) -------------------------------------------
   A small sheet like an alert: centred title, a 56px red (orange when nothing can be done) squircle
   glyph, the consequence, the confirmation field, then Cancel · Delete side by side. */
.danger-sheet .modal__header {
  text-align: center;
}
.danger-sheet .modal__header > .grow {
  padding-left: 28px; /* balances the close button */
}
.danger-sheet__hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.danger-sheet__glyph {
  --size: 56px;
  margin-bottom: 4px;
  box-shadow:
    inset 0 0.5px 0 rgb(255 255 255 / 0.35),
    0 2px 6px rgb(0 0 0 / 0.15);
}
.danger-sheet__glyph .icon {
  width: 28px;
  height: 28px;
}
.danger-sheet__lead,
.danger-sheet__text {
  color: var(--text-2);
  font-size: var(--type-callout);
  line-height: 1.45;
  text-wrap: pretty;
}
.danger-sheet__lead strong {
  color: var(--text);
}
@media (min-width: 640px) {
  .danger-sheet .modal__footer {
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    gap: 8px;
  }
  .danger-sheet .modal__footer .btn {
    width: 100%;
  }
}
.members-search {
  margin-bottom: var(--space-1);
}

/* Results of a filter change morphing in (projects.js): dim only if the fetch is not instant. */
.board-root,
.list-root {
  transition: opacity var(--dur-2) ease;
}
.board-root.is-filtering,
.list-root.is-filtering {
  opacity: 0.55;
  transition: opacity var(--dur-2) ease 80ms;
}

/* -- Toolbar of the project views (projects/partials/task_toolbar.html) ---------------------------
   The toolbar component itself is core (static/css/core/toolbar.css). Here: its place in the
   project header's row 2, the Display popover's field toggles, the active-filter row and the
   per-browser display prefs (data-hide / data-density on the view roots). */
.task-toolbar {
  flex: 1 1 auto;
}
.task-toolbar .toolbar__group--grow {
  justify-content: flex-start;
}
.task-toolbar__filter,
.task-toolbar__display {
  display: inline-flex;
}
.task-display {
  width: min(340px, calc(100vw - 16px));
}
.task-display .display-panel__row {
  flex-wrap: wrap;
  row-gap: 6px;
  padding-block: 4px;
}
.task-display .display-panel__row > .segmented,
.task-display .display-panel__row > .select-menu {
  margin-left: auto;
}
.task-display .select-menu,
.task-display select {
  min-width: 148px;
}
.task-display__title {
  padding: 8px 4px 6px;
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
}
.task-display__fields {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 4px 4px;
}
/* The toggles: core .filter-pill--xs (+ __check). */
/* Active filters: the first row of a view's content (inside the refreshed root). */
.view-filters {
  margin-bottom: var(--space-3);
}

/* Display prefs: hidden fields (data-hide on .board-root / .list-root) */
[data-hide~="key"] :is(.task-card__head, .task-row__main) > .task-key,
[data-hide~="type"] :is(.task-card__type, .task-row__main > .type-icon),
[data-hide~="priority"] :is(.task-card__meta > .priority, .task-row__cell--priority),
[data-hide~="due"] :is(.task-card__meta > .due, .task-row__cell--due),
[data-hide~="labels"] :is(.task-card__labels, .task-row__labels),
[data-hide~="assignee"] :is(.task-card__assignee, .task-row__cell--assignee),
[data-hide~="counts"] .task-card__stats {
  display: none !important;
}

/* -- 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: 300px;
  position: relative;
}
@property --board-fade-l {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}
@property --board-fade-r {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}
.board {
  --board-fade-l: 0px;
  --board-fade-r: 0px;
  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;
  /* Edge fades show there is more board to the left / right (classes set by projects.js). */
  -webkit-mask-image: linear-gradient(to right, transparent 0, black var(--board-fade-l), black calc(100% - var(--board-fade-r)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, black var(--board-fade-l), black calc(100% - var(--board-fade-r)), transparent 100%);
  transition:
    --board-fade-l var(--dur-2) ease,
    --board-fade-r var(--dur-2) ease;
}
.board.can-scroll-left {
  --board-fade-l: 28px;
}
.board.can-scroll-right {
  --board-fade-r: 48px;
}
.board.is-dragging {
  --board-fade-l: 0px;
  --board-fade-r: 0px;
}
.board-column {
  position: relative;
  display: flex;
  flex: 0 0 var(--col-w);
  flex-direction: column;
  width: var(--col-w);
  min-width: 0;
  max-height: 100%;
  min-height: 0;
  border-radius: var(--radius-panel); /* r4 · 12.7: a well, 18 − 6 padding = the card's 12 */
  background: var(--surface-well);
  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-well));
  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 1px color-mix(in srgb, var(--danger) 40%, transparent);
}
.board-column__header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 6px 6px 0 12px;
}
.board-column__dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tone);
}
.board-column__name {
  min-width: 0;
  overflow: hidden;
  font-size: var(--fs-sm);
  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-medium);
  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(--danger) 15%, transparent);
  color: var(--danger-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: 6px;
  min-height: 0;
  padding: 4px 6px 6px;
  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: 6px;
}
/* Empty column: one quiet line (components/empty_inline.html in .board-column__empty) — never a
   big box. While a card is dragged the (empty) list itself becomes a one-line dashed drop zone in
   the same place; the line hides as soon as the list holds a card (also the dragged one). */
.board-column__cards:not(:has(> .task-card)) {
  margin-bottom: -6px; /* no double gap above the empty line */
}
.board-column__empty .empty-inline {
  min-height: 34px;
  padding-inline: 8px;
}
.board-column__cards:has(> .task-card) + .board-column__empty,
.board.is-dragging .board-column__empty,
.board-column.is-composing .board-column__empty {
  display: none;
}
.board.is-dragging .board-column__cards:not(:has(> .task-card)) {
  margin-bottom: 0;
}
.board.is-dragging .board-column__cards:not(:has(> .task-card))::before {
  content: attr(data-empty-text);
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  outline: 1px dashed var(--line-strong);
  outline-offset: -1px;
  color: var(--text-3);
  font-size: var(--fs-sm);
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.board.is-dragging .board-column.is-drop-target .board-column__cards:not(:has(> .task-card))::before {
  outline-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: var(--accent-softer);
  color: var(--accent-ink);
}
.board-column__footer {
  padding: 0 6px 6px;
}
.board-column.is-composing .board-column__footer {
  display: none;
}
.board-column__add {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-full); /* r4 · 12.7: a capsule on hover */
  background: none;
  color: var(--text-3);
  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 drag (project admins): the header is the handle. */
.board-root[data-can-manage="1"] .board-column__header,
.board-root[data-can-manage="1"] .board-column__name[data-column-rename-trigger] {
  cursor: grab;
}
.board-root[data-can-manage="1"] .board-column__header :is(button, input) {
  cursor: pointer;
}
.board-column.board-column--ghost {
  background: color-mix(in srgb, var(--accent) 5%, transparent);
  box-shadow: none;
  outline: 2px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: -2px;
}
.board-column.board-column--ghost > * {
  visibility: hidden;
}
.board-column.board-column--lifted {
  opacity: 0.97;
  rotate: 1.2deg;
  box-shadow:
    0 0 0 1px var(--card-ring),
    var(--shadow-xl);
  cursor: grabbing;
}
.board-root.is-dragging-column .board {
  --board-fade-l: 0px;
  --board-fade-r: 0px;
}

/* Column menu */
.column-menu {
  min-width: 264px;
  max-width: min(320px, calc(100vw - 16px));
}
.column-menu .menu__text {
  white-space: normal;
  overflow-wrap: anywhere;
}
.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: 72px;
}
.column-menu__wip {
  flex-wrap: wrap;
  row-gap: 4px;
}
.column-menu__wip .btn--icon {
  margin-left: -4px;
}
.column-menu__wip .input[aria-invalid="true"] {
  border-color: var(--c-red);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-red) 18%, transparent);
}
.column-menu__wip-error {
  flex-basis: 100%;
  margin: 0;
  color: var(--c-red-ink);
  font-size: var(--fs-xs);
  line-height: 1.35;
}
.column-menu__wip-error[hidden] {
  display: none;
}

/* Quick add composer (board + list) */
.quick-add {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-board-card);
  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-width: 0;
  max-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;
}
.board-column .quick-add__hint {
  display: none;
}
.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 (project admins, r4 · 12.7): a dashed tile the width of a column at the end of the
   board — "+ Add column" centred; its form opens in a well like the columns'. */
.board-add-column {
  flex: 0 0 var(--col-w);
  width: var(--col-w);
}
.board-add-column__button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 48px;
  padding: 0 12px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-panel);
  background: none;
  color: var(--text-3);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  white-space: nowrap;
  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: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-softer);
  color: var(--accent-ink);
}
.board-add-column__button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: no-preference) {
  .board-add-column__button:active {
    scale: 0.98;
    transition: scale var(--dur-1) ease;
  }
}
.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: 6px;
  border-radius: var(--radius-panel);
  background: var(--surface-well);
}
.board-add-column__form[hidden] {
  display: none;
}
.board-add-column__actions {
  display: flex;
  gap: 6px;
}
.board__empty {
  flex: 1;
  align-self: center;
}
/* Compact density (Display popover): tighter cards, titles up to two lines. */
.board-root[data-density="compact"] .board-column__cards {
  gap: 4px;
}
.board-root[data-density="compact"] .task-card {
  gap: 2px;
  padding: 7px 9px 7px 10px;
}
.board-root[data-density="compact"] .task-card__title {
  font-size: var(--fs-sm);
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.board-root[data-density="compact"] .task-card__meta {
  margin-top: 1px;
}
/* A project without tasks: the empty state (projects/partials/empty_project.html) */
.empty-project {
  display: flex;
  justify-content: center;
  padding: var(--space-6) 0 var(--space-8);
}
.empty-project > .empty-state {
  width: min(520px, 100%);
}

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

/* Phones: column pills in a glass capsule floating 8px above the tab bar (r4 · 11.6) — tap to
   jump; follows the scroll (projects.js syncSwitcher). */
.board-switcher {
  display: none;
}
@media (max-width: 767px) {
  .board-root:has(> .board-switcher) {
    padding-bottom: 52px; /* the last cards scroll clear of the capsule */
  }
  .board-switcher {
    position: fixed;
    z-index: var(--z-sticky);
    right: max(12px, var(--safe-right));
    bottom: calc(max(8px, var(--safe-bottom) - 8px) + var(--tabbar-h) + 8px);
    left: max(12px, var(--safe-left));
    display: flex;
    gap: 2px;
    width: fit-content;
    max-width: calc(100vw - 24px);
    margin: 0 auto;
    padding: 4px;
    overflow-x: auto;
    border: 0.5px solid var(--glass-border);
    border-radius: var(--radius-full);
    background: var(--glass-sheen), var(--mat-chrome);
    -webkit-backdrop-filter: var(--mat-filter-strong);
    backdrop-filter: var(--mat-filter-strong);
    box-shadow: var(--glass-rim), var(--shadow-md);
    scroll-padding-inline: 4px;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
    transition: transform var(--dur-smooth) var(--spring-smooth);
  }
  /* The tab bar shrinks while scrolling down: the capsule follows it. */
  :root:has(.tabbar.is-minimized) .board-switcher {
    transform: translateY(10px);
  }
  .board-switcher::-webkit-scrollbar {
    display: none;
  }
  .board-switcher__item {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 0 11px 0 10px;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--text-2);
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    text-decoration: none;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    transition:
      background-color var(--dur-2) ease,
      color var(--dur-2) ease,
      box-shadow var(--dur-2) ease;
  }
  .board-switcher__item .dot {
    width: 7px;
    height: 7px;
  }
  .board-switcher__item[aria-current="true"] {
    background: var(--segmented-thumb);
    box-shadow:
      0 0 0 0.5px var(--glass-border),
      var(--shadow-sm);
    color: var(--text);
    font-weight: var(--fw-semibold);
  }
  .board-switcher__count {
    color: var(--text-3);
    font-variant-numeric: tabular-nums;
  }
  .board-switcher__item:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
  }
}
@media (max-width: 767px) and (pointer: coarse) {
  .board-switcher__item {
    min-height: 32px;
  }
}

/* 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 ---------------------------------------------------------------------------------------- */
/* Cell widths follow the list's own width (container query), not the window: with the sidebar
   open a 1280px window leaves the list ~950px. Wide lists (≥ 1080px) show the priority name, the
   assignee's name and label names; narrower ones icons, avatars and label colour dots. */
.list-root {
  position: relative;
  padding-bottom: var(--space-12);
  container: task-list / inline-size;
}
.list-view {
  --cell-due: 104px;
  --cell-priority: 40px;
  --cell-assignee: 40px;
  --row-key: 52px;
}
@container task-list (min-width: 1080px) {
  .list-view {
    --cell-due: 112px;
    --cell-priority: 116px;
    --cell-assignee: 172px;
  }
}
.list-view {
  --list-head-h: 0px;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.list-head {
  display: none;
}
@media (min-width: 768px) {
  /* The column header sticks under the (sticky) topbar; projects.js keeps --list-sticky-top in
     sync with the topbar's real height. */
  .list-head {
    position: sticky;
    top: var(--list-sticky-top, 0px);
    z-index: 3;
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--cell-due) var(--cell-priority) var(--cell-assignee);
    align-items: center;
    gap: 10px;
    min-height: 34px;
    margin-bottom: calc(var(--space-3) * -1 + 2px);
    padding: 0 14px 0 calc(16px + 20px + 12px + var(--row-key) + 8px);
    border-radius: var(--radius-md);
    background: var(--bg);
    transition:
      background-color var(--dur-2) ease,
      box-shadow var(--dur-2) ease;
  }
  /* r4 · 12.8: once the rows scroll under it, the header turns into a thin glass strip. */
  .list-head.is-stuck {
    background: var(--glass-sheen), var(--mat-chrome);
    -webkit-backdrop-filter: var(--mat-filter);
    backdrop-filter: var(--mat-filter);
    box-shadow:
      var(--glass-rim),
      0 0 0 0.5px var(--glass-border),
      var(--shadow-sm);
  }
  .list-view.is-selectable .list-head {
    padding-left: calc(10px + 18px + 10px + 20px + 10px + var(--row-key) + 8px);
  }
  .list-view {
    --list-head-h: 34px;
  }
}
.list-head__sort {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  justify-self: start;
  min-width: 0;
  max-width: 100%;
  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__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-head__icon {
  display: none;
  flex-shrink: 0;
}
/* Narrow cells (priority, assignee below the wide tier): an icon (+ tooltip) instead of a clipped
   word. */
@container task-list (max-width: 1079px) {
  .list-head__sort--3,
  .list-head__sort--4 {
    justify-self: center;
  }
  .list-head__sort--3 .list-head__icon,
  .list-head__sort--4 .list-head__icon {
    display: block;
  }
  .list-head__sort--3 .list-head__label,
  .list-head__sort--4 .list-head__label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .list-head__sort--3.is-active > .icon:last-child,
  .list-head__sort--4.is-active > .icon:last-child {
    display: none;
  }
}
.list-head__sort:hover {
  background: var(--fill-1);
  color: var(--text);
}
.list-head__sort.is-active {
  color: var(--accent-ink);
}
/* A group = one card (Linear-like): a sticky header bar (name · count · +), dense rows, and an
   "Add task" row at the bottom. overflow: clip (not hidden) keeps the header sticky. */
.list-section {
  overflow: clip;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow:
    0 0 0 1px var(--card-ring),
    var(--shadow-xs);
}
.list-section__header {
  position: sticky;
  top: calc(var(--list-sticky-top, 0px) + var(--list-head-h));
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  padding: 0 8px 0 6px;
  background: var(--surface);
  box-shadow: inset 0 -0.5px 0 var(--line-subtle);
}
.list-section.is-collapsed .list-section__header {
  box-shadow: none;
}
.list-section__toggle {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 28px;
  padding: 0 8px 0 4px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text);
  font-size: var(--fs-sm);
  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-snappy) var(--spring-snappy);
}
.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;
}
.list-section__body[hidden] {
  display: none;
}
.list-section__rows {
  display: flex;
  flex-direction: column;
  min-height: 4px;
}
/* An empty group: one quiet line (a drop target while dragging). */
.list-section__rows:not(:has(> .task-row))::before {
  content: attr(data-empty-text);
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 0 16px;
  color: var(--text-3);
  font-size: var(--fs-sm);
}
.list-root.is-dragging .list-section__rows:not(:has(> .task-row))::before {
  margin: 4px 8px;
  border-radius: var(--radius-md);
  outline: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: -1px;
  background: var(--accent-softer);
  color: var(--accent-ink);
}
.list-section__more {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 16px;
  box-shadow: inset 0 0.5px 0 var(--line-subtle);
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.list-section__more:hover {
  background: var(--surface-2);
  color: var(--text);
}
.list-section.is-composing .list-section__add {
  display: none;
}
.list-section__add {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 38px;
  padding: 0 16px 0 18px;
  border: 0;
  background: none;
  box-shadow: inset 0 0.5px 0 var(--line-subtle);
  color: var(--text-3);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-align: left;
  cursor: pointer;
  transition:
    background-color var(--dur-1) ease,
    color var(--dur-1) ease;
}
.list-section__add:hover {
  background: var(--surface-2);
  color: var(--text);
}
.list-section__add:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: -2px;
}
.list-section .quick-add--row {
  margin: 6px;
  border-radius: var(--radius-md);
}
/* Rows: hover lifts to --surface-2 (core); completed rows read muted. */
.list-view .task-row.is-done .task-row__title {
  color: var(--text-3);
}
.list-view .task-row.is-done :is(.task-row__labels, .task-row__meta) {
  opacity: 0.6;
}
/* Compact density (Display popover): 34px rows. */
.list-root[data-density="compact"] .list-view .task-row {
  min-height: 34px;
  padding-block: 2px;
}
.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__main > .task-key {
    min-width: var(--row-key);
  }
  .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;
  }
}
/* Below the wide tier label chips become colour dots (names in the tooltip / aria-label), so
   titles keep their room and no chip is cut mid-word. */
@container task-list (min-width: 600px) and (max-width: 1079px) {
  .list-view .task-row__labels {
    flex-shrink: 0;
    gap: 3px;
  }
  .list-view .task-row__labels .chip {
    width: 18px;
    padding: 0;
    justify-content: center;
  }
  .list-view .task-row__labels .chip__text {
    display: none;
  }
}
@container task-list (min-width: 1080px) {
  /* Chips keep their natural width (never padded, never cut mid-word); only a very long name
     ellipsizes inside its own chip (title = full name) and the title gives way first. */
  .list-view .task-row__labels {
    flex-shrink: 0;
  }
  .list-view .task-row__labels .chip {
    flex-shrink: 0;
    max-width: 128px;
  }
  .list-view .task-row__cell--priority,
  .list-view .task-row__cell--assignee {
    justify-self: stretch;
    justify-content: flex-start;
    gap: 7px;
    min-width: 0;
  }
  .list-view .task-row__cell-text {
    display: block;
  }
  .list-view .task-row__cell--priority > .priority {
    flex-shrink: 0;
  }
}
@media (max-width: 767px) {
  .list-root {
    padding-bottom: calc(var(--space-12) + var(--tabbar-h));
  }
  /* Phones (r4 · 12.8, iOS inset grouped): the group header — a sticky bar on the page background —
     sits above one white rounded group of rows; the "Add task" row closes the group. */
  .list-section {
    overflow: visible;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }
  .list-section__header {
    margin: 0 calc(var(--page-pad-x) * -1) 4px;
    padding-inline: calc(var(--page-pad-x) - 6px) var(--page-pad-x);
    background: var(--bg);
    box-shadow: none;
  }
  .list-section__body {
    overflow: clip;
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow:
      0 0 0 0.5px var(--card-ring),
      var(--shadow-xs);
  }
  .list-section__rows {
    overflow-x: clip;
  }
  .list-view .task-row__select {
    display: none;
  }
  .list-view .task-row__meta {
    gap: 6px;
  }
}
/* A completed row leaving a "Hide completed" list (projects.js sets the start height). */
.task-row.is-leaving {
  overflow: hidden;
  min-height: 0;
  padding-block: 0;
  opacity: 0;
  transition:
    height var(--dur-3) var(--ease-in-out),
    padding var(--dur-3) var(--ease-in-out),
    opacity var(--dur-2) ease;
}
.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;
  min-height: 48px;
  max-width: calc(100vw - 24px);
  padding: 6px;
  border: 0.5px solid var(--glass-border);
  border-radius: var(--radius-full);
  background: var(--glass-sheen), var(--mat-thick);
  -webkit-backdrop-filter: var(--mat-filter-strong);
  backdrop-filter: var(--mat-filter-strong);
  box-shadow: var(--glass-rim), 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-bouncy) var(--spring-bouncy) both;
  }
  .bulk-bar.is-leaving {
    animation: projects-bar-out var(--dur-2) var(--ease-in-out) forwards;
  }
}
/* r4 · 12.8: the capsule slides up from below the window edge and settles with a little bounce. */
@keyframes projects-bar-in {
  from {
    transform: translateY(calc(100% + 48px));
  }
}
@keyframes projects-bar-out {
  to {
    opacity: 0;
    transform: translateY(calc(100% + 24px));
  }
}
.bulk-bar__count {
  padding: 0 10px 0 12px;
  color: var(--accent-ink);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bulk-bar > .btn,
.bulk-bar > div > .btn {
  height: 36px;
}
.bulk-bar.is-compact .btn:not(.btn--icon),
.bulk-bar .btn--icon {
  width: 36px;
}
.bulk-bar__sep {
  width: 1px;
  height: 20px;
  margin: 0 4px;
  background: var(--line);
}
.bulk-bar__delete,
.bulk-bar__delete .icon {
  color: var(--danger-ink);
}
/* Labels give way to icons when they don't fit — long ky/ru labels on tablets, phones (projects.js
   sets .is-compact by measuring); the tooltip (= aria-label) only shows then. */
.bulk-bar:not(.is-compact) [data-tooltip]::after {
  display: none;
}
.bulk-bar.is-compact .btn > .btn__label {
  display: none;
}
.bulk-bar.is-compact .btn:not(.btn--icon) {
  width: 36px;
  padding: 0;
}
/* Centred over the main column, clear of the sidebar (or the rail). */
@media (min-width: 1024px) {
  .bulk-bar {
    --bulk-aside: var(--sidebar-col);
    left: calc(50% + var(--bulk-aside) / 2);
    max-width: calc(100vw - var(--bulk-aside) - 32px);
  }
  .app.is-rail .bulk-bar {
    --bulk-aside: var(--rail-col);
  }
}
/* Phones: the capsule takes the tab bar's place — the tab bar steps aside while rows are
   selected (r4 · 12.8). */
@media (max-width: 767px) {
  .bulk-bar {
    bottom: max(8px, calc(var(--safe-bottom) - 8px));
    min-height: var(--tabbar-h);
  }
  :root:has(#bulk-bar) .tabbar {
    transition:
      transform var(--dur-smooth) var(--spring-smooth),
      opacity var(--dur-2) ease;
  }
  :root:has(#bulk-bar:not([hidden], .is-leaving)) .tabbar {
    opacity: 0;
    transform: translateY(calc(100% + 16px));
    pointer-events: none;
    visibility: hidden;
    transition:
      transform var(--dur-2) var(--ease-in-out),
      opacity var(--dur-2) ease,
      visibility 0s var(--dur-2);
  }
}

/* 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;
}
/* Summary band: progress (ring + status bar + legend) · four counters · time tracked. Labels
   never wrap mid-tile (long ky/ru words): they truncate with a tooltip, values stay on one line. */
.overview-hero {
  display: grid;
  gap: var(--space-5);
  padding: 20px 24px;
  border-radius: var(--radius-widget); /* r4 · 12.6: the progress widget */
  box-shadow:
    0 0 0 0.5px var(--card-ring),
    var(--shadow-sm),
    inset 0 0.5px 0 var(--card-highlight);
}
.overview-hero__progress {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  min-width: 0;
}
.overview-hero__progress .progress-ring {
  flex-shrink: 0;
}
.overview-hero__progress .progress-ring__label {
  font-family: var(--font-rounded);
  font-size: var(--fs-title-2);
  font-weight: var(--fw-bold);
  letter-spacing: -0.02em;
}
.overview-hero__summary {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.overview-hero__label {
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  line-height: 1.3;
}
.overview-hero__sub {
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}
.overview-hero__bar {
  height: 8px;
  margin-top: 8px;
}
.overview-hero__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}
.overview-hero__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  color: var(--text-2);
  font-size: var(--fs-xs);
}
.overview-hero__legend-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.overview-hero__legend-count {
  color: var(--text);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
}
.overview-hero__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  min-width: 0;
}
/* Mini widgets (r4 · 12.6): a coloured glyph circle + label, a big rounded number. */
.overview-stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 12px 14px 14px;
  border-radius: var(--radius-card);
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
  transition:
    background-color var(--dur-1) ease,
    box-shadow var(--dur-1) ease,
    transform var(--dur-snappy) var(--spring-snappy);
}
a.overview-stat:hover {
  background: var(--fill-2);
}
a.overview-stat:active {
  transform: scale(0.97);
  transition-duration: var(--dur-1);
}
.overview-stat__label > .overview-stat__icon {
  display: inline-grid;
  flex-shrink: 0;
  place-items: center;
  width: 22px;
  min-width: 22px;
  height: 22px;
  overflow: visible;
  border-radius: 50%;
  background: var(--tone-gradient);
  color: var(--tone-on);
}
.overview-stat__icon .icon {
  --icon-stroke: 2.4;
}
a.overview-stat:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: 2px;
}
.overview-stat__label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  white-space: nowrap;
}
.overview-stat__label > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.overview-stat__label .icon {
  flex-shrink: 0;
}
.overview-stat__value {
  font-family: var(--font-rounded);
  font-size: var(--type-title1);
  font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.overview-stat.is-alert {
  background: var(--tone-softer);
  box-shadow: inset 0 0 0 0.5px var(--tone-line);
}
a.overview-stat.is-alert:hover {
  background: var(--tone-soft);
}
/* Latest status update, one line under the numbers */
.overview-pulse {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
  padding-top: var(--space-4);
  border-top: 0.5px solid var(--line);
  font-size: var(--fs-sm);
}
.overview-pulse__text {
  flex: 1 1 220px;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}
a.overview-pulse__text:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.overview-pulse__text--empty {
  color: var(--text-3);
}
.overview-pulse__meta {
  color: var(--text-3);
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.overview-start {
  padding: var(--space-2) var(--space-4);
}
.overview-start .empty-project {
  padding-block: var(--space-4);
}
.overview-stat.is-alert .overview-stat__value {
  color: var(--tone-ink);
}
.overview-time {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  padding-top: var(--space-4);
  border-top: 0.5px solid var(--line);
  font-size: var(--fs-sm);
}
.overview-time__icon {
  display: inline-grid;
  margin-right: -10px;
  color: var(--tone);
}
.overview-time__item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}
.overview-time__label {
  color: var(--text-2);
}
.overview-time__value {
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
}
.overview-time__meter {
  display: inline-flex;
  flex: 1 1 160px;
  align-items: center;
  gap: 10px;
  min-width: 140px;
  max-width: 360px;
}
.overview-time__meter .progress {
  flex: 1;
}
.overview-time__pct {
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
}
@container overview (min-width: 640px) {
  .overview-hero__stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@container overview (min-width: 1080px) {
  .overview-hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
    align-items: center;
    column-gap: var(--space-8);
  }
  .overview-time,
  .overview-pulse {
    grid-column: 1 / -1;
  }
}
@container overview (max-width: 420px) {
  .overview-hero {
    padding: 16px;
  }
  .overview-hero__progress {
    align-items: flex-start;
    gap: var(--space-4);
  }
}
.overview-dates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
.overview-dates__arrow {
  color: var(--text-3);
}
.overview-grid {
  display: grid;
  gap: var(--space-5);
  align-items: start;
}
/* r4 · 12.6: two columns 8 / 4 */
@container overview (min-width: 860px) {
  .overview-grid {
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  }
}
.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);
}
/* Details as form-group rows (r4 · 12.6): label left, value right, hairlines between. */
.overview-props {
  gap: 0;
}
.overview-props dt {
  min-height: 40px;
}
.overview-props dd {
  justify-content: flex-end;
  min-height: 40px;
  padding-left: 12px;
  font-size: var(--fs-sm);
  text-align: right;
}
.overview-props dt:not(:first-of-type),
.overview-props dd:not(:first-of-type) {
  box-shadow: inset 0 0.5px 0 var(--line);
}
.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 */
/* Status updates (r4 · 12.6): a section of cards — the composer is an inset grouped field with
   a status segmented control (coloured dots) and the primary "Post update"; each update a card. */
.overview-updates {
  display: flex;
  flex-direction: column;
}
.overview-updates > .overview-card__header {
  margin-bottom: var(--space-2);
  padding-inline: 4px;
}
.update-composer {
  --card-pad: 6px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: var(--space-4);
}
.update-composer__body.input {
  min-height: 64px;
  padding: 10px 4px 4px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  font-size: var(--type-body);
}
.update-composer__body.input:focus,
.update-composer__body.input:focus-visible {
  outline: none;
  box-shadow: none;
}
.update-composer:focus-within {
  box-shadow:
    0 0 0 0.5px var(--card-ring),
    0 0 0 3.5px var(--focus-ring),
    var(--shadow-xs);
}
.update-composer__statuses {
  display: flex;
  align-self: flex-start;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.update-composer__statuses::-webkit-scrollbar {
  display: none;
}
.update-composer__statuses .segmented__item {
  flex: 0 0 auto;
}
.update-composer__statuses .segmented__item > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.status-choice__dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tone);
}
.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-3);
}
.status-update {
  --card-pad: 14px 16px;
  display: flex;
  gap: 12px;
  min-width: 0;
}
.updates-feed > .overview-card__empty {
  padding: 4px;
}
.status-update__avatar {
  position: relative;
  flex-shrink: 0;
}
.status-update__body {
  flex: 1;
  min-width: 0;
}
.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: 8px;
}
.distribution__seg {
  flex: var(--share) 1 0;
  min-width: 8px;
  border-radius: var(--radius-full);
  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);
  }
}

.deadline-list,
.project-people {
  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: 0.5px 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);
}
.project-people__item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}
.project-people__item + .project-people__item {
  border-top: 0.5px solid var(--line);
}
.project-people__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.project-people__name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
}
.project-people__full {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-people__lead {
  display: inline-grid;
  flex-shrink: 0;
  color: var(--c-orange);
}
.project-people__role {
  overflow: hidden;
  color: var(--text-2);
  font-size: var(--fs-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.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;
  scrollbar-width: none;
}
.settings-views::-webkit-scrollbar {
  display: none;
}
/* Six views do not fit a phone: the segments keep their words and the control scrolls. */
@media (max-width: 639px) {
  .settings-views .segmented__item {
    flex: 1 0 auto;
  }
}
@media (max-width: 767px) {
  .settings-identity > .icon-tile {
    display: none;
  }
}
/* Project settings share the settings anatomy of account / workspace settings (people.css:
   .settings-head, .settings-section, .save-bar, .danger-zone list rows). */
.people-settings > .project-settings__header {
  margin-bottom: 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: 52px;
  padding: 6px 8px 6px 8px;
  background: var(--surface);
}
/* r4 · 12.14: inset grouped rows — hairlines start at the name, like iOS. */
.workflow-col + .workflow-col::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 66px;
  height: 0.5px;
  background: var(--line);
}
.workflow-col.sortable-chosen::before,
.workflow-col.sortable-chosen + .workflow-col::before {
  display: none;
}
.workflow-col.sortable-ghost {
  background: var(--accent-softer);
}
.workflow-col.sortable-ghost > * {
  visibility: hidden;
}
.workflow-col.sortable-fallback {
  border-radius: 12px;
  box-shadow:
    0 0 0 0.5px var(--card-ring),
    var(--shadow-lift);
  opacity: 1 !important;
  scale: 1.02;
}
.workflow-col__handle {
  display: grid;
  place-items: center;
  height: 32px;
  color: var(--text-3);
  cursor: grab;
}
.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;
  box-shadow: none;
  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: 8px 10px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-card);
}
.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;
}

/* Section titles of the project settings. Not .page-header__title: the app shell treats that as a
   "large title" duplicating the topbar title and hides the small one (the project name) until
   it scrolls away — here the topbar must keep showing which project is being configured. */
.project-settings__title {
  font-family: var(--font-display);
  font-size: var(--fs-title-1);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
}

/* 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;
}
.project-member-row__actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.project-member-row__actions .input {
  width: auto;
}
.project-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) {
  .project-member-row {
    flex-wrap: wrap;
  }
  .project-member-row__actions {
    width: 100%;
    padding-left: 48px;
  }
  .project-member-row__actions > form {
    flex: 1;
    min-width: 0;
  }
  .project-member-row__actions .input {
    width: 100%;
  }
  .member-add__row select {
    flex: 1 1 100%;
  }
}
.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;
}
/* Project header: the members' avatar stack refreshes itself inside its button (layouts/project.html) */
.project-members__stack {
  display: contents;
}
