/*
 * Application shell: sidebar, top bar, project header, list view, task drawer.
 * Everything is desktop-first — the workday happens on a large screen — with
 * tablet and phone breakpoints at the bottom.
 */

/* ---- shell ------------------------------------------------------------ */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
  background: var(--background);
}

.app-shell.is-collapsed {
  grid-template-columns: var(--sidebar-width-collapsed) minmax(0, 1fr);
}

.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
}

.app-content {
  flex: 1;
  min-height: 0;
  /* Pages own their scroll regions; this only catches content that does not. */
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* ---- sidebar ---------------------------------------------------------- */

.sidebar {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--sidebar-background);
  color: var(--sidebar-text);
  border-right: 1px solid var(--sidebar-border);
  overflow: hidden;
}

.sidebar-top {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: var(--topbar-height);
  padding: 0 var(--space-3) 0 var(--space-4);
  border-bottom: 1px solid var(--sidebar-border);
  flex: 0 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  color: var(--sidebar-text);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: var(--radius);
  background: var(--brand);
  color: #ffffff;
}

.brand-name {
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sidebar-toggle {
  margin-left: auto;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--sidebar-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle:hover {
  background: var(--sidebar-surface-hover);
  color: var(--sidebar-text);
}

.sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-3) var(--space-3) var(--space-6);
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  background: #3a3b3e;
  background-clip: content-box;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: 30px;
  padding: 0 var(--space-3);
  border-radius: var(--radius);
  color: var(--sidebar-text);
  font-size: var(--text-base);
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.nav-item:hover {
  background: var(--sidebar-surface-hover);
  text-decoration: none;
}

.nav-item.is-active {
  background: var(--sidebar-surface-active);
  font-weight: 600;
}

.nav-item svg {
  flex: 0 0 auto;
  color: var(--sidebar-text-muted);
}

.nav-item.is-active svg {
  color: var(--sidebar-text);
}

.nav-item-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--danger);
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-group {
  margin-top: var(--space-5);
}

.nav-group-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: none;
  background: transparent;
  color: var(--sidebar-text-muted);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.nav-group-header:hover {
  color: var(--sidebar-text);
}

.nav-group-chevron {
  transition: transform var(--transition-fast);
}

.nav-group-chevron.is-collapsed {
  transform: rotate(-90deg);
}

.nav-group-action {
  margin-left: auto;
  display: flex;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.nav-group:hover .nav-group-action {
  opacity: 1;
}

.project-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 3px;
}

.sidebar-divider {
  height: 1px;
  margin: var(--space-3) var(--space-3);
  background: var(--sidebar-border);
}

.sidebar-empty {
  padding: var(--space-2) var(--space-3);
  color: var(--sidebar-text-muted);
  font-size: var(--text-sm);
}

/* Collapsed sidebar keeps only the icon rail. */
.is-collapsed .brand-name,
.is-collapsed .nav-item-label,
.is-collapsed .nav-group-header span,
.is-collapsed .sidebar-empty,
.is-collapsed .nav-badge {
  display: none;
}

.is-collapsed .nav-item {
  justify-content: center;
  padding: 0;
}

.is-collapsed .nav-group-header {
  justify-content: center;
}

/* ---- top bar ---------------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  height: var(--topbar-height);
  padding: 0 var(--space-5);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex: 0 0 auto;
  z-index: 200;
}

.topbar-search {
  position: relative;
  flex: 0 1 460px;
}

.topbar-search svg {
  position: absolute;
  top: 50%;
  left: var(--space-3);
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

.topbar-search input {
  width: 100%;
  height: 30px;
  padding: 0 var(--space-4) 0 30px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--surface-sunken);
  color: var(--text-primary);
  font: inherit;
}

.topbar-search input:hover {
  background: var(--surface-hover);
}

.topbar-search input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.topbar-search kbd {
  position: absolute;
  top: 50%;
  right: var(--space-3);
  transform: translateY(-50%);
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  font-family: var(--font-sans);
  font-size: 10px;
  pointer-events: none;
}

.topbar-spacer {
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 2px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  cursor: pointer;
}

.topbar-user:hover {
  background: var(--surface-hover);
}

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

.page-header {
  padding: var(--space-5) var(--space-6) 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex: 0 0 auto;
}

.page-header-main {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.page-header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  color: #ffffff;
}

.page-title-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.page-title {
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.page-subtitle {
  margin-top: 1px;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.tabs {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: 34px;
  padding: 0 var(--space-4);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-base);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border-radius: var(--radius) var(--radius) 0 0;
}

.tab:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  text-decoration: none;
}

.tab.is-active {
  color: var(--text-primary);
  font-weight: 600;
}

.tab.is-active::after {
  content: "";
  position: absolute;
  right: var(--space-3);
  bottom: 0;
  left: var(--space-3);
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--text-primary);
}

.tab:disabled {
  color: var(--text-tertiary);
  cursor: not-allowed;
}

.tab:disabled:hover {
  background: transparent;
  color: var(--text-tertiary);
}

/* ---- toolbar ---------------------------------------------------------- */

/*
 * Two rows, not one wrapping line: the controls stay put and the active
 * criteria appear underneath. A toolbar that rearranges itself as you use it is
 * worse than one line more.
 */
.toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex: 0 0 auto;
}

.toolbar-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

/* Separates what narrows the list from what arranges it. */
.toolbar-divider {
  flex: 0 0 auto;
  width: 1px;
  height: 18px;
  margin: 0 var(--space-1);
  background: var(--border);
}

.toolbar-spacer {
  flex: 1;
}

/* ---- scroll region ---------------------------------------------------- */

.page-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: var(--background);
}

.page-body {
  max-width: var(--content-max-width);
  padding: var(--space-6);
}

/* A page of cards takes the whole width: a grid that fills itself with as
   many columns as fit has no reason to stop short of the edge and leave a
   third of a wide monitor empty. Reading pages keep the measure. */
.page-body.is-fluid {
  max-width: none;
}

/* ---- task list -------------------------------------------------------- */

.task-list {
  padding-bottom: var(--space-8);
}

.task-list-head {
  position: sticky;
  top: 0;
  z-index: 60;
  display: grid;
  align-items: center;
  height: 32px;
  padding: 0 var(--space-6);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
}

.task-list-head > div {
  padding: 0 var(--space-3);
}

/* Columns: title | assignee | due date | priority | status */
.task-grid {
  /* Set inline from the columns this person left switched on. The fallback is
     every column, which is what a page renders with before its preferences have
     been read out of the browser. */
  grid-template-columns: var(--task-grid-columns, minmax(240px, 1fr) 140px 120px 150px 130px 100px 120px);
}

.section-group {
  border-bottom: 1px solid var(--border);
}

.section-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: 34px;
  padding: 0 var(--space-6);
  background: var(--background-subtle);
  position: sticky;
  top: 32px;
  z-index: 50;
}

.section-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
}

.section-toggle:hover {
  background: var(--surface-active);
  color: var(--text-primary);
}

.section-toggle svg {
  transition: transform var(--transition-fast);
}

.section-toggle.is-collapsed svg {
  transform: rotate(-90deg);
}

.section-name {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 1px var(--space-2);
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: var(--text-base);
  font-weight: 600;
}

.section-name:hover {
  background: var(--surface-hover);
}

.section-name:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

.section-count {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

.section-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.section-header:hover .section-actions,
.section-header:focus-within .section-actions {
  opacity: 1;
}

/* ---- task row --------------------------------------------------------- */

.task-row {
  display: grid;
  align-items: center;
  min-height: var(--row-height);
  padding: 0 var(--space-6);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.task-row:hover {
  background: var(--surface-hover);
}

.task-row.is-selected {
  background: var(--accent-soft);
}

.task-row.is-completed .task-title {
  color: var(--text-tertiary);
  text-decoration: line-through;
}

.task-row.is-dragging {
  opacity: 0.4;
}

.task-row.is-drop-target {
  box-shadow: inset 0 2px 0 var(--accent);
}

.task-cell {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  padding: 0 var(--space-3);
  height: 100%;
}

.task-cell-title {
  gap: var(--space-3);
  padding-left: 0;
}

.task-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 20px;
  margin-left: -14px;
  color: var(--text-tertiary);
  opacity: 0;
  cursor: grab;
  transition: opacity var(--transition-fast);
}

.task-row:hover .task-drag-handle {
  opacity: 1;
}

/* The subtask twisty, and the gap it leaves behind on rows without one. Both
   are the same width so titles stay in a single column down the list. */
.task-twisty,
.task-twisty-spacer {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-right: calc(var(--space-3) * -1 + 2px);
}

.task-twisty {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
}

.task-twisty:hover {
  background: var(--surface-active);
  color: var(--text-primary);
}

.task-twisty svg {
  transform: rotate(-90deg);
  transition: transform var(--transition-fast);
}

.task-twisty.is-open svg {
  transform: rotate(0deg);
}

/* Placeholder while a subtask list is on its way. */
.task-row-loading {
  display: flex;
  align-items: center;
  min-height: var(--row-height);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.task-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-base);
}

.task-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 0 0 auto;
  color: var(--text-tertiary);
  font-size: var(--text-xs);
}

.task-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.task-key {
  flex: 0 0 auto;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.task-row-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.task-row:hover .task-row-actions {
  opacity: 1;
}

.due-date {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 22px;
  padding: 0 var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  cursor: pointer;
}

.due-date:hover {
  background: var(--surface-active);
}

.due-date.is-overdue {
  color: var(--danger);
  font-weight: 500;
}

.due-date.is-today {
  color: var(--warning);
  font-weight: 500;
}

/* ---- due date panels -------------------------------------------------- */

/*
  The date popover is a form, not a list of options. The 340px cap that keeps a
  long list of projects or people scrollable is simply too short for it once the
  weekly repeat section opens, and a scrollbar through a form is a nuisance: the
  fields below the fold look like there is nothing there. It gets a cap tied to
  the window instead, so it scrolls only on a screen too short to hold it at all.
*/
.date-menu {
  min-width: 262px;
  max-height: min(620px, calc(100vh - 24px));
}

/* The time and repeat sections that fold out of the date popover. */
.date-extra {
  padding: var(--space-3) var(--space-3) var(--space-2);
  border-top: 1px solid var(--border);
}

.date-extra .label {
  display: block;
  margin-bottom: var(--space-2);
}

.date-footer {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0 var(--space-2) var(--space-1);
}

.date-footer .btn-icon.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.weekday-row {
  display: flex;
  gap: 4px;
}

.weekday {
  width: 26px;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.weekday:hover {
  background: var(--surface-hover);
}

.weekday.is-on {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.due-date.is-empty {
  color: var(--text-tertiary);
}

/* Rendered as a button when idle and as a wrapper around the input while
   typing, so both states line up with the task rows above them. */
.add-task-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  height: var(--row-height);
  padding: 0 var(--space-6);
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-tertiary);
  font: inherit;
  font-size: var(--text-base);
  text-align: left;
  cursor: text;
}

.add-task-row:hover {
  background: var(--surface-hover);
  color: var(--text-secondary);
}

.add-task-row input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
}

.add-task-row input:focus {
  outline: none;
}

.add-section-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  color: var(--text-tertiary);
}

/* ---- project cards (Projects page) ------------------------------------ */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: var(--space-4);
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.project-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.project-card-top {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.project-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  color: #ffffff;
}

.project-card-name {
  font-size: var(--text-md);
  font-weight: 600;
}

.project-card-team {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

.project-card-footer {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: auto;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.progress-track {
  flex: 1;
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--success);
  transition: width var(--transition);
}

/* ---- task drawer ------------------------------------------------------ */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: transparent;
  z-index: 480;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: var(--drawer-width);
  max-width: 100vw;
  border-left: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-drawer);
  z-index: 500;
  animation: drawer-in 160ms ease;
}

@keyframes drawer-in {
  from {
    transform: translateX(16px);
    opacity: 0;
  }
}

/* ---- the same task, in the middle or as a page ---------------------------
   How a task opens is each person's choice (the account menu): the edge is
   the default, the middle gives a wider reading, the page the whole window.
   The full-screen button in the header goes to the page from either. */

.drawer-backdrop.is-dim {
  background: var(--overlay);
}

.drawer.is-centered {
  top: 24px;
  right: auto;
  bottom: 24px;
  left: 50%;
  width: min(1100px, calc(100vw - 48px));
  transform: translateX(-50%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  animation: drawer-centered-in 160ms ease;
}

@keyframes drawer-centered-in {
  from {
    transform: translate(-50%, 8px);
    opacity: 0;
  }
}

/* The page's own scroll region, the task's surface colour edge to edge. */
.task-page {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: var(--surface);
}

/* A page of its own: in the flow of the shell, as wide as the content area,
   and the body scrolls with the page rather than inside a fixed box. */
.drawer.is-page {
  position: static;
  width: auto;
  max-width: 1180px;
  min-height: 100%;
  margin: 0 auto;
  border-left: none;
  box-shadow: none;
  animation: none;
}

.drawer.is-page .drawer-header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface);
}

.drawer.is-page .drawer-body {
  overflow: visible;
  padding-left: var(--space-8);
  padding-right: var(--space-8);
}

/* The left edge doubles as a grab handle. Wider than the border it sits on so
   it can be found without aiming; painted only under the pointer, so the edge
   otherwise reads as the hairline it always was. */
.drawer-resize {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -3px;
  width: 7px;
  cursor: col-resize;
  z-index: 1;
}

.drawer-resize::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 3px;
  width: 2px;
  background: var(--primary);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.drawer-resize:hover::after,
.drawer.is-resizing .drawer-resize::after {
  opacity: 1;
}

/* Mid-drag no text selection sweeps across the page under the pointer. The
   entrance animation is left alone: switching it off and on again would replay
   it at the end of every drag. */
.drawer.is-resizing {
  user-select: none;
}

.drawer.is-resizing iframe {
  pointer-events: none;
}

.drawer-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: 46px;
  padding: 0 var(--space-4);
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}

.drawer-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
}

.drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--space-5) var(--space-6) var(--space-8);
}

/* Above a subtask's title: the way back up to the task it belongs to. */
.drawer-crumb {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  max-width: 100%;
  margin-bottom: var(--space-2);
  padding: 2px var(--space-2) 2px var(--space-1);
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
}

.drawer-crumb:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.drawer-crumb strong {
  font-weight: 500;
  color: var(--text-primary);
}

.drawer-title {
  width: 100%;
  margin-bottom: var(--space-5);
  padding: var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--text-xl);
  font-weight: 600;
  line-height: 1.3;
  resize: none;
  overflow: hidden;
}

.drawer-title:hover {
  background: var(--surface-hover);
}

.drawer-title:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

.drawer-fields {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin-bottom: var(--space-6);
}

.drawer-field-label {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
}

.drawer-section {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}

.drawer-section-title {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.drawer-footer-note {
  margin-top: var(--space-6);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
}

.subtask-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}

.subtask-row:last-child {
  border-bottom: none;
}

/* The grip a subtask is dragged by: there on hover, like the rows of the List. */
.subtask-grip {
  display: flex;
  align-items: center;
  flex: none;
  margin-right: calc(var(--space-2) * -1);
  color: var(--text-tertiary);
  opacity: 0;
  cursor: grab;
  transition: opacity var(--transition-fast);
}

.subtask-row:hover .subtask-grip {
  opacity: 1;
}

/* The pencil that renames a subtask where it is: there on hover, like the grip. */
.subtask-rename {
  flex: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.subtask-row:hover .subtask-rename,
.subtask-rename:focus-visible {
  opacity: 1;
}

.subtask-row.is-dragging {
  opacity: 0.4;
}

/* The line above the row the dragged one will go before. */
.subtask-row.is-drop-target {
  box-shadow: inset 0 2px 0 var(--accent);
}

/* ---- renaming a task in its row ------------------------------------------ */

/* While a name is being edited the box takes the whole column: the counts
   and the key beside the title would leave it a sliver otherwise. */
.task-cell-title.is-renaming .task-meta,
.task-cell-title.is-renaming .task-row-actions {
  display: none;
}

.task-title-input {
  flex: 1;
  min-width: 0;
  height: 26px;
  padding: 0 var(--space-2);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
  outline: none;
}

.subtask-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subtask-row.is-completed .subtask-title {
  color: var(--text-tertiary);
  text-decoration: line-through;
}

/* Value control that reads as text until hovered — used in the drawer. */
.value-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-height: 28px;
  padding: var(--space-1) var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.value-button:hover {
  background: var(--surface-hover);
}

.value-button.is-empty {
  color: var(--text-tertiary);
}

/* A value that is typed rather than picked, dressed as the others until it
   has focus, so the drawer reads as one column of values. */
input.drawer-estimate {
  font: inherit;
  font-size: var(--text-sm);
  background: transparent;
  color: var(--text-primary);
}

input.drawer-estimate::placeholder {
  color: var(--text-tertiary);
}

input.drawer-estimate:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

/* ---- time tracking ---------------------------------------------------- */

.time-tracking {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.time-tracking .value-button.is-static {
  width: auto;
  cursor: default;
}

.time-tracking .value-button.is-static:hover {
  background: transparent;
}

/* The running stopwatch: monospaced digits so the seconds do not jitter. */
.timer-running {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--success);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-sm);
}

.timer-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  animation: timer-pulse 1.2s ease-in-out infinite;
}

@keyframes timer-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* A figure typed in by hand rather than timed: the hand says so, the colour
   makes it stand out in a column of clock readings. */
.time-tracking .value-button.is-manual {
  color: var(--warning, var(--accent));
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.time-tracking .timer-note {
  color: var(--text-tertiary);
  font-size: var(--text-xs);
}

/* The same figure in a list cell or on a card. */
.task-time {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.task-time.is-running {
  color: var(--success);
  gap: var(--space-2);
}

.task-time.is-manual {
  color: var(--warning, var(--accent));
}

.task-time.is-empty {
  color: var(--text-tertiary);
}

.task-card-meta .task-time {
  font-size: var(--text-xs);
}

/* ---- importing tasks from a spreadsheet --------------------------------- */

.import-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.import-step {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.import-step-number {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-sunken);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
}

.import-summary {
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
}

/* The rows read back, scrolling on their own so a long sheet does not push
   the Import button off the screen. */
.import-table-wrap {
  max-height: 50vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.import-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.import-table th,
.import-table td {
  padding: var(--space-2) var(--space-3);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  max-width: 260px;
}

.import-table th {
  position: sticky;
  top: 0;
  background: var(--surface-sunken);
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.import-table tr.is-faulty td {
  background: var(--danger-soft, var(--surface-sunken));
}

.import-table tr.is-faulty td:last-child {
  color: var(--danger);
}

/* A sync run's log, as it was written: one line each. */
.hesk-log {
  margin: 0;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

input.drawer-estimate[readonly] {
  cursor: default;
}

.save-indicator {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
}

/* ---- home ------------------------------------------------------------- */

.home-greeting {
  padding: var(--space-8) var(--space-6) var(--space-6);
  text-align: center;
}

.home-date {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.home-title {
  margin-top: var(--space-2);
  font-size: var(--text-2xl);
  font-weight: 600;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: var(--space-5);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6) var(--space-8);
}

.panel {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
}

.panel-title {
  font-size: var(--text-md);
  font-weight: 600;
}

.panel-count {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

/* A team's name on the Teams page leads to its projects, and reads as the
   heading it is until the pointer is over it. */
.team-link {
  color: inherit;
  text-decoration: none;
}

.team-link:hover {
  color: var(--accent-text);
  text-decoration: underline;
}

.panel-body {
  padding: var(--space-2) 0;
}

.panel-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-5);
  cursor: pointer;
}

.panel-row:hover {
  background: var(--surface-hover);
}

/* ---- responsive ------------------------------------------------------- */

@media (max-width: 1280px) {
  .task-grid {
    grid-template-columns: var(--task-grid-columns-md, minmax(200px, 1fr) 130px 115px 140px 120px 95px);
  }

  /* Dropped rather than squeezed. A project column at 60px shows nothing. */
  .task-col-status,
  .task-col-custom {
    display: none;
  }
}

@media (max-width: 1024px) {
  .app-shell {
    grid-template-columns: var(--sidebar-width-collapsed) minmax(0, 1fr);
  }

  /* A chosen width is honoured here too, as long as the rail stays visible. */
  .drawer {
    width: min(var(--drawer-width), calc(100vw - var(--sidebar-width-collapsed)));
  }
}

@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    transform: translateX(-100%);
    transition: transform var(--transition);
    z-index: 700;
  }

  .sidebar.is-open {
    transform: none;
  }

  .task-grid {
    grid-template-columns: var(--task-grid-columns-sm, minmax(0, 1fr) 110px);
  }

  .task-col-priority,
  .task-col-time,
  .task-col-assignee,
  .task-col-collaborators,
  .task-col-projects {
    display: none;
  }

  .drawer {
    width: 100vw;
  }

  /* Full width on a phone; there is nothing to resize against. */
  .drawer-resize {
    display: none;
  }

  .page-body,
  .task-row,
  .section-header,
  .task-list-head,
  .add-task-row {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}

/* ---- timeline (history + comments) ------------------------------------ */

.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.timeline-comment {
  display: flex;
  gap: var(--space-3);
}

.timeline-comment-body {
  flex: 1;
  min-width: 0;
}

.timeline-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.timeline-author {
  color: var(--text-primary);
  font-size: var(--text-base);
  font-weight: 600;
}

.timeline-time {
  color: var(--text-tertiary);
  font-size: var(--text-xs);
}

.timeline-actions {
  display: flex;
  gap: var(--space-1);
  margin-left: auto;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.timeline-comment:hover .timeline-actions,
.timeline-comment:focus-within .timeline-actions {
  opacity: 1;
}

.timeline-text {
  color: var(--text-primary);
  font-size: var(--text-base);
  line-height: 1.55;
  /* Comments are plain text today; honour the line breaks people type. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* So the mention list hangs off the editing box, as it does off the composer. */
.timeline-edit-zone {
  position: relative;
}

.timeline-edit-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

/* History lines sit quieter than comments: they are context, not conversation. */
.timeline-activity {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.timeline-activity-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-activity .timeline-author {
  font-size: var(--text-sm);
  font-weight: 600;
}

.comment-composer {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.comment-composer-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-3);
}

/* ---- attachments ------------------------------------------------------ */

.file-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}

.file-row:last-of-type {
  border-bottom: none;
}

.file-name {
  flex: 1;
  min-width: 0;
  color: var(--text-primary);
}

.file-name:hover {
  color: var(--accent-text);
}

.file-upload {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

/* The real input is hidden; the label is the button. */
.file-upload label {
  cursor: pointer;
}

/* ---- tags ------------------------------------------------------------- */

.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  min-width: 0;
}

/* ---- project activity feed -------------------------------------------- */

.activity-feed {
  max-width: 760px;
  padding: var(--space-6);
}

.activity-day {
  margin-bottom: var(--space-6);
}

.activity-day-label {
  margin-bottom: var(--space-3);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.activity-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}

.activity-row-text {
  flex: 1;
  min-width: 0;
  color: var(--text-secondary);
  font-size: var(--text-base);
}

/* ---- attachment previews ---------------------------------------------- */

.file-previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.file-preview {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-sunken);
  overflow: hidden;
}

.file-preview img {
  display: block;
  width: 100%;
  height: 96px;
  /* Cover, not contain: a wall of thumbnails reads better when they line up. */
  object-fit: cover;
  background: var(--surface-sunken);
}

.file-preview figcaption {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.file-preview figcaption .truncate {
  flex: 1;
}

/* ---- toolbar filter state --------------------------------------------- */

/* An active filter has to look active, or people forget why the list is short. */
.btn-ghost.is-on {
  background: var(--accent-soft);
  color: var(--accent-text);
}

/* ---- mentions ---------------------------------------------------------- */

.mention {
  padding: 0 3px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 500;
}

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

.inbox {
  max-width: 860px;
}

.inbox-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.inbox-row:hover {
  background: var(--surface-hover);
}

/* Unread rows carry a filled dot and a heavier title; read ones recede. */
.inbox-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-top: 8px;
  border-radius: 50%;
  background: transparent;
}

.inbox-row.is-unread .inbox-dot {
  background: var(--accent);
}

.inbox-body {
  flex: 1;
  min-width: 0;
}

.inbox-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 2px;
}

.inbox-kind {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.inbox-title {
  color: var(--text-primary);
  font-size: var(--text-base);
}

.inbox-row.is-unread .inbox-title {
  font-weight: 600;
}

.inbox-message {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.inbox-toggle {
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.inbox-row:hover .inbox-toggle,
.inbox-row:focus-within .inbox-toggle {
  opacity: 1;
}

.tab-count {
  margin-left: var(--space-2);
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
}

/* The top-bar bell carries the count as a corner dot rather than a pill. */
.topbar-inbox {
  position: relative;
}

.topbar-badge {
  position: absolute;
  top: 1px;
  right: 0;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--danger);
  color: #ffffff;
  font-size: 9px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

/* Columns scroll horizontally as a group; each column scrolls its own cards,
   so a long column never pushes the others off the bottom of the screen. */
.board {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  height: 100%;
  padding: var(--space-5) var(--space-6);
  overflow-x: auto;
  overflow-y: hidden;
}

.board-column {
  display: flex;
  flex-direction: column;
  flex: 0 0 280px;
  max-height: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--background-subtle);
}

.board-column-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4) var(--space-3);
}

.board-column-name {
  color: var(--text-primary);
  font-size: var(--text-base);
  font-weight: 600;
}

.board-column-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 0 var(--space-3) var(--space-3);
  overflow-y: auto;
  /* Keeps a drop target below the last card in an otherwise short column. */
  min-height: 60px;
}

.board-add {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-3);
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-tertiary);
  font: inherit;
  font-size: var(--text-base);
  text-align: left;
  cursor: pointer;
}

.board-add:hover {
  background: var(--surface-hover);
  color: var(--text-secondary);
}

.board-composer {
  width: 100%;
}

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

.task-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.task-card:hover {
  box-shadow: var(--shadow);
}

.task-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.task-card.is-completed .task-card-title span {
  color: var(--text-tertiary);
  text-decoration: line-through;
}

.task-card.is-dragging {
  opacity: 0.4;
}

.task-card.is-drop-target {
  box-shadow: inset 0 2px 0 var(--accent);
}

.task-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.task-card-title {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  color: var(--text-primary);
  font-size: var(--text-base);
  line-height: 1.4;
  /* Long names wrap onto a second line rather than being cut mid-word. */
  overflow-wrap: anywhere;
}

.task-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
}

/* The due date is a button in the list view; on a card it is only a label. */
.task-card-meta .due-date {
  height: auto;
  padding: 0;
}

/* ---- calendar view ----------------------------------------------------- */

.calendar {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-5) var(--space-6);
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.calendar-month {
  min-width: 150px;
  color: var(--text-primary);
  font-size: var(--text-lg);
  font-weight: 600;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--border);
  overflow: hidden;
}

.calendar-weekday {
  padding: var(--space-3) var(--space-4);
  background: var(--background-subtle);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.calendar-day {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 108px;
  padding: var(--space-2);
  background: var(--surface);
}

/* A day that takes a click as "add a task here". */
.calendar-day.can-add {
  cursor: cell;
}

/* The "+" in the corner of a day. Kept out of the way until the pointer is
   over the day; where there is no pointer to hover with, it stays visible,
   because a control that only appears on hover is a control a phone cannot
   reach. */
.calendar-add {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
}

.calendar-add:hover {
  background: var(--surface-active);
  color: var(--text-primary);
}

@media (hover: hover) {
  .calendar-add {
    opacity: 0;
  }

  .calendar-day:hover .calendar-add,
  .calendar-add:focus-visible {
    opacity: 1;
  }
}

/* The one-line composer that opens inside a day. Drawn like a task so the
   eye reads it as the task about to exist there. */
.calendar-composer input {
  width: 100%;
  padding: 3px var(--space-2);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
  font-size: var(--text-xs);
}

.calendar-composer input:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-soft);
}

/* Days spilling in from the neighbouring months stay visible but recede. */
.calendar-day.is-outside {
  background: var(--background-subtle);
}

.calendar-day.is-outside .calendar-day-number {
  color: var(--text-tertiary);
}

.calendar-day-number {
  padding: 0 var(--space-2);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
}

.calendar-day.is-today .calendar-day-number {
  align-self: flex-start;
  min-width: 20px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--text-inverse);
  text-align: center;
}

/* The day a task is about to land on. */
.calendar-day.is-drop-zone,
.calendar-unscheduled.is-drop-zone {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.calendar-task[draggable="true"],
.calendar-loose[draggable="true"] {
  cursor: grab;
}

.calendar-task.is-dragging,
.calendar-loose.is-dragging {
  opacity: 0.4;
}

.calendar-task {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: 3px var(--space-2);
  border: none;
  border-radius: var(--radius-sm);
  background: var(--surface-hover);
  color: var(--text-primary);
  font: inherit;
  font-size: var(--text-xs);
  text-align: left;
  cursor: pointer;
}

.calendar-task:hover {
  background: var(--surface-active);
}

/* The title takes what is left after the dot and the face; the face never
   shrinks and never wraps under a long title. */
.calendar-task-title {
  flex: 1;
  min-width: 0;
}

/* The hour a task is due, ahead of its name; figures of one width so the
   times of a day line up down the cell. */
.calendar-task-time {
  flex-shrink: 0;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.calendar-task.is-completed .calendar-task-time {
  color: inherit;
}

.calendar-task .avatar {
  flex-shrink: 0;
}

.calendar-task.is-completed {
  color: var(--text-tertiary);
  text-decoration: line-through;
}

/* "+N more": a button that reads like the label it used to be, and opens the
   whole day. */
.calendar-more {
  display: block;
  width: 100%;
  padding: 2px var(--space-2);
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-tertiary);
  font: inherit;
  font-size: var(--text-xs);
  text-align: left;
  cursor: pointer;
}

.calendar-more:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}


.calendar-unscheduled {
  max-width: 520px;
}

/* ---- the calendar as an agenda, on a phone -------------------------------
 *
 * Drawn alongside the grid and shown instead of it below the phone
 * breakpoint. One day after another, each a heading and full-width rows:
 * the hour, the project's colour, the whole title, the face.
 */

.calendar-agenda {
  display: none;
  flex-direction: column;
  gap: var(--space-4);
}

.agenda-day {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

.agenda-day-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  background: var(--background-subtle);
}

.agenda-day-number {
  min-width: 28px;
  padding: 2px 0;
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  font-size: var(--text-md);
  font-weight: 600;
  text-align: center;
}

.agenda-day.is-today .agenda-day-number {
  background: var(--accent);
  color: var(--text-inverse);
}

.agenda-day-name {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
}

.agenda-today {
  padding: 1px var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--text-xs);
  font-weight: 600;
}

/* A row is a finger's height at least, and the title wraps rather than being
   cut: reading the task is the whole point of this layout. */
.agenda-task {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
  font-size: var(--text-base);
  text-align: left;
  cursor: pointer;
}

.agenda-task:last-child {
  border-bottom: none;
}

.agenda-task:active {
  background: var(--surface-active);
}

.agenda-task-time {
  flex-shrink: 0;
  width: 42px;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.agenda-task-title {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.agenda-task.is-completed .agenda-task-title {
  color: var(--text-tertiary);
  text-decoration: line-through;
}

.agenda-task .avatar {
  flex-shrink: 0;
}

.agenda-empty {
  padding: var(--space-3);
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

.agenda-composer {
  padding: var(--space-2) var(--space-3);
}

.agenda-composer input {
  font-size: var(--text-base);
  padding: var(--space-2);
}

@media (max-width: 768px) {
  .calendar {
    gap: var(--space-4);
    padding: var(--space-3);
  }

  .calendar-grid {
    display: none;
  }

  .calendar-agenda {
    display: flex;
  }

  .calendar-month {
    min-width: 0;
  }

  .calendar-unscheduled {
    max-width: none;
  }
}

/* ---- collaborators ----------------------------------------------------- */

.collaborators {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* The remove button sits on the avatar rather than beside it, so a row of
   eight people stays a row of eight avatars. */
.collaborator {
  position: relative;
  display: inline-flex;
}

.collaborator-remove {
  position: absolute;
  top: -3px;
  right: -3px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
}

.collaborator:hover .collaborator-remove,
.collaborator:focus-within .collaborator-remove {
  display: inline-flex;
}

.collaborator-remove:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.collaborator-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.collaborator-add:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Faces overlap in a list cell, where a column is 130px wide and a row of
   separate avatars would not fit. */
.avatar-stack {
  display: inline-flex;
  align-items: center;
}

.avatar-stack > * + * {
  margin-left: -5px;
}

/* The ring keeps overlapping faces readable against each other. */
.avatar-stack > * {
  box-shadow: 0 0 0 1.5px var(--surface);
  border-radius: var(--radius-pill);
}

.task-row:hover .avatar-stack > * {
  box-shadow: 0 0 0 1.5px var(--surface-hover);
}

.task-row.is-selected .avatar-stack > * {
  box-shadow: 0 0 0 1.5px var(--accent-soft);
}

/* ---- project chips ----------------------------------------------------- */

.project-chips {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  min-width: 0;
}

.project-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 140px;
  padding: 1px var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  text-decoration: none;
}

.project-chip.is-link:hover {
  background: var(--surface-active);
  color: var(--text-primary);
}

/* Marks the project that named the task, which is the one it cannot leave. */
.project-chip-home {
  color: var(--text-tertiary);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* A project reads as a small tinted tile rather than a bare dot: at sidebar size
   a dot carries the colour but nothing else, and every row looks alike. */
.project-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-sm);
  color: #ffffff;
}

.project-icon svg {
  /* Beats the .nav-item svg rule, which greys icons out. */
  color: inherit;
}

/* Team names are group headers, so they get the same quiet treatment as the
   other headers rather than competing with the projects underneath. */
.nav-group-header .truncate {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Explains what a field does when the label alone cannot. */
.field-hint {
  margin-top: var(--space-2);
  color: var(--text-tertiary);
  font-size: var(--text-sm);
  line-height: 1.4;
}

/* ---- board columns: renaming and adding -------------------------------- */

/* The name is an input when you may rename it, so editing is one click rather
   than a menu. It has to look like the plain heading until then. */
input.board-column-name {
  min-width: 0;
  flex: 1;
  height: 22px;
  padding: 0 var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: var(--text-base);
  font-weight: 600;
}

input.board-column-name:hover {
  background: var(--surface-hover);
}

input.board-column-name:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

.board-column-actions {
  margin-left: auto;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.board-column:hover .board-column-actions,
.board-column:focus-within .board-column-actions {
  opacity: 1;
}

/* The trailing "add column" tile: same footprint, nothing in it but the button. */
.board-column.is-add {
  flex: 0 0 200px;
  border-style: dashed;
  background: transparent;
  padding: var(--space-3);
}

/* ---- project Files tab -------------------------------------------------- */

.file-list {
  max-width: var(--content-max-width);
  padding: var(--space-4) var(--space-6) var(--space-8);
}

/* The drawer reuses .file-row in a 520px panel; here there is room for a
   thumbnail and a second line, so the row is taller. */
.file-list .file-row {
  padding: var(--space-3) 0;
}

.file-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--surface-sunken);
  color: var(--text-tertiary);
}

.file-row-main {
  flex: 1;
  min-width: 0;
}

.file-row-main .file-name {
  display: block;
  text-decoration: none;
}

.file-meta {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

.file-list .file-row.is-selected {
  background: var(--accent-soft);
  margin: 0 calc(var(--space-2) * -1);
  padding-left: var(--space-2);
  padding-right: var(--space-2);
  border-radius: var(--radius);
}

/* Fixed cells on both ends, so a file nobody may remove keeps its name in
   line with the ones that have a checkbox and a bin. */
.file-select {
  display: inline-flex;
  align-items: center;
  flex: 0 0 17px;
  height: 17px;
}

.file-select input {
  margin: 0;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.file-date {
  flex: 0 0 auto;
  min-width: 92px;
  text-align: right;
}

.file-actions {
  display: inline-flex;
  flex: 0 0 28px;
  justify-content: flex-end;
}

.files-select-all {
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  user-select: none;
}

.files-select-all input {
  margin: 0;
  width: 15px;
  height: 15px;
}

/* A button that has to read as part of a sentence rather than as a control. */
.link-button {
  padding: 0;
  border: none;
  background: none;
  color: var(--text-secondary);
  font: inherit;
  cursor: pointer;
}

.link-button:hover {
  color: var(--accent-text);
  text-decoration: underline;
}

/* ---- project members ---------------------------------------------------- */

/* The stack of faces in the project header is a button, not decoration: it is
   how people are invited, and on a private project that is what makes it
   visible to them at all. */
.member-summary {
  display: flex;
  align-items: center;
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.member-summary:hover {
  border-color: var(--border);
  background: var(--surface-hover);
}

.member-summary-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: var(--space-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-pill);
  color: var(--text-tertiary);
}

.member-summary:hover .member-summary-add {
  border-color: var(--accent);
  color: var(--accent);
}

.member-list {
  display: flex;
  flex-direction: column;
}

.member-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}

.member-row:last-child {
  border-bottom: none;
}

.member-row-main {
  flex: 1;
  min-width: 0;
}

.member-role {
  width: auto;
  min-width: 104px;
}

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

/* Bottom-left, out of the way of the drawer on the right and the row the user
   just tried to edit. */
.toast-host {
  position: fixed;
  left: var(--space-6);
  bottom: var(--space-6);
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: 420px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.toast {
  animation: toast-in 160ms ease-out;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  font-size: var(--text-base);
}

.toast.is-error {
  border-color: var(--danger);
}

.toast.is-error > .wf-icon {
  color: var(--danger);
}

.toast-message {
  flex: 1;
  min-width: 0;
  line-height: 1.45;
}

/* Somebody who has turned motion down still gets the message, just without
   it sliding in from underneath. */
@media (prefers-reduced-motion: reduce) {
  .toast {
    animation: none;
  }
}

/* ---- admin ------------------------------------------------------------ */

.admin-grid {
  grid-template-columns: minmax(180px, 1fr) 110px 130px minmax(170px, 1fr) 200px 110px 140px 44px;
}

.admin-search {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  height: 28px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-tertiary);
  min-width: 260px;
}

.admin-search input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  outline: none;
}

/* Templates are browsed as cards: a template is a shape, not a row of fields. */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
  padding: var(--space-6);
}

.template-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.template-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.template-card-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.template-section {
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background-subtle);
}

.template-section-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.template-task {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-2) 0 var(--space-2) var(--space-4);
  color: var(--text-tertiary);
}

.chip-success {
  background: var(--success-soft, var(--accent-soft));
  color: var(--success, var(--accent-text));
}

.chip-muted {
  background: var(--surface-active);
  color: var(--text-tertiary);
}

/* The one sentence in a delete confirmation that must not be skimmed past. */
.delete-warning {
  margin: 0 0 var(--space-4);
  color: var(--danger);
  font-weight: 500;
}

/* A choice in the copy dialog: a checkbox, a label, and why you would want it. */
.copy-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  cursor: pointer;
}

.copy-option input {
  margin-top: 3px;
  flex: 0 0 auto;
}

.copy-option-label {
  display: block;
  color: var(--text-primary);
}

.copy-option .field-hint {
  margin: 2px 0 0;
}

.copy-option input:disabled ~ span .copy-option-label {
  color: var(--text-tertiary);
}

/* ---- admin settings --------------------------------------------------- */

.settings-page {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-6);
}

.settings-card {
  margin-bottom: var(--space-5);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.settings-card h3 {
  margin: 0 0 var(--space-4);
  font-size: var(--text-md);
  font-weight: 600;
}

.settings-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.settings-identity {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.org-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background-subtle);
  color: var(--text-tertiary);
  overflow: hidden;
}

.org-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/*
 * The same logo in the sidebar, where it stands in the initials badge's place.
 * Contained rather than cropped: a wordmark is the usual upload, and cutting it
 * to a square would make it unreadable.
 */
.org-mark {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.settings-test {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.settings-ok {
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: var(--text-sm);
}

.settings-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding-bottom: var(--space-8);
}

.audit-grid {
  grid-template-columns: 130px 180px minmax(280px, 1fr) 180px;
}

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

/* Lists of addresses on the security screen: an address, what it is, actions. */
.ip-list {
  margin-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.ip-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}

.ip-address {
  flex: 0 0 auto;
  min-width: 130px;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

.ip-detail {
  flex: 1;
  min-width: 0;
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

/* ---- task dependencies ------------------------------------------------ */

.dependency-group + .dependency-group {
  margin-top: var(--space-5);
}

.dependency-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
}

.dependency-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) 0;
  color: var(--text-tertiary);
}

/*
 * An unfinished predecessor is the only thing here that changes what somebody
 * can do next, so it is the only thing that gets a colour.
 */
.dependency-row.is-blocking {
  color: var(--warning, var(--danger));
}

.dependency-link {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  flex: 1;
  min-width: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.dependency-link:hover {
  text-decoration: underline;
}

.dependency-link .is-completed {
  color: var(--text-tertiary);
  text-decoration: line-through;
}

.chip-warning {
  background: var(--warning-soft, var(--danger-soft));
  color: var(--warning, var(--danger));
}

/* A settings card whose heading carries an action, e.g. "New field". */
.settings-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.settings-card-head h3 {
  margin: 0 0 var(--space-1);
}

/* ---- custom fields ---------------------------------------------------- */

.project-field {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}

.project-field:last-child {
  border-bottom: none;
}

.project-field-main {
  flex: 1;
  min-width: 0;
}

.project-field-name {
  font-weight: 500;
}

.project-field-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  cursor: pointer;
  white-space: nowrap;
}

/* A required field nobody has filled in yet. */
.required-dot {
  margin-left: 2px;
  color: var(--danger);
}

.field-with-suffix {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

/* ---- search ----------------------------------------------------------- */

/* Results under the top-bar box. Above the scrim, which catches the click
   that should close them. */
.search-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  z-index: 320;
  max-height: 60vh;
  overflow-y: auto;
  padding: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg, var(--shadow));
}

.search-menu-all {
  margin-top: var(--space-1);
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
}

.search-scrim {
  position: fixed;
  inset: 0;
  z-index: 310;
}

.search-page {
  max-width: 780px;
  margin: 0 auto;
  padding: var(--space-6);
}

.search-box {
  margin-bottom: var(--space-6);
  height: 36px;
}

.search-group + .search-group {
  margin-top: var(--space-7);
}

.search-group-title {
  margin: 0 0 var(--space-2);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.search-result {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3);
  border: none;
  border-radius: var(--radius);
  background: none;
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.search-result:hover {
  background: var(--surface-hover);
  text-decoration: none;
}

.search-result-main {
  flex: 1;
  min-width: 0;
}

.search-result .is-completed {
  color: var(--text-tertiary);
  text-decoration: line-through;
}

/* Tags as search results: a chip you can press to see what carries it. */
.search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 3px var(--space-3);
  border: 1px solid var(--tag-color, var(--border));
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
}

.tag-chip:hover {
  background: var(--surface-hover);
}

.tag-chip.is-selected {
  background: var(--tag-color, var(--accent));
  border-color: var(--tag-color, var(--accent));
  color: #ffffff;
}

.tag-count {
  color: var(--text-tertiary);
  font-size: var(--text-xs);
}

.tag-chip.is-selected .tag-count {
  color: inherit;
  opacity: 0.75;
}

.search-tag-tasks {
  padding-left: var(--space-2);
  border-left: 2px solid var(--border);
}

/*
 * The search box's own clear button.
 *
 * The browser's is drawn underneath the Ctrl K hint, where it cannot be pressed,
 * so it is suppressed and replaced by one that sits in the hint's place — the
 * hint is only useful while the box is empty anyway.
 */
.topbar-search input[type="search"]::-webkit-search-cancel-button {
  display: none;
}

.topbar-search-clear {
  position: absolute;
  top: 50%;
  right: var(--space-2);
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
}

.topbar-search-clear:hover {
  background: var(--surface-active);
  color: var(--text-primary);
}

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

/* One line, never wrapping: the chips live on their own row. */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.filter-search {
  position: relative;
  flex: 0 1 200px;
}

/* A card being dragged into place, and the card it will go before. */
.project-card.is-dragging {
  opacity: 0.4;
}

/* Where it will land is a line between two cards, not a ring round one: a ring
   says "this card" and leaves open which side of it. The line stands in the
   middle of the gap, on the side the pointer's half of the card chose. */
.project-card.is-drop-before::before,
.project-card.is-drop-after::after {
  content: "";
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 4px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  pointer-events: none;
}

/* Half the grid's gap, plus the card's own border, less half the line. */
.project-card.is-drop-before::before {
  left: calc(var(--space-4) / -2 - 3px);
}

.project-card.is-drop-after::after {
  right: calc(var(--space-4) / -2 - 3px);
}

/* A sidebar entry or team group being dragged into place, and the one it
   will go before. */
.nav-item.is-dragging,
.nav-group.is-dragging {
  opacity: 0.4;
}

.nav-item.is-drop-target {
  box-shadow: inset 0 2px 0 var(--accent);
}

.nav-group.is-drop-target > .nav-group-header {
  box-shadow: inset 0 2px 0 var(--accent);
}

/* "+N more" under a team's first five projects: reads like the muted
   labels around it, and is a button. */
.nav-more {
  display: block;
  width: 100%;
  height: 26px;
  padding: 0 var(--space-3) 0 calc(var(--space-3) + 22px);
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--sidebar-text-muted);
  font: inherit;
  font-size: var(--text-xs);
  text-align: left;
  cursor: pointer;
}

.nav-more:hover {
  background: var(--sidebar-surface-hover);
  color: var(--sidebar-text);
}

/* The owner dropdown beside the search box, sized to a name rather than
   to the row. */
.projects-owner {
  width: auto;
  max-width: 220px;
  font-size: var(--text-sm);
}

.filter-search svg {
  position: absolute;
  top: 50%;
  left: var(--space-2);
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

.filter-search input {
  width: 100%;
  height: 26px;
  padding: 0 var(--space-2) 0 26px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--surface-sunken);
  color: var(--text-primary);
  font: inherit;
  font-size: var(--text-sm);
}

.filter-search input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

.filter-count {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Tall enough to hold every criterion, scrolled rather than cut off. */
.filter-menu {
  min-width: 260px;
  max-height: 70vh;
  overflow-y: auto;
}

.filter-dates {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
}

.filter-date {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
  color: var(--text-secondary);
  font-size: var(--text-xs);
}

.filter-date input {
  height: 26px;
  font-size: var(--text-sm);
}

.filter-quick {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  padding: 0 var(--space-3) var(--space-2);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  max-width: 220px;
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: var(--text-xs);
}

.filter-chip button {
  display: flex;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  opacity: 0.7;
}

.filter-chip button:hover {
  opacity: 1;
}

/* A project's own column in the List view. Read here, edited in the drawer. */
.task-col-custom {
  min-width: 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

@media (max-width: 1400px) {
  .task-col-custom {
    display: none;
  }
}

/* Custom fields on a board card. */
.task-card-fields {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-2);
}

/* ---- saved views ------------------------------------------------------- */

.saved-view-row {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0 var(--space-1);
  border-radius: var(--radius);
}

.saved-view-row:hover,
.saved-view-row.is-selected {
  background: var(--surface-hover);
}

/* "As you left it": the state with no view, at the top of the list, with the
   one line that says the filters are kept. */
.saved-view-own .saved-view-apply {
  flex-wrap: wrap;
  row-gap: 0;
}

.saved-view-own .text-xs {
  flex-basis: 100%;
}

.saved-view-row.is-selected .saved-view-apply > .truncate:first-child {
  font-weight: 600;
}

.saved-view-apply {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  flex: 1;
  min-width: 0;
  padding: var(--space-2) var(--space-2);
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.saved-view-form {
  padding: var(--space-2) var(--space-3) var(--space-3);
}

.saved-view-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

/* The chip row: only there when something is on, and flush with the controls. */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.filter-clear {
  padding: 0;
  border: none;
  background: none;
  color: var(--text-tertiary);
  font: inherit;
  font-size: var(--text-xs);
  text-decoration: underline;
  cursor: pointer;
}

.filter-clear:hover {
  color: var(--text-primary);
}

/* Who can see the project at all, above the list of what people may do in it. */
.access-summary {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background-subtle);
}

.access-summary svg {
  flex: 0 0 auto;
  margin-top: 2px;
  color: var(--text-secondary);
}

.access-summary-title {
  margin-bottom: 2px;
  font-weight: 500;
}

/* A link out of the application, with a line saying where it goes. */
.settings-linkout {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.settings-linkout .field-hint {
  margin-top: var(--space-2);
}

/* ---- comment composer -------------------------------------------------- */

/*
 * A drop target the size of the whole composer, not just the textarea: somebody
 * dropping a screenshot aims at the box, not at the input inside it.
 */
.comment-composer.is-dropping {
  outline: 2px dashed var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius);
}

.composer-pending {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.pending-file {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 220px;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-sunken);
  font-size: var(--text-sm);
}

.pending-file img {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.pending-file button {
  display: flex;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-tertiary);
  cursor: pointer;
}

.pending-file button:hover {
  color: var(--text-primary);
}

/* ---- files inside a comment ------------------------------------------- */

.comment-files {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

/*
 * Capped rather than full width. A screenshot pasted into a conversation is
 * usually a whole desktop, and at full size it buries the remark it belongs to.
 *
 * The width is definite, not left to the picture. As a flex item sized by its
 * content, the box would take its width from an image that has not loaded — and
 * an image in a zero-sized box never loads. The two waited for each other and
 * nothing appeared.
 */
.comment-image {
  display: block;
  flex: 0 0 auto;
  width: 320px;
  max-width: 100%;
  min-height: 60px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-sunken);
  overflow: hidden;
}

.comment-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 260px;
  object-fit: cover;
}

.comment-file {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  max-width: 280px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: var(--text-sm);
  text-decoration: none;
}

.comment-file:hover {
  background: var(--surface-hover);
  text-decoration: none;
}

/* The @mention list, anchored under the composer. */
.mention-menu {
  position: absolute;
  z-index: 320;
  right: 0;
  left: 0;
  max-height: 240px;
  overflow-y: auto;
  margin-top: var(--space-1);
  padding: var(--space-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg, var(--shadow));
}

/* So the menu above hangs off the composer and not off the page. */
.comment-composer {
  position: relative;
}

/* A row's dependency mark. Coloured only when something is actually in the way. */
.task-meta-item.is-blocking {
  color: var(--warning, var(--danger));
}

/* ---- the formatted-text editor ------------------------------------------
 *
 * One box with a rule across it: the tools above, the writing below. The whole
 * thing takes the focus ring, not the writing area alone, so that pressing bold
 * does not look like leaving the field.
 */

.rte {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.rte:hover {
  border-color: var(--text-tertiary);
}

.rte:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.rte.is-disabled {
  background: var(--surface-sunken, var(--surface));
  opacity: 0.7;
}

.rte-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px var(--space-2);
  border-bottom: 1px solid var(--border);
}

.rte-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.rte-tool:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* Lit while the caret is inside text this button applied. */
.rte-tool.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.rte-tool-divider {
  width: 1px;
  height: 16px;
  margin: 0 var(--space-1);
  background: var(--border);
}

/* A person with a browser connected right now. */
.presence-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 2px var(--success-soft);
}

/* ---- the "confirm your email" line ------------------------------------ */

/* Between the top bar and the page, in the warning colour: it is asking for
   something, not announcing a failure. Wraps on a phone. */
.verify-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-6);
  border-bottom: 1px solid var(--border);
  background: var(--warning-soft);
  color: var(--text-primary);
  font-size: var(--text-sm);
}

.verify-banner > svg {
  color: var(--warning);
  flex: none;
}

.verify-banner-text {
  flex: 1 1 320px;
  min-width: 0;
}

/* Signed in as somebody else. Louder than the verification banner on
   purpose: this one changes whose name goes on everything you do. */
.impersonation-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-6);
  border-bottom: 1px solid var(--border);
  background: var(--danger-soft);
  color: var(--text-primary);
  font-size: var(--text-sm);
}

.impersonation-banner > svg {
  color: var(--danger);
  flex: none;
}

/* The owner's reminder, while everybody else is looking at the maintenance
   page: the same line as the impersonation one, in the warning colour. */
.maintenance-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-6);
  border-bottom: 1px solid var(--border);
  background: var(--warning-soft);
  color: var(--text-primary);
  font-size: var(--text-sm);
}

.maintenance-banner > svg {
  color: var(--warning);
  flex: none;
}

/* The Admin screen's one-line verdict: open, or closed since when. */
.maintenance-status {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin: 0 0 var(--space-5);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  background: var(--surface-sunken);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.maintenance-status > svg {
  flex: none;
  margin-top: 2px;
  color: var(--success);
}

.maintenance-status.is-on {
  background: var(--warning-soft);
  color: var(--text-primary);
}

.maintenance-status.is-on > svg {
  color: var(--warning);
}

/* The description box: taller than a comment, and it grows with its words
   rather than scrolling inside itself — a description is read, not sent. */
.rte-description .rte-input {
  min-height: 96px;
  max-height: none;
}

/* A link in the box looks like one and opens on click (see the script). */
.rte-input a {
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}

.rte-input {
  min-height: 76px;
  max-height: 340px;
  overflow-y: auto;
  padding: var(--space-2) var(--space-3);
  line-height: 1.55;
  outline: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* A contenteditable has no placeholder of its own. :empty covers the box
   before the script has run; after that the script says, through is-empty,
   because a browser leaves a <br> behind in an emptied box — and Firefox
   keeps one after the words too, so no selector on the markup can tell an
   empty box from a written one. See workflow.richText syncEmpty. */
.rte-input:empty::before,
.rte-input.is-empty::before {
  content: attr(data-placeholder);
  color: var(--text-tertiary);
  pointer-events: none;
}

/* ---- formatted text, as written and as read -----------------------------
 *
 * The same rules for the editor and for a posted comment, so that what somebody
 * types looks like what everybody else will see.
 */

.rte-input > :first-child,
.rich-text > :first-child {
  margin-top: 0;
}

.rte-input > :last-child,
.rich-text > :last-child {
  margin-bottom: 0;
}

.rte-input p,
.rich-text p {
  margin: 0 0 var(--space-2);
}

.rte-input ul,
.rte-input ol,
.rich-text ul,
.rich-text ol {
  margin: 0 0 var(--space-2);
  padding-left: var(--space-6);
}

/* The markers have to be asked for. app.css takes them off every list in the
   application — navigation, menus — and without these the editor made a list
   that was indented and otherwise looked like plain lines: the button seemed
   to do nothing. */
.rte-input ul,
.rich-text ul {
  list-style: disc outside;
}

.rte-input ol,
.rich-text ol {
  list-style: decimal outside;
}

.rte-input ul ul,
.rich-text ul ul {
  list-style-type: circle;
}

.rte-input ol ol,
.rich-text ol ol {
  list-style-type: lower-alpha;
}

/* A list inside a list sits tight under its parent line. */
.rte-input li > ul,
.rte-input li > ol,
.rich-text li > ul,
.rich-text li > ol {
  margin-bottom: 0;
}

.rte-input li,
.rich-text li {
  margin: 2px 0;
}

.rte-input blockquote,
.rich-text blockquote {
  margin: 0 0 var(--space-2);
  padding-left: var(--space-3);
  border-left: 2px solid var(--border-strong);
  color: var(--text-secondary);
}

.rte-input code,
.rich-text code {
  padding: 1px 4px;
  border-radius: var(--radius-sm);
  background: var(--surface-hover);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.92em;
}

.rte-input pre,
.rich-text pre {
  margin: 0 0 var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  background: var(--surface-hover);
  overflow-x: auto;
}

.rte-input pre code,
.rich-text pre code {
  padding: 0;
  background: none;
}

.rich-text a {
  color: var(--accent);
  text-decoration: underline;
  overflow-wrap: anywhere;
}

/* ---- colour palette -----------------------------------------------------
 *
 * Eight swatches rather than a colour input: colours that read against both
 * themes, and a row of tags that goes together rather than one in whatever
 * sixteen million shades somebody picked.
 */

.colour-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.colour-swatch {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.colour-swatch:hover {
  transform: scale(1.1);
}

/* A ring outside the colour, not a tick on top of it — a tick has to be light
   on some of these and dark on others, and the ring is legible on all eight. */
.colour-swatch.is-selected {
  border-color: var(--surface);
  box-shadow: 0 0 0 2px var(--text-primary);
}

/* ---- notification preferences -------------------------------------------
 *
 * A matrix: one row per kind of event, one column per channel. Read down a
 * column to see everything that reaches you one way, across a row to see where
 * one kind of event goes.
 */

.pref-table {
  display: flex;
  flex-direction: column;
}

.pref-head,
.pref-row {
  display: grid;
  grid-template-columns: 1fr 72px 72px;
  align-items: center;
  gap: var(--space-3);
}

.pref-head {
  padding: 0 0 var(--space-2);
  border-bottom: 1px solid var(--border);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pref-head > span + span,
.pref-check {
  justify-self: center;
}

.pref-row {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}

.pref-row:last-child {
  border-bottom: none;
}

.pref-name {
  color: var(--text-primary);
  font-weight: 500;
}

/* The whole cell is the target, not the 13 pixels of the box itself. */
.pref-check {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2);
  cursor: pointer;
}

.pref-check:has(input:disabled) {
  cursor: default;
  opacity: 0.4;
}

@media (max-width: 640px) {
  .pref-head,
  .pref-row {
    grid-template-columns: 1fr 56px 56px;
    gap: var(--space-2);
  }
}

/* ---- release notes ------------------------------------------------------- */

.release {
  gap: var(--space-3);
}

.release-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.release-version {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
}

.release-current {
  color: var(--success);
  background: var(--success-soft, var(--surface-hover));
}

.release-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

/* The word, not a coloured pill: three pills down a page read as decoration,
   and what matters is telling "New" from "Fixed" at a glance. */
.release-group-label {
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.release-group-label.is-added {
  color: var(--success);
}

.release-group-label.is-fixed {
  color: var(--warning);
}

.release-list {
  margin: 0;
  padding-left: var(--space-5);
  color: var(--text-secondary);
  line-height: 1.6;
}

.release-list li {
  margin: 2px 0;
}

/* ---- the notes and the rail of versions beside them ----------------------- */

.whats-new {
  display: grid;
  grid-template-columns: minmax(0, 720px) 220px;
  justify-content: center;
  gap: var(--space-8);
  padding: var(--space-6);
}

.whats-new-notes {
  min-width: 0;
}

/* A release folded to its line: the version, the title, the date, a chevron. */
.release.is-folded {
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-2);
}

.release.is-folded .release-head {
  cursor: pointer;
}

.release.is-folded .release-version {
  font-size: var(--text-base);
}

.release-folded-title {
  min-width: 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.release-chevron {
  color: var(--text-tertiary);
  flex: none;
}

/* Scrolled to from the rail: the page's own scroll region, so the anchor must
   land below the top of it, not under the header. */
.release {
  scroll-margin-top: var(--space-4);
}

/* The rail: stays put while the notes scroll, scrolls on its own when it is
   taller than the window. */
.whats-new-rail {
  position: sticky;
  top: var(--space-6);
  align-self: start;
  max-height: calc(100vh - var(--topbar-height) - var(--project-header-height) - var(--space-8));
  overflow-y: auto;
  padding-right: var(--space-2);
}

.whats-new-rail-title {
  margin-bottom: var(--space-3);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.release-rail {
  position: relative;
  margin: 0;
  padding: 0 0 0 var(--space-4);
  list-style: none;
}

/* The line the dots sit on. */
.release-rail::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 5px;
  width: 2px;
  background: var(--border);
}

.release-rail-month {
  margin: var(--space-3) 0 var(--space-1);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  font-weight: 600;
}

.release-rail-item {
  position: relative;
}

.release-rail-link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  column-gap: var(--space-2);
  align-items: center;
  width: 100%;
  padding: 2px var(--space-2);
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: var(--text-xs);
  text-align: left;
  cursor: pointer;
}

.release-rail-link:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.release-rail-dot {
  position: absolute;
  left: calc(var(--space-4) * -1 + 2px);
  width: 8px;
  height: 8px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--border-strong);
  box-shadow: 0 0 0 1px var(--border);
}

.release-rail-version {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  color: var(--text-primary);
}

.release-rail-title {
  grid-column: 1 / -1;
  min-width: 0;
  color: var(--text-secondary);
}

.release-rail-date {
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* The newest few: larger, with their titles, so the rail reads as "what just
   happened" before it reads as a list. */
.release-rail-item.is-recent .release-rail-link {
  padding: var(--space-2);
  font-size: var(--text-sm);
}

.release-rail-item.is-recent .release-rail-version {
  font-weight: 600;
}

.release-rail-item.is-recent .release-rail-dot {
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

/* The one running: the green of the badge in the notes. */
.release-rail-item.is-current .release-rail-dot {
  background: var(--success);
  box-shadow: 0 0 0 1px var(--success);
}

.release-rail-item.is-current .release-rail-version::after {
  content: " · you are here";
  font-family: inherit;
  font-weight: 400;
  color: var(--success);
}

/* The one being read right now. */
.release-rail-item.is-reading .release-rail-link {
  background: var(--accent-soft, var(--surface-hover));
  color: var(--text-primary);
}

/* On a narrow screen the rail has no room beside the notes: the notes alone,
   folded as before, and the versions reached by scrolling. */
@media (max-width: 900px) {
  .whats-new {
    grid-template-columns: minmax(0, 1fr);
  }

  .whats-new-rail {
    display: none;
  }
}

/* ---- keyboard shortcuts -------------------------------------------------- */

.shortcut-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
}

.shortcut-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-1) 0;
  color: var(--text-secondary);
}

.shortcut-keys {
  display: flex;
  gap: 4px;
}

kbd {
  min-width: 22px;
  padding: 2px 6px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-primary);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: var(--text-xs);
  text-align: center;
}

/* ---- the "something is new" dot ------------------------------------------ */

.topbar-help {
  position: relative;
}

.topbar-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border: 1.5px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
}

/* ---- reported problems --------------------------------------------------
 *
 * A queue: one line per report, opened in place. A separate detail page would
 * mean losing your position in the list every time you looked at one, which is
 * the whole activity.
 */

.report-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.report + .report {
  border-top: 1px solid var(--border);
}

.report.is-open {
  background: var(--surface-hover);
}

.report-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3);
  border: none;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.report-head:hover {
  background: var(--surface-hover);
}

.report-title {
  flex: 1;
  min-width: 0;
  color: var(--text-primary);
  font-weight: 500;
}

.report-who {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  max-width: 180px;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.report.is-open .report-head .wf-icon:last-child {
  transform: rotate(180deg);
}

.report-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 0 var(--space-3) var(--space-3);
}

.report-detail {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Label and value, so the eye can run down the labels rather than reading
   sentences to find the address. */
.report-context {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  background: var(--surface);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: var(--text-xs);
}

.report-fact {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: var(--space-2);
}

.report-fact-label {
  color: var(--text-tertiary);
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

/* Removing a report is not one of the decisions beside it, so it does not look
   like one until you go near it. */
.report-actions .btn.is-danger {
  color: var(--text-tertiary);
}

.report-actions .btn.is-danger:hover:not(:disabled) {
  color: var(--danger);
  background: var(--danger-soft, var(--surface-hover));
}

/* The five states, coloured by what they mean rather than by a palette:
   nothing decided, going to happen, being looked at, done, not happening. */
.badge.is-new {
  color: var(--accent);
  background: var(--accent-soft);
}

.badge.is-accepted,
.badge.is-fixed {
  color: var(--success);
}

.badge.is-investigating {
  color: var(--warning);
}

.badge.is-rejected {
  color: var(--text-tertiary);
}

@media (max-width: 768px) {
  .report-who,
  .report-head .text-xs {
    display: none;
  }
}

/* ---- Timeline (Gantt) view ------------------------------------------------------
 *
 * A sticky column of task names on the left and a scrolling stretch of days on
 * the right, laid out as one grid so a row cannot come apart from its bar.
 *
 * Everything horizontal is measured in --tl-day, the width of a single day at
 * the current zoom. The component sets it and the drag script reads it back,
 * so both sides agree on what a day is worth without either one being told.
 */

.gantt {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
}

.gantt-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* A row of buttons that behave as one control. */
.segmented {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.segmented-option {
  padding: 5px var(--space-3);
  border: 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
}

.segmented-option:last-child {
  border-right: 0;
}

.segmented-option:hover {
  background: var(--surface-hover);
}

.segmented-option.is-active {
  background: var(--accent-soft);
  color: var(--accent-text);
}

.gantt-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.gantt-grid {
  --tl-names: 240px;

  /* The two header rows plus their bottom border. The overlay starts here,
     so it is stated once rather than guessed at from padding. */
  --tl-head: 49px;

  position: relative;
  display: grid;
  grid-template-columns: var(--tl-names) calc(var(--tl-day) * var(--tl-days));
  width: fit-content;
  min-width: 100%;
}

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

.gantt-corner,
.gantt-head {
  position: sticky;
  top: 0;
  z-index: 3;
  border-bottom: 1px solid var(--border);
  background: var(--background-subtle);
}

.gantt-corner {
  left: 0;
  z-index: 4;
  display: flex;
  align-items: flex-end;
  padding: 0 var(--space-4) var(--space-2);
  border-right: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gantt-months,
.gantt-ticks {
  display: flex;
}

.gantt-months {
  height: 26px;
}

.gantt-ticks {
  height: 22px;
}

.gantt-month {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  /* A month cut short by the edge of the window can be narrower than its
     name. clip, not hidden: hidden would make the cell a scroll container
     and the sticky label below would stick to it instead of the scrollport. */
  overflow: clip;
  padding: 0 var(--space-2);
  border-left: 1px solid var(--border);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
}

/* The label stays where it can be read when a month is scrolled half out. */
.gantt-month span {
  position: sticky;
  /* The names column is pinned over the left of the scrollport, so a label
     that stuck to zero would stick underneath it. */
  left: calc(var(--tl-names) + var(--space-2));
}

.gantt-tick {
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid var(--border);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  text-align: center;
  white-space: nowrap;
}

.gantt-tick.is-weekend {
  background: var(--surface-sunken);
}

.gantt-tick.is-today {
  color: var(--accent-text);
  font-weight: 700;
}

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

.gantt-section-name,
.gantt-name {
  position: sticky;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  box-sizing: border-box;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.gantt-section-name {
  height: 28px;
  padding: 0 var(--space-4);
  background: var(--background-subtle);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gantt-section-track {
  height: 28px;
  border-bottom: 1px solid var(--border);
  background: var(--background-subtle);
}

.gantt-name {
  height: 34px;
  padding: 0 var(--space-3) 0 var(--space-4);
}

.gantt-name-button {
  display: block;
  overflow: hidden;
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-primary);
  font-size: var(--text-sm);
  text-align: left;
  cursor: pointer;
}

.gantt-name-button:hover {
  color: var(--accent-text);
}

.gantt-name.is-completed .gantt-name-button {
  color: var(--text-tertiary);
  text-decoration: line-through;
}

/*
 * The day and week rules are painted rather than placed: one gradient instead
 * of a div per day, which for a two-year project is the difference between a
 * few hundred elements and a few thousand.
 */
.gantt-track {
  position: relative;
  height: 34px;
  border-bottom: 1px solid var(--border);
  background-image: repeating-linear-gradient(
    to right,
    var(--border) 0 1px,
    transparent 1px calc(var(--tl-day) * 7)
  );
}

/* ---- bars ---- */

.gantt-bar {
  position: absolute;
  top: 5px;
  display: flex;
  align-items: center;
  height: 24px;

  /* A task with one date is one day wide, which at the week and month zooms
     is a few pixels of nothing. It stays honest about where it sits and
     becomes wide enough to see and to grab. */
  min-width: 14px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--text-inverse);
  cursor: pointer;
  touch-action: none;
  user-select: none;
}

.gantt-bar.is-completed {
  background: var(--success);
  opacity: 0.55;
}

/* A bar that continues past the edge of the window: squared off on that
   side, so it reads as cut rather than as ending there. */
.gantt-bar.is-clipped-start {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 3px dotted var(--text-inverse);
}

.gantt-bar.is-clipped-end {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: 3px dotted var(--text-inverse);
}

/* ---- what falls outside the window ---- */

/* The fold sits in the names column and stays put while the tracks scroll,
   like a section heading. Overdue work is counted in red: the number is the
   alarm, the fold is the way to it. */
.gantt-fold {
  position: sticky;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  box-sizing: border-box;
  height: 28px;
  padding: 0 var(--space-4);
  border: none;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--background-subtle);
  color: var(--text-secondary);
  font: inherit;
  font-size: var(--text-xs);
  text-align: left;
  cursor: pointer;
}

.gantt-fold svg {
  transform: rotate(-90deg);
  transition: transform 0.15s;
}

.gantt-fold.is-open svg {
  transform: none;
}

.gantt-fold.is-earlier strong {
  color: var(--danger);
}

.gantt-fold-track {
  height: 28px;
  border-bottom: 1px solid var(--border);
  background: var(--background-subtle);
}

.gantt-fold-track.is-earlier {
  background: var(--danger-soft);
}

/* A row for a task outside the window: no bar to draw, so a line that says
   where it is instead, pinned to the edge it lies beyond. */
.gantt-outside {
  position: sticky;
  left: calc(var(--tl-names) + var(--space-3));
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--danger);
  font: inherit;
  font-size: var(--text-xs);
  cursor: pointer;
}

.gantt-outside.is-later {
  color: var(--text-secondary);
}

.gantt-bar.is-overdue {
  background: var(--danger);
}

.gantt-bar.is-urgent {
  background: var(--priority-urgent);
}

.gantt-bar.is-high {
  background: var(--priority-high);
}

.gantt-bar.is-medium {
  background: var(--priority-medium);
}

.gantt-bar.is-low {
  background: var(--priority-low);
}

.gantt-bar-label {
  overflow: hidden;
  font-size: var(--text-xs);
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
  pointer-events: none;
}

/* Wide enough to be caught with a mouse, invisible until the bar is hovered. */
.gantt-grab {
  position: absolute;
  top: 0;
  width: 8px;
  height: 100%;
  cursor: ew-resize;
}

.gantt-grab.is-start {
  left: -2px;
}

.gantt-grab.is-end {
  right: -2px;
}

.gantt-bar:hover .gantt-grab::after {
  position: absolute;
  top: 6px;
  left: 3px;
  width: 2px;
  height: 12px;
  border-radius: 1px;
  background: var(--text-inverse);
  opacity: 0.6;
  content: "";
}

/* While a bar is being dragged nothing else should react to the pointer. */
.gantt-grid.is-dragging .gantt-bar {
  cursor: grabbing;
}

.gantt-grid.is-dragging .gantt-name-button {
  pointer-events: none;
}

/* ---- overlay ---- */

.gantt-overlay {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--tl-names);
  right: 0;
  pointer-events: none;
}

/* Below the header, which is where the first row starts. */
.gantt-overlay > svg,
.gantt-today {
  position: absolute;
  top: var(--tl-head, 48px);
}

.gantt-overlay > svg {
  left: 0;
  overflow: visible;
}

.gantt-arrow {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 1.5;
}

.gantt-arrow-head {
  fill: var(--border-strong);
}

.gantt-today {
  bottom: 0;
  width: 2px;
  background: var(--danger);
  opacity: 0.5;
}

/* ---- what could not be placed ---- */

.gantt-unscheduled summary {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  cursor: pointer;
}

.gantt-unscheduled-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: var(--space-3);
}

/* ---- workload ----------------------------------------------------------
 *
 * People down the side, weeks across. The heat of a cell is five bands rather
 * than a continuous scale: a wash of near-identical greens says nothing at the
 * glance this screen is always read at.
 */

.workload {
  padding: var(--space-5) var(--space-6);

  /* The columns have a floor, so past a certain number of weeks — or on a
     narrow window — the grid is wider than the page and has to be scrolled
     rather than cut off, which is what it was. */
  overflow-x: auto;
}

.workload-grid {
  display: grid;
  grid-template-columns: 220px repeat(var(--wl-weeks), minmax(56px, 1fr));
  min-width: calc(220px + var(--wl-weeks) * 56px);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.workload-corner,
.workload-week {
  padding: var(--space-3) var(--space-2);
  border-bottom: 1px solid var(--border);
  background: var(--background-subtle);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.workload-corner {
  padding-left: var(--space-4);
}

.workload-week {
  border-left: 1px solid var(--border);
  text-align: center;
}

.workload-week.is-now {
  color: var(--accent-text);
}

.workload-person {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  overflow: hidden;
  padding: 0 var(--space-4);
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-size: var(--text-sm);
}

.workload-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  height: 46px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
}

.workload-cell:disabled {
  cursor: default;
}

/* The week everybody is actually in, marked down the whole column. */
.workload-cell.is-now {
  box-shadow: inset 1px 0 0 var(--accent), inset -1px 0 0 var(--accent);
}

.workload-cell.is-open {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.workload-cell.is-light {
  background: var(--success-soft);
}

.workload-cell.is-medium {
  background: var(--info-soft);
}

.workload-cell.is-heavy {
  background: var(--warning-soft);
}

.workload-cell.is-full {
  background: var(--danger-soft);
}

.workload-count {
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: 600;
}

.workload-hours {
  color: var(--text-tertiary);
  font-size: 10px;
  white-space: nowrap;
}

.workload-hours-sep {
  margin: 0 1px;
}

/* Time spent beside the estimate: quiet while it fits, red once it does not. */
.workload-hours .is-spent,
.workload-detail-row .is-spent {
  color: var(--text-secondary);
}

.workload-hours .is-over,
.workload-detail-row .is-over {
  color: var(--danger);
  font-weight: 600;
}

/* A week with nothing left open but work that was done in it. */
.workload-count.is-done {
  color: var(--success);
}

.workload-detail-row .is-done {
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

/* ---- what is in one cell ---- */

.workload-detail {
  margin: 0 var(--space-6) var(--space-6);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.workload-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  background: var(--background-subtle);
}

.workload-detail-head h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: 600;
}

.workload-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 0;
  border-bottom: 1px solid var(--border);
  background: none;
  color: var(--text-primary);
  font-size: var(--text-sm);
  text-align: left;
  cursor: pointer;
}

.workload-detail-row:last-child {
  border-bottom: 0;
}

.workload-detail-row:hover {
  background: var(--surface-hover);
}

/* ---- narrow windows -----------------------------------------------------
 *
 * The phone pass. Everything above is written for a screen with room; this is
 * what has to give when there is none, gathered in one place rather than
 * scattered through the file so that "what happens on a phone" is one thing to
 * read.
 *
 * Last in the file on purpose: same specificity as the rules it overrides, so
 * it wins by order without a single !important.
 */

/* The way into navigation on a phone, and nothing at all on a desktop, where
   the sidebar is always on the screen already. */
.topbar-menu {
  display: none;
  align-items: center;
  justify-content: center;

  /* Fixed, not merely wide: the top bar is a flex row and would otherwise
     squeeze this to the width of the glyph, leaving a 16px tap target. */
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  margin-left: calc(var(--space-2) * -1);
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
}

.topbar-menu:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* Under the panel, over everything else. Tapping it is how the panel closes —
   which is what people try first, before looking for a button. */
.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 650;
  background: var(--overlay);
}

@media (min-width: 769px) {
  /* On a wide window the panel is furniture, so neither the scrim nor the state
     that opens it mean anything. Stated rather than left to chance: the class
     survives a window being made wider with the menu open. */
  .sidebar-scrim {
    display: none;
  }
}

@media (max-width: 768px) {
  .topbar-menu {
    display: inline-flex;
  }

  .topbar {
    gap: var(--space-2);
    padding: 0 var(--space-3);
  }

  /* The keyboard hint is for a keyboard nobody has here. */
  .topbar-search kbd {
    display: none;
  }

  /* Collapsing an overlay to an icon rail is not a thing anyone wants; on a
     phone the panel is either there or it is not. */
  .sidebar-toggle {
    display: none;
  }

  /* A row of controls that cannot fit goes onto two rows rather than sliding
     over each other, which is what it did: Filter, Views and Columns were drawn
     on top of one another and none of the three could be read. */
  .toolbar-row,
  .page-header-actions,
  .gantt-toolbar,
  .calendar-toolbar {
    flex-wrap: wrap;
  }

  .toolbar {
    padding: var(--space-3) var(--space-4);
  }

  .page-header {
    padding: var(--space-4) var(--space-4) 0;
  }

  .page-header-main {
    gap: var(--space-3);
    flex-wrap: wrap;
  }

  /* The faces go under the title on their own line. Beside it they took the
     width the title row needed, and the settings and the menu — the buttons
     that matter — were pushed off the edge of the screen as soon as a project
     had more than one or two people on it. The title row itself wraps too,
     so a long name moves the badge and the buttons down rather than out. */
  .page-header-main > .page-header-actions {
    flex: 1 1 100%;
    margin-left: 0;
    padding-left: calc(32px + var(--space-3));
  }

  .page-header-main > .page-header-actions .member-summary {
    padding-left: var(--space-3);
  }

  .page-title-row {
    flex-wrap: wrap;
    row-gap: var(--space-1);
  }

  .page-title-row > * {
    flex: 0 0 auto;
  }

  .page-title-row > .page-title {
    flex: 0 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
  }

  /* The tab strip scrolls sideways instead of wrapping: five tabs on two lines
     read as two groups of tabs. */
  .tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    flex: 0 0 auto;
  }

  /* Both grids keep a column of names pinned while the rest scrolls, and both
     of those columns were sized for a desktop — on a phone they left nothing
     for what the screen is actually about. */
  .gantt-grid {
    --tl-names: 140px;
  }

  .gantt,
  .workload {
    padding: var(--space-4) var(--space-3);
  }

  .workload-grid {
    grid-template-columns: 130px repeat(var(--wl-weeks), minmax(48px, 1fr));
    min-width: calc(130px + var(--wl-weeks) * 48px);
  }

  .workload-detail {
    margin: 0 var(--space-3) var(--space-4);
  }

  /* The title is what identifies a row, and it was the thing that disappeared:
     the meta icons refuse to shrink, so on a phone a busy task showed five
     little counters and no name at all. Now the counters give way instead. */
  .task-title {
    flex: 1 1 auto;
  }

  .task-meta {
    flex: 0 1 auto;
    overflow: hidden;
  }

  /* A board column at a third of a phone is unreadable; one at a time, swiped
     across, is how every other board application does this. */
  .board {
    padding: var(--space-4) var(--space-3);
  }

  .board-column {
    flex-basis: 80vw;
    min-width: 240px;
  }
}

/* A picture pasted into a description or a comment: one of our own
   attachments, shown at the width of the column and no wider. */
.rte-input img,
.rich-text img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: var(--space-2) 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* A team panel being dragged into place on the Teams page, and the one it
   will go before. */
.team-panel.is-dragging {
  opacity: 0.4;
}

/* A line above or below the panel, by the half the pointer is in. A shadow
   rather than an element of its own: a panel clips what is inside it. */
.team-panel.is-drop-before {
  box-shadow: 0 -4px 0 0 var(--accent);
}

.team-panel.is-drop-after {
  box-shadow: 0 4px 0 0 var(--accent);
}

/* ---- arranging ------------------------------------------------------- */

/* The grip that appears on everything draggable while arranging: the sign
   that a drag will do something, and the place to take hold. */
.nav-grip {
  flex: 0 0 auto;
  color: var(--sidebar-text-muted);
  cursor: grab;
}

.project-card.is-arrangeable,
.team-panel.is-arrangeable {
  cursor: grab;
}

.project-card-grip {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  color: var(--text-tertiary);
}

.project-card.is-arrangeable {
  position: relative;
}

.team-grip {
  color: var(--text-tertiary);
  cursor: grab;
}

/* The line under the tabs that says whose order is on screen. */
.tabs-note {
  margin-left: auto;
  color: var(--text-tertiary);
  font-size: var(--text-sm);
}

.tabs-note .link-button {
  color: var(--accent-text);
}

/* The arrange switch beside the collapse button. The first toggle takes the
   auto margin, so the two sit together at the right. */
.sidebar-arrange {
  margin-left: auto;
}

.sidebar-arrange + .sidebar-toggle {
  margin-left: 0;
}

.sidebar-arrange.is-on {
  background: var(--sidebar-surface-active);
  color: var(--sidebar-text);
}

/* ---- timeline reading ------------------------------------------------ */

/* Comments or everything, and which end to start from. */
.timeline-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

/* "N more comments": a line in the stream, where the missing ones would be. */
.timeline-more {
  align-self: flex-start;
  padding: var(--space-1) 0;
  border: none;
  background: transparent;
  color: var(--accent-text);
  font: inherit;
  font-size: var(--text-sm);
  cursor: pointer;
}

.timeline-more:hover {
  text-decoration: underline;
}

/* A long comment cut to five lines, fading out at the bottom so it reads as
   cut rather than as ending. */
.timeline-text.is-clamped {
  max-height: calc(1.55em * 5);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent);
  mask-image: linear-gradient(to bottom, #000 60%, transparent);
}

.timeline-see-more {
  margin-top: var(--space-1);
  color: var(--accent-text);
  font-size: var(--text-sm);
}

/* ---- the collapsed rail ----------------------------------------------- */

/* A column of icons: the brand mark above the toggle rather than beside it,
   and nothing that needs words — no "+N more", no chevrons, no "+" for a new
   project, no grips. */
.is-collapsed .sidebar-top {
  flex-direction: column;
  justify-content: center;
  gap: var(--space-2);
  height: auto;
  padding: var(--space-3) 0;
}

.is-collapsed .sidebar-toggle,
.is-collapsed .sidebar-arrange {
  margin-left: 0;
}

.is-collapsed .nav-more,
.is-collapsed .nav-group-chevron,
.is-collapsed .nav-group-action,
.is-collapsed .nav-grip,
.is-collapsed .nav-arrange {
  display: none;
}

.is-collapsed .nav-group-header {
  padding: var(--space-2) 0;
  cursor: default;
}

.is-collapsed .nav-item .project-icon {
  margin: 0;
}

/* A project chip with its remove button, hung on the corner the way a
   collaborator's is and shown the same way: when the pointer is over it. */
.project-chip-group {
  position: relative;
  display: inline-flex;
}

.project-chip-group:hover .collaborator-remove,
.project-chip-group:focus-within .collaborator-remove {
  display: inline-flex;
}

/* A bookmark stays visible when the pointer leaves: it is a mark on the
   notification, not an action waiting to happen. */
.inbox-toggle.is-on {
  opacity: 1;
  color: var(--warning);
}

/* The rail keeps no group headers at all: a header with its words and
   chevron hidden was an invisible button that folded a group when the empty
   space was clicked. A hairline between groups says where one ends. */
.is-collapsed .nav-group-header {
  display: none;
}

.is-collapsed .nav-group {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--sidebar-border);
}

/* Headings and tables come only from imported descriptions — the editor
   offers neither — and are shown as the modest things they are: a subject
   line, a sender's box. */
.rich-text h1,
.rich-text h2,
.rich-text h3,
.rich-text h4,
.rich-text h5,
.rich-text h6,
.rte-input h1,
.rte-input h2,
.rte-input h3,
.rte-input h4,
.rte-input h5,
.rte-input h6 {
  margin: var(--space-3) 0 var(--space-2);
  font-size: var(--text-md);
  font-weight: 600;
  line-height: 1.3;
}

.rich-text table,
.rte-input table {
  margin: var(--space-2) 0;
  border-collapse: collapse;
  max-width: 100%;
}

.rich-text td,
.rich-text th,
.rte-input td,
.rte-input th {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  vertical-align: top;
}
