/* TinyWoolf Studio components. Values come from tokens.css. */

/* Base */
*, *::before, *::after { box-sizing: border-box; }
/* The hidden attribute always hides, even on elements whose class sets a display. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--scroll-pad, 0px); }
body {
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh;
  margin: 0;
  background: var(--surface-page);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
/* The wash of brand colour behind everything, so the glass has something to show through. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--ambient);
}
body > main { flex: 1 0 auto; width: 100%; }
h1, h2, h3 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: var(--weight-regular);
  line-height: 1.2;
}
h1 { font-size: var(--text-2xl); letter-spacing: -0.01em; }
h2 { font-size: var(--text-lg); }
h3 { font-size: var(--text-base); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
img { display: block; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.95em; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--primary-hover); }
[data-theme="dark"] a:hover { color: var(--link); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: var(--radius-sm); }
main:focus-visible, h2[tabindex="-1"]:focus-visible { outline: none; }
[id^="section-"], [id^="group-"] { scroll-margin-top: calc(var(--topbar-height) + var(--space-4)); }
::selection { background: var(--primary-tint); color: var(--text); }

.icon { width: 18px; height: 18px; flex: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--space-3); top: -60px; z-index: 100;
  padding: var(--space-2) var(--space-3); background: var(--surface);
  border: 1px solid var(--border-control); border-radius: var(--radius-md);
}
.skip-link:focus { top: var(--space-2); }
.muted { color: var(--text-muted); }
.preserve-lines { white-space: pre-wrap; overflow-wrap: anywhere; }
.stack > * + * { margin-top: var(--space-4); }
.kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 16px; height: 16px;
  margin-left: var(--space-1); padding: 0 4px; vertical-align: 0;
  border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10.5px; line-height: 1;
}

/* Page shells */
.page { max-width: var(--page-max); margin: 0 auto; padding: var(--space-6) var(--space-5) var(--space-7); }
.page--wide { max-width: var(--page-max-wide); }
/* A project's header card starts level with the top of the sidebar (and sticks there). */
.page.page--project { padding-top: var(--sidebar-gap); }
.page--narrow { max-width: var(--page-max-narrow); }
.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
  gap: var(--space-3) var(--space-4); margin-bottom: var(--space-5);
}
.page-sub { margin-top: var(--space-1); color: var(--text-muted); font-size: var(--text-md); }
.eyebrow { font-size: var(--text-sm); color: var(--text-muted); margin-bottom: var(--space-1); }
.eyebrow a { color: inherit; text-decoration: none; }

/* The Overview's hello. Its language shows on hover, but isn't read out as part of the heading. */
.greeting [data-tooltip]::after { content: attr(data-tooltip) / ""; font-family: var(--font-body); letter-spacing: normal; }

/* The Overview's clock opens the clients' timezones: on hover or focus, kept open by a click
   or tap. The pill sits around the text, so the text stays in line with the heading. */
.world-clock { position: relative; }
.world-clock__trigger {
  margin: -3px -10px; padding: 3px 10px; border: 0; border-radius: var(--radius-pill);
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
  transition: background-color 0.12s var(--ease), color 0.12s var(--ease);
}
.world-clock__trigger:hover, .world-clock__trigger[aria-expanded="true"] { background: var(--surface-sunken); color: var(--text); }
.world-clock__trigger:focus-visible { border-radius: var(--radius-pill); }
.world-clock__panel {
  position: absolute; top: calc(100% + 10px); left: -10px; z-index: 40;
  width: min(340px, calc(100vw - 2 * var(--space-4))); max-height: min(560px, 70vh); overflow-y: auto;
  padding: var(--space-4) var(--space-4) var(--space-3); border-radius: var(--radius-lg);
  background: var(--glass-sheen), var(--glass-fill-strong); border: 1px solid var(--glass-rim); box-shadow: var(--shadow-menu);
  -webkit-backdrop-filter: var(--glass-blur-strong); backdrop-filter: var(--glass-blur-strong);
  color: var(--text); font-size: var(--text-sm); line-height: 1.35;
  transform-origin: top left; animation: clock-drop 0.16s var(--ease);
}
.world-clock__panel.is-closing { animation: clock-lift 0.14s var(--ease) forwards; pointer-events: none; }
@keyframes clock-drop { from { opacity: 0; transform: translateY(-6px) scale(0.98); } }
@keyframes clock-lift { to { opacity: 0; transform: translateY(-4px) scale(0.98); } }
.world-clock__panel h2 { font-size: var(--text-lg); margin-bottom: var(--space-1); }
.world-clock__note { color: var(--text-muted); font-size: var(--text-xs); }
.world-clock__list { margin: var(--space-2) 0; }
.world-clock__row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 9px 0; }
.world-clock__row + .world-clock__row { border-top: 1px solid var(--border); }
.world-clock__row dd {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px; margin: 0;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.world-clock__row strong { font-weight: var(--weight-strong); }
.world-clock__row small { color: var(--text-muted); font-size: var(--text-xs); }
/* On a phone it lines up with the page's text, clear of the screen's edge. */
@media (max-width: 640px) {
  .world-clock__panel { left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .world-clock__panel, .world-clock__panel.is-closing { animation: none; }
}
.eyebrow a:hover { color: var(--link); text-decoration: underline; }

/* App shell: a floating glass sidebar at the left, and the page beside it. Below 1024px
   the sidebar becomes a drawer and a small glass bar sits at the top (see Small screens). */
body.has-sidebar { padding-left: var(--sidebar-offset); }

/* Logo: the official blue logo on light, the official white one on dark (partials/logo.html). */
.logo-on-dark { display: none; }
[data-theme="dark"] .logo-on-light { display: none; }
[data-theme="dark"] .logo-on-dark { display: block; }
.brand { display: flex; align-items: center; flex: none; border-radius: var(--radius-md); text-decoration: none; }
.brand__logo { height: 30px; width: auto; }

/* The chrome's glass is on a pseudo-element: an element with its own backdrop blur would
   stop the menus inside it from blurring what's behind them. */
.sidebar::before, .mobilebar::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--glass-sheen), var(--surface-chrome);
  border: 1px solid var(--glass-rim); box-shadow: var(--shadow-raised);
  -webkit-backdrop-filter: var(--glass-blur-strong); backdrop-filter: var(--glass-blur-strong);
}

/* Sidebar */
.sidebar {
  position: fixed; top: var(--sidebar-gap); bottom: var(--sidebar-gap); left: var(--sidebar-gap); z-index: 25;
  display: flex; flex-direction: column; width: var(--sidebar-w);
  padding: var(--space-5) var(--space-3) var(--space-3); border-radius: var(--radius-xl);
}
.sidebar__head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 40px; padding-left: var(--space-3); }
.brand--sidebar { align-items: flex-end; gap: 7px; }
.brand--sidebar .brand__logo { height: 36px; }
.sidebar__close { display: none; }

.sidenav {
  flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin;
  margin: var(--space-5) calc(var(--space-2) * -1) 0; padding: 2px var(--space-2) var(--space-3);
}
.sidenav__group + .sidenav__group { margin-top: var(--space-4); }
.sidenav__heading {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  margin-bottom: var(--space-1); padding: 6px var(--space-3);
  background: none; border: 0; border-radius: var(--radius-md); cursor: pointer;
  color: var(--text-muted); font-size: 11.5px; letter-spacing: 0.1em; text-align: left; text-transform: uppercase;
  transition: color 0.15s var(--ease);
}
.sidenav__heading:hover { color: var(--text); }
.sidenav__chevron { width: 15px; height: 15px; transition: transform 0.18s var(--ease); }
.sidenav__heading[aria-expanded="false"] .sidenav__chevron { transform: rotate(-90deg); }
/* Folded groups, set on <html> by theme.js before the page paints. A group folds as a
   grid row easing to nothing while its items fade and lift away; unfolding, the items
   drop back in one after another. The list clips only while it's moving (app.js adds
   .is-moving), so the current page's raised capsule keeps its shadow at rest. */
.sidenav__fold {
  display: grid; grid-template-rows: 1fr;
  transition: grid-template-rows 0.3s var(--ease), visibility 0s;
}
.sidenav__fold > .sidenav__list { min-height: 0; }
.sidenav__fold.is-moving > .sidenav__list { overflow: hidden; }
.sidenav__fold .sidenav__list > li { transition: opacity 0.24s var(--ease), transform 0.3s var(--ease); }
.sidenav__fold .sidenav__list > li:nth-child(2) { transition-delay: 40ms; }
.sidenav__fold .sidenav__list > li:nth-child(3) { transition-delay: 80ms; }
.sidenav__fold .sidenav__list > li:nth-child(n+4) { transition-delay: 120ms; }
[data-nav-folded~="studio"] #sidenav-studio, [data-nav-folded~="workspace"] #sidenav-workspace {
  grid-template-rows: 0fr; visibility: hidden;
  transition: grid-template-rows 0.26s var(--ease), visibility 0s linear 0.26s;
}
[data-nav-folded~="studio"] #sidenav-studio > .sidenav__list, [data-nav-folded~="workspace"] #sidenav-workspace > .sidenav__list { overflow: hidden; }
[data-nav-folded~="studio"] #sidenav-studio li, [data-nav-folded~="workspace"] #sidenav-workspace li {
  opacity: 0; transform: translateY(-6px); transition-duration: 0.16s; transition-delay: 0s;
}
.sidenav__list { display: grid; gap: 2px; }
.sidenav__link {
  position: relative; display: flex; align-items: center; gap: var(--space-3); min-height: 40px; padding: 0 var(--space-3);
  border-radius: var(--radius-pill); color: var(--text-secondary); font-size: var(--text-base); text-decoration: none;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.sidenav__link .icon { width: 20px; height: 20px; color: var(--text-muted); transition: color 0.15s var(--ease); }
.sidenav__link:hover { color: var(--text); background: var(--surface-sunken); }
.sidenav__link:hover .icon { color: var(--text); }
/* The current page sits in a raised glass capsule. */
.sidenav__link[aria-current="page"] {
  color: var(--link); font-weight: var(--weight-strong);
  background: var(--glass-sheen), var(--glass-bubble); box-shadow: var(--shadow-card);
}
.sidenav__link[aria-current="page"] .icon { color: var(--link); }
.sidenav__link:focus-visible { border-radius: var(--radius-pill); outline-offset: -2px; }

.sidebar__foot {
  display: grid; gap: var(--space-2);
  margin: 0 calc(var(--space-1) * -1); padding: var(--space-3) var(--space-1) 0; border-top: 1px solid var(--border);
}
.sidebar__appearance {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  padding-left: var(--space-3); color: var(--text-muted); font-size: var(--text-sm);
}

.theme-switch {
  display: inline-flex; align-items: center; flex: none; padding: 3px; margin: 0;
  background: none; border: 0; border-radius: var(--radius-pill); cursor: pointer; color: inherit;
}
.theme-switch__track {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  width: 56px; height: 30px; padding: 0 7px; border-radius: var(--radius-pill);
  background: var(--surface-sunken); box-shadow: inset 0 0 0 1px var(--border-strong);
  color: var(--text-muted); transition: background-color 0.2s var(--ease);
}
.theme-switch__track > .icon { width: 14px; height: 14px; }
.theme-switch__thumb {
  position: absolute; top: 3px; left: 3px; display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; background: var(--surface); color: var(--tw-blue);
  box-shadow: 0 1px 3px rgba(30, 30, 30, 0.25); transition: transform 0.2s var(--ease);
}
.theme-switch__thumb .icon { width: 14px; height: 14px; }
.theme-switch__thumb .theme-switch__moon { display: none; }
.theme-switch:hover .theme-switch__track { box-shadow: inset 0 0 0 1px var(--text-muted); }
.theme-switch:focus-visible { outline-offset: 1px; border-radius: var(--radius-pill); }
[data-theme="dark"] .theme-switch__track { background: var(--primary-tint); }
[data-theme="dark"] .theme-switch__thumb { transform: translateX(26px); background: var(--primary); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 3px rgba(0, 0, 0, 0.5); }
[data-theme="dark"] .theme-switch__thumb .theme-switch__sun { display: none; }
[data-theme="dark"] .theme-switch__thumb .theme-switch__moon { display: block; }

/* The account menu at the foot of the sidebar opens upwards. */
.account-menu { position: relative; }
.account-menu summary {
  display: flex; align-items: center; gap: 10px; cursor: pointer; list-style: none;
  padding: 6px var(--space-2) 6px 6px; border-radius: var(--radius-lg);
  transition: background-color 0.15s var(--ease);
}
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary:hover, .account-menu[open] summary { background: var(--surface-sunken); }
.account-menu summary .avatar { width: 34px; height: 34px; font-size: 12px; }
.account-menu__text { display: grid; flex: 1; min-width: 0; line-height: 1.3; }
.account-menu__name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text); font-size: var(--text-md); }
.account-menu__role { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text-muted); font-size: var(--text-xs); }
.account-menu__chevron { width: 15px; height: 15px; color: var(--text-muted); transform: rotate(180deg); transition: transform 0.15s var(--ease); }
.account-menu[open] .account-menu__chevron { transform: none; }
.account-menu__panel {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 30;
  padding: var(--space-2); border-radius: var(--radius-lg);
  transform-origin: 50% 100%;
}
/* Opening, the menu rises and fades in from the account button; closing (app.js adds
   .is-closing, then shuts it) it sinks back and fades out. */
.account-menu[open] .account-menu__panel { animation: menu-rise 0.2s var(--ease); }
.account-menu.is-closing .account-menu__panel { animation: menu-sink 0.14s var(--ease) forwards; }
@keyframes menu-rise { from { opacity: 0; transform: translateY(8px) scale(0.97); } }
@keyframes menu-sink { to { opacity: 0; transform: translateY(6px) scale(0.98); } }
@keyframes menu-slide-in { from { opacity: 0; transform: translateX(-8px) scale(0.97); } }
@keyframes menu-slide-out { to { opacity: 0; transform: translateX(-6px) scale(0.98); } }
/* Floating glass: menus and pickers that open over content. */
.account-menu__panel, .assign-picker__panel, .assignee-add__panel, .section-menu__panel, .date-picker__panel,
.add-task__panel, .approval-menu__panel {
  background: var(--glass-sheen), var(--glass-fill-strong);
  border: 1px solid var(--glass-rim); box-shadow: var(--shadow-menu);
  -webkit-backdrop-filter: var(--glass-blur-strong); backdrop-filter: var(--glass-blur-strong);
}
.account-menu__who {
  display: flex; flex-direction: column; gap: 2px; padding: var(--space-2);
  margin-bottom: var(--space-1); border-bottom: 1px solid var(--border); font-size: var(--text-md);
}
.account-menu__who strong { font-weight: var(--weight-strong); }
.account-menu__who span { color: var(--text-muted); font-size: var(--text-sm); }
.account-menu__panel a, .account-menu__panel button {
  display: flex; align-items: center; gap: var(--space-2); width: 100%; padding: 7px var(--space-2); text-align: left;
  background: none; border: 0; border-radius: var(--radius-md); color: var(--text);
  font-size: var(--text-md); text-decoration: none; cursor: pointer;
}
.account-menu__panel .icon { width: 16px; height: 16px; color: var(--text-muted); }
.account-menu__panel a:hover, .account-menu__panel button:hover { background: var(--surface-sunken); color: var(--text); }

/* Collapsing the sidebar on wide screens: a quiet icon button at the head's right. It
   sits a fixed distance from the right edge, so it rides along as the sidebar narrows
   and ends up centred in the rail. Its label says what it will do. */
.sidebar__toggle {
  position: absolute; top: 50%; right: 7px; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0;
  background: none; border: 0; border-radius: 50%; color: var(--text-muted); cursor: pointer;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.sidebar__toggle .icon { width: 19px; height: 19px; }
.sidebar__toggle:hover { background: var(--surface-sunken); color: var(--text); }
.sidebar__toggle:focus-visible { border-radius: 50%; }
.sidebar__toggle-expand, [data-sidebar="collapsed"] .sidebar__toggle-collapse { display: none; }
[data-sidebar="collapsed"] .sidebar__toggle-expand { display: inline; }

/* The small top bar, below 1024px only: the menu button for the drawer, and the logo. */
.mobilebar {
  position: sticky; top: var(--space-2); z-index: 20;
  display: none; align-items: center; gap: var(--space-3);
  min-height: var(--topbar-height); margin: var(--space-2) var(--space-2) 0; padding: var(--space-2);
  border-radius: var(--radius-pill);
}
.mobilebar .brand__logo { height: 28px; }
.sidebar-scrim { display: none; }
.mobilebar__menu, .sidebar__close {
  align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; padding: 0;
  background: var(--glass-sheen), var(--control-fill); border: 1px solid var(--border-strong); border-radius: 50%;
  box-shadow: var(--shadow-control); color: var(--text); cursor: pointer;
}
.mobilebar__menu .icon, .sidebar__close .icon { width: 20px; height: 20px; }
.mobilebar__menu:hover, .sidebar__close:hover { background: var(--glass-sheen), var(--glass-bubble); }
.mobilebar__menu:focus-visible, .sidebar__close:focus-visible { border-radius: 50%; }

/* Footer */
.site-footer { color: var(--text-muted); font-size: var(--text-sm); }
.site-footer__inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4);
  max-width: var(--page-max-wide); margin: 0 auto; padding: var(--space-4) var(--space-5);
}
.site-footer__meta, .site-footer__end { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.site-footer__version { font-variant-numeric: tabular-nums; }
a.site-footer__version { color: inherit; text-decoration: none; border-radius: var(--radius-sm); }
a.site-footer__version:hover { color: var(--link); text-decoration: underline; }

/* What's new: one card per release, newest first. */
.page--reading { max-width: 860px; }
.release-index { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-3); }
.release-index__link {
  padding: 4px 12px; border-radius: var(--radius-pill); background: var(--glass-fill-thin);
  box-shadow: inset 0 0 0 1px var(--border); color: var(--text-muted); font-size: var(--text-sm);
  text-decoration: none; font-variant-numeric: tabular-nums;
}
.release-index__link:hover { color: var(--text); background: var(--glass-bubble); }
.release-index__link.is-current { color: var(--link); background: var(--glass-bubble); box-shadow: var(--shadow-card); }
.releases { display: grid; gap: var(--space-4); }
.release { scroll-margin-top: calc(var(--topbar-height) + var(--space-5)); }
.release__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-2); }
.release__head h2 { font-size: var(--text-xl); font-variant-numeric: tabular-nums; }
.release__date { margin-left: auto; color: var(--text-muted); font-size: var(--text-sm); }
.release__summary { margin-bottom: var(--space-3); color: var(--text-muted); font-size: var(--text-base); }
.release__group + .release__group { margin-top: var(--space-4); }
.release__label {
  display: inline-block; margin-bottom: var(--space-2); padding: 1px 10px; border-radius: var(--radius-pill);
  font-family: var(--font-body); font-size: var(--text-xs); font-weight: var(--weight-strong);
  letter-spacing: 0.04em; text-transform: uppercase; background: var(--status-todo-bg); color: var(--status-todo-text);
}
.release__label--added { background: var(--status-done-bg); color: var(--status-done-text); }
.release__label--changed { background: var(--status-in_progress-bg); color: var(--status-in_progress-text); }
.release__label--fixed { background: var(--status-waiting_client-bg); color: var(--status-waiting_client-text); }
.release__label--removed { background: var(--danger-tint); color: var(--danger); }
.release__items { display: grid; gap: var(--space-2); padding-left: 1.2em; list-style: disc; font-size: var(--text-md); line-height: 1.55; }
.release__items ul { display: grid; gap: var(--space-1); margin-top: var(--space-1); padding-left: 1.2em; list-style: circle; }
.release__items li::marker { color: var(--text-muted); }
.release__items code { padding: 1px 5px; border-radius: var(--radius-sm); background: var(--surface-sunken); font-size: 0.9em; }
.site-footer__credit a {
  display: inline-flex; align-items: center; gap: 5px; vertical-align: bottom;
  color: var(--text); font-weight: var(--weight-strong); text-decoration: none;
}
.site-footer__credit a:hover { color: var(--link); text-decoration: underline; }
.site-footer__credit .icon { width: 15px; height: 15px; }
.site-footer .theme-switch { margin-right: var(--space-2); }
.badge {
  display: inline-flex; align-items: center; padding: 1px 8px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: var(--weight-strong); letter-spacing: 0.05em; text-transform: uppercase; line-height: 18px;
}
.badge--beta { background: var(--primary-tint); color: var(--link); }

/* Request progress line */
.request-bar {
  position: fixed; top: 0; left: 0; z-index: 50; width: 100%; height: 2px;
  background: var(--primary); opacity: 0; transition: opacity 0.1s;
}
.request-bar.is-active { opacity: 1; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--control-h); padding: 0 16px; background: var(--glass-sheen), var(--control-fill);
  border: 1px solid var(--border-strong); border-radius: var(--radius-pill); box-shadow: var(--shadow-control);
  color: var(--text); font-size: var(--text-md); line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), color 0.15s var(--ease);
}
.btn:hover { color: var(--text); background: var(--glass-sheen), var(--glass-bubble); }
.btn .icon { width: 16px; height: 16px; }
/* Brand blue on light, brushed silver on dark (the --btn-primary-* tokens). */
.btn--primary {
  background: var(--btn-primary-bg); border-color: transparent; color: var(--btn-primary-text);
  box-shadow: var(--btn-primary-shadow);
}
.btn--primary:hover { background: var(--btn-primary-bg-hover); border-color: transparent; color: var(--btn-primary-text); }
.btn--danger { background: var(--danger-solid); border-color: transparent; color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 4px 14px rgba(163, 35, 27, 0.25); }
.btn--danger:hover { background: var(--danger-hover); border-color: transparent; color: #fff; }
[data-theme="dark"] .btn--danger:hover { background: var(--danger-solid); filter: brightness(1.1); }
.btn--danger-quiet { color: var(--danger); border-color: var(--danger); }
.btn--danger-quiet:hover { color: var(--danger); background: var(--danger-tint); }
.btn--small { min-height: var(--control-h-sm); padding: 0 12px; font-size: var(--text-sm); }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-busy="true"] { opacity: 0.6; cursor: progress; }
.link-button {
  padding: 0; background: none; border: 0; color: var(--link);
  font-size: var(--text-sm); text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.link-button:hover { color: var(--primary-hover); }
.button-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* Segmented navigation */
.segmented {
  display: inline-flex; max-width: 100%; overflow-x: auto; scrollbar-width: none;
  padding: 3px; gap: 2px; background: var(--surface-sunken); border-radius: var(--radius-pill);
  box-shadow: inset 0 0 0 1px var(--border);
}
.segmented::-webkit-scrollbar { display: none; }
.segmented a {
  display: inline-flex; align-items: center; gap: 6px; min-height: calc(var(--control-h) - 6px);
  padding: 0 var(--space-3); border-radius: var(--radius-pill); color: var(--text-muted);
  font-size: var(--text-md); text-decoration: none; white-space: nowrap;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.segmented a .icon { width: 16px; height: 16px; }
.segmented a:hover { color: var(--text); }
.segmented a[aria-current] { background: var(--glass-bubble); color: var(--text); box-shadow: var(--shadow-card); }
.segmented--small a { min-height: calc(var(--control-h-sm) - 6px); padding: 0 10px; font-size: var(--text-sm); }

/* Forms */
.field { margin: 0 0 var(--space-4); padding: 0; border: 0; min-width: 0; }
.field label, .field legend, .filters__field label {
  display: block; margin-bottom: 6px; padding: 0;
  font-size: var(--text-sm); line-height: 18px;
}
input[type="text"], input[type="search"], input[type="email"], input[type="password"],
input[type="date"], input[type="url"], input[type="number"], select, textarea {
  width: 100%; min-height: var(--control-h); padding: 7px var(--control-px); background-color: var(--field-fill);
  border: 1px solid var(--border-control); border-radius: var(--field-radius, var(--radius-pill)); font-size: var(--text-md);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
/* Single-line fields are capsules, like the buttons beside them. Fields of several lines
   keep a rounded rectangle, since a capsule that tall would clip its corners' text. */
textarea, select[multiple], select[size] { --field-radius: var(--radius-lg); }
/* Our own chevron, inset like the text, instead of the browser's arrow at the very edge. */
select {
  appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: var(--chevron); background-repeat: no-repeat;
  background-position: right 14px center; background-size: 16px 16px;
  text-overflow: ellipsis;
}
select[multiple], select[size] { padding-right: var(--control-px); background-image: none; }
/* A text box with suggestions (a datalist) wears the same chevron. The browser's own
   button stays where the chevron is, invisible, so clicking it still lists them. */
input[list] {
  padding-right: 40px; background-image: var(--chevron); background-repeat: no-repeat;
  background-position: right 14px center; background-size: 16px 16px;
}
input[list]::-webkit-calendar-picker-indicator { opacity: 0; width: 24px; margin-right: -31px; cursor: pointer; }
input[list]::-webkit-list-button { opacity: 0; }
input[type="text"]:hover, input[type="search"]:hover, input[type="email"]:hover, input[type="password"]:hover,
input[type="date"]:hover, input[type="url"]:hover, input[type="number"]:hover, select:hover, textarea:hover { border-color: var(--text-muted); }
input[type="text"]:focus-visible, input[type="search"]:focus-visible, input[type="email"]:focus-visible, input[type="password"]:focus-visible,
input[type="date"]:focus-visible, input[type="url"]:focus-visible, input[type="number"]:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-tint), 0 0 0 1px var(--primary);
  border-radius: var(--field-radius, var(--radius-pill));
}
input[type="date"] { min-width: 0; }
textarea { display: block; resize: vertical; line-height: 1.45; }
::placeholder { color: var(--text-muted); opacity: 1; }
.field--error input, .field--error select, .field--error textarea { border-color: var(--danger); }
.field__help { margin-top: var(--space-1); font-size: var(--text-sm); color: var(--text-muted); }
.field__error { margin-top: var(--space-1); font-size: var(--text-sm); color: var(--danger); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--space-3); }
.field-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.form-alert {
  margin-bottom: var(--space-4); padding: var(--space-3); border-radius: var(--radius-md);
  background: var(--danger-tint); color: var(--danger); font-size: var(--text-md);
}
.password-field { position: relative; }
.password-field input { padding-right: 68px; }
.password-field__toggle {
  position: absolute; top: 4px; right: 4px; bottom: 4px; min-width: 56px;
  background: none; border: 0; border-radius: var(--radius-pill); color: var(--link);
  font-size: var(--text-sm); cursor: pointer;
}
.password-field__toggle:hover { background: var(--primary-tint); }
.check-grid > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px var(--space-3); }
.check-grid label { display: flex; align-items: center; gap: var(--space-2); margin: 0; padding: 4px 0; font-size: var(--text-md); cursor: pointer; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; margin: 0; flex: none; accent-color: var(--primary); }

/* Appearance choice on Settings */
.theme-choice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); margin: 0; padding: 0; border: 0; min-width: 0; }
.theme-choice__option {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: var(--space-2);
  padding: var(--space-3); background: var(--control-fill); border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  font-size: var(--text-md); cursor: pointer; transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.theme-choice__option:hover { background: var(--surface-hover); }
.theme-choice__option:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); background: var(--primary-tint); }
.theme-choice__swatch { grid-column: 1 / -1; grid-row: 1; height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); }
.theme-choice__option input { grid-row: 2; }
.theme-choice__option > span:last-child { grid-row: 2; }
/* Tiny previews: a page, a card and a blue accent line. */
.theme-choice__swatch--light {
  background:
    linear-gradient(#3663E4, #3663E4) 12px 28px / 32% 5px no-repeat,
    linear-gradient(#FFFFFF, #FFFFFF) 8px 8px / calc(100% - 16px) 30px no-repeat,
    #F7F5F1;
}
.theme-choice__swatch--dark {
  background:
    linear-gradient(#5A80F0, #5A80F0) 12px 28px / 32% 5px no-repeat,
    linear-gradient(#2C2B29, #2C2B29) 8px 8px / calc(100% - 16px) 30px no-repeat,
    #141413;
}
.theme-choice__swatch--system {
  background:
    linear-gradient(#3663E4, #3663E4) 12px 28px / 32% 5px no-repeat,
    linear-gradient(90deg, #FFFFFF 0 50%, #2C2B29 50%) 8px 8px / calc(100% - 16px) 30px no-repeat,
    linear-gradient(90deg, #F7F5F1 0 50%, #141413 50%);
}

/* Sign-in */
/* The link's own 8px inset is taken off, so its arrow lines up with the footer text. */
.auth-top { padding: var(--space-4) calc(var(--space-5) - 8px) 0; }
.auth-top__link {
  display: inline-flex; align-items: center; gap: var(--space-2); padding: 6px 12px 6px 8px;
  border-radius: var(--radius-pill); color: var(--text-muted); font-size: var(--text-md); text-decoration: none;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.auth-top__link .icon { width: 16px; height: 16px; }
.auth-top__link:hover, [data-theme="dark"] .auth-top__link:hover { background: var(--surface-sunken); color: var(--text); }
.auth { display: flex; align-items: center; justify-content: center; padding: var(--space-6) var(--space-4); }
.auth__card {
  width: 100%; max-width: 400px; padding: var(--space-6);
  background: var(--glass-sheen), var(--glass-fill);
  border: 1px solid var(--glass-rim); border-radius: var(--radius-xl); box-shadow: var(--shadow-raised);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
/* On black, a cone of light falls on the sign-in card from above. */
[data-theme="dark"] .auth__card {
  background: radial-gradient(70% 55% at 50% -8%, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0) 72%), var(--glass-sheen), var(--glass-fill);
}
.auth__logo { height: 56px; width: auto; margin-bottom: var(--space-5); }
.auth__card h1 { font-size: var(--text-xl); margin-bottom: var(--space-4); }
.auth__lead { margin: calc(var(--space-2) * -1) 0 var(--space-4); color: var(--text-muted); font-size: var(--text-md); }
.auth__note { margin-top: var(--space-4); font-size: var(--text-sm); color: var(--text-muted); }
.auth__signout { margin-top: var(--space-4); }

/* Messages */
.flash-stack { margin-bottom: var(--space-4); display: grid; gap: var(--space-2); }
.flash { padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); font-size: var(--text-md); background: var(--surface-sunken); }
.flash--success { background: var(--status-done-bg); color: var(--status-done-text); }
.flash--error { background: var(--danger-tint); color: var(--danger); }
.toasts {
  position: fixed; left: 50%; bottom: var(--space-5); transform: translateX(-50%); z-index: 90;
  display: grid; gap: var(--space-2); width: max-content; max-width: min(92vw, 480px);
}
.toast {
  padding: 10px var(--space-4); background: var(--toast-bg); color: var(--toast-text);
  border-radius: var(--radius-lg); font-size: var(--text-md); box-shadow: var(--shadow-menu);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  animation: toast-in 0.2s var(--ease);
}
.has-sidebar .toasts { left: calc(50% + var(--sidebar-offset) / 2); }
.toast--error { background: var(--danger-solid); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3);
  margin-bottom: var(--space-4); padding: var(--space-3); border-radius: var(--radius-md);
  background: var(--status-waiting_client-bg); color: var(--status-waiting_client-text); font-size: var(--text-md);
}

/* Cards and sections */
/* In-page glass: translucent, with no blur of its own. The page behind is a smooth
   wash, so blurring it would look the same and cost a lot on long pages. */
.card {
  container-type: inline-size;
  background: var(--glass-sheen), var(--glass-fill); border: 1px solid var(--glass-rim); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
/* The liquid glass rim (--glass-edge): a 1px ring of light laid over the border,
   brightest at the top-left. It's a masked pseudo-element, because a border can't take
   a gradient. The chrome's ring sits on its own edge, since its glass is a pseudo too. */
.card, .stat-tile, .auth__card { position: relative; }
.card::after, .stat-tile::after, .project-head::after, .auth__card::after, .sidebar::after, .mobilebar::after {
  content: ""; position: absolute; inset: -1px; padding: 1px; border-radius: inherit; pointer-events: none;
  background: var(--glass-edge);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.sidebar::after, .mobilebar::after { inset: 0; }
/* Only children that touch the card's edge need its lower corners. */
.card:not(.card--pad) > :last-child { border-bottom-left-radius: inherit; border-bottom-right-radius: inherit; }
.card--pad { padding: var(--space-5) var(--row-inset); }
.card__head {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--border);
}
.card__head h2 { font-size: var(--text-base); }
.card__more { padding: var(--space-2) var(--space-4); border-top: 1px solid var(--border); font-size: var(--text-sm); color: var(--text-muted); }
.count {
  min-width: 22px; padding: 0 7px; background: var(--surface-sunken); border-radius: var(--radius-pill);
  color: var(--text-muted); font-size: var(--text-xs); line-height: 20px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.count--alert { background: var(--danger-tint); color: var(--danger); }
.settings-section { margin-bottom: var(--space-4); }
form.card + .card { margin-top: var(--space-4); }
.settings-section h2 { margin-bottom: var(--space-2); }
.settings-section > p.muted { margin-bottom: var(--space-3); font-size: var(--text-md); }
.facts { display: grid; gap: var(--space-3); margin: var(--space-3) 0; }
.facts dt { font-size: var(--text-sm); color: var(--text-muted); }
.copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.copy-row code { padding: 4px 8px; background: var(--surface-sunken); border-radius: var(--radius-sm); font-size: var(--text-base); }

/* Empty, filtered and error states */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: var(--space-7) var(--space-5); text-align: center;
  background: var(--glass-fill-thin); border: 1px dashed var(--border-strong); border-radius: var(--radius-lg);
}
.empty-state__icon {
  width: 44px; height: 44px; margin-bottom: var(--space-3); padding: 10px;
  border-radius: 50%; background: var(--primary-tint); color: var(--link);
}
.empty-state h2 { margin-bottom: var(--space-1); }
.empty-state p { max-width: 46ch; margin-bottom: var(--space-4); color: var(--text-muted); font-size: var(--text-md); }
.empty-state p:last-child { margin-bottom: 0; }
.empty-state--compact { padding: var(--space-4); }
.empty-inline { padding: var(--space-4) var(--row-inset); color: var(--text-muted); font-size: var(--text-md); }
.state-page { max-width: 480px; margin: var(--space-7) auto; text-align: center; }
.state-page img { margin: 0 auto var(--space-4); }
.state-page h1 { font-size: var(--text-xl); margin-bottom: var(--space-2); }
.state-page p { margin-bottom: var(--space-4); color: var(--text-muted); }

/* Chips */
.chip {
  display: inline-block; padding: 1px 8px; border-radius: var(--radius-pill);
  font-size: var(--text-xs); line-height: 18px; white-space: nowrap;
  background: var(--status-todo-bg); color: var(--status-todo-text);
}
.chip--neutral, .chip--todo, .chip--planned, .chip--sched-upcoming, .chip--project-completed { background: var(--status-todo-bg); color: var(--status-todo-text); }
.chip--in_progress, .chip--active, .chip--sched-started { background: var(--status-in_progress-bg); color: var(--status-in_progress-text); }
.chip--internal_review { background: var(--status-internal_review-bg); color: var(--status-internal_review-text); }
.chip--waiting_client, .chip--on_hold, .chip--sched-today { background: var(--status-waiting_client-bg); color: var(--status-waiting_client-text); }
.chip--done, .chip--completed { background: var(--status-done-bg); color: var(--status-done-text); }
.chip--urgent, .chip--sched-overdue { background: var(--danger-tint); color: var(--danger); }

.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; vertical-align: 1px; background: var(--status-todo-text); }
.status-dot--in_progress { background: var(--status-in_progress-text); }
.status-dot--internal_review { background: var(--status-internal_review-text); }
.status-dot--waiting_client { background: var(--status-waiting_client-text); }
.status-dot--done { background: var(--status-done-text); }

/* Avatars */
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface-sunken); color: var(--text);
  font-size: 10.5px; font-weight: var(--weight-strong); letter-spacing: 0.02em;
}
.avatar--tone-0 { background: var(--tone-0-bg); color: var(--tone-0-text); }
.avatar--tone-1 { background: var(--tone-1-bg); color: var(--tone-1-text); }
.avatar--tone-2 { background: var(--tone-2-bg); color: var(--tone-2-text); }
.avatar--tone-3 { background: var(--tone-3-bg); color: var(--tone-3-text); }
.avatar--tone-4 { background: var(--tone-4-bg); color: var(--tone-4-text); }
.avatar--tone-5 { background: var(--tone-5-bg); color: var(--tone-5-text); }
.avatar--empty { background: none; border: 1px dashed var(--border-control); color: var(--text-muted); font-weight: var(--weight-regular); }
.avatar--inactive { opacity: 0.55; }
/* A photo fills the circle; a portrait that isn't square is cropped from its middle. */
.avatar--photo { overflow: hidden; padding: 0; background: var(--surface-sunken); }
.avatar--photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-setting { display: flex; align-items: center; gap: var(--space-4); }
.photo-setting__preview .avatar { width: 64px; height: 64px; font-size: 20px; }
.photo-setting__body { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.photo-setting__body p { margin: 0; }
.avatar-stack { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
/* Several people on one task: overlapping, with a ring so each stays distinct. */
.avatar-group { display: inline-flex; align-items: center; flex: none; }
.avatar-group .avatar { box-shadow: 0 0 0 2px var(--surface); }
.avatar-group .avatar + .avatar { margin-left: -3px; }
.avatar--more { background: var(--surface-sunken); color: var(--text-muted); font-size: 10px; }

/* Assignee picker in list rows */
.assign-picker { position: relative; flex: 1; min-width: 0; }
/* An open menu or date panel goes above everything else in its row and the rows after it,
   whose ticks, menus and handles are raised too. Its card goes above the cards after it. */
.raised:has(details[open]), details.raised[open] { z-index: 20; }
.card:has(details[open]) { position: relative; z-index: 21; }
.assign-picker summary {
  display: flex; align-items: center; gap: var(--space-2); min-height: var(--control-h-sm); padding: 2px 9px 2px 3px;
  border: 1px solid transparent; border-radius: var(--radius-md); cursor: pointer; list-style: none;
}
.assign-picker summary::-webkit-details-marker { display: none; }
.assign-picker summary:hover, .assign-picker[open] summary { border-color: var(--border-control); background: var(--surface); }
.assign-picker__names { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text); }
.assign-picker__chevron { width: 14px; height: 14px; color: var(--text-muted); }
.assign-picker__panel {
  position: absolute; left: 0; top: calc(100% + 4px); z-index: 30; width: max(100%, 250px); max-height: 320px; overflow-y: auto;
  padding: var(--space-2); border-radius: var(--radius-lg);
}
.assign-picker__title { padding: 2px var(--space-2) var(--space-1); font-size: var(--text-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.assign-picker__option {
  display: flex; align-items: center; gap: var(--space-2); padding: 6px var(--space-2);
  border-radius: var(--radius-md); font-size: var(--text-md); color: var(--text); cursor: pointer;
}
.assign-picker__option:hover { background: var(--surface-sunken); }
.assign-picker__option.is-saving { opacity: 0.6; }
.task-row__names { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.assignee-field .field__help { margin-top: var(--space-2); }
/* The menu hangs from the whole row, not the button, so it never runs off the panel's edge. */
.assignee-chips { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); min-height: var(--control-h); }
.assignee-chips__empty { font-size: var(--text-md); }
.assignee-chip {
  display: inline-flex; align-items: center; gap: 6px; height: var(--control-h-sm); padding: 0 4px 0 3px;
  background: var(--surface-sunken); border: 1px solid var(--border); border-radius: var(--radius-pill);
  font-size: var(--text-md);
}
.assignee-chip[hidden], .assignee-chips [hidden] { display: none; }
.assignee-chip__note { color: var(--text-muted); font-size: var(--text-sm); }
.assignee-chip__remove {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0;
  background: none; border: 0; border-radius: 50%; color: var(--text-muted); cursor: pointer;
}
.assignee-chip__remove .icon { width: 14px; height: 14px; }
.assignee-chip__remove:hover { background: var(--surface); color: var(--danger); }
.assignee-chip__remove:focus-visible { border-radius: 50%; }
.assignee-add { position: static; }
.assignee-add summary { list-style: none; }
.assignee-add summary::-webkit-details-marker { display: none; }
.assignee-add__button { border-style: dashed; border-radius: var(--radius-pill); color: var(--text-muted); gap: 4px; padding: 0 12px 0 9px; }
.assignee-add__button:hover, .assignee-add[open] .assignee-add__button { color: var(--text); border-style: solid; }
.assignee-add__panel {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; width: min(280px, 100%); max-height: 300px; overflow-y: auto;
  padding: var(--space-2); border-radius: var(--radius-lg);
}
.assignee-add__panel .assign-picker__option { width: 100%; background: none; border: 0; text-align: left; font: inherit; }
.assignee-add__panel .assign-picker__option[disabled] { opacity: 0.5; cursor: not-allowed; }
.assignee-add__none { padding: var(--space-2); font-size: var(--text-sm); }

/* Progress */
.progress { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-muted); }
.progress progress {
  appearance: none; -webkit-appearance: none; width: 80px; height: 6px;
  border: 0; border-radius: 3px; overflow: hidden; background: var(--surface-sunken);
}
.progress progress::-webkit-progress-bar { background: var(--surface-sunken); }
.progress progress::-webkit-progress-value { background: var(--primary); border-radius: 3px; }
.progress progress::-moz-progress-bar { background: var(--primary); border-radius: 3px; }
.progress__empty { font-size: var(--text-sm); color: var(--text-muted); }

/* Task rows */
.stretched::after { content: ""; position: absolute; inset: 0; }
.raised { position: relative; z-index: 1; }
.task-rows__head, .project-rows__head, .team-rows__head {
  font-size: var(--text-xs); color: var(--text-muted); letter-spacing: 0.04em; text-transform: uppercase;
}
.task-rows__head, .task-row, .composer--row {
  display: grid; grid-template-columns: minmax(0, 1fr) 210px 130px 130px;
  gap: var(--space-2) var(--space-3); align-items: center;
  padding: var(--space-2) var(--space-4);
}
@container (min-width: 1000px) {
  .task-rows__head, .task-row, .composer--row { grid-template-columns: minmax(0, 1fr) 240px 210px 180px; gap: var(--space-2) var(--space-4); }
}
.task-rows__head { padding-block: var(--space-2); border-bottom: 1px solid var(--border); }
.task-row { position: relative; min-height: 52px; border-top: 1px solid var(--border); font-size: var(--text-md); transition: background-color 0.12s var(--ease); }
.task-rows > .task-row:first-child, .task-rows__head + .task-row { border-top: 0; }
/* A task just added: a brief tint where it landed, so it's found at a glance. */
@keyframes new-task { from, 40% { background-color: var(--primary-tint); } }
.task-row.is-new, .board-card.is-new { animation: new-task 1.8s var(--ease); }
@media (prefers-reduced-motion: reduce) {
  .task-row.is-new, .board-card.is-new { animation: none; background-color: var(--primary-tint); }
}
.task-row:hover { background: var(--surface-hover); }
.task-rows > .task-row:last-child { border-bottom-left-radius: inherit; border-bottom-right-radius: inherit; }
/* The tick, the title and the ⇅ button sit in the middle of the row, level with the dates,
   people and status beside them, however many lines the title takes. */
.task-row__main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.task-row__text { flex: 1; min-width: 0; }
.task-link { color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
/* A finished task reads quieter. :has() shows it the moment the tick is clicked. */
.task-row.is-done .task-link, .task-row:has(.complete-check:checked) .task-link { color: var(--text-muted); }
.task-link:hover { color: var(--link); text-decoration: underline; }
.task-row__main .chip { margin-left: var(--space-1); }
.task-row__project { display: block; margin-top: 1px; color: var(--text-muted); font-size: var(--text-sm); overflow-wrap: anywhere; }
.task-row__checks { margin-left: var(--space-2); color: var(--text-muted); font-size: var(--text-sm); white-space: nowrap; }
.task-row__assignee { display: flex; align-items: center; gap: var(--space-2); min-width: 0; font-size: var(--text-sm); color: var(--text-muted); }
.task-row__assignee .quick { flex: 1; min-width: 0; }
.task-row__assignee .quick-select { color: var(--text); }
.task-dates { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--space-2); }
.task-dates__range { font-size: var(--text-md); white-space: nowrap; }

/* @container keeps rows readable in narrow cards such as the Overview side column. */
@container (max-width: 700px) {
  .task-rows__head { display: none; }
  .task-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "main status" "dates dates" "assignee assignee";
    gap: var(--space-1) var(--space-3);
    padding-block: var(--space-3);
  }
  .task-row__main { grid-area: main; }
  .task-row__status { grid-area: status; }
  .task-row__dates { grid-area: dates; }
  .task-row__assignee { grid-area: assignee; }
  .task-row .quick-select { max-width: 170px; }
  /* Dates and assignees line up under the title, past the tick (20px wide, 10px gap). */
  .task-row__dates, .task-row__assignee { padding-left: 30px; }
  .task-row__assignee .assign-picker summary:not(.assign-picker__empty) { margin-left: -4px; }
  /* As wide as the names it shows, not the whole row. */
  .task-row__assignee .assign-picker { flex: 0 1 auto; max-width: 100%; }
}

/* The tick beside a task: an empty circle that fills green with a white check. */
input[type="checkbox"].complete-check {
  appearance: none; -webkit-appearance: none;
  display: inline-grid; place-content: center; flex: none;
  width: 20px; height: 20px; margin: 0; border-radius: 50%;
  border: 1.5px solid var(--text-muted); background: var(--control-fill); color: var(--text-muted);
  cursor: pointer; transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.1s var(--ease);
}
.complete-check::before {
  content: ""; width: 12px; height: 12px; background: currentColor; opacity: 0;
  -webkit-mask: var(--tick) center / contain no-repeat; mask: var(--tick) center / contain no-repeat;
  transition: opacity 0.15s var(--ease);
}
/* States repeat the base selector, so they outrank it rather than lose to it. */
input[type="checkbox"].complete-check:hover::before { opacity: 0.75; }
input[type="checkbox"].complete-check:checked { background: var(--done-solid); border-color: var(--done-solid); color: #fff; }
input[type="checkbox"].complete-check:checked::before { opacity: 1; }
input[type="checkbox"].complete-check:active { transform: scale(0.88); }
input[type="checkbox"].complete-check:disabled { cursor: default; opacity: 0.75; }
input[type="checkbox"].complete-check:disabled:not(:checked)::before { opacity: 0; }
input[type="checkbox"].complete-check:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: 50%; }
input[type="checkbox"].complete-check.htmx-request { opacity: 0.6; }
@media (pointer: coarse) {
  input[type="checkbox"].complete-check { width: 24px; height: 24px; }
}

/* ADGI PRO membership badge: ADGI's logo beside a member's name (accounts/_adgi_badge.html).
   Pointing at it shows the membership and its period, on two lines. */
.adgi-badge { display: inline-flex; flex: none; vertical-align: middle; cursor: default; }
.adgi-badge img { display: block; width: 20px; height: 20px; border-radius: 5px; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.08); }
.adgi-badge--large img { width: 28px; height: 28px; border-radius: 7px; }
/* Its tooltip ends at the logo's right edge and stays inside the card (or panel) the
   badge is in: app.js nudges it sideways only as far as it must (--tip-shift), and on a
   card too narrow for it, the period wraps (.tip-wraps, --tip-width). It exists only while
   it shows, so it never widens the page. */
.adgi-badge[data-tooltip]::after {
  display: none; left: auto; right: 0; transform: translateX(var(--tip-shift, 0px));
  white-space: pre; text-align: left;
  /* A short shadow: the usual long one would darken the name just below. */
  box-shadow: 0 0 0 0.5px var(--border-strong), 0 4px 12px rgba(0, 0, 0, 0.18);
}
.adgi-badge.tip-wraps[data-tooltip]::after { width: var(--tip-width); white-space: pre-line; }
.adgi-badge[data-tooltip]:hover::after {
  display: block; transform: translateX(var(--tip-shift, 0px)); animation: adgi-tip-in 0.12s var(--ease) 0.35s both;
}
@keyframes adgi-tip-in { from { opacity: 0; translate: 0 3px; } to { opacity: 1; translate: 0 0; } }
/* ADGI PRO slots on Team › a person: how many of the period's slots are taken, and by whom. */
.adgi-slots { margin: var(--space-3) 0; padding: var(--space-3); border-radius: var(--radius-md); background: var(--surface-sunken); }
.adgi-slots__count { margin: 0; font-size: var(--text-md); }
.adgi-slots__count strong { font-weight: var(--weight-strong); font-variant-numeric: tabular-nums; }
.adgi-slots__meter { display: flex; gap: 4px; margin: var(--space-2) 0; }
.adgi-slots__slot { flex: 1; height: 6px; border-radius: var(--radius-pill); background: var(--border-strong); }
.adgi-slots__slot.is-taken { background: #D24A51; } /* ADGI's red, from its logo */
.adgi-slots__who { margin: 0; color: var(--text-muted); font-size: var(--text-sm); }
.profile-name { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.profile-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-1); }
.profile-line .adgi-badge { margin-left: var(--space-1); }
/* In the Team list it follows the name's last word, even when a long name wraps. */
.team-row__who { min-width: 0; }
.team-row__who .adgi-badge { margin-left: 6px; vertical-align: -4px; }

/* Tooltips: a short label above a control, after a moment's hover or on keyboard focus. */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip); position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 40;
  padding: 6px 10px; border-radius: var(--radius-md); background: var(--toast-bg); color: var(--toast-text);
  font-size: var(--text-sm); font-weight: var(--weight-regular); line-height: 1.3; white-space: nowrap;
  box-shadow: var(--shadow-menu); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  opacity: 0; pointer-events: none; transform: translate(-50%, 3px);
  transition: opacity 0.12s var(--ease), transform 0.12s var(--ease);
}
[data-tooltip]:hover::after, [data-tooltip]:focus-visible::after, [data-tooltip]:has(:focus-visible)::after {
  opacity: 1; transform: translate(-50%, 0); transition-delay: 0.35s;
}
details[open] > summary[data-tooltip]::after, details[open] > summary [data-tooltip]::after { display: none; }

/* Near the foot of the window, a menu opens above its button instead of below (app.js). */
details.opens-up > .assign-picker__panel, details.opens-up > .date-picker__panel,
details.opens-up > .section-menu__panel, details.opens-up > .approval-menu__panel,
details.opens-up > .assignee-add__panel, details.opens-up > .dep-type__panel,
details.opens-up > .add-task__panel { top: auto; bottom: calc(100% + 6px); }
.js-menus details[open]:not(.is-placed) > :is(.assign-picker__panel, .date-picker__panel, .section-menu__panel,
  .approval-menu__panel, .assignee-add__panel, .dep-type__panel, .add-task__panel) { visibility: hidden; }

/* Add-chips: a dashed circle where a task has no assignee or due date yet. A blue "+"
   appears on hover. Once the composer has a value, the chip shows it. */
.add-chip {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 5px; flex: none;
  min-width: 30px; height: 30px; padding: 0; border: 1.5px dashed var(--text-muted); border-radius: var(--radius-pill);
  color: var(--text-muted); cursor: pointer; list-style: none; transition: color 0.12s var(--ease), border-color 0.12s var(--ease);
}
.add-chip::-webkit-details-marker { display: none; }
.add-chip > .icon { width: 15px; height: 15px; }
.add-chip:hover, .add-chip:focus-within, summary:focus-visible > .add-chip, summary.add-chip:focus-visible { color: var(--text); border-color: var(--text); }
.add-chip__plus {
  position: absolute; right: -5px; bottom: -5px; display: flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%; background: var(--primary); color: #fff;
  font-size: 12px; font-weight: var(--weight-strong); line-height: 1; opacity: 0; transform: scale(0.6);
  transition: opacity 0.12s var(--ease), transform 0.12s var(--ease); pointer-events: none;
}
.add-chip:hover .add-chip__plus, .add-chip:focus-within .add-chip__plus, summary:focus-visible .add-chip__plus { opacity: 1; transform: none; }
.add-chip.has-value { padding: 0 10px 0 7px; border-style: solid; border-color: var(--border-strong); color: var(--text); font-size: var(--text-sm); }
.add-chip.has-value .add-chip__plus { display: none; }
.add-chip__value:empty { display: none; }
.add-chip input[type="date"].add-chip__input {
  position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; margin: 0;
  border: 0; border-radius: inherit; background: none; box-shadow: none; opacity: 0; cursor: pointer;
}
.add-chip:has(.add-chip__input:focus-visible) { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
/* The empty picker is just the chip: no padding or border, so it lines up with the date chip. */
.assign-picker summary.assign-picker__empty, .assign-picker summary.assign-picker__empty:hover,
.assign-picker[open] summary.assign-picker__empty { padding: 0; border: 0; background: none; min-height: 0; }

/* "Write a task name": a new task's title, assignee and due date. */
.composer { display: flex; align-items: center; gap: 10px; min-width: 0; }
.composer--row { display: grid; column-gap: var(--space-3); padding: 6px var(--space-4); }
.composer__main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.composer--row .composer__main { grid-column: 1; grid-row: 1; }
.composer--row .composer__extras { display: contents; }
.composer--row .composer__extras > * { grid-column: 3; grid-row: 1; justify-self: start; }
.composer--row .composer__extras > .date-picker { grid-column: 2; }
.composer--row .composer__extras > .composer__approvers { grid-column: 4; }
@container (min-width: 1000px) {
  .composer--row { column-gap: var(--space-4); }
}
@container (max-width: 700px) {
  .composer--row { grid-template-columns: minmax(0, 1fr); gap: var(--space-1); }
  .composer--row .composer__extras > * { grid-column: 1; grid-row: 3; margin-left: 30px; }
  .composer--row .composer__extras > .date-picker { grid-column: 1; grid-row: 2; }
  .composer--row .composer__extras > .composer__approvers { grid-column: 1; grid-row: 4; }
  .composer--row .composer__assign > .assign-picker__panel { left: 0; right: auto; }
}
.composer--card { flex-wrap: wrap; gap: var(--space-2) 10px; }
.composer__tick {
  display: inline-grid; place-content: center; flex: none; width: 20px; height: 20px;
  border: 1.5px solid var(--border-strong); border-radius: 50%; color: var(--border-strong);
}
.composer__tick .icon { width: 12px; height: 12px; }
.composer input[type="text"].composer__title {
  flex: 1; min-width: 0; width: 100%; min-height: 32px; padding: 4px 6px;
  background-color: transparent; border-color: transparent; box-shadow: none;
  /* Reads as the row's own text, not a form field, so it keeps a soft rectangle. */
  --field-radius: var(--radius-md);
}
.composer input[type="text"].composer__title:hover { border-color: var(--border-strong); }
.composer__extras { display: flex; align-items: center; gap: var(--space-2); flex: none; }
.composer--card .composer__extras { flex-basis: 100%; padding-left: 30px; }
.composer__assign { position: relative; }
.composer__assign > .assign-picker__panel { position: absolute; left: auto; right: 0; top: calc(100% + 6px); z-index: 30; width: 250px; max-height: 300px; overflow-y: auto; padding: var(--space-2); border-radius: var(--radius-lg); }
.composer--card .composer__assign > .assign-picker__panel { left: 0; right: auto; }
.composer .assign-picker__option input[type="radio"] { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }

/* Dates as a range: a small panel with a start and a due date. */
.date-picker { position: relative; flex: none; }
.date-picker > summary { list-style: none; }
.date-picker > summary::-webkit-details-marker { display: none; }
.date-picker__panel {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; display: grid; gap: var(--space-3);
  width: 250px; padding: var(--space-3); border-radius: var(--radius-lg); cursor: default;
}
.composer--row .date-picker__panel { left: 0; right: auto; }
.date-picker__fields { display: grid; gap: var(--space-2); }
.date-picker__field { display: grid; gap: 4px; margin: 0; font-size: var(--text-xs); color: var(--text-muted); }
.date-picker__field input[type="date"] { min-height: var(--control-h-sm); padding-block: 4px; color: var(--text); }
.date-picker__actions { display: flex; justify-content: flex-end; gap: var(--space-2); }
/* Dates already set: the dates themselves open the panel to change them. */
.date-picker__current {
  display: inline-flex; align-items: center; margin: -3px -6px; padding: 3px 6px;
  border-radius: var(--radius-md); cursor: pointer; list-style: none;
}
.date-picker__current::-webkit-details-marker { display: none; }
.date-picker__current:hover, .date-picker[open] > .date-picker__current { background: var(--surface-sunken); }

/* A tick that belongs to someone else's task: shown, but locked and fainter. */
.complete-lock { display: inline-flex; flex: none; }
/* Waiting on another task: an hourglass in the waiting colour, and a tick that's locked. */
.waiting-flag { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; vertical-align: -2px; color: var(--status-waiting_client-text); }
.waiting-flag .icon { width: 15px; height: 15px; }
.waiting-flag--chip {
  margin-left: 0; padding: 1px 8px 1px 6px; vertical-align: baseline; border-radius: var(--radius-pill);
  background: var(--status-waiting_client-bg); font-size: var(--text-xs); line-height: 18px;
}
.waiting-flag--chip .icon { width: 12px; height: 12px; }
.complete-lock--waiting input[type="checkbox"].complete-check:disabled { border-style: dashed; border-color: var(--status-waiting_client-text); cursor: not-allowed; opacity: 1; }
.chip--waiting { display: inline-flex; align-items: center; gap: 4px; background: var(--status-waiting_client-bg); color: var(--status-waiting_client-text); white-space: normal; }
.chip--waiting .icon { flex: none; width: 12px; height: 12px; }
.approval-note { display: flex; align-items: flex-start; gap: 6px; margin: 0 0 var(--space-1); padding: 4px var(--space-2); font-size: var(--text-sm); color: var(--status-waiting_client-text); }
.approval-note .icon { flex: none; width: 14px; height: 14px; margin-top: 2px; }
.complete-lock .complete-check { cursor: not-allowed; }
input[type="checkbox"].complete-check:disabled:not(:checked) { opacity: 0.4; }

/* Tooltips near the edge of a row open inwards, so none are cut off. */
.complete-lock[data-tooltip]::after { left: -4px; transform: translate(0, 3px); }
.complete-lock[data-tooltip]:hover::after { transform: translate(0, 0); }
.composer--row .composer__extras [data-tooltip]::after { left: auto; right: -4px; transform: translate(0, 3px); }
.composer--row .composer__extras [data-tooltip]:hover::after,
.composer--row .composer__extras [data-tooltip]:focus-visible::after { transform: translate(0, 0); }

/* "No section" can be hidden by each person. */
.icon-button {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0;
  background: none; border: 0; border-radius: 50%; color: var(--text-muted); cursor: pointer;
}
.icon-button .icon { width: 17px; height: 17px; }
.icon-button:hover { background: var(--surface-sunken); color: var(--text); }
.no-section-hide { margin-left: auto; }
.hidden-note {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3);
  color: var(--text-muted); font-size: var(--text-md);
}
.hidden-note .icon { width: 16px; height: 16px; }
.hidden-note .link-button { font-size: var(--text-md); }
.board-bar .hidden-note { margin: 0; }

/* Dragging tasks into order. The handle shows on hover or focus, like the tick. */
/* Level with the title's first line, whatever the row's height. */
.drag-handle {
  position: absolute; left: 0; top: 11px; z-index: 2;
  display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 28px; padding: 0;
  background: none; border: 0; border-radius: var(--radius-sm); color: var(--text-secondary);
  cursor: grab; opacity: 0; transition: opacity 0.12s var(--ease), color 0.12s var(--ease);
}
/* Large enough for the six dots to read as dots, drawn past the handle's narrow box and
   nudged left so they keep clear of the tick or title beside them. */
.drag-handle .icon { flex: none; width: 20px; height: 20px; margin-left: -3px; }
.drag-handle:hover, .drag-handle:focus-visible { color: var(--text); }
.task-row:hover .drag-handle, .project-row:hover .drag-handle, .portal-row:hover .drag-handle, .drag-handle:focus-visible { opacity: 1; }
.drag-handle:active { cursor: grabbing; }
@media (hover: none) { .drag-handle { opacity: 0.6; } }
.task-row.is-dragging, .project-row.is-dragging, .portal-row.is-dragging { opacity: 0.45; }
/* Where a dragged task, project or client will land: a line between rows or cards. */
.task-row.drop-before::before, .task-row.drop-after::before,
.project-row.drop-before::before, .project-row.drop-after::before,
.portal-row.drop-before::before, .portal-row.drop-after::before,
.board-card.drop-before::before, .board-card.drop-after::before {
  content: ""; position: absolute; left: var(--space-2); right: var(--space-2); z-index: 3; height: 2px;
  border-radius: 2px; background: var(--primary); pointer-events: none;
}
.task-row.drop-before::before, .project-row.drop-before::before, .portal-row.drop-before::before { top: -1px; }
.task-row.drop-after::before, .project-row.drop-after::before, .portal-row.drop-after::before { bottom: -1px; }
.board-card.drop-before::before { top: -6px; left: 0; right: 0; }
.board-card.drop-after::before { bottom: -6px; left: 0; right: 0; }
.list-section.is-drop-target, [data-sort-list].is-drop-target { box-shadow: 0 0 0 2px var(--primary), var(--shadow-card); }

/* Sections in the List view */
.list-section { margin-bottom: var(--card-gap); }
.list-section__head {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-2); border-bottom: 1px solid var(--border);
}
.list-section.is-folded .list-section__head { border-bottom: 0; }
.list-section__title { min-width: 0; font-size: var(--text-lg); }
.list-section__toggle {
  display: inline-flex; align-items: center; gap: var(--space-2); max-width: 100%;
  padding: 4px 10px 4px 6px; background: none; border: 0; border-radius: var(--radius-md);
  color: var(--text); font-family: var(--font-heading); text-align: left; cursor: pointer;
}
.list-section__toggle span { overflow-wrap: anywhere; }
.list-section__toggle:hover { background: var(--surface-sunken); }
.list-section__chevron { width: 16px; height: 16px; color: var(--text-muted); transition: transform 0.15s var(--ease); }
.list-section__toggle[aria-expanded="false"] .list-section__chevron { transform: rotate(-90deg); }
.list-section__empty { padding: var(--space-3) var(--space-4); color: var(--text-muted); font-size: var(--text-md); }
.task-row--add { display: block; min-height: 0; padding: 0; }
.task-row--add:hover { background: none; }

.section-menu { position: relative; flex: none; margin-left: auto; }
.section-menu summary {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: 50%; color: var(--text-muted); cursor: pointer; list-style: none;
}
.section-menu summary::-webkit-details-marker { display: none; }
.section-menu summary:hover, .section-menu[open] summary { background: var(--surface-sunken); color: var(--text); }
.section-menu summary .icon { width: 18px; height: 18px; }
.section-menu__panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 270px; padding: var(--space-2); border-radius: var(--radius-lg); }
.section-menu__rename { padding: var(--space-1) var(--space-2) var(--space-3); margin-bottom: var(--space-1); border-bottom: 1px solid var(--border); }
.section-menu__rename label { display: block; margin-bottom: 6px; font-size: var(--text-xs); color: var(--text-muted); }
.section-menu__row { display: flex; gap: var(--space-2); }
.section-menu__row input[type="text"] { min-height: var(--control-h-sm); padding-block: 4px; }
.section-menu__item {
  display: flex; align-items: center; gap: var(--space-2); width: 100%; padding: 7px var(--space-2);
  background: none; border: 0; border-radius: var(--radius-md); color: var(--text); font-size: var(--text-md); text-align: left; cursor: pointer;
}
.section-menu__item .icon { width: 16px; height: 16px; color: var(--text-muted); }
.section-menu__item:hover:not(:disabled) { background: var(--surface-sunken); }
.section-menu__item:disabled { opacity: 0.45; cursor: default; }
.section-menu__item--danger, .section-menu__item--danger .icon { color: var(--danger); }

.section-new { margin: var(--space-1) 0 var(--space-4); }
.section-new summary { list-style: none; }
.section-new summary::-webkit-details-marker { display: none; }
.section-new__button { border-style: dashed; color: var(--text-muted); }
.section-new[open] .section-new__button { display: none; }
.section-new__form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); max-width: 560px; }
.section-new__form input[type="text"] { flex: 1 1 240px; width: auto; }

/* Quick edits */
.quick { display: block; position: relative; }
.quick-select {
  min-height: var(--control-h-sm); padding: 0 32px 0 12px; font-size: var(--text-sm);
  border-color: var(--border-control); background-position: right 11px center; background-size: 14px 14px;
}
.quick-select--todo { background-color: var(--status-todo-bg); color: var(--status-todo-text); }
.quick-select--in_progress { background-color: var(--status-in_progress-bg); color: var(--status-in_progress-text); }
.quick-select--internal_review { background-color: var(--status-internal_review-bg); color: var(--status-internal_review-text); }
.quick-select--waiting_client { background-color: var(--status-waiting_client-bg); color: var(--status-waiting_client-text); }
.quick-select--done { background-color: var(--status-done-bg); color: var(--status-done-text); }
.quick-select option { background: var(--surface); color: var(--text); }
.quick.is-saving select { opacity: 0.55; }
.quick.is-saving::after {
  content: "Saving…"; position: absolute; left: 0; top: 100%; z-index: 2;
  padding: 0 4px; background: var(--surface); font-size: var(--text-xs); color: var(--text-muted);
}

/* Filters */
.filters {
  display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-3);
}
.filters__field { flex: 0 1 170px; min-width: 130px; }
.filters__field--grow { flex: 1 1 240px; }
.filters__field label { color: var(--text-muted); font-size: var(--text-xs); }
.filters--inline { flex: 1; justify-content: flex-start; margin: 0; }

/* Overview */
.stat-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--card-gap); margin-bottom: var(--card-gap); }
.stat-tile {
  display: grid; grid-template-columns: auto 1fr; grid-template-areas: "icon value" "icon label";
  align-items: center; column-gap: var(--space-3);
  padding: var(--space-4); background: var(--glass-sheen), var(--glass-fill); color: var(--text); text-decoration: none;
  border: 1px solid var(--glass-rim); border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
  transition: box-shadow 0.15s var(--ease), transform 0.15s var(--ease), background-color 0.15s var(--ease);
}
.stat-tile:hover { color: var(--text); background: var(--glass-sheen), var(--glass-fill-strong); box-shadow: var(--shadow-raised); transform: translateY(-1px); }
.stat-tile__icon {
  grid-area: icon; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius-md);
  background: var(--status-todo-bg); color: var(--status-todo-text);
}
.stat-tile__icon .icon { width: 20px; height: 20px; }
.stat-tile__value { grid-area: value; font-family: var(--font-heading); font-size: var(--text-3xl); line-height: 1; font-variant-numeric: tabular-nums; }
.stat-tile__label { grid-area: label; margin-top: 2px; font-size: var(--text-sm); color: var(--text-muted); }
.stat-tile--alert .stat-tile__icon { background: var(--danger-tint); color: var(--danger); }
.stat-tile--alert .stat-tile__value { color: var(--danger); }
.stat-tile--today .stat-tile__icon { background: var(--status-waiting_client-bg); color: var(--status-waiting_client-text); }
.stat-tile--week .stat-tile__icon { background: var(--status-in_progress-bg); color: var(--status-in_progress-text); }
.stat-tile--waiting .stat-tile__icon { background: var(--status-internal_review-bg); color: var(--status-internal_review-text); }
.overview { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--space-4); align-items: start; }
.overview__main, .overview__side { display: grid; gap: var(--space-4); min-width: 0; }
.mini-project { position: relative; display: grid; gap: 3px; padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); transition: background-color 0.12s var(--ease); }
.mini-project:first-child { border-top: 0; }
.mini-project:last-child { border-bottom-left-radius: var(--radius-lg); border-bottom-right-radius: var(--radius-lg); }
.mini-project:hover { background: var(--surface-hover); }
.mini-project a { color: var(--text); text-decoration: none; font-size: var(--text-md); }
.mini-project a:hover { color: var(--link); text-decoration: underline; }
.mini-project__client, .mini-project__deadline { font-size: var(--text-sm); color: var(--text-muted); }
.mini-project__deadline strong { color: var(--text); font-weight: var(--weight-strong); }

/* Project index */
.project-rows__head, .project-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 110px 170px 110px 170px;
  gap: var(--space-2) var(--space-4); align-items: center; padding: var(--space-2) var(--space-4);
}
.project-rows__head { border-bottom: 1px solid var(--border); }
.project-row { position: relative; min-height: 60px; border-top: 1px solid var(--border); font-size: var(--text-md); transition: background-color 0.12s var(--ease); }
.project-rows__head + .project-row { border-top: 0; }
.project-row:hover { background: var(--surface-hover); }
.project-row:last-child { border-bottom-left-radius: var(--radius-lg); border-bottom-right-radius: var(--radius-lg); }
.project-row__main { min-width: 0; }
.project-row__main a { color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.project-row__main a:hover { color: var(--link); text-decoration: underline; }
.project-row__client { display: block; font-size: var(--text-sm); color: var(--text-muted); }
.project-rows--archived .project-rows__head, .project-rows--archived .project-row { grid-template-columns: minmax(0, 1fr) 170px 120px 170px 150px; }
.project-row__archived { font-size: var(--text-md); }
.project-row__action { display: flex; justify-content: flex-end; gap: var(--space-2); }
.project-row__client .chip { vertical-align: 1px; }
/* Admins put projects in the studio's order by the handle at the left, or from the menu
   at the right. */
.project-rows--sortable .project-rows__head, .project-rows--sortable .project-row { grid-template-columns: minmax(0, 1fr) 110px 170px 110px 170px 32px; }
.project-row .drag-handle, .task-row .drag-handle { top: 50%; margin-top: -14px; }
/* A stacked task row's middle is below its title: there the handle stays by the title. */
@container (max-width: 700px) { .task-row .drag-handle { top: 11px; margin-top: 0; } }
.project-row__menu { display: flex; justify-content: flex-end; }
.section-menu__panel--compact { width: 200px; }
.list-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3) var(--space-4); margin-bottom: var(--space-3); }
.segmented a .count { margin-left: 2px; background: var(--surface-sunken); }
.segmented a[aria-current] .count { background: var(--primary-tint); color: var(--link); }
@container (max-width: 760px) {
  .project-rows__head { display: none; }
  .project-row, .project-rows--archived .project-row { grid-template-columns: minmax(0, 1fr) auto; }
  .project-row__main { grid-column: 1; }
  .project-row__dates { grid-column: 1 / -1; }
  .project-rows--sortable .project-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .project-rows--sortable .project-row__menu { grid-column: 3; grid-row: 1; }
  /* Level with the name, as the rows grow tall here. */
  .project-row .drag-handle { top: 5px; margin-top: 0; }
}

/* Team */
.team-rows__head, .team-row {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 0.8fr) minmax(0, 1.3fr) 170px 150px;
  gap: var(--space-2) var(--space-4); align-items: center; padding: var(--space-2) var(--row-inset);
}
.team-rows__head { border-bottom: 1px solid var(--border); }
.team-row { position: relative; min-height: 52px; border-top: 1px solid var(--border); font-size: var(--text-md); }
.team-rows__head + .team-row { border-top: 0; }
.team-row:hover { background: var(--surface-hover); }
.team-row:last-child { border-bottom-left-radius: var(--radius-lg); border-bottom-right-radius: var(--radius-lg); }
.team-row__name { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.team-row__name a { color: var(--text); text-decoration: none; }
.team-row__name a:hover { color: var(--link); text-decoration: underline; }
.team-row--inactive { color: var(--text-muted); }
.team-row__title { min-width: 0; overflow-wrap: anywhere; }
.team-row__email { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.team-row__email a { color: var(--text-muted); text-decoration: none; }
.team-row__email a:hover { color: var(--link); text-decoration: underline; }
/* Narrow: the name and status, with the job title and email under the name. */
@container (max-width: 700px) {
  .team-rows__head { display: none; }
  .team-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .team-row__name { grid-column: 1; grid-row: 1; }
  .team-row__status { grid-column: 2; grid-row: 1; }
  .team-row__title, .team-row__email { grid-column: 1 / -1; padding-left: calc(26px + var(--space-2)); font-size: var(--text-sm); }
  .team-row__username, .team-row__last, .team-row__title--empty, .team-row__email--empty { display: none; }
}

/* Project page */
/* The header sticks to the top while the page scrolls. Once it has, app.js sets
   data-head-stuck on <html> (not on the header, which refreshes replace). The header
   keeps its full height in the layout, so nothing on the page ever moves: the facts fade
   out, and the glass (on ::before, with its rim on ::after) shrinks up by --head-fold,
   the facts' height, measured by app.js. What's left below the glass is see-through and
   lets clicks through to the page. The glass being on ::before also keeps the header
   from being a backdrop root, so the veil inside it can blur the page. */
.project-head {
  position: sticky; top: var(--sticky-top); z-index: 15;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-5);
  margin-bottom: var(--space-4); padding: var(--space-5);
  /* The sidebar's radius: they float side by side, level at the top. */
  border: 1px solid transparent; border-radius: var(--radius-xl);
}
.project-head::before {
  content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit;
  background-color: var(--glass-fill); background-image: var(--glass-sheen);
  border: 1px solid var(--glass-rim); box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: var(--glass-blur-strong); backdrop-filter: var(--glass-blur-strong);
  transition: bottom 0.32s var(--ease), background-color 0.32s var(--ease), box-shadow 0.32s var(--ease), --glass-melt 0.32s var(--ease), --glass-cut 0.32s var(--ease);
}
.project-head::after { transition: bottom 0.32s var(--ease), --glass-melt 0.32s var(--ease), --glass-cut 0.32s var(--ease); }
[data-head-stuck] .project-head { pointer-events: none; }
/* Stuck, the header is half a card: the glass keeps its top edge, rounded top corners and
   rim light, then from its middle down (--glass-melt, half of --head-glass, the glass's
   height from app.js) its sides and bottom melt away into the progressive blur, with no
   bottom edge. The melt is a registered length, so it eases in. */
@property --glass-melt { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --glass-cut { syntax: "<length>"; inherits: false; initial-value: 0px; }
/* --glass-cut keeps the bottom corners' curve fully clear, so no rounding shows. */
[data-head-stuck] .project-head::before, [data-head-stuck] .project-head::after {
  --glass-cut: var(--radius-xl);
  --glass-melt: calc(var(--head-glass, 112px) * 0.5 - var(--radius-xl));
}
[data-head-stuck] .project-head::before {
  bottom: calc(var(--head-fold, 0px) - 1px); pointer-events: auto;
  background-color: var(--glass-fill-strong); box-shadow: var(--shadow-raised);
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - var(--glass-cut) - var(--glass-melt)), transparent calc(100% - var(--glass-cut)));
  mask-image: linear-gradient(to bottom, #000 calc(100% - var(--glass-cut) - var(--glass-melt)), transparent calc(100% - var(--glass-cut)));
}
[data-head-stuck] .project-head::after {
  bottom: calc(var(--head-fold, 0px) - 1px);
  -webkit-mask: linear-gradient(to bottom, #000 calc(100% - var(--glass-cut) - var(--glass-melt)), transparent calc(100% - var(--glass-cut))), linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: source-in, xor;
  mask: linear-gradient(to bottom, #000 calc(100% - var(--glass-cut) - var(--glass-melt)), transparent calc(100% - var(--glass-cut))), linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: intersect, exclude;
}
[data-head-stuck] .project-head__main, [data-head-stuck] .project-head__actions { pointer-events: auto; }
.project-head__title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.project-head__desc { margin-top: var(--space-1); color: var(--text-muted); font-size: var(--text-md); max-width: 68ch; }
.project-head__actions { grid-column: 2; grid-row: 1; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: flex-start; gap: var(--space-2); }

/* The facts: always the header's last row, so the glass can shrink up past them. Hidden
   once faded, so nothing in them takes focus. */
.project-head__more {
  grid-column: 1 / -1; padding-top: var(--space-4);
  transition: opacity 0.24s var(--ease), transform 0.32s var(--ease), visibility 0s;
}
[data-head-stuck] .project-head__more {
  opacity: 0; transform: translateY(-6px); visibility: hidden;
  transition: opacity 0.16s var(--ease), transform 0.32s var(--ease), visibility 0s linear 0.32s;
}
.project-head__facts {
  display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6);
  padding-top: var(--space-4); border-top: 1px solid var(--border);
}
.project-head__facts dt { font-size: var(--text-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.project-head__facts dd { display: flex; align-items: center; min-height: 28px; font-size: var(--text-md); }

/* Progressive blur under the stuck header, like iOS: the page goes softly out of focus
   as it slides under, strongest at the header and fading to sharp over --veil-tail. It
   reaches up behind the header to the top of the window, so nothing shows sharp above
   it. Four layers of blur, the strongest stopping first and each lighter one reaching a
   little further down, so at every point one layer is whole and nothing sharp shows
   through; then a tint. Each layer
   fades by itself: fading their parent would stop their blur from seeing the page. The
   veil ends --veil-tail below the shrunken glass, not below the header's full box. */
.project-head__veil {
  /* The veil reaches out over the page's side gutters (--veil-bleed) and fades away there,
     so whatever spills past the header's sides (a button's glow) blurs as much as the
     rest, with no hard edge where the blur stops. */
  /* The blur starts easing off from the middle of the glass, where the glass begins to
     melt, and is gone --veil-below under it: one long gradient, with no seam. */
  --veil-below: 80px;
  --veil-tail: calc(var(--head-glass, 112px) * 0.5 + var(--veil-below));
  --veil-bleed: var(--space-5);
  position: absolute; z-index: -2;
  left: calc(-1px - var(--veil-bleed)); right: calc(-1px - var(--veil-bleed));
  top: calc(var(--sticky-top) * -1 - 1px); bottom: calc(var(--head-fold, 0px) - var(--veil-below));
  pointer-events: none;
}
.project-head__veil > span {
  --veil-sides: linear-gradient(to right, transparent, #000 var(--veil-bleed), #000 calc(100% - var(--veil-bleed)), transparent);
  position: absolute; inset: 0; opacity: 0; transition: opacity 0.25s var(--ease);
  -webkit-mask-image: var(--veil-band), var(--veil-sides); -webkit-mask-composite: source-in;
  mask-image: var(--veil-band), var(--veil-sides); mask-composite: intersect;
}
[data-head-stuck] .project-head__veil > span { opacity: 1; }
.project-head__veil > span:nth-child(1) {
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  --veil-band: linear-gradient(to bottom, #000 calc(100% - var(--veil-tail)), transparent calc(100% - var(--veil-tail) * 0.7));
}
.project-head__veil > span:nth-child(2) {
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  --veil-band: linear-gradient(to bottom, #000 calc(100% - var(--veil-tail) * 0.75), transparent calc(100% - var(--veil-tail) * 0.45));
}
.project-head__veil > span:nth-child(3) {
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  --veil-band: linear-gradient(to bottom, #000 calc(100% - var(--veil-tail) * 0.5), transparent calc(100% - var(--veil-tail) * 0.2));
}
.project-head__veil > span:nth-child(4) {
  -webkit-backdrop-filter: blur(1.5px); backdrop-filter: blur(1.5px);
  --veil-band: linear-gradient(to bottom, #000 calc(100% - var(--veil-tail) * 0.25), transparent 100%);
}
.project-head__veil > span:nth-child(5) {
  --veil-band: linear-gradient(#000, #000);
  background: linear-gradient(to bottom, var(--veil-tint) calc(100% - var(--veil-tail)), transparent 100%);
}
@media (prefers-reduced-transparency: reduce) {
  .project-head__veil > span:not(:last-child) { display: none; }
}
/* Shrinks at once, with no animation, when a page opens already scrolled down. */
[data-head-instant] .project-head *, [data-head-instant] .project-head::before, [data-head-instant] .project-head::after { transition: none !important; }
.project-head__facts dt { font-size: var(--text-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.project-head__facts dd { display: flex; align-items: center; min-height: 28px; font-size: var(--text-md); }
.view-bar { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); margin-bottom: var(--space-3); }
.view-bar > .filters--inline { align-self: stretch; }

/* "+ Add task", with a menu beside it to add an approval instead. */
.add-bar { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.add-task { position: relative; display: inline-flex; }
.add-task__main { padding: 0 14px 0 12px; }
.add-task:has(.add-task__more) .add-task__main { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.add-task__more > summary { list-style: none; }
.add-task__more > summary::-webkit-details-marker { display: none; }
.add-task__toggle {
  width: 36px; padding: 0; margin-left: 1px;
  border-top-left-radius: 0; border-bottom-left-radius: 0;
}
.add-task__toggle .icon { transition: transform 0.15s var(--ease); }
.add-task__more[open] .add-task__toggle .icon { transform: rotate(180deg); }
.add-task__panel {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; width: 240px;
  padding: var(--space-2); border-radius: var(--radius-lg);
}
.add-task__option {
  display: flex; align-items: center; gap: var(--space-2); width: 100%; padding: 8px var(--space-2);
  background: none; border: 0; border-radius: var(--radius-md); color: var(--text);
  font-size: var(--text-md); text-align: left; cursor: pointer;
}
.add-task__option .icon { width: 17px; height: 17px; color: var(--text-muted); }
.add-task__option:hover { background: var(--surface-sunken); }
.add-task__default {
  margin-left: auto; padding: 1px 8px; border-radius: var(--radius-sm);
  background: var(--surface-sunken); color: var(--text-muted); font-size: var(--text-xs);
}
/* Where "+ Add task" opens when the view has no list to open it in. */
.add-fallback { margin-bottom: var(--space-3); }
.add-section { margin-bottom: var(--space-3); padding: var(--space-3); }
/* The new row at the top of the List, picked out until it's put away. */
.task-row--top { background: var(--surface-hover); box-shadow: inset 3px 0 0 var(--primary); }
/* While it's put away, the row after it is the first one. */
.task-rows__head + .task-row--top[hidden] + .task-row, .task-rows > .task-row--top[hidden]:first-child + .task-row { border-top: 0; }
.task-row--top:hover { background: var(--surface-hover); }

/* An approval: a rounded square instead of a circle, filled with its decision. */
.composer__approval-icon { display: none; }
.composer--approval .composer__tick { border-radius: 6px; }
.composer--approval .composer__task-icon { display: none; }
.composer--approval .composer__approval-icon { display: block; }
.approval-menu { position: relative; flex: none; }
.approval-box {
  display: inline-grid; place-content: center; flex: none; width: 20px; height: 20px;
  border: 1.5px solid var(--text-muted); border-radius: 6px; background: var(--control-fill); color: var(--text-muted);
  cursor: pointer; list-style: none; transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.approval-box::-webkit-details-marker { display: none; }
.approval-box .icon { width: 12px; height: 12px; stroke-width: 2.4; }
.approval-box--pending .icon { opacity: 0.6; stroke-width: 2; }
.approval-box--pending:hover .icon, .approval-menu[open] .approval-box--pending .icon { opacity: 1; }
.approval-box--approved { background: var(--done-solid); border-color: var(--done-solid); color: #fff; }
.approval-box--changes_requested { background: var(--changes-solid); border-color: var(--changes-solid); color: #fff; }
.approval-box--rejected { background: var(--danger-solid); border-color: var(--danger-solid); color: #fff; }
.approval-box.is-locked { cursor: not-allowed; opacity: 0.55; }
summary.approval-box:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.board-card__head .approval-box { margin-top: 1px; }
@media (pointer: coarse) {
  .approval-box { width: 24px; height: 24px; }
}
.approval-menu__panel {
  position: absolute; left: -6px; top: calc(100% + 6px); z-index: 30; width: 230px;
  padding: var(--space-2); border-radius: var(--radius-lg); cursor: default;
}
.approval-menu__title { padding: 2px var(--space-2) var(--space-1); font-size: var(--text-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.approval-menu__item {
  display: flex; align-items: center; gap: var(--space-2); width: 100%; padding: 7px var(--space-2);
  background: none; border: 0; border-radius: var(--radius-md); color: var(--text); font-size: var(--text-md); text-align: left; cursor: pointer;
}
.approval-menu__item .icon { width: 16px; height: 16px; }
.approval-menu__item:hover { background: var(--surface-sunken); }
.approval-menu__item[aria-pressed="true"] { background: var(--surface-sunken); font-weight: var(--weight-strong); }
.approval-menu__item--approve .icon, .approval-action--approve .icon { color: var(--status-done-text); }
.approval-menu__item--changes .icon, .approval-action--changes .icon { color: var(--status-waiting_client-text); }
.approval-menu__item--reject .icon, .approval-action--reject .icon { color: var(--danger); }
.approval-menu__item--reset { margin-top: var(--space-1); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-md) var(--radius-md); color: var(--text-muted); }
.approval-menu__item--reset .icon { color: var(--text-muted); }
.approval-menu > summary[data-tooltip]::after { left: -4px; transform: translate(0, 3px); }
.approval-menu > summary[data-tooltip]:hover::after, .approval-menu > summary[data-tooltip]:focus-visible::after { transform: translate(0, 0); }
/* The decision buttons in the task panel. The current decision is filled in. */
.approval-bar {
  display: grid; gap: var(--space-2); margin: 0 0 var(--space-4); padding: var(--space-3);
  border-radius: var(--radius-lg); background: var(--surface-sunken); box-shadow: inset 0 0 0 1px var(--border);
}
.approval-bar__label { margin: 0; font-size: var(--text-md); }
.approval-bar__heading { margin: 0; font-size: var(--text-sm); font-weight: var(--weight-strong); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.approval-bar__meta { margin: 0; color: var(--text-muted); font-size: var(--text-sm); }
/* Each approver with their own decision. */
.approver-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.approver { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--text-md); }
.approver .avatar { width: 26px; height: 26px; font-size: 10.5px; }
.approver__name { min-width: 0; overflow-wrap: anywhere; }
.approver__by { color: var(--text-muted); font-size: var(--text-sm); }
/* An approval's approvers in a list: small faces, ringed in the colour of their decision. */
.approvers-mini { display: inline-flex; align-items: center; gap: 3px; margin-left: var(--space-2); vertical-align: middle; }
.approvers-mini__icon { width: 13px; height: 13px; margin-right: 1px; color: var(--text-muted); }
.approvers-mini .avatar { width: 20px; height: 20px; font-size: 8.5px; }
.approvers-mini__person { display: inline-flex; border-radius: 50%; }
.approvers-mini__person--approved { box-shadow: 0 0 0 2px var(--done-solid); }
.approvers-mini__person--changes_requested { box-shadow: 0 0 0 2px var(--changes-solid); }
.approvers-mini__person--rejected { box-shadow: 0 0 0 2px var(--danger-solid); }
.approvers-mini__person--pending { box-shadow: 0 0 0 1.5px var(--border-strong); }
.board-card__meta .approvers-mini { margin-left: 0; }
/* The add box words its people menu for the kind of task it adds. */
.composer__for-approval { display: none; }
.composer--approval .composer__for-task { display: none; }
.composer--approval .composer__for-approval { display: inline; }
.composer--approval .date-picker__actions.composer__for-approval { display: flex; margin-top: var(--space-2); }
.approval-bar__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.approval-action {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--control-h-sm); padding: 0 12px;
  background: var(--glass-sheen), var(--control-fill); border: 1px solid var(--border-strong); border-radius: var(--radius-pill);
  color: var(--text); font-size: var(--text-sm); cursor: pointer; box-shadow: var(--shadow-control);
}
.approval-action .icon { width: 15px; height: 15px; }
.approval-action:hover { background: var(--glass-sheen), var(--glass-bubble); }
.approval-action--approve[aria-pressed="true"] { background: var(--done-solid); border-color: transparent; color: #fff; }
.approval-action--changes[aria-pressed="true"] { background: var(--changes-solid); border-color: transparent; color: #fff; }
.approval-action--reject[aria-pressed="true"] { background: var(--danger-solid); border-color: transparent; color: #fff; }
.approval-action[aria-pressed="true"] .icon { color: inherit; }
.approval-action--reset { color: var(--text-muted); }
.approval-action--reset .icon { color: var(--text-muted); }
.chip--approval-pending { background: var(--status-todo-bg); color: var(--status-todo-text); }
.chip--approval-yours { background: var(--primary-tint); color: var(--primary); font-weight: var(--weight-strong); }
.chip--approval-approved { background: var(--status-done-bg); color: var(--status-done-text); }
.chip--approval-changes_requested { background: var(--status-waiting_client-bg); color: var(--status-waiting_client-text); }
.chip--approval-rejected { background: var(--danger-tint); color: var(--danger); }

/* "Only me": a task only its owner can see. */
.private-label { display: inline-flex; align-items: center; gap: 4px; color: var(--text-muted); white-space: nowrap; }
.private-label .icon { width: 13px; height: 13px; }
.private-chip {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px 0 9px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-pill);
  color: var(--text-muted); font-size: var(--text-sm); white-space: nowrap;
}
.private-chip .icon { width: 14px; height: 14px; }
.composer--row .composer__extras .private-chip[data-tooltip]::after { left: auto; right: -4px; transform: translate(0, 3px); }
.composer--row .composer__extras .private-chip[data-tooltip]:hover::after { transform: translate(0, 0); }
.list-note { margin-bottom: var(--space-3); font-size: var(--text-md); }
.list-footer { margin-top: var(--space-3); font-size: var(--text-sm); }
.view-hint { margin-bottom: var(--space-3); font-size: var(--text-sm); color: var(--text-muted); }

/* Board */
.board {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(212px, 1fr);
  gap: var(--space-3); overflow-x: auto; padding-bottom: var(--space-3); position: relative;
  scroll-snap-type: x proximity; scroll-padding-inline: var(--space-1);
}
/* Each status column is outlined in its colour, with its count in a matching tint. */
.board-col {
  display: flex; flex-direction: column; min-height: 360px; scroll-snap-align: start;
  background: var(--surface-column); border: 1px solid var(--status-todo-line); border-radius: var(--radius-lg);
  transition: background-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.board-col--in_progress { border-color: var(--status-in_progress-line); }
.board-col--internal_review { border-color: var(--status-internal_review-line); }
.board-col--waiting_client { border-color: var(--status-waiting_client-line); }
.board-col--done { border-color: var(--status-done-line); }
.board-col--todo .board-col__head .count { background: var(--status-todo-bg); color: var(--status-todo-text); box-shadow: none; }
.board-col--in_progress .board-col__head .count { background: var(--status-in_progress-bg); color: var(--status-in_progress-text); box-shadow: none; }
.board-col--internal_review .board-col__head .count { background: var(--status-internal_review-bg); color: var(--status-internal_review-text); box-shadow: none; }
.board-col--waiting_client .board-col__head .count { background: var(--status-waiting_client-bg); color: var(--status-waiting_client-text); box-shadow: none; }
.board-col--done .board-col__head .count { background: var(--status-done-bg); color: var(--status-done-text); box-shadow: none; }
.board-col.is-drop-target { background: var(--primary-tint); box-shadow: inset 0 0 0 2px var(--primary); }
.board-col__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-3) var(--space-3) var(--space-2); }
.board-col__head h2 { font-family: var(--font-body); font-size: var(--text-md); font-weight: var(--weight-strong); }
.board-col__head .count { background: var(--surface); box-shadow: 0 0 0 1px var(--border); }
.board-col__note { margin: calc(var(--space-1) * -1) var(--space-3) var(--space-2); font-size: var(--text-xs); color: var(--text-muted); }
.board-col__cards { flex: 1; display: grid; align-content: start; gap: var(--space-2); padding: var(--space-1) var(--space-2) var(--space-2); }
/* An empty column says "No tasks", unless it has its own "+ Add task" below. */
.board-col__cards:not(.board-col__cards--addable):not(:has(.board-card))::before,
.board-col.is-drop-target .board-col__cards:not(:has(.board-card))::before {
  content: "No tasks"; display: flex; align-items: center; justify-content: center; min-height: 72px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-md);
  color: var(--text-muted); font-size: var(--text-sm);
}
.board-col.is-drop-target .board-col__cards:not(:has(.board-card))::before { content: "Drop here"; border-color: var(--primary); color: var(--link); }
/* "+ Add task" at the foot of a column, and the card it opens. */
/* Sits right after the last card (of each section), so there's no scrolling down to it. */
.board-col__compose { padding: 0; }
.board-col__add-task {
  display: flex; align-items: center; gap: 6px; width: 100%; padding: 10px 12px;
  background: var(--glass-fill-thin); border: 0; border-radius: 14px; color: var(--text-muted);
  font-size: var(--text-md); text-align: left; cursor: pointer; transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.board-col__add-task .icon { width: 16px; height: 16px; }
.board-col__add-task:hover { background: var(--glass-bubble); color: var(--text); }
/* Looks like a card, but isn't one: counts, drags and clicks only see real cards. */
.board-composer {
  position: relative; padding: var(--space-3);
  background: var(--glass-sheen), var(--glass-fill-strong); border: 1px solid var(--glass-rim); border-radius: 14px; box-shadow: var(--shadow-card);
}
.board-card {
  position: relative; display: grid; gap: var(--space-2); padding: var(--space-3);
  background: var(--glass-sheen), var(--glass-fill-strong); border: 1px solid var(--glass-rim); border-radius: 14px;
  box-shadow: var(--shadow-card); cursor: pointer;
  transition: box-shadow 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.board-card:hover { box-shadow: var(--shadow-raised); transform: translateY(-1px); }
.board-card[draggable="true"]:active { cursor: grabbing; }
.board-card.is-dragging { opacity: 0.45; transform: rotate(1.5deg); }
.board-card--urgent {
  background: var(--neon-urgent-fill), var(--glass-sheen), var(--glass-fill-strong);
  border-color: var(--neon-urgent-rim); box-shadow: var(--neon-urgent-glow), var(--shadow-card);
}
/* The neon breathes: a brighter rim and wider glow, on a layer of their own, slowly swell
   and fade (only its opacity moves, so it costs nothing to draw). It rests, lit, for anyone
   who asked their system for less motion, and goes out with the glow once a card is done.
   While a card is a drop target, ::before is the drop line instead, so the glow steps aside. */
.portal-card--alert::before, .board-card--urgent:not(.drop-before, .drop-after)::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  box-shadow: var(--neon-urgent-pulse); opacity: 0.2; will-change: opacity;
  animation: neon-breathe 3.2s ease-in-out infinite;
}
@keyframes neon-breathe {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}
.board-card--urgent.board-card--done:not(.drop-before, .drop-after)::before,
.board-card--urgent:has(.complete-check:checked):not(.drop-before, .drop-after)::before { display: none; }
@media (prefers-reduced-motion: reduce) {
  .portal-card--alert::before, .board-card--urgent:not(.drop-before, .drop-after)::before { animation: none; opacity: 0.6; }
}
.board-card--urgent:hover { box-shadow: var(--neon-urgent-glow), var(--shadow-raised); }
/* Once it's done, it's no longer pressing, so the glow goes out. */
.board-card--urgent.board-card--done, .board-card--urgent:has(.complete-check:checked) {
  background: var(--glass-sheen), var(--glass-fill-strong); border-color: var(--glass-rim); box-shadow: var(--shadow-card);
}
.board-card--urgent.board-card--done:hover, .board-card--urgent:has(.complete-check:checked):hover { box-shadow: var(--shadow-raised); }
.board-card--done .board-card__title .task-link, .board-card:has(.complete-check:checked) .board-card__title .task-link { color: var(--text-muted); }
.board-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
/* Section headings inside a status column. */
.board-col__group {
  margin: var(--space-2) var(--space-1) 0; font-family: var(--font-body); font-size: var(--text-xs);
  font-weight: var(--weight-strong); color: var(--text-muted); letter-spacing: 0.04em; text-transform: uppercase;
}
.board-col__group:first-child { margin-top: 0; }
/* The board grouped by section: one column per section, then one to add a section. */
.board-col--section { border-color: var(--status-todo-line); }
/* Same height with or without the section menu, so the headings line up. */
.board--sections .board-col__head { justify-content: flex-start; min-height: 50px; }
.board--sections .board-col__head .count { margin-left: auto; }
.board-col--new { align-self: start; min-height: 0; padding: var(--space-3); background: none; border: 1px dashed var(--border-strong); box-shadow: none; }
.board-col--new .section-new { margin: 0; }
.board-card__head { display: flex; align-items: flex-start; gap: var(--space-2); }
.board-card__head .complete-check { margin-top: 1px; }
.board-card__head .board-card__title { flex: 1; min-width: 0; }
.board-card__project { font-size: var(--text-xs); color: var(--text-muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.board-card__title { font-family: var(--font-body); font-size: var(--text-md); line-height: 1.4; }
.board-card__title .task-link:hover { text-decoration: underline; }
.board-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); }
.board-card__meta .task-dates__range { font-size: var(--text-sm); color: var(--text-muted); }
/* In a narrow card the dates may shrink, so a label like Overdue wraps under them
   instead of running out of the card. */
.board-card__meta .date-picker { flex: 0 1 auto; min-width: 0; }
.board-card__meta .date-picker__current { max-width: calc(100% + 12px); }
.board-card__checks { display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-sm); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.board-card__checks .icon { width: 14px; height: 14px; }
.board-card__checks.is-complete { color: var(--status-done-text); }
.board-card__foot { display: flex; align-items: center; gap: var(--space-2); padding-top: var(--space-2); border-top: 1px solid var(--border); }
/* A card is never wider than its column, whatever it holds. An approval's footer (who
   asked, who decides, and its state) wraps when the column is narrow, and a long state
   is cut short rather than pushing the card out. */
.board-card { min-width: 0; }
.board-card--request .board-card__foot { flex-wrap: wrap; row-gap: var(--space-1); }
.board-card--request .board-card__foot > .chip { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-card__foot .quick { flex: 1; min-width: 0; }
.board-card__person .assign-picker { flex: none; }
.board-card__person .assign-picker summary { padding: 2px; border-radius: var(--radius-pill); }
/* The same padding when pointed at or open, so nothing in the card shifts. */
.board-card__person .assign-picker summary.assign-picker__empty:hover,
.board-card__person .assign-picker[open] summary.assign-picker__empty { padding: 2px; }
/* The board's scrolling area cuts off anything past its edges, so tooltips in a card
   start at their control and run right, into the card, instead of centring on it. */
.board-card [data-tooltip]::after { left: -4px; transform: translate(0, 3px); }
.board-card [data-tooltip]:hover::after, .board-card [data-tooltip]:focus-visible::after,
.board-card [data-tooltip]:has(:focus-visible)::after { transform: translate(0, 0); }
/* A card holding an open menu stays put, so the menu (placed by app.js) stays beside it. */
.board-card:has(details[open]), .board-card:has(details[open]):hover { transform: none; z-index: 5; }

/* Timeline */
.timeline-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
.timeline-bar__nav { display: flex; gap: var(--space-1); }
.timeline-bar__title { font-size: var(--text-base); }
.timeline {
  --name-width: 280px; --day-width: 72px;
  margin-bottom: var(--space-3); overflow-x: auto; position: relative; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
}
.timeline--month { --day-width: 36px; }
.tl-grid {
  display: grid; grid-template-columns: var(--name-width) repeat(var(--days), minmax(var(--day-width), 1fr));
  min-width: calc(var(--name-width) + var(--days) * var(--day-width));
}
.tl-corner, .tl-name { position: sticky; left: 0; z-index: 3; background: var(--surface); border-right: 1px solid var(--border); }
.tl-corner { display: flex; align-items: flex-end; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); font-size: var(--text-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.tl-day { display: grid; justify-items: center; padding: var(--space-1) 0; border-bottom: 1px solid var(--border); font-size: var(--text-xs); color: var(--text-muted); }
.tl-day__num { font-size: var(--text-sm); color: var(--text); }
.tl-day.is-weekend { background: var(--surface-hover); }
.tl-day.is-today .tl-day__name, .tl-day.is-today .tl-day__num { color: var(--link); font-weight: var(--weight-strong); }
.tl-day.is-today { box-shadow: inset 0 -2px 0 var(--primary); }
.tl-name { padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); font-size: var(--text-md); min-width: 0; }
.tl-name .task-link { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tl-name__meta { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: var(--text-xs); color: var(--text-muted); }
.tl-track {
  grid-column: 2 / -1; display: grid; grid-template-columns: repeat(var(--days), minmax(var(--day-width), 1fr));
  align-items: center; border-bottom: 1px solid var(--border);
  background-image: linear-gradient(to right, var(--border) 1px, transparent 1px);
  background-size: calc(100% / var(--days)) 100%;
}
.tl-shade { grid-row: 1; align-self: stretch; background: var(--surface-sunken); opacity: 0.55; }
.tl-shade--today { background: var(--primary-tint); opacity: 1; }
.tl-bar {
  grid-row: 1; z-index: 1; display: flex; align-items: center; min-width: 0; height: 26px; margin-inline: 2px;
  padding: 0 8px; overflow: hidden; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-size: var(--text-xs); text-decoration: none; white-space: nowrap;
}
.tl-bar:hover { filter: brightness(0.96); text-decoration: underline; }
[data-theme="dark"] .tl-bar:hover { filter: brightness(1.15); }
.tl-bar__text { overflow: hidden; text-overflow: ellipsis; }
.tl-bar--todo { background: var(--status-todo-bg); color: var(--status-todo-text); border-color: var(--status-todo-text); }
.tl-bar--in_progress { background: var(--status-in_progress-bg); color: var(--status-in_progress-text); border-color: var(--status-in_progress-text); }
.tl-bar--internal_review { background: var(--status-internal_review-bg); color: var(--status-internal_review-text); border-color: var(--status-internal_review-text); }
.tl-bar--waiting_client { background: var(--status-waiting_client-bg); color: var(--status-waiting_client-text); border-color: var(--status-waiting_client-text); }
.tl-bar--done { background: var(--status-done-bg); color: var(--status-done-text); border-color: var(--status-done-text); }
.tl-bar--overdue { border-color: var(--danger); border-width: 2px; }
.tl-bar--cont-before { margin-left: 0; border-left-style: dashed; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.tl-bar--cont-after { margin-right: 0; border-right-style: dashed; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.tl-marker { grid-row: 1; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; color: var(--status-todo-text); font-size: 10px; line-height: 1; text-decoration: none; }
.tl-marker__diamond { width: 12px; height: 12px; transform: rotate(45deg); background: var(--status-todo-text); border-radius: 2px; margin-bottom: 2px; }
.tl-marker--in_progress .tl-marker__diamond { background: var(--status-in_progress-text); }
.tl-marker--internal_review .tl-marker__diamond { background: var(--status-internal_review-text); }
.tl-marker--waiting_client .tl-marker__diamond { background: var(--status-waiting_client-text); }
.tl-marker--done .tl-marker__diamond { background: var(--status-done-text); }
.timeline-group { margin-bottom: var(--space-3); }

/* Gantt */
.gantt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
.gantt-bar__actions { display: flex; gap: var(--space-2); margin-left: auto; }
.gantt-toggle .icon { width: 15px; height: 15px; }
.gantt-toggle[aria-pressed="true"] { background: var(--gantt-critical-tint); border-color: var(--gantt-critical); color: var(--text); }
.gantt-toggle[aria-pressed="true"] .icon { color: var(--gantt-critical); }
.gantt-legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-4); font-size: var(--text-sm); color: var(--text-muted); }
.gantt-legend li { display: inline-flex; align-items: center; gap: 6px; }
.gantt-legend__baseline { width: 22px; height: 5px; border-radius: 3px; background: var(--gantt-baseline); }
.gantt-legend__link { width: 22px; height: 0; border-top: 1.5px solid var(--gantt-link); }
.gantt-legend__late { color: var(--danger); }
.gantt-legend__critical .icon { color: var(--gantt-critical); }
.gantt-legend .icon { width: 15px; height: 15px; }

/* The chart: a sticky table of tasks on the left, one grid column per day on the right. */
.gantt {
  --table-width: 470px; --day-width: 30px; --row-height: 44px; --grid-step: 1;
  --gantt-baseline: rgba(30, 30, 30, 0.32); --gantt-weekend: rgba(30, 30, 30, 0.035);
  margin-bottom: var(--space-3); overflow: auto; max-height: 75vh; position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
}
[data-theme="dark"] .gantt { --gantt-baseline: rgba(255, 255, 255, 0.34); --gantt-weekend: rgba(255, 255, 255, 0.03); }
.gantt--week { --day-width: 12px; --grid-step: 7; }
.gantt--month { --day-width: 4px; --grid-step: 7; --gantt-weekend: transparent; }
.gantt--baseline { --table-width: 530px; }
.gantt__grid {
  position: relative; display: grid;
  grid-template-columns: var(--table-width) calc(var(--days) * var(--day-width));
  width: max-content; min-width: 100%;
}
.gantt__cols { display: grid; grid-template-columns: minmax(0, 1fr) 58px 58px 40px; gap: var(--space-2); align-items: center; }
.gantt--baseline .gantt__cols { grid-template-columns: minmax(0, 1fr) 58px 58px 40px 56px; }
.gantt__corner, .gantt__cell {
  position: sticky; left: 0; z-index: 5; padding: 0 var(--space-3) 0 var(--space-4);
  background: var(--surface); border-right: 1px solid var(--border-strong);
}
.gantt__corner {
  top: 0; z-index: 6; min-height: 52px; border-bottom: 1px solid var(--border);
  font-size: var(--text-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em;
}
.gantt__scale {
  position: sticky; top: 0; z-index: 4; display: grid;
  grid-template-columns: repeat(var(--days), var(--day-width)); grid-template-rows: 26px 26px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.gantt--month .gantt__scale { grid-template-rows: 52px; }
.gantt__month, .gantt__minor {
  overflow: hidden; padding: 0 6px; white-space: nowrap; font-size: var(--text-xs); color: var(--text-muted);
  border-left: 1px solid var(--border); display: flex; align-items: center;
}
.gantt__month { grid-row: 1; color: var(--text); font-weight: var(--weight-strong); }
.gantt__minor { grid-row: 2; padding: 0; justify-content: center; font-variant-numeric: tabular-nums; }
.gantt--week .gantt__minor { justify-content: flex-start; padding-left: 4px; }
/* Today: its date in a blue circle (days), or a mark under the scale (weeks, months). */
.gantt__minor.is-today {
  color: #FFFFFF; font-weight: var(--weight-strong);
  background: radial-gradient(circle 11px at 50% 50%, var(--primary) 96%, transparent 100%);
}
.gantt__now { grid-row: 1 / -1; justify-self: center; position: relative; width: 2px; background: var(--primary); opacity: 0.55; pointer-events: none; }
.gantt__now::after { content: ""; position: absolute; left: 50%; bottom: -1px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--primary); }
.gantt--day .gantt__now { display: none; }
.gantt__cell { min-height: var(--row-height); border-bottom: 1px solid var(--border); font-size: var(--text-md); }
.gantt__title { display: flex; align-items: center; gap: 6px; min-width: 0; }
.gantt__title .task-link { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.gantt__kind, .gantt__flag { display: inline-flex; flex: none; color: var(--text-muted); }
.gantt__kind .icon, .gantt__flag .icon { width: 15px; height: 15px; }
.gantt__flag--late { color: var(--danger); }
.gantt__flag--waiting { color: var(--status-waiting_client-text); }
.gantt__date, .gantt__num, .gantt__slip { font-size: var(--text-sm); color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.gantt__num { text-align: right; }
.gantt__slip.is-late { color: var(--danger); font-weight: var(--weight-strong); }
.gantt__slip.is-early { color: var(--status-done-text); }
.gantt__track {
  position: relative; display: grid; grid-template-columns: repeat(var(--days), var(--day-width)); grid-template-rows: 30px 1fr;
  min-height: var(--row-height); padding-top: 4px; border-bottom: 1px solid var(--border);
  background-image:
    repeating-linear-gradient(to right, transparent 0 calc(5 * var(--day-width)), var(--gantt-weekend) calc(5 * var(--day-width)) calc(7 * var(--day-width))),
    repeating-linear-gradient(to right, var(--border) 0 1px, transparent 1px calc(var(--grid-step) * var(--day-width)));
  transition: background-color 0.12s var(--ease);
}
.gantt__track:hover { background-color: var(--surface-hover); }
/* Section headings across the Gantt chart and timeline. Opaque, as they scroll sideways. */
.gantt__group, .tl-group {
  display: flex; align-items: center; gap: var(--space-2); min-height: 34px;
  background: linear-gradient(var(--surface-sunken), var(--surface-sunken)), var(--surface);
  font-size: var(--text-md); font-weight: var(--weight-strong);
}
.gantt__track--group, .tl-track--group { min-height: 34px; padding-top: 0; background: var(--surface-sunken); background-image: none; }
.gantt__track--group { grid-template-rows: 1fr; }
.gantt__track--group:hover { background-color: var(--surface-sunken); }
.gantt__fold {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; margin-left: -6px; padding: 3px 8px 3px 4px;
  background: none; border: 0; border-radius: var(--radius-md); color: var(--text); font: inherit; cursor: pointer;
}
.gantt__fold span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.gantt__fold:hover { background: var(--surface-sunken); }
.gantt__fold-icon { flex: none; width: 16px; height: 16px; color: var(--text-muted); transition: transform 0.15s var(--ease); }
.gantt__fold[aria-expanded="false"] .gantt__fold-icon { transform: rotate(-90deg); }
/* A section's span, filled as far as its tasks are done. */
.gantt__summary {
  grid-row: 1; align-self: center; height: 8px; min-width: 6px; border-radius: 4px;
  background: linear-gradient(to right, var(--gantt-summary-done) 0 var(--done), var(--gantt-summary) var(--done) 100%);
}

/* Bars: filled in their status colour, with the task's name, people and signs beside them. */
.gantt__bar {
  --gantt-fill: var(--gantt-todo);
  position: relative; z-index: 3; grid-row: 1; align-self: center; display: block;
  height: 22px; min-width: 6px; border-radius: 6px; background: var(--gantt-fill); color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 1px 2px rgba(0, 0, 0, 0.18);
  text-decoration: none; white-space: nowrap; cursor: pointer;
  -webkit-user-select: none; user-select: none; -webkit-user-drag: none;
  transition: box-shadow 0.15s var(--ease), opacity 0.15s var(--ease), filter 0.15s var(--ease);
}
.gantt__bar:hover { filter: brightness(1.06); }
.gantt__bar--in_progress { --gantt-fill: var(--gantt-in_progress); }
.gantt__bar--internal_review { --gantt-fill: var(--gantt-internal_review); }
.gantt__bar--waiting_client { --gantt-fill: var(--gantt-waiting_client); }
.gantt__bar--done { --gantt-fill: var(--gantt-done); }
/* Urgent work glows, like urgent cards on the Board. */
.gantt__bar--urgent { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 0 0 1.5px var(--danger), 0 0 14px -2px rgba(255, 69, 58, 0.65); }
/* Starts before what it waits for is due. */
.gantt__bar--late { outline: 2px dashed var(--danger); outline-offset: 2px; }
.gantt__bar--clip-before { border-top-left-radius: 0; border-bottom-left-radius: 0; -webkit-mask-image: linear-gradient(to right, transparent, #000 14px); mask-image: linear-gradient(to right, transparent, #000 14px); }
.gantt__bar--clip-after { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.gantt__bar--clip-after .gantt__label { display: none; }
/* A due date only: a diamond. A start date only: a bar fading out to the right. */
.gantt__bar--milestone { justify-self: center; width: 18px; min-width: 18px; height: 18px; background: none; box-shadow: none; }
.gantt__bar--milestone::before {
  content: ""; position: absolute; inset: 2px; border-radius: 3px; transform: rotate(45deg);
  background: var(--gantt-fill); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.gantt__bar--milestone.gantt__bar--urgent { box-shadow: none; }
.gantt__bar--milestone.gantt__bar--urgent::before { box-shadow: 0 0 0 1.5px var(--danger), 0 0 12px -2px rgba(255, 69, 58, 0.65); }
.gantt__bar--start { -webkit-mask-image: linear-gradient(to right, #000 55%, transparent); mask-image: linear-gradient(to right, #000 55%, transparent); }
.gantt__bar--start .gantt__label { display: none; }
.gantt__label {
  position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 5px; max-width: 320px;
  font-size: var(--text-sm); line-height: 1.2; color: var(--text);
}
.gantt__grid[data-editable] .gantt__label { left: calc(100% + 24px); }
.gantt__label .avatar { width: 20px; height: 20px; font-size: 8.5px; box-shadow: 0 0 0 2px var(--surface); }
.gantt__label .avatar + .avatar { margin-left: -9px; }
.gantt__label-icon { flex: none; width: 14px; height: 14px; color: var(--text-muted); }
.gantt__label-icon--waiting { color: var(--status-waiting_client-text); }
.gantt__label-icon--late { color: var(--danger); }
.gantt__label-text { overflow: hidden; text-overflow: ellipsis; }
.gantt__bar--done .gantt__label-text { color: var(--text-muted); }
.gantt--month .gantt__label { font-size: var(--text-xs); }

/* Editing on the chart (app.js): ends to resize, dots to draw links, rows to draw dates. */
.gantt__handle { position: absolute; top: 0; bottom: 0; z-index: 1; width: 8px; cursor: ew-resize; }
.gantt__handle--start { left: 0; }
.gantt__handle--end { right: 0; }
.gantt__handle::after {
  content: ""; position: absolute; top: 6px; bottom: 6px; left: 3px; width: 2px; border-radius: 1px;
  background: rgba(255, 255, 255, 0.8); opacity: 0; transition: opacity 0.12s var(--ease);
}
.gantt__bar:hover .gantt__handle::after { opacity: 1; }
.gantt__bar.is-narrow .gantt__handle { display: none; }
.gantt__dot {
  position: absolute; top: 50%; z-index: 2; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--gantt-fill); cursor: crosshair;
  opacity: 0; transition: opacity 0.12s var(--ease), transform 0.12s var(--ease);
}
.gantt__dot--start { left: -16px; }
.gantt__dot--end { right: -16px; }
.gantt__bar:hover .gantt__dot, .gantt.is-linking .gantt__dot { opacity: 1; }
.gantt__dot:hover { transform: scale(1.3); }
.gantt__grid[data-editable] .gantt__bar { cursor: grab; }
.gantt__bar.is-dragging { z-index: 7; cursor: grabbing; filter: brightness(1.08); box-shadow: 0 0 0 2px var(--primary), 0 8px 20px rgba(0, 0, 0, 0.25); }
.gantt__bar.is-saving { opacity: 0.6; }
.gantt__bar.is-link-target { box-shadow: 0 0 0 2px var(--primary), 0 0 0 6px var(--primary-tint); }
.gantt.is-dragging, .gantt.is-dragging * { cursor: grabbing !important; }
.gantt.is-resizing, .gantt.is-resizing * { cursor: ew-resize !important; }
.gantt.is-linking, .gantt.is-linking * { cursor: crosshair !important; }
.gantt__track--empty[data-gantt-draw] { cursor: cell; }
.gantt__ghost {
  position: relative; z-index: 3; grid-row: 1; align-self: center; height: 22px;
  border: 1.5px dashed var(--primary); border-radius: 6px; background: var(--primary-tint); pointer-events: none;
}
.gantt__ghost::after {
  content: attr(data-label); position: absolute; left: calc(100% + 8px); top: 50%; transform: translateY(-50%);
  font-size: var(--text-sm); color: var(--link); white-space: nowrap;
}
.gantt-tip, .gantt-card {
  position: fixed; z-index: 120; pointer-events: none;
  background: var(--glass-sheen), var(--glass-fill-strong); border: 1px solid var(--glass-rim); box-shadow: var(--shadow-menu);
  -webkit-backdrop-filter: var(--glass-blur-strong); backdrop-filter: var(--glass-blur-strong);
}
.gantt-tip { padding: 5px 10px; border-radius: var(--radius-md); font-size: var(--text-sm); font-weight: var(--weight-strong); white-space: nowrap; font-variant-numeric: tabular-nums; }
.gantt-card { display: grid; gap: 6px; width: 270px; padding: 12px 14px; border-radius: var(--radius-lg); font-size: var(--text-sm); }
.gantt-card__title { font-size: var(--text-md); font-weight: var(--weight-strong); overflow-wrap: anywhere; }
.gantt-card__row { display: flex; gap: 8px; color: var(--text-muted); }
.gantt-card__row b { flex: none; width: 64px; font-weight: var(--weight-regular); }
.gantt-card__row span { color: var(--text); overflow-wrap: anywhere; }
.gantt-card__row--waiting span { color: var(--status-waiting_client-text); }
.gantt-card__row--late span { color: var(--danger); }
.gantt-unlink {
  position: fixed; z-index: 120;
  background: var(--glass-sheen), var(--glass-fill-strong); box-shadow: var(--shadow-menu);
  -webkit-backdrop-filter: var(--glass-blur-strong); backdrop-filter: var(--glass-blur-strong);
}
.gantt__baseline { grid-row: 2; align-self: start; height: 5px; margin-top: 1px; border-radius: 3px; background: var(--gantt-baseline); }
.gantt__baseline--point { justify-self: center; width: 7px; height: 7px; border-radius: 1px; transform: rotate(45deg); margin-top: 0; }
.gantt__today {
  position: absolute; top: 0; bottom: 0; z-index: 2; width: 2px; pointer-events: none;
  left: calc(var(--table-width) + (var(--col) - 0.5) * var(--day-width) - 1px);
  background: var(--primary); opacity: 0.55;
}
.gantt__links { position: absolute; top: 0; left: 0; z-index: 2; overflow: visible; pointer-events: none; }
.gantt__links .gantt__link { fill: none; stroke: var(--gantt-link); stroke-width: 1.5; stroke-linejoin: round; }
.gantt__links .gantt__link.is-late { stroke: var(--danger); stroke-dasharray: 4 3; }
.gantt__links .gantt__link.is-selected { stroke: var(--primary); stroke-width: 2.5; stroke-dasharray: none; }
.gantt__links .gantt__link--draft { stroke: var(--primary); stroke-width: 2; stroke-dasharray: 5 4; }
.gantt__links .gantt__arrow { fill: var(--gantt-link); stroke: none; }
.gantt__links .gantt__arrow--late { fill: var(--danger); }
.gantt__links .gantt__hit { fill: none; stroke: transparent; stroke-width: 12; pointer-events: stroke; cursor: pointer; }
/* Critical path: the linked work that sets the end date stands out, the rest steps back. */
.gantt--critical .gantt__bar:not(.gantt__bar--critical) { opacity: 0.3; }
.gantt--critical .gantt__bar--critical { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 0 0 2px var(--gantt-critical), 0 0 14px -2px var(--gantt-critical); }
.gantt--critical .gantt__bar--milestone.gantt__bar--critical { box-shadow: none; }
.gantt--critical .gantt__bar--milestone.gantt__bar--critical::before { box-shadow: 0 0 0 2px var(--gantt-critical); }
.gantt--critical .gantt__links .gantt__link:not(.is-critical), .gantt--critical .gantt__links .gantt__arrow:not(.is-critical) { opacity: 0.25; }
.gantt--critical .gantt__links .gantt__link.is-critical { stroke: var(--gantt-critical); stroke-width: 2; stroke-dasharray: none; }
.gantt--critical .gantt__links .gantt__arrow.is-critical { fill: var(--gantt-critical); }

/* Calendar */
.cal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
.cal {
  margin-bottom: var(--space-3); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
}
.cal__weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.cal__weekdays span { padding: var(--space-2) var(--space-3); font-size: var(--text-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.cal-week {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: 30px repeat(var(--lanes), 26px) minmax(26px, 1fr);
  row-gap: 3px; min-height: 124px; border-bottom: 1px solid var(--border);
}
.cal-week:last-child { border-bottom: 0; }
.cal--week .cal-week { grid-template-rows: 34px repeat(var(--lanes), 34px) minmax(40px, 1fr); min-height: 420px; row-gap: 4px; }
.cal-day {
  grid-row: 1 / -1; display: flex; flex-direction: column; justify-content: space-between;
  min-width: 0; padding: 6px 8px; border-left: 1px solid var(--border); transition: background-color 0.12s var(--ease);
}
.cal-day:first-child { border-left: 0; }
.cal-day.is-weekend { background: var(--surface-hover); }
.cal-day.is-outside { background: var(--surface-sunken); }
.cal-day.is-outside .cal-day__num { color: var(--text-muted); opacity: 0.7; }
.cal-day.is-drop-target { background: var(--primary-tint); box-shadow: inset 0 0 0 2px var(--primary); }
.cal-day__num { align-self: flex-start; padding: 0 6px; border-radius: var(--radius-pill); font-size: var(--text-sm); line-height: 22px; font-variant-numeric: tabular-nums; }
.cal-day.is-today .cal-day__num { background: var(--primary); color: var(--text-on-primary); font-weight: var(--weight-strong); }
.cal-day__more { position: relative; z-index: 2; align-self: flex-start; font-size: var(--text-xs); }
.cal-item {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 6px; min-width: 0; margin: 0 4px;
  padding: 0 8px; overflow: hidden; border-radius: var(--radius-sm); border-left: 3px solid var(--status-todo-text);
  background: var(--status-todo-bg); color: var(--status-todo-text);
  font-size: var(--text-xs); line-height: 1.2; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.cal-item:hover { filter: brightness(0.96); color: var(--status-todo-text); }
[data-theme="dark"] .cal-item:hover { filter: brightness(1.15); }
.cal-item[draggable="true"]:active { cursor: grabbing; }
.cal-item.is-dragging { opacity: 0.45; }
.cal-item.is-saving { opacity: 0.6; }
.cal-item__text { overflow: hidden; text-overflow: ellipsis; }
.cal-item__mark { flex: none; width: 7px; height: 7px; border-radius: 1px; transform: rotate(45deg); background: currentColor; }
.cal-item__who { flex: none; margin-left: auto; padding: 0 5px; border-radius: var(--radius-pill); background: var(--surface); font-size: 10px; line-height: 16px; }
.cal--week .cal-item { font-size: var(--text-sm); }
.cal-item--in_progress { background: var(--status-in_progress-bg); color: var(--status-in_progress-text); border-left-color: var(--status-in_progress-text); }
.cal-item--internal_review { background: var(--status-internal_review-bg); color: var(--status-internal_review-text); border-left-color: var(--status-internal_review-text); }
.cal-item--waiting_client { background: var(--status-waiting_client-bg); color: var(--status-waiting_client-text); border-left-color: var(--status-waiting_client-text); }
.cal-item--done { background: var(--status-done-bg); color: var(--status-done-text); border-left-color: var(--status-done-text); opacity: 0.75; }
.cal-item--done .cal-item__text { text-decoration: line-through; }
.cal-item--overdue { box-shadow: inset 0 0 0 1px var(--danger); }
.cal-item--cont-before { margin-left: 0; border-left-style: dashed; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal-item--cont-after { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cal-undated summary { cursor: pointer; list-style: none; }
.cal-undated summary::-webkit-details-marker { display: none; }
.cal-undated:not([open]) summary { border-bottom: 0; }

/* Dependencies in the task panel */
.panel-subhead { margin: var(--space-3) 0 var(--space-1); font-size: var(--text-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.panel-section > .panel-subhead:first-of-type { margin-top: 0; }
.dep-list { display: grid; gap: var(--space-2); margin-bottom: var(--space-2); }
.dep-list__item {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-2) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-md); font-size: var(--text-md);
}
.dep-list__item.is-late { border-color: var(--danger); background: var(--danger-tint); }
.dep-list__main { display: grid; gap: 2px; min-width: 0; }
.dep-list__meta { font-size: var(--text-sm); color: var(--text-muted); }
.dep-list__warning { display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-sm); color: var(--danger); }
.dep-list__warning .icon { width: 14px; height: 14px; }
#task-dependencies .inline-form select { flex: 1 1 220px; width: auto; }
/* Blocked by (waiting, amber) and Blocking (holding others up, red). */
.dep-head { display: flex; align-items: center; gap: 6px; }
.dep-head .icon { width: 15px; height: 15px; }
.dep-head--blocked_by .icon, .dep-type__choice--blocked_by, .dep-type__option--blocked_by { color: var(--status-waiting_client-text); }
.dep-head--blocking .icon, .dep-type__choice--blocking, .dep-type__option--blocking { color: var(--danger); }
/* Adding one: which way round, then the other task. */
.dep-add { display: grid; gap: var(--space-2); margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px dashed var(--border); }
.dep-add__label { margin: 0; font-size: var(--text-sm); color: var(--text-muted); }
.dep-add__row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.dep-add__row select { flex: 1 1 220px; width: auto; }
.dep-type { position: relative; }
.dep-type > summary {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--control-h-sm); padding: 0 10px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--control-fill);
  font-size: var(--text-sm); cursor: pointer; list-style: none;
}
.dep-type > summary::-webkit-details-marker { display: none; }
.dep-type > summary:hover, .dep-type[open] > summary { border-color: var(--border-control); }
.dep-type__choice { display: inline-flex; align-items: center; gap: 6px; }
.dep-type__choice .icon, .dep-type__option .icon { width: 15px; height: 15px; }
.dep-type:has(input[value="blocking"]:checked) .dep-type__choice--blocked_by,
.dep-type:not(:has(input[value="blocking"]:checked)) .dep-type__choice--blocking { display: none; }
.dep-type__chevron { width: 14px; height: 14px; color: var(--text-muted); }
.dep-type__panel {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; width: 220px;
  padding: var(--space-2); border-radius: var(--radius-lg);
  background: var(--glass-sheen), var(--glass-fill-strong); border: 1px solid var(--glass-rim); box-shadow: var(--shadow-menu);
  -webkit-backdrop-filter: var(--glass-blur-strong); backdrop-filter: var(--glass-blur-strong);
}
.dep-type__option {
  position: relative; display: flex; align-items: center; gap: var(--space-2); padding: 7px var(--space-2);
  border-radius: var(--radius-md); font-size: var(--text-md); cursor: pointer;
}
.dep-type__option input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dep-type__option:hover, .dep-type__option:has(input:checked) { background: var(--surface-sunken); }
.dep-type__option:has(input:focus-visible) { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.dep-type__option .dep-type__tick { color: var(--text); visibility: hidden; }
.dep-type__option:has(input:checked) .dep-type__tick { visibility: visible; }
.dep-kind {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--control-h-sm); padding: 0 10px;
  border: 1px solid var(--border); border-radius: var(--radius-md); color: var(--text-muted); font-size: var(--text-sm);
}
.dep-kind .icon { width: 15px; height: 15px; }
/* Menus on Board cards float over the page, clear of the board's scrolling area. They're
   fixed from the first frame, just under their button; app.js then places them exactly. */
.board details > [data-float-panel] { position: fixed; top: auto; right: auto; bottom: auto; left: auto; }
/* An approval's approvers on a row or card, opening a menu to change them. */
.approver-picker { position: relative; display: inline-flex; vertical-align: middle; }
.approver-picker > summary { display: inline-flex; list-style: none; cursor: pointer; border-radius: var(--radius-pill); }
.approver-picker > summary::-webkit-details-marker { display: none; }
.approver-picker > summary .approvers-mini { padding: 2px 6px 2px 4px; border-radius: var(--radius-pill); }
.approver-picker > summary:hover .approvers-mini, .approver-picker[open] > summary .approvers-mini { background: var(--surface-sunken); }
.task-row__text .approver-picker { margin-left: var(--space-1); }
.approver-picker .assign-picker__panel { width: 250px; }

/* Task panel */
/* A glass sheet floating at the right edge. */
.panel {
  position: fixed; top: var(--space-2); right: var(--space-2); bottom: auto; left: auto; margin: 0; padding: 0;
  width: min(660px, calc(100vw - 2 * var(--space-2))); max-width: none;
  height: calc(100vh - 2 * var(--space-2)); height: calc(100dvh - 2 * var(--space-2)); max-height: none;
  overflow-y: auto; color: var(--text);
  background: var(--glass-sheen), var(--glass-fill-strong);
  border: 1px solid var(--glass-rim); border-radius: var(--radius-xl); box-shadow: var(--shadow-panel);
  -webkit-backdrop-filter: var(--glass-blur-strong); backdrop-filter: var(--glass-blur-strong);
}
.panel[open] #panel-content { animation: panel-in 0.22s var(--ease); }
.panel::backdrop, .panel-backdrop { background: var(--backdrop); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
/* Not a modal (app.js says why), so the panel and its backdrop stack by z-index: above the
   page, below toasts. Writing tools' suggestion cards float higher still. */
.panel { z-index: 81; }
.panel-backdrop { position: fixed; inset: 0; z-index: 80; animation: backdrop-in 0.18s var(--ease); }
.panel-backdrop[hidden] { display: none; }
@keyframes backdrop-in { from { opacity: 0; } }
@keyframes panel-in { from { transform: translateX(24px); opacity: 0.6; } }
#task-dialog #panel-content { padding: var(--space-5); }
.panel-loading { padding: var(--space-5) 0; color: var(--text-muted); }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.panel-head__text { min-width: 0; }
.panel-head h2 { font-size: var(--text-xl); overflow-wrap: anywhere; }
.panel-head__chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); margin-top: var(--space-2); }
.panel-head__close { flex: none; }
.panel-section { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.panel-section > h3 { margin-bottom: var(--space-2); }
.panel-section .empty-inline { padding: 0; margin-bottom: var(--space-2); }
.panel-activity summary { cursor: pointer; }
.panel-activity summary h3 { display: inline; }
.panel-activity .activity { margin-top: var(--space-3); }
.panel-activity .field__help { margin-top: var(--space-2); }
.panel-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.task-readonly { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.facts__wide { grid-column: 1 / -1; }
.checklist { display: grid; gap: var(--space-1); margin-bottom: var(--space-2); }
.checklist__item { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); padding: 2px 0; font-size: var(--text-md); }
.checklist__label { display: flex; align-items: flex-start; gap: var(--space-2); min-width: 0; overflow-wrap: anywhere; cursor: pointer; }
.checklist__label input { margin-top: 2px; }
.checklist__item.is-done .checklist__label span { color: var(--text-muted); text-decoration: line-through; }
.inline-form { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.inline-form input[type="text"] { flex: 1 1 200px; width: auto; }
.inline-form .field__error { flex-basis: 100%; margin-top: 0; }
.link-list { display: grid; gap: var(--space-1); margin-bottom: var(--space-2); }
.link-list__item { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); font-size: var(--text-md); overflow-wrap: anywhere; }
.link-list__actions { display: inline-flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; gap: var(--space-1) var(--space-3); flex: none; }
.inline-form__option { flex-basis: 100%; font-size: var(--text-sm); }
.comments { display: grid; gap: var(--space-3); margin-bottom: var(--space-3); }
.comment__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); font-size: var(--text-sm); }
.comment__meta strong { font-weight: var(--weight-strong); }
.comment__meta time { color: var(--text-muted); }
.comment__body { margin-top: var(--space-1); padding-left: 34px; font-size: var(--text-md); }
.comment-form { display: grid; gap: var(--space-2); justify-items: start; }
.conflict { margin-bottom: var(--space-4); padding: var(--space-3); border: 1px solid var(--status-waiting_client-text); border-radius: var(--radius-md); background: var(--status-waiting_client-bg); font-size: var(--text-md); }
.conflict h3 { margin-bottom: var(--space-1); }
.conflict__table { width: 100%; margin: var(--space-3) 0; border-collapse: collapse; background: var(--surface); font-size: var(--text-sm); }
.conflict__table th, .conflict__table td { padding: var(--space-1) var(--space-2); border: 1px solid var(--border); text-align: left; vertical-align: top; font-weight: var(--weight-regular); }
.conflict__table thead th, .conflict__table tbody th { font-weight: var(--weight-strong); }
.task-page .panel-head__close { display: inline-flex; }

/* Activity */
.activity { display: grid; gap: var(--space-3); }
.activity__line { font-size: var(--text-md); }
.activity__line strong { font-weight: var(--weight-strong); }
.activity__time { display: block; font-size: var(--text-xs); color: var(--text-muted); }
.activity__changes { margin-top: 2px; font-size: var(--text-sm); color: var(--text-muted); }

/* Small screens */
/* Below 1024px the sidebar slides in from the left as a drawer, over a dimmed page, and a
   small glass bar with the menu button stays at the top. */
@media (max-width: 1023px) {
  :root { --sidebar-offset: 0px; --topbar-height: 56px; --sticky-top: calc(var(--topbar-height) + var(--space-2) * 2); }
  .page.page--project { padding-top: var(--space-2); }
  .mobilebar { display: flex; }
  .mobilebar__menu, .sidebar__close { display: inline-flex; }
  .sidebar__close { width: 36px; height: 36px; }
  .sidebar__toggle { display: none; }
  .sidebar {
    top: var(--space-2); bottom: var(--space-2); left: var(--space-2); z-index: 60;
    width: min(300px, calc(100vw - 56px)); padding-top: var(--space-4);
    transform: translateX(calc(-100% - var(--space-5))); visibility: hidden;
    transition: transform 0.32s var(--ease), visibility 0s linear 0.32s;
  }
  .sidebar-open .sidebar { transform: none; visibility: visible; transition: transform 0.32s var(--ease); }
  .sidebar-scrim {
    display: block; position: fixed; inset: 0; z-index: 55; background: var(--backdrop);
    opacity: 0; pointer-events: none; transition: opacity 0.25s var(--ease);
  }
  .sidebar-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  html.sidebar-open { overflow: hidden; }
}
/* From 1024px up the sidebar collapses to a rail of icons (data-sidebar="collapsed" on
   <html>, set by app.js and restored by theme.js). The rail and the page's left padding
   ease together, so the page only gets wider; nothing moves down. In the rail, names
   become tooltips, the group headings become a divider, and the account menu opens to
   the side. Going back, the words fade in once there's room for them, so they never
   spill past the glass while it widens. */
@media (min-width: 1024px) {
  .sidebar { transition: width 0.3s var(--ease); }
  body.has-sidebar { transition: padding-left 0.3s var(--ease); }
  [data-sidebar="collapsed"] { --sidebar-w: 72px; }

  .brand--sidebar { transition: opacity 0.2s var(--ease) 0.12s, visibility 0s; }
  .sidenav__label, .sidenav__heading, .sidebar__appearance > span, .account-menu__text {
    white-space: nowrap; transition: opacity 0.2s var(--ease) 0.12s;
  }
  [data-sidebar="collapsed"] .brand--sidebar { opacity: 0; visibility: hidden; transition: none; }
  [data-sidebar="collapsed"] .sidenav__label, [data-sidebar="collapsed"] .sidebar__appearance > span, [data-sidebar="collapsed"] .account-menu__text {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; transition: none;
  }

  [data-sidebar="collapsed"] .sidenav { overflow: visible; }
  [data-sidebar="collapsed"] .sidenav__heading {
    height: 0; margin: 0; padding-block: 0; overflow: hidden; opacity: 0; visibility: hidden; transition: none;
  }
  /* Every icon shows in the rail, folded group or not. */
  [data-sidebar="collapsed"] #sidenav-studio, [data-sidebar="collapsed"] #sidenav-workspace { grid-template-rows: 1fr; visibility: visible; }
  [data-sidebar="collapsed"] #sidenav-studio li, [data-sidebar="collapsed"] #sidenav-workspace li { opacity: 1; transform: none; }
  [data-sidebar="collapsed"] #sidenav-studio > .sidenav__list, [data-sidebar="collapsed"] #sidenav-workspace > .sidenav__list { overflow: visible; }
  [data-sidebar="collapsed"] .sidenav__group + .sidenav__group { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--border); }
  [data-sidebar="collapsed"] .sidenav__link { justify-content: center; padding: 0; }
  [data-sidebar="collapsed"] .sidenav__link::after {
    content: attr(data-label); position: absolute; left: calc(100% + 14px); top: 50%; z-index: 40;
    padding: 6px 10px; border-radius: var(--radius-md); background: var(--toast-bg); color: var(--toast-text);
    box-shadow: var(--shadow-menu); font-size: var(--text-sm); font-weight: var(--weight-regular); line-height: 1.3; white-space: nowrap;
    opacity: 0; transform: translate(-4px, -50%); pointer-events: none;
    transition: opacity 0.12s var(--ease), transform 0.12s var(--ease);
  }
  [data-sidebar="collapsed"] .sidenav__link:hover::after, [data-sidebar="collapsed"] .sidenav__link:focus-visible::after { opacity: 1; transform: translate(0, -50%); }

  [data-sidebar="collapsed"] .sidebar__appearance { justify-content: center; padding-left: 0; }
  [data-sidebar="collapsed"] .theme-switch__track { width: 30px; padding: 0; justify-content: center; }
  [data-sidebar="collapsed"] .theme-switch__track > .icon { display: none; }
  [data-theme="dark"][data-sidebar="collapsed"] .theme-switch__thumb { transform: none; }
  [data-sidebar="collapsed"] .account-menu summary { justify-content: center; padding-inline: 0; }
  [data-sidebar="collapsed"] .account-menu__chevron { display: none; }
  [data-sidebar="collapsed"] .account-menu__panel { left: calc(100% + 14px); right: auto; bottom: 0; width: 240px; transform-origin: 0 100%; }
  [data-sidebar="collapsed"] .account-menu[open] .account-menu__panel { animation-name: menu-slide-in; }
  [data-sidebar="collapsed"] .account-menu.is-closing .account-menu__panel { animation-name: menu-slide-out; }
}
@media (max-width: 1000px) {
  .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .overview { grid-template-columns: minmax(0, 1fr); }
  .filters--inline { flex-basis: 100%; justify-content: flex-start; }
  .project-head { grid-template-columns: minmax(0, 1fr); }
  .project-head__actions { grid-column: 1; grid-row: 2; justify-content: flex-start; margin-top: var(--space-4); }
  .project-head__more { grid-row: 3; }
}
@media (max-width: 640px) {
  .page { padding: var(--space-4) var(--space-4) var(--space-6); }
  .project-head__veil { --veil-bleed: var(--space-4); }
  .page-head, .studio-head { margin-bottom: var(--space-4); }
  .site-footer__inner { padding: var(--space-4); }
  .auth-top { padding-inline: calc(var(--space-4) - 8px); }
  .field-row, .field-row--3 { grid-template-columns: minmax(0, 1fr); }
  .filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
  .filters__field { min-width: 0; }
  .filters__field--grow { grid-column: 1 / -1; }
  .filters select { padding-inline: 12px 28px; background-position: right 9px center; background-size: 14px 14px; }
  .kbd { display: none; }
  .stat-tile { padding: var(--space-3); column-gap: var(--space-2); }
  .stat-tile__icon { width: 34px; height: 34px; }
  .stat-tile__value { font-size: var(--text-2xl); }
  .project-head { padding: var(--space-4); }
  .board { grid-auto-columns: minmax(78vw, 1fr); }
  #task-dialog #panel-content { padding: var(--space-4); }
  .timeline { --name-width: 150px; --day-width: 56px; }
  .segmented--icons a .icon { display: none; }
  .segmented--icons a { padding-inline: 10px; }
  .gantt, .gantt--baseline { --table-width: 168px; }
  .gantt__cols, .gantt--baseline .gantt__cols { grid-template-columns: minmax(0, 1fr); }
  .gantt__cols > :not(:first-child) { display: none; }
  .gantt-bar__actions { margin-left: 0; }
  .cal-day { padding: 4px; }
  .cal-day__num { padding: 0 4px; font-size: var(--text-xs); }
  .cal-item { margin: 0 1px; padding: 0 4px; font-size: 10.5px; }
  .cal__weekdays span { padding: var(--space-2) 4px; text-align: center; }
  .timeline--month { --day-width: 32px; }
  .auth__card { padding: var(--space-5); }
  .theme-choice { grid-template-columns: minmax(0, 1fr); }
  /* iOS zooms into inputs below 16px. */
  input[type="text"], input[type="search"], input[type="email"], input[type="password"],
  input[type="date"], input[type="url"], select, textarea { font-size: 16px; }
}
@media (hover: none) {
  .kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .board-card:hover, .stat-tile:hover { transform: none; }
}

/* Studio Tasks: the studio's own work, with a compact header so tasks sit high on the page. */
.chip--blocked { background: var(--status-blocked-bg); color: var(--status-blocked-text); }
.status-dot--blocked { background: var(--status-blocked-text); }
.quick-select--blocked { background-color: var(--status-blocked-bg); color: var(--status-blocked-text); }
.board-col--blocked { border-color: var(--status-blocked-line); }
.board-col--blocked .board-col__head .count { background: var(--status-blocked-bg); color: var(--status-blocked-text); box-shadow: none; }
.board-col--approvals { border-color: var(--status-internal_review-line); }
.board-col--approvals .board-col__head .count { background: var(--status-internal_review-bg); color: var(--status-internal_review-text); box-shadow: none; }
.board-col__icon { width: 15px; height: 15px; margin-right: 6px; vertical-align: -2px; color: var(--status-internal_review-text); }
.gantt__bar--blocked { --gantt-fill: var(--status-blocked-text); }
.cal-item--blocked { background: var(--status-blocked-bg); color: var(--status-blocked-text); border-left-color: var(--status-blocked-text); }
.tl-bar--blocked { background: var(--status-blocked-bg); color: var(--status-blocked-text); border-color: var(--status-blocked-text); }

.studio-head {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
  gap: var(--space-3) var(--space-4); margin-bottom: var(--space-5);
}
.studio-head__text { min-width: 0; }
.studio-head .page-sub { margin-top: 2px; }
.studio-head__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.studio-more { margin-left: 0; }
.studio-more > summary { width: var(--control-h); height: var(--control-h); }
.studio-more .section-menu__item { color: var(--text); text-decoration: none; }
.studio-more form { margin: 0; }

.studio-bar { align-items: flex-start; margin-bottom: var(--space-3); }
.studio-views { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.view-more { position: relative; }
.view-more > summary { list-style: none; color: var(--text-muted); }
.view-more > summary::-webkit-details-marker { display: none; }
.view-more > summary.is-current { color: var(--link); border-color: var(--primary); font-weight: var(--weight-strong); }
.view-more__chevron { width: 14px; height: 14px; margin-left: -2px; }
.view-more > .section-menu__panel { left: 0; right: auto; }
/* Closed menus take no room, so a panel anchored at the left can never widen the page. */
.view-more:not([open]) > .section-menu__panel, .filter-more:not([open]) > .filter-more__panel { display: none; }
.view-more .section-menu__item { color: var(--text); text-decoration: none; }
.view-more .section-menu__item[aria-current] { color: var(--link); font-weight: var(--weight-strong); }

.filters.studio-filters { display: grid; gap: var(--space-3); margin-bottom: var(--space-3); }
.quick-filters { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.quick-filter { position: relative; display: inline-flex; }
.quick-filter input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.quick-filter > span {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--control-h-sm); padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-pill); background: var(--glass-sheen), var(--control-fill);
  color: var(--text-secondary); font-size: var(--text-sm); white-space: nowrap;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.quick-filter:hover > span { color: var(--text); }
.quick-filter input:checked + span { background: var(--primary-tint); border-color: var(--primary); color: var(--link); font-weight: var(--weight-strong); }
.quick-filter input:focus-visible + span { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.quick-filter .count { min-width: 20px; padding: 0 6px; line-height: 18px; }
.studio-filters__row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2) var(--space-3); }
.studio-filters__row .filters__field--grow { flex: 1 1 260px; }
.filter-more { position: relative; }
.filter-more > summary { list-style: none; }
.filter-more > summary::-webkit-details-marker { display: none; }
.filter-more > summary.is-active { border-color: var(--primary); color: var(--link); }
.filter-more > summary .count { min-width: 20px; padding: 0 6px; line-height: 18px; background: var(--primary-tint); color: var(--link); }
.filter-more > .filter-more__panel {
  left: 0; right: auto; width: min(380px, calc(100vw - 32px));
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2) var(--space-3); padding: var(--space-3);
}
.filter-more__panel .filters__field { min-width: 0; }
.filter-more__clear { grid-column: 1 / -1; margin: 0; }
/* Also inside .field, whose labels are otherwise blocks above their control. */
.check-row, .field label.check-row { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--control-h-sm); margin: 0; font-size: var(--text-md); cursor: pointer; }
.studio-filters__done { color: var(--text-secondary); font-size: var(--text-sm); }

.list-section__hint { margin-left: auto; color: var(--text-muted); font-size: var(--text-sm); }

/* Approval requests in lists and on boards: an indicator, who asked → who decides, where it stands. */
.request-box { cursor: default; }
.request-box--draft { border-style: dashed; color: var(--text-muted); }
.request-box--pending { border-color: var(--status-internal_review-text); color: var(--status-internal_review-text); }
.request-box--approved { background: var(--done-solid); border-color: var(--done-solid); color: #fff; }
.request-box--changes_requested { background: var(--changes-solid); border-color: var(--changes-solid); color: #fff; }
.request-box--rejected { background: var(--danger-solid); border-color: var(--danger-solid); color: #fff; }
.request-box--cancelled { border-color: var(--border-strong); color: var(--text-muted); }
.chip--kind { background: var(--status-internal_review-bg); color: var(--status-internal_review-text); font-weight: var(--weight-strong); }
.chip--request-draft, .chip--request-cancelled { background: var(--status-todo-bg); color: var(--status-todo-text); }
.chip--request-pending { background: var(--status-internal_review-bg); color: var(--status-internal_review-text); }
.chip--request-changes_requested { background: var(--status-waiting_client-bg); color: var(--status-waiting_client-text); }
.chip--request-approved { background: var(--status-done-bg); color: var(--status-done-text); }
.chip--request-rejected { background: var(--danger-tint); color: var(--danger); }
.chip .icon { width: 12px; height: 12px; margin-right: 4px; vertical-align: -2px; }
.chip--approver { margin-left: var(--space-1); background: var(--status-internal_review-bg); color: var(--status-internal_review-text); }
.request-people { display: inline-flex; align-items: center; gap: 4px; min-width: 0; color: var(--text-muted); font-size: var(--text-sm); }
.request-people .avatar { width: 22px; height: 22px; font-size: 9px; }
.request-people__arrow { width: 12px; height: 12px; flex: none; color: var(--text-muted); }
.request-people__names { min-width: 0; margin-left: 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.request-due__label { color: var(--text-muted); }
.task-dates--none { font-size: var(--text-sm); }
.task-row--request .task-row__text .chip--kind { margin-left: var(--space-1); }
.board-card--request .board-card__meta .task-dates { flex-wrap: wrap; }
.cal-item--request { border-style: dashed; }
.cal-item__icon { width: 11px; height: 11px; flex: none; margin-right: 3px; }

/* My Tasks: approvals that need you, ahead of the work assigned to you. */
.card--reviews { border-color: var(--status-internal_review-line); }
.card--reviews .card__head h2 { display: inline-flex; align-items: center; gap: var(--space-2); }
.card--reviews .card__head .icon { width: 16px; height: 16px; color: var(--status-internal_review-text); }
.group-heading { margin: var(--space-2) 0 calc(var(--space-1) * -1); color: var(--text-muted); font-size: var(--text-sm); font-weight: var(--weight-strong); letter-spacing: 0.04em; text-transform: uppercase; }
.banner--reviews { justify-content: flex-start; background: var(--status-internal_review-bg); color: var(--status-internal_review-text); }
.banner--reviews .icon { width: 16px; height: 16px; }
.banner--reviews a { color: inherit; font-weight: var(--weight-strong); }

/* Sidebar: how many approvals wait for you. */
.sidenav__count {
  margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: var(--radius-pill);
  background: var(--danger-solid); color: #fff; font-size: 11px; font-weight: var(--weight-strong); line-height: 18px; text-align: center;
}
.sidenav__count[hidden] { display: none; }
@media (min-width: 1024px) {
  [data-sidebar="collapsed"] .sidenav__count { position: absolute; top: 4px; right: 6px; min-width: 16px; padding: 0 4px; font-size: 10px; line-height: 16px; }
}

/* The approval request panel. */
.panel-head__sub { margin-top: var(--space-1); color: var(--text-muted); font-size: var(--text-md); }
.request-status {
  display: grid; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-lg);
  background: var(--surface-sunken); border: 1px solid var(--border);
}
.request-status--pending { border-color: var(--status-internal_review-line); }
.request-status--changes_requested { border-color: var(--status-waiting_client-line); }
.request-status--approved { border-color: var(--status-done-line); }
.request-status--rejected { border-color: var(--danger); }
.request-status__summary { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0; font-size: var(--text-lg); }
.request-status__summary > .icon { width: 18px; height: 18px; color: var(--text-muted); }
.request-status__note { margin: 0; font-size: var(--text-md); }
.request-people-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--space-2) var(--space-4); margin: 0; }
.request-people-list dt { color: var(--text-muted); font-size: var(--text-xs); }
.request-people-list dd { display: flex; align-items: center; gap: var(--space-2); margin: 2px 0 0; font-size: var(--text-md); }
.request-warning { display: inline; margin: 0; }
.request-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-2); }
.request-actions:empty { display: none; }
.request-actions form { margin: 0; }
.request-more > summary { list-style: none; }
.request-more > summary::-webkit-details-marker { display: none; }
.request-more[open] { flex-basis: 100%; }
.request-more__form { display: grid; gap: var(--space-2); max-width: 460px; margin-top: var(--space-2); }
.request-more__form label { font-size: var(--text-sm); color: var(--text-muted); }
.request-more__form .btn { justify-self: start; }
/* A request's next step: fields only that step uses, shown when it's chosen. */
.step-field { display: grid; gap: var(--space-2); }
.step-field .field__help { margin-top: 0; }
.step-field__note { margin: 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--status-waiting_client-bg); color: var(--status-waiting_client-text); font-size: var(--text-sm); line-height: 1.5; }
.decision-form { display: grid; gap: var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--border); }
.decision-form__title { margin: 0; font-size: var(--text-base); }
.decision-form label { font-size: var(--text-sm); color: var(--text-muted); }
.decision-form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.decision-form__reject { margin-left: auto; }
.request-text { margin: 0 0 var(--space-2); font-size: var(--text-md); }
.request-linked { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-2); }
.request-snapshot { margin: var(--space-2) 0; }
.request-snapshot > summary { color: var(--link); font-size: var(--text-sm); cursor: pointer; }
.request-snapshot[open] > summary { margin-bottom: var(--space-2); }
.request-changed {
  display: flex; align-items: flex-start; gap: var(--space-2); margin: var(--space-2) 0; padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md); background: var(--status-waiting_client-bg); color: var(--status-waiting_client-text); font-size: var(--text-sm);
}
.request-changed .icon { flex: none; width: 16px; height: 16px; margin-top: 1px; }
.link-list__url { display: block; font-size: var(--text-xs); overflow-wrap: anywhere; }
.request-history { display: grid; gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.request-event { padding-left: var(--space-3); border-left: 2px solid var(--border); }
.request-event--approved { border-left-color: var(--done-solid); }
.request-event--changes_requested { border-left-color: var(--changes-solid); }
.request-event--rejected, .request-event--cancelled { border-left-color: var(--danger-solid); }
.request-event--submitted, .request-event--resubmitted { border-left-color: var(--status-internal_review-text); }
.request-event__line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--space-2); margin: 0; font-size: var(--text-md); }
.request-event__line .avatar { width: 22px; height: 22px; font-size: 9px; }
.request-event__move { margin: 2px 0 0; color: var(--text-muted); font-size: var(--text-sm); }
.request-event__comment { margin: var(--space-2) 0 0; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--surface-sunken); font-size: var(--text-md); }
.request-version { padding: var(--space-2) 0; border-top: 1px solid var(--border); }
.request-version h4 { margin: 0 0 4px; font-size: var(--text-md); }
.request-version__title { margin: 0 0 4px; font-weight: var(--weight-strong); }
.form-more { margin: var(--space-2) 0 var(--space-3); }
.form-more > summary { color: var(--link); font-size: var(--text-md); cursor: pointer; }
.form-more > summary .muted { font-size: var(--text-sm); }
.form-more__body { margin-top: var(--space-3); }
.btn--quiet { background: none; border-color: transparent; box-shadow: none; }
.btn--quiet:hover { background: var(--surface-sunken); }

/* A studio task's approvals, in its panel. */
.panel-section__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-2); }
.panel-section__head h3 { margin: 0; }
.request-mini { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.request-mini__item { display: flex; align-items: center; gap: var(--space-2); }
.request-mini__text { display: flex; flex-direction: column; flex: 1; min-width: 0; font-size: var(--text-md); }
.request-mini__text .muted { font-size: var(--text-sm); }

/* Setting up Studio Tasks, and its archived sections. */
.setup-card p { font-size: var(--text-md); }
.setup-pick { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); margin: var(--space-4) 0; }
.setup-pick .field { flex: 1 1 260px; margin: 0; }
/* The note sits under the row, so the button lines up with the menu, not with the note. */
.setup-pick__help { flex-basis: 100%; margin: calc(var(--space-2) * -1) 0 0; }
.setup-summary { margin: var(--space-4) 0; padding: var(--space-4); border-radius: var(--radius-lg); background: var(--surface-sunken); border: 1px solid var(--border); }
.setup-summary__list { margin: var(--space-2) 0 var(--space-3); padding-left: 1.2em; font-size: var(--text-md); }
.setup-empty { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.button-row--center { justify-content: center; }
.archived-sections { margin: 0; padding: 0; list-style: none; }
.archived-section { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); }
.archived-section:first-child { border-top: 0; }
.archived-section__text { display: grid; gap: 2px; min-width: 0; }
.archived-section__name { font-weight: var(--weight-strong); overflow-wrap: anywhere; }
.archived-section .muted { font-size: var(--text-sm); }

@media (max-width: 640px) {
  .studio-head { align-items: flex-start; }
  .studio-head__actions { width: 100%; }
  .studio-head__actions > .btn { flex: 1 1 auto; }
  .quick-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--space-4) * -1); padding: 2px var(--space-4); }
  .quick-filters::-webkit-scrollbar { display: none; }
  .filters.studio-filters { display: grid; grid-template-columns: minmax(0, 1fr); }
  .studio-filters__row { display: flex; }
  .studio-filters__row .filters__field--grow { flex-basis: 100%; }
  .filter-more > .filter-more__panel { grid-template-columns: minmax(0, 1fr); }
  .list-section__hint { display: none; }
  .decision-form__reject { margin-left: 0; }
}

/* An approval's indicator sits at the left edge of its row or card, so its tooltip opens
   to the right of it instead of centred, where it would be cut off. */
.request-box[data-tooltip]::after { left: -4px; transform: translate(0, 3px); }
.request-box[data-tooltip]:hover::after { transform: translate(0, 0); }
/* In a list row, an approval's people, review date and state read at the same size as a
   task's assignees, dates and status beside them. */
.task-row--request .request-people { gap: 5px; font-size: var(--text-md); }
.task-row--request .request-people .avatar { width: 26px; height: 26px; font-size: 10.5px; }
.task-row--request .request-people__names { margin-left: 6px; color: var(--text); }
.task-row--request .task-dates--none { font-size: var(--text-md); }
.task-row--request .task-row__status .chip { padding: 4px 12px; font-size: var(--text-sm); }

/* Breathing room at the sides of lists: rows, their headings, add boxes and section heads
   sit further in from the card's edges, with the drag handle centred in the gap at the
   left. Phones keep the tighter inset, where the width is needed for the work itself. */
:root { --row-inset: var(--space-6); }
@media (max-width: 640px) { :root { --row-inset: var(--space-4); } }
.task-rows__head, .task-row, .composer--row, .project-rows__head, .project-row,
.list-section__empty, .archived-section { padding-inline: var(--row-inset); }
/* The add row's own composer carries the inset; the row around it adds none, so its
   controls stay level with the columns above. */
.task-row.task-row--add { padding-inline: 0; }
.list-section__head { padding-inline: calc(var(--row-inset) - var(--space-2)) calc(var(--row-inset) - var(--space-3)); }
.card__head { padding-inline: var(--row-inset); }
.drag-handle { left: max(0px, calc((var(--row-inset) - 20px) / 2)); }

/* Client Portal and Clients. Built from the same tokens and components as the workspace. */
.label {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: var(--radius-pill);
  font-size: var(--text-xs); font-weight: var(--weight-strong); line-height: 18px; white-space: nowrap; vertical-align: middle;
}
.label .icon { width: 12px; height: 12px; }
.label--shared { background: var(--status-done-bg); color: var(--status-done-text); }
.label--internal { background: var(--status-todo-bg); color: var(--status-todo-text); }
.label--off { background: var(--surface-sunken); color: var(--text-muted); }
.btn--shared { border-color: var(--status-done-text); color: var(--status-done-text); }
.btn--shared:hover { background: var(--status-done-bg); color: var(--status-done-text); }
/* TinyWoolf-only boxes: a fine dashed edge. A card that is one drops its rim light, which
   would sit on the dashes; a box inside a card (the update composer) gets a dashed rule
   and a faint tint instead of a second frame. */
.internal-box { border: 1px dashed var(--border-strong); }
.card.internal-box::after { display: none; }
.card .internal-box:not(.card) { border: 0; border-top: 1px dashed var(--border-strong); background: var(--surface-sunken); }
.internal-box > .label { margin-bottom: var(--space-2); }

.preview-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); border: 1px dashed var(--primary);
  background: var(--primary-tint); color: var(--text);
}
.preview-banner p { flex: 1 1 280px; margin: 0; font-size: var(--text-md); }
.preview-banner > .icon { width: 18px; height: 18px; color: var(--link); }
.banner--info { justify-content: flex-start; background: var(--status-in_progress-bg); color: var(--status-in_progress-text); }
.banner--info a { color: inherit; font-weight: var(--weight-strong); }
.banner p { margin: 0; }

/* One rhythm on Client Portal and Clients pages: cards sit --card-gap apart (16px, the
   workspace's own card gap, as on the Overview), and text inside every card starts on
   the same line as the list rows (--row-inset). */
:root { --card-gap: var(--space-4); }
/* Cards inside a live region (the Clients list) keep the same gap as the page's own. */
:is(.page--portal, .page--clients) > :is(.card, .portal-grid, .thread-columns, .empty-state),
:is(.page--portal, .page--clients) > [data-live-region] > :is(.card, .portal-grid, .thread-columns, .empty-state) { margin-bottom: var(--card-gap); }
.portal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--card-gap); margin-bottom: var(--card-gap); }
.portal-card h2, .portal-section h2 { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); font-size: var(--text-lg); }
.portal-section .card__head h2 { margin: 0; font-size: var(--text-base); }
/* Something waits for the client's decision: the card glows like an urgent Board card. */
.portal-card--alert {
  background: var(--neon-urgent-fill), var(--glass-sheen), var(--glass-fill-strong);
  border-color: var(--neon-urgent-rim); box-shadow: var(--neon-urgent-glow), var(--shadow-card);
}
/* On the glow, the count is solid, like the sidebar's, so it still reads in dark mode. */
.portal-card--alert .count--alert { background: var(--danger-solid); color: #FFFFFF; font-weight: var(--weight-strong); }
.portal-section { margin-bottom: var(--card-gap); }
.portal-section-actions { justify-content: flex-end; margin-bottom: var(--space-3); }
.portal-item { display: flex; flex-direction: column; gap: 2px; margin: 0 0 var(--space-2); font-size: var(--text-md); }
.portal-item .muted { font-size: var(--text-sm); }
.portal-big { margin: 0 0 var(--space-1); font-size: var(--text-lg); font-weight: var(--weight-strong); }
.portal-excerpt { margin: var(--space-1) 0 0; color: var(--text-secondary); font-size: var(--text-md); }
.portal-phase { display: flex; align-items: center; gap: var(--space-2); margin: 0; }
.card__pad-inline { padding: var(--space-3) var(--row-inset); margin: 0; }
.portal-add { border-top: 1px solid var(--border); }
.portal-rows { margin: 0; padding: 0; list-style: none; }
.portal-row {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3);
  min-height: 52px; padding: var(--space-3) var(--row-inset); border-top: 1px solid var(--border); font-size: var(--text-md);
}
.portal-rows > .portal-row:first-child { border-top: 0; }
.portal-row:hover { background: var(--surface-hover); }
/* A row title reads as text, not as a blue underlined link; the link shows on hover.
   With .stretched the whole row is the link, so hovering anywhere on the row shows it. */
.portal-row > a:first-child, .portal-row__title { color: var(--text); font-weight: var(--weight-strong); text-decoration: none; overflow-wrap: anywhere; }
.portal-row > a:first-child:hover, .portal-row__title:hover, .portal-row:hover .portal-row__title.stretched { color: var(--link); text-decoration: underline; }
.portal-row .muted { font-size: var(--text-sm); }
.portal-row__main { display: flex; flex: 1 1 260px; flex-direction: column; gap: 2px; min-width: 0; }
.portal-row form { margin: 0; }
.portal-row--manage .request-more[open] { flex-basis: 100%; }
.portal-row.is-inactive { opacity: 0.65; }
/* A completed project: a green chip, and a quieter row below the ones in progress. */
.chip--completed { display: inline-flex; align-items: center; gap: 4px; background: var(--status-done-bg); color: var(--status-done-text); }
.chip--completed .icon { width: 14px; height: 14px; }
.portal-row--completed .portal-row__title, .portal-row--completed > a:first-child { color: var(--text-secondary); font-weight: var(--weight-regular); }
.project-complete, .partnership-remove { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--border); }
.project-complete p, .partnership-remove p { margin: 0; }
.portal-team__eyebrow { color: var(--text-muted); font-size: var(--text-xs); font-weight: var(--weight-strong); letter-spacing: 0.08em; text-transform: uppercase; }
.portal-section.portal-team > .portal-team__eyebrow { margin-bottom: calc(-1 * var(--space-1)); }
.portal-team__note { color: var(--text-secondary); font-size: var(--text-md); line-height: 1.5; }
.portal-contacts { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; font-size: var(--text-md); }
.portal-contacts li { display: flex; align-items: center; gap: var(--space-2); }
/* A client's account page: the person up top, what their access lets them do, then
   signing in, one setting per row with its button on the right. */
.card--pad.portal-section.account-profile { flex-direction: row; align-items: center; gap: var(--space-4); }
.account-profile > .avatar { width: 56px; height: 56px; font-size: 18px; }
.account-profile__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.account-profile__text h2 { margin-bottom: 2px; font-size: var(--text-xl); overflow-wrap: anywhere; }
.account-profile__text p { color: var(--text-secondary); font-size: var(--text-md); overflow-wrap: anywhere; }
.account-profile__text p.muted { color: var(--text-muted); font-size: var(--text-sm); }
.account-heading { display: flex; align-items: center; gap: var(--space-2); }
.account-heading .chip { font-family: var(--font-body); }
.chip--access-collaborator { background: var(--status-in_progress-bg); color: var(--status-in_progress-text); }
.account-perms { display: grid; gap: var(--space-2); font-size: var(--text-md); }
.account-perms li { display: flex; align-items: flex-start; gap: var(--space-2); line-height: 1.4; }
.account-perms .icon { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--done-solid); }
.account-perms .is-locked { color: var(--text-muted); }
.account-perms .is-locked .icon { color: var(--text-muted); }
.account-rows { align-self: stretch; }
.account-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4);
  padding: var(--space-3) 0; border-top: 1px solid var(--border);
}
.account-row:first-child { padding-top: var(--space-1); border-top: 0; }
.account-row:last-child { padding-bottom: 0; }
.account-row form { margin: 0; }
.account-row__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.account-row__label { font-size: var(--text-md); font-weight: var(--weight-strong); }
.account-row__value { color: var(--text-secondary); font-size: var(--text-md); overflow-wrap: anywhere; }
.account-row__help { color: var(--text-muted); font-size: var(--text-sm); }
.version-open { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.version-open .field__help { flex-basis: 100%; margin: 0; }
.deliverable-block { padding: var(--space-3) 0 0; border-top: 1px solid var(--border); }
.deliverable-block:first-of-type { border-top: 0; }
.deliverable-block > .muted { padding: 0 var(--row-inset); }
.deliverable-block__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); padding: 0 var(--row-inset); }
.deliverable-block__head > h3 { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); min-width: 0; font-size: var(--text-base); }
.deliverable-block__head form { margin: 0; }
/* A small square button with only an icon, such as Delete on a row of the client page. */
.btn--icon { width: var(--control-h-sm); padding: 0; justify-content: center; flex: none; }

/* "Hide from the client" under the task form, for a client project. */
.client-visibility { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.client-visibility .check-row span { display: inline-flex; align-items: center; gap: var(--space-2); }
.client-visibility .field__help { margin-top: var(--space-1); }

.hidden-flag { position: relative; z-index: 1; display: inline-flex; vertical-align: -3px; margin-left: var(--space-1); color: var(--text-muted); }
.hidden-flag .icon { width: 15px; height: 15px; }

/* A project's tasks in the client portal, read-only (portal/plan/). */
.portal-plan { margin-bottom: var(--card-gap); scroll-margin-top: var(--space-4); }
.portal-plan__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.portal-plan__head h2 { font-size: var(--text-lg); }
.portal-plan__head .muted { margin-top: var(--space-1); font-size: var(--text-sm); }
.portal-plan .list-section + .list-section, .portal-plan .timeline-group { margin-top: var(--space-4); }
.portal-plan .empty-inline { padding: var(--space-5) var(--row-inset); border: 1px dashed var(--border); border-radius: var(--radius-lg); }
/* The done mark in place of the tick: shows the state, can't be clicked. */
.plan-tick {
  display: inline-grid; place-content: center; flex: none; width: 20px; height: 20px; margin-top: 1px;
  border: 1.5px solid var(--border-strong); border-radius: 50%;
}
.plan-tick.is-done { background: var(--done-solid); border-color: var(--done-solid); color: #fff; }
.plan-tick .icon { width: 12px; height: 12px; }
/* Deeper headings than the studio's board uses: same look, without the browser's margins. */
.portal-plan h4, .portal-plan h5 { margin: 0; font-weight: inherit; }
.portal-plan .board-card__head .plan-tick { margin-top: 0; }
/* A task's details for the client, in the side panel or on its own page. */
.portal-task__people { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.portal-task__description { font-size: var(--text-md); line-height: 1.6; overflow-wrap: anywhere; }
.portal-task__progress { margin-left: var(--space-2); font-family: var(--font-body); font-size: var(--text-sm); font-weight: var(--weight-regular); }
.portal-checklist { display: grid; gap: var(--space-2); }
.portal-checklist__item { display: flex; align-items: flex-start; gap: var(--space-2); font-size: var(--text-md); }
.portal-checklist__item.is-done .portal-checklist__text { color: var(--text-muted); text-decoration: line-through; }
.portal-task__empty, .portal-task__note { margin-top: var(--space-4); }
.portal-task-page { max-width: 760px; }

.timeline-list { margin: 0; padding: var(--space-3) var(--row-inset); list-style: none; }
.timeline-list__item { position: relative; display: flex; gap: var(--space-3); padding-bottom: var(--space-4); }
.timeline-list__item:last-child { padding-bottom: 0; }
.timeline-list__item::before { content: ""; position: absolute; left: 6px; top: 16px; bottom: 0; width: 2px; background: var(--border); }
.timeline-list__item:last-child::before { display: none; }
.timeline-list__dot { flex: none; width: 14px; height: 14px; margin-top: 3px; border: 2px solid var(--primary); border-radius: 50%; background: var(--surface); }
.timeline-list__item.is-done .timeline-list__dot { background: var(--done-solid); border-color: var(--done-solid); }
.timeline-list__title { margin: 0; font-weight: var(--weight-strong); }
.timeline-list__text p { margin: 0 0 2px; }

.chip--large { padding: 4px 12px; font-size: var(--text-sm); }
.chip--client-draft, .chip--client-cancelled, .chip--partnership-draft, .chip--partnership-ended { background: var(--status-todo-bg); color: var(--status-todo-text); }
.chip--client-pending, .chip--request-awaiting_review { background: var(--status-internal_review-bg); color: var(--status-internal_review-text); }
.chip--client-changes_requested, .chip--request-needs_info, .chip--partnership-paused { background: var(--status-waiting_client-bg); color: var(--status-waiting_client-text); }
.chip--client-approved, .chip--request-completed, .chip--partnership-active { background: var(--status-done-bg); color: var(--status-done-text); }
.chip--request-submitted, .chip--request-queued { background: var(--status-todo-bg); color: var(--status-todo-text); }
.chip--request-in_progress { background: var(--status-in_progress-bg); color: var(--status-in_progress-text); }

.thread-columns { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--card-gap); align-items: start; }
.thread-columns > .card { margin: 0; }
.thread__heading { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--text-lg); margin-bottom: var(--space-3); }
.comment--studio { border-left: 2px solid var(--primary); padding-left: var(--space-3); }
.comment-form__label { display: block; margin-bottom: 6px; font-size: var(--text-sm); color: var(--text-muted); }
.comment-form .field__help .icon { width: 13px; height: 13px; vertical-align: -2px; }
.thread__copy { margin-top: var(--space-1); }
.thread__copy > summary { list-style: none; display: inline; }
.thread__copy > summary::-webkit-details-marker { display: none; }

.client-tabs { margin-bottom: var(--space-3); }
/* Admins put clients in the studio's order by the handle at the left, and move, hide or
   show them from the menu at the right, which stays at the end of the row as it wraps. */
.portal-row--client .drag-handle { top: 50%; margin-top: -14px; }
.portal-row__menu { display: flex; order: 1; margin-left: auto; }
.section-menu__divided { margin-top: var(--space-1); padding-top: var(--space-1); border-top: 1px solid var(--border); }
.client-logo { width: 36px; height: 36px; margin-right: var(--space-2); border-radius: var(--radius-md); object-fit: contain; vertical-align: middle; background: var(--surface); }
.client-logo--large { width: 80px; height: 80px; margin: 0 0 var(--space-2); }
.sidenav__org { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-2); padding: 0 var(--space-3); color: var(--text-muted); font-size: var(--text-sm); font-weight: var(--weight-strong); }
.sidenav__org-logo { width: 28px; height: 28px; border-radius: var(--radius-sm); object-fit: contain; }
.filters__apply { align-self: flex-end; }
.decision-card { border-color: var(--status-internal_review-line); }

@media (max-width: 900px) {
  .thread-columns { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1023px) {
  [data-sidebar="collapsed"] .sidenav__org span { display: inline; }
}
/* The client's name above the portal's links keeps the width it has in the open sidebar,
   clipped by its row, so it never re-wraps while the sidebar moves: the row keeps one
   height and the links below stay put. Like the links' names, it goes at once when the
   sidebar collapses and fades in once there's room when it opens. */
@media (min-width: 1024px) {
  .sidenav__org { overflow: hidden; }
  .sidenav__org-logo { flex: none; }
  /* While the sidebar opens, the links are briefly wider than it: clip them rather than
     flash a sideways scrollbar. (The rail keeps overflow visible for its tooltips.) */
  .sidenav { overflow-x: hidden; }
  .sidenav__org span { flex: none; width: calc(var(--sidebar-w-open) - 48px); transition: opacity 0.2s var(--ease) 0.12s, visibility 0s; }
  .sidenav__org-logo + span { width: calc(var(--sidebar-w-open) - 84px); }
  [data-sidebar="collapsed"] .sidenav__org span { opacity: 0; visibility: hidden; transition: none; }
}
@media (min-width: 1024px) and (prefers-reduced-motion: reduce) {
  .sidenav__org span { transition: none; }
}
.portal-card .empty-inline, .portal-section > .empty-inline { padding: 0; }
/* A note or empty message set inside a list card keeps the rows' inset. */
.portal-section > .card__pad-inline, .portal-rows > .card__pad-inline, .card > .card__pad-inline { padding: var(--space-3) var(--row-inset); }
.inline-form.portal-add { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.inline-form.portal-add input[type="text"] { flex: 1 1 260px; width: auto; }
.inline-form.portal-add input[type="date"] { flex: 0 1 190px; width: auto; }
.thread .empty-inline, .internal-box .empty-inline { padding: 0; }

/* Collapsing and expanding the sidebar keeps every icon exactly where it is, so only the
   width moves. Icons sit at one fixed inset (centred in the 72px rail), never re-centred;
   group headings keep their height and only fade, so nothing below them jumps up or down;
   the account avatar keeps its inset; and the theme switch rides the right edge as the
   sidebar narrows, ending centred in the rail. */
@media (min-width: 1024px) {
  :root { --rail-inset: 13px; }
  .sidenav__link { padding-left: var(--rail-inset); }
  [data-sidebar="collapsed"] .sidenav__link { justify-content: flex-start; padding: 0 0 0 var(--rail-inset); }

  .sidenav__heading { transition: color 0.15s var(--ease), opacity 0.2s var(--ease) 0.12s, visibility 0s; }
  [data-sidebar="collapsed"] .sidenav__heading {
    height: auto; margin: 0 0 var(--space-1); padding-block: 6px; overflow: visible;
    opacity: 0; visibility: hidden; transition: opacity 0.12s var(--ease), visibility 0s linear 0.12s;
  }
  [data-sidebar="collapsed"] .sidenav__group + .sidenav__group { margin-top: var(--space-4); padding-top: 0; border-top: 0; }
  /* In the rail, a short line stands where the next group's heading was. */
  .sidenav__group { position: relative; }
  .sidenav__group + .sidenav__group::before {
    content: ""; position: absolute; top: 14px; left: var(--rail-inset); width: 20px; height: 1px;
    background: var(--border-strong); opacity: 0; pointer-events: none; transition: opacity 0.12s var(--ease);
  }
  [data-sidebar="collapsed"] .sidenav__group + .sidenav__group::before { opacity: 1; transition: opacity 0.2s var(--ease) 0.12s; }

  [data-sidebar="collapsed"] .account-menu summary { justify-content: flex-start; padding-inline: 6px var(--space-2); }

  .sidebar__appearance { justify-content: flex-end; padding-right: 0; transition: padding-right 0.3s var(--ease); }
  .sidebar__appearance > span { margin-right: auto; }
  [data-sidebar="collapsed"] .sidebar__appearance { justify-content: flex-end; padding-left: 0; padding-right: 5px; }
  .theme-switch__track { transition: background-color 0.2s var(--ease), width 0.3s var(--ease), padding 0.3s var(--ease); }
}
@media (min-width: 1024px) and (prefers-reduced-motion: reduce) {
  .sidebar, body.has-sidebar, .sidebar__appearance, .theme-switch__track { transition: none; }
}

/* File pickers look like the app's small buttons, not the browser's default. */
input[type="file"] { max-width: 100%; color: var(--text-muted); font-size: var(--text-sm); }
input[type="file"]::file-selector-button {
  min-height: var(--control-h-sm); margin-right: var(--space-2); padding: 0 12px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-pill);
  background: var(--glass-sheen), var(--control-fill); box-shadow: var(--shadow-control);
  color: var(--text); font: inherit; font-size: var(--text-sm); cursor: pointer;
  transition: background-color 0.15s var(--ease);
}
input[type="file"]::file-selector-button:hover { background: var(--glass-sheen), var(--glass-bubble); }

/* The spacing rhythm, on every page:
   - a page's header to its content: 24px (16px on phones);
   - toolbar rows (views, filters, Add task, hints) and a toolbar to what it controls: 12px;
   - card to card, and between cards in a grid: 16px (--card-gap);
   - text in a card or list starts --row-inset (32px, 16px on phones) from its edge.
   The Board's columns and the calendar's days keep their tighter spacing: they're dense
   data, not cards. */
:root { --title-line: calc(var(--text-2xl) * 1.2); }
/* A header's controls sit centred on the title's line, so the title is in the same place
   on every page whatever is beside it: buttons and tabs, a small button, or a status chip. */
:is(.page-head, .studio-head) > :not(:first-child) { margin-top: calc((var(--title-line) - var(--control-h)) / 2); }
:is(.page-head, .studio-head) > .btn--small { margin-top: calc((var(--title-line) - var(--control-h-sm)) / 2); }
:is(.page-head, .studio-head) > .chip, .studio-head > .portal-phase { margin-top: calc((var(--title-line) - 20px) / 2); }
:is(.page-head, .studio-head) > .chip--large { margin-top: calc((var(--title-line) - 26px) / 2); }
@media (max-width: 640px) {
  /* On a phone a control may sit beside the title or wrap below it. It's pulled up to the
     title's line either way, and the row gap makes up for it, so a wrapped control still
     sits exactly 12px below the title. */
  :is(.page-head, .studio-head) { row-gap: calc(var(--space-3) - (var(--title-line) - var(--control-h)) / 2); }
  :is(.page-head, .studio-head) > :not(:first-child) { margin-top: calc((var(--title-line) - var(--control-h)) / 2); }
  /* The project's phase is a line of its own under the title. */
  .studio-head > .portal-phase { flex-basis: 100%; }
}
/* In a stacked region, a toolbar's own 12px leads into what follows it. */
.stack > :is(.cal-bar, .board-bar, .timeline-bar, .view-hint) + * { margin-top: 0; }
/* A field's control with its button beside it, the same height. */
.control-row { display: flex; gap: var(--space-2); align-items: center; }
.control-row > :is(select, input) { flex: 1 1 auto; min-width: 0; }
.control-row > .btn { flex: none; }
.card--pad > .field:last-child, .card--pad > form > .field:last-of-type { margin-bottom: 0; }
/* In a discussion or notes box, the composer stands apart from the messages (or the
   "nothing yet" line) above it. */
:is(.thread, .internal-box) > :is(.comments, .empty-inline) + .comment-form { margin-top: var(--space-4); }
.card-subform { margin-top: var(--space-3); }
/* A version's file or link always sits under its text, on the same left edge, whichever kind it is. */
.portal-row--version { flex-direction: column; align-items: flex-start; }
.portal-row--version > .portal-row__main { flex: none; align-self: stretch; }

/* Portal cards: one type scale and one rhythm. Card title (lg), then each item's main line
   (md, strong), its details (sm, muted) and any text (sm, readable line height). Pieces of a
   card are 8px apart, separate items 12px, and the title sits 12px above the first. */
:is(.portal-card, .card--pad.portal-section) { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
:is(.portal-card, .card--pad.portal-section) > * { margin-top: 0; margin-bottom: 0; max-width: 100%; }
:is(.portal-card, .card--pad.portal-section) > :is(h2, .card__head) { align-self: stretch; flex-wrap: nowrap; margin-bottom: var(--space-1); }
:is(.portal-card, .card--pad.portal-section) > :is(form, .field, .decision-form) { align-self: stretch; }
.portal-card h2 .count { flex: none; }
.portal-item { gap: var(--space-1); line-height: 1.4; }
.portal-item + .portal-item { margin-top: var(--space-1); }
.portal-item > a, .portal-big, .portal-big a { font-size: var(--text-md); font-weight: var(--weight-strong); }
.portal-big { margin: 0; }
:is(.portal-card, .card--pad.portal-section) > p.muted { font-size: var(--text-sm); line-height: 1.5; }
.portal-excerpt { margin: 0; font-size: var(--text-sm); line-height: 1.6; }
:is(.portal-card, .card--pad.portal-section) > p:not([class]) { line-height: 1.55; }
.version-open { row-gap: var(--space-2); }
:is(.portal-card, .card--pad.portal-section) > .link-button { margin-top: var(--space-1); }
/* The count sits at the card's top right, level with the title's first line, so counts
   line up from card to card and never drop onto a line of their own. */
.portal-card > h2 { display: flex; flex-wrap: nowrap; align-items: baseline; justify-content: space-between; gap: var(--space-3); }
.portal-card > h2 .count { display: inline-flex; flex: none; justify-content: center; margin: 0; }
.portal-card .empty-inline { color: var(--text-muted); font-size: var(--text-sm); }
/* Choosing a file is a quieter step than sending it: a dashed, flat picker beside a primary button. */
input[type="file"]::file-selector-button { border-style: dashed; background: var(--surface-sunken); box-shadow: none; }
input[type="file"]::file-selector-button:hover { background: var(--surface-hover); border-color: var(--text-muted); }
/* After sending a message, the page comes back to its discussion with room above it. */
#thread-heading, #notes-heading { scroll-margin-top: calc(var(--topbar-height) + var(--space-5)); }

/* "Write a task name" at the foot of a list is just the name until it's used (one opened
   by "+ Add task" shows everything at once). Click or type in it and
   Dates, People and Status slide in one after another; they stay while it has anything in it. */
.composer--row .composer__extras > .composer__status { grid-column: 4; grid-row: 1; justify-self: start; }
/* On a narrow list the columns stack, and a new task's status goes without saying. */
@container (max-width: 700px) { .composer--row .composer__extras > .composer__status { display: none; } }
.composer--row .composer__extras > * {
  transition: opacity 0.2s var(--ease), transform 0.24s var(--ease), visibility 0s;
}
.composer--row .composer__extras > .composer__assign { transition-delay: 0.04s; }
.composer--row .composer__extras > .composer__status { transition-delay: 0.08s; }
.composer--row:not([data-top-composer] *):not(:focus-within):not(:has(.composer__title:not(:placeholder-shown))):not(:has(.add-chip.has-value)):not(:has(details[open])) .composer__extras > * {
  opacity: 0; transform: translateX(-8px); visibility: hidden; pointer-events: none;
  transition: opacity 0.14s var(--ease), transform 0.14s var(--ease), visibility 0s linear 0.14s;
}
@media (prefers-reduced-motion: reduce) {
  .composer--row .composer__extras > * { transition: none !important; transform: none !important; }
}

/* The partnership offer, for a client without one: what's included, then the subscription
   as a blue card that stands out from the page. Inside it, a white panel with the billing
   periods and the price, then Speed up, the summary and the two actions on the blue. */
.portal-section .offer__headline { font-size: var(--text-xl); line-height: 1.25; }
.offer__benefits { display: grid; gap: var(--space-2); margin: var(--space-1) 0 0; padding: 0; list-style: none; font-size: var(--text-md); }
.offer__benefits li, .plan-speed__list li { display: flex; align-items: flex-start; gap: var(--space-2); }
.offer__benefits .icon { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--done-solid); }
.offer-special__eyebrow { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--status-in_progress-text); font-size: var(--text-xs); font-weight: var(--weight-strong); letter-spacing: 0.06em; text-transform: uppercase; }
.offer-special__eyebrow .icon { width: 16px; height: 16px; }

.plan-card {
  --plan-ink: #FFFFFF; --plan-ink-soft: rgba(255, 255, 255, 0.78); --plan-rule: rgba(255, 255, 255, 0.24);
  display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-2) var(--space-2) var(--space-5);
  border-radius: var(--radius-xl); color: var(--plan-ink);
  background: radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, 0.22), transparent 55%), linear-gradient(160deg, #4A76F0, #2447B3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 18px 40px -18px rgba(36, 71, 179, 0.7);
}
.plan-card > :not(.plan-card__panel) { margin-inline: var(--space-4); }
.plan-card__panel { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-5); border-radius: calc(var(--radius-xl) - 8px); background: var(--surface); color: var(--text); box-shadow: 0 6px 20px -10px rgba(10, 20, 60, 0.45); }
.plan-card__controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-3); }
.plan-tabs, .plan-currency { display: inline-flex; flex-wrap: wrap; gap: 2px; margin: 0; padding: 3px; border: 0; border-radius: var(--radius-pill); background: var(--surface-sunken); }
.plan-tabs label, .plan-currency label { position: relative; margin: 0; cursor: pointer; }
.plan-tabs input, .plan-currency input, .plan-switch input { position: absolute; opacity: 0; pointer-events: none; }
.plan-tabs span, .plan-currency span { display: block; padding: 7px 16px; border-radius: var(--radius-pill); color: var(--text-secondary); font-size: var(--text-md); font-weight: var(--weight-strong); transition: background 0.15s var(--ease), color 0.15s var(--ease); }
.plan-currency span { padding: 5px 12px; font-size: var(--text-sm); }
.plan-tabs input:checked + span, .plan-currency input:checked + span { background: var(--text); color: var(--surface-page); }
.plan-tabs input:focus-visible + span, .plan-currency input:focus-visible + span { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.plan-tabs label:hover span, .plan-currency label:hover span { color: var(--text); }
.plan-tabs input:checked + span:hover, .plan-currency input:checked + span:hover { color: var(--surface-page); }
.plan-card__lead { margin: 0; font-size: var(--text-lg); }
.plan-price { display: none; }
.plan-price__amount { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); margin: 0; line-height: 1.05; }
.plan-price__number { font-size: clamp(40px, 7vw, 64px); font-weight: 500; letter-spacing: -0.02em; }
.plan-price__unit { margin-left: calc(-1 * var(--space-3)); font-size: clamp(28px, 4.5vw, 44px); font-weight: 500; }
.plan-badge { padding: 3px 8px; border-radius: var(--radius-sm); background: var(--primary-tint); color: var(--status-in_progress-text); font-size: var(--text-sm); font-weight: var(--weight-strong); text-transform: uppercase; }
.plan-price__special { display: flex; align-items: center; gap: var(--space-1); margin: var(--space-2) 0 0; color: var(--status-in_progress-text); font-weight: var(--weight-strong); }
.plan-price__special .icon { width: 16px; height: 16px; }
.plan-price__note { margin: var(--space-1) 0 0; color: var(--text-muted); font-size: var(--text-sm); }
.plan-card__summary { margin: var(--space-2) 0 0; color: var(--text-secondary); font-size: var(--text-md); line-height: 1.55; }
.plan-speed { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); }
.plan-speed__ask { align-self: stretch; margin: 0; color: var(--plan-ink-soft); text-align: center; }
.plan-switch { display: inline-flex; align-items: center; gap: var(--space-3); cursor: pointer; font-size: var(--text-xl); font-weight: 500; }
.plan-switch__track { position: relative; flex: none; width: 56px; height: 32px; border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.28); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2); transition: background 0.2s var(--ease); }
.plan-switch__track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); transition: transform 0.2s var(--ease); }
.plan-switch input:checked + .plan-switch__track { background: #22B26B; }
.plan-switch input:checked + .plan-switch__track::after { transform: translateX(24px); }
.plan-switch input:focus-visible + .plan-switch__track { outline: 2px solid #FFFFFF; outline-offset: 3px; }
.plan-speed__list { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; font-size: var(--text-md); }
.plan-speed__list .icon { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.plan-summary { padding-top: var(--space-4); border-top: 1px solid var(--plan-rule); }
.plan-summary h3 { margin: 0 0 var(--space-2); font-size: var(--text-lg); font-weight: 500; }
.plan-summary__rows { display: none; margin: 0; }
.plan-summary__rows > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-1) var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--plan-rule); }
.plan-summary__rows dt { color: var(--plan-ink-soft); }
.plan-summary__rows dd { margin: 0; font-weight: var(--weight-strong); text-align: right; }
.plan-summary__total { border-bottom: 0 !important; font-size: var(--text-xl); }
.plan-summary__total dt { color: var(--plan-ink); font-weight: 500; }
.plan-summary__total dd { font-weight: 500; }
.plan-card:has(#period-weekly:checked):has(#currency-usd:checked) [data-period="weekly"][data-currency="usd"],
.plan-card:has(#period-weekly:checked):has(#currency-idr:checked) [data-period="weekly"][data-currency="idr"],
.plan-card:has(#period-monthly:checked):has(#currency-usd:checked) [data-period="monthly"][data-currency="usd"],
.plan-card:has(#period-monthly:checked):has(#currency-idr:checked) [data-period="monthly"][data-currency="idr"],
.plan-card:has(#period-quarterly:checked):has(#currency-usd:checked) [data-period="quarterly"][data-currency="usd"],
.plan-card:has(#period-quarterly:checked):has(#currency-idr:checked) [data-period="quarterly"][data-currency="idr"],
.plan-card:has(#period-yearly:checked):has(#currency-usd:checked) [data-period="yearly"][data-currency="usd"],
.plan-card:has(#period-yearly:checked):has(#currency-idr:checked) [data-period="yearly"][data-currency="idr"] { display: block; }
.plan-card:has(#speed-up:checked) [data-speed="0"],
.plan-card:not(:has(#speed-up:checked)) [data-speed="1"],
.plan-card:has(#currency-usd:checked) [data-currency-only="idr"],
.plan-card:has(#currency-idr:checked) [data-currency-only="usd"] { display: none !important; }
.plan-extra { color: var(--plan-ink); }
.plan-extra summary { cursor: pointer; color: var(--plan-ink-soft); font-size: var(--text-sm); text-decoration: underline; text-underline-offset: 3px; }
.plan-extra__fields { margin-top: var(--space-3); padding: var(--space-4); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); }
.plan-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.plan-cta { display: inline-flex; flex: 1 1 200px; align-items: center; justify-content: center; gap: var(--space-2); min-height: 48px; padding: 0 var(--space-5); border: 1px solid #FFFFFF; border-radius: var(--radius-pill); background: #FFFFFF; color: #1E3FA8; font: inherit; font-size: var(--text-md); font-weight: var(--weight-strong); cursor: pointer; transition: transform 0.15s var(--ease), background 0.15s var(--ease); }
.plan-cta:hover { background: #EEF2FF; }
.plan-cta:active { transform: translateY(1px); }
.plan-cta:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 3px; }
.plan-cta--quiet { border-color: rgba(255, 255, 255, 0.7); background: transparent; color: #FFFFFF; }
.plan-cta--quiet:hover { background: rgba(255, 255, 255, 0.12); }
.plan-cta .icon { width: 18px; height: 18px; }
.plan-card__fine { margin: 0; color: var(--plan-ink-soft); font-size: var(--text-sm); line-height: 1.5; }
@media (max-width: 560px) {
  .plan-card__panel { padding: var(--space-4); }
  .plan-tabs { width: 100%; justify-content: space-between; }
  .plan-tabs span { padding: 7px 10px; font-size: var(--text-sm); }
  .plan-switch { font-size: var(--text-lg); }
}
.offer-done { border-color: var(--status-done-line); }
.offer-done h2 .icon { color: var(--done-solid); }
.offer-done__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.offer-done__actions form { margin: 0; }
.plan-editing { display: flex; align-items: flex-start; gap: var(--space-2); }
.plan-editing .icon { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.offer-terms p { color: var(--text-muted); font-size: var(--text-sm); line-height: 1.6; }
.offer-teaser { flex-direction: row !important; flex-wrap: wrap; align-items: center !important; justify-content: space-between; }
.offer-teaser__text { display: flex; flex: 1 1 260px; flex-direction: column; gap: var(--space-1); }
.offer-teaser h2 { display: flex; align-items: center; gap: var(--space-2); margin: 0; font-size: var(--text-md); }
.offer-teaser h2 .icon { color: var(--primary); }
.offer-teaser p { margin: 0; font-size: var(--text-sm); }
.offer-prices { width: 100%; margin: var(--space-2) 0 0; border-collapse: collapse; font-size: var(--text-sm); }
.offer-prices th { padding: var(--space-2); border-bottom: 1px solid var(--border-strong); color: var(--text-muted); font-weight: var(--weight-strong); text-align: left; vertical-align: top; }
.offer-prices tbody th { color: var(--text); }
.offer-prices td { padding: var(--space-2); border-bottom: 1px solid var(--border); vertical-align: top; }
.offer-form h2 { margin-top: var(--space-5); }
/* TinyWoolf's side: a client's partnership enquiry. */
.enquiry { border-color: var(--status-in_progress-line); }
.enquiry h2 .icon { color: var(--primary); }
.enquiry__message { margin: 0; padding: var(--space-2) var(--space-3); border-left: 3px solid var(--status-in_progress-line); background: var(--surface-sunken); border-radius: var(--radius-sm); font-size: var(--text-md); }

/* Sidebar: Requests is locked until the client has a partnership. */
.sidenav__lock { display: inline-flex; margin-left: auto; color: var(--text-muted); }
.sidenav__link .sidenav__lock .icon { width: 14px; height: 14px; }
/* In the rail there's no room beside the label, so the lock becomes a small round badge
   on the icon's lower-right corner, ringed so it reads on any row background. */
@media (min-width: 1024px) {
  [data-sidebar="collapsed"] .sidenav__lock {
    position: absolute; top: 50%; left: 50%; align-items: center; justify-content: center;
    width: 16px; height: 16px; margin: 0; border-radius: 50%;
    background: var(--surface); box-shadow: 0 0 0 1px var(--border-strong);
    transform: translate(3px, 2px);
  }
  [data-sidebar="collapsed"] .sidenav__link .sidenav__lock .icon { width: 10px; height: 10px; stroke-width: 2.4; }
}

/* Requests, locked: what the partnership unlocks, and the way to it. */
.requests-locked { border-color: var(--status-in_progress-line); background: linear-gradient(160deg, var(--primary-tint), transparent 60%), var(--surface); }
.requests-locked__icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface); color: var(--primary); box-shadow: 0 0 0 1px var(--status-in_progress-line); }
.requests-locked__icon .icon { width: 20px; height: 20px; }
.portal-section.requests-locked > h2 { font-size: var(--text-xl); }
.portal-section.requests-locked > .requests-locked__lead { max-width: 62ch; color: var(--text-secondary); font-size: var(--text-md); line-height: 1.55; }
.requests-locked__points { display: grid; gap: var(--space-2); margin: 0; padding: 0; list-style: none; font-size: var(--text-md); }
.requests-locked__points li, .requests-locked__sent { display: flex; align-items: flex-start; gap: var(--space-2); }
.requests-locked__points .icon, .requests-locked__sent .icon { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--done-solid); }
.requests-locked__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-2) !important; }
.requests-locked__oneoff { display: flex; flex-direction: column; gap: var(--space-2); align-self: stretch; margin-top: var(--space-3) !important; padding-top: var(--space-4); border-top: 1px solid var(--border); }
.requests-locked__oneoff p { margin: 0; color: var(--text-secondary); font-size: var(--text-sm); }
.portal-subhead { margin: var(--space-2) 0 var(--space-3); color: var(--text-muted); font-size: var(--text-sm); font-weight: var(--weight-strong); }

/* The partnership: capacity first (a big count, then slots holding the requests in
   progress, then the queue), then what's included and the details as label and value. */
.pship-eyebrow { margin: 0; color: var(--text-muted); font-size: var(--text-xs) !important; font-weight: var(--weight-strong); letter-spacing: 0.06em; text-transform: uppercase; }
.pship-capacity__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-3); align-self: stretch; }
.pship-capacity__summary { display: flex; flex-direction: column; gap: var(--space-1); }
.pship-capacity__summary > * { margin: 0; }
.pship-capacity__count { line-height: 1; }
.pship-capacity__count strong { font-size: 48px; font-weight: 500; letter-spacing: -0.02em; }
.pship-capacity__count span { margin-left: 4px; color: var(--text-muted); font-size: var(--text-xl); }
.pship-capacity__state { color: var(--text-secondary); font-size: var(--text-md); }
.pship-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-2); align-self: stretch; margin: var(--space-2) 0 0 !important; padding: 0; list-style: none; }
.pship-slot { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); min-height: 92px; padding: var(--space-3) var(--space-4); border: 1px solid var(--border-strong); border-radius: var(--radius-md); }
.pship-slot--busy { border-left: 3px solid var(--status-in_progress-text); background: var(--surface-sunken); }
.pship-slot--awaiting_review { border-left-color: var(--status-internal_review-text); }
.pship-slot--free { border-style: dashed; color: var(--text-muted); }
.pship-slot__label { color: var(--text-muted); font-size: var(--text-xs); font-weight: var(--weight-strong); letter-spacing: 0.04em; text-transform: uppercase; }
.pship-slot__title { font-size: var(--text-md); font-weight: var(--weight-strong); overflow-wrap: anywhere; }
.pship-slot--free .pship-slot__title { font-weight: var(--weight-regular); }
.pship-queue { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); align-self: stretch; padding-top: var(--space-3); border-top: 1px solid var(--border); color: var(--text-secondary); font-size: var(--text-md); }
.pship-queue .icon { width: 18px; height: 18px; color: var(--text-muted); }
.pship-queue__link { margin-left: auto; font-size: var(--text-sm); font-weight: var(--weight-strong); }
.pship-how { align-self: stretch; color: var(--text-secondary); font-size: var(--text-sm); }
.pship-how summary { cursor: pointer; color: var(--text-muted); font-weight: var(--weight-strong); }
.pship-how ul { display: grid; gap: var(--space-2); margin: var(--space-3) 0 0; padding: 0; list-style: none; }
.pship-how li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); }
.pship-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--card-gap); align-items: start; margin-bottom: var(--card-gap); }
.pship-grid > .portal-section { margin-bottom: 0; }
@media (max-width: 860px) { .pship-grid { grid-template-columns: minmax(0, 1fr); } }
.pship-included__text { font-size: var(--text-md); line-height: 1.6; }
.pship-note { align-self: stretch; margin: var(--space-2) 0 0 !important; padding: var(--space-3) var(--space-4); border-left: 3px solid var(--status-in_progress-line); border-radius: var(--radius-sm); background: var(--surface-sunken); }
.pship-note blockquote { margin: 0; font-size: var(--text-md); line-height: 1.55; }
.pship-note figcaption { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); color: var(--text-muted); font-size: var(--text-sm); }
.pship-details { display: flex; flex-direction: column; align-self: stretch; margin: 0; }
.pship-details > div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-1) var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.pship-details > div:first-child { padding-top: 0; }
.pship-details > div:last-child { border-bottom: 0; padding-bottom: 0; }
.pship-details dt { color: var(--text-muted); font-size: var(--text-sm); }
.pship-details dd { margin: 0; font-size: var(--text-md); font-weight: var(--weight-strong); text-align: right; }
.pship-details__person { display: inline-flex; align-items: center; gap: var(--space-2); }

/* Confetti when a task is done: a burst from where the person clicked, over everything,
   never in the way of a click. */
.confetti-burst { position: fixed; z-index: 140; width: 360px; height: 360px; pointer-events: none; }
.confetti-burst svg { display: block; }

/* The studio cat, bottom right. It never blocks what's under it: only its small buttons
   take clicks. Tucked away, a paw in the corner brings it back. */
/* Raised clear of the footer's text (about 35px tall from the window's edge), which it would otherwise cover at the bottom of a page. */
.studio-pet { position: fixed; right: var(--space-4); bottom: var(--space-7); z-index: 30; pointer-events: none; }
.studio-pet.is-starting { visibility: hidden; }
.studio-pet__cat { position: relative; width: 84px; height: 86px; transition: opacity 0.2s var(--ease), transform 0.25s var(--ease); }
/* Flipped, so the cat faces into the page. */
.studio-pet__stage { width: 100%; height: 100%; transform: scaleX(-1); }
.studio-pet__stage svg { display: block; }
.studio-pet__hide, .studio-pet__show {
  display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--glass-rim); border-radius: 50%;
  background: var(--glass-fill-strong); color: var(--text-muted); box-shadow: var(--shadow-card); cursor: pointer; pointer-events: auto;
}
/* The cat sits low in its frame, so its button sits by its ear, not the frame's corner. */
.studio-pet__hide { position: absolute; top: 22%; right: -2px; width: 22px; height: 22px; opacity: 0.55; transition: opacity 0.15s var(--ease); }
.studio-pet__hide .icon { width: 12px; height: 12px; }
.studio-pet__hide:hover, .studio-pet__hide:focus-visible { opacity: 1; color: var(--text); }
.studio-pet__show { display: none; width: 36px; height: 36px; }
.studio-pet__show .icon { width: 18px; height: 18px; }
.studio-pet__show:hover, .studio-pet__show:focus-visible { color: var(--text); }
.studio-pet.is-tucked .studio-pet__cat { display: none; }
.studio-pet.is-tucked .studio-pet__show { display: inline-flex; }
@media (max-width: 640px) {
  .studio-pet { right: var(--space-2); }
  .studio-pet__cat { width: 60px; height: 62px; }
}
@media print { .studio-pet, .confetti-burst { display: none; } }

/* An organisation's header: its logo beside its name, and the people looking after it. */
.client-head__id { display: flex; align-items: center; gap: var(--space-4); min-width: 0; }
.client-head__logo {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 56px; height: 56px; overflow: hidden; border-radius: var(--radius-md);
}
/* The logo itself, no frame around it: a square logo fills the corner-rounded box. */
.client-head__logo img { width: 100%; height: 100%; object-fit: contain; }
.client-head__logo--initials { background: var(--surface-sunken); border: 1px solid var(--border); color: var(--text); font-family: var(--font-heading); font-size: 24px; }
.client-head__people { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); margin-top: var(--space-2); }
.client-head__label { color: var(--text-muted); font-size: var(--text-sm); }
.person-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 2px;
  border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface-hover);
  font-size: var(--text-sm); color: var(--text);
}
.person-pill .avatar { width: 22px; height: 22px; font-size: 9px; }
.person-pill__tag { padding: 0 6px; border-radius: var(--radius-pill); background: var(--surface-sunken); color: var(--text-muted); font-size: var(--text-xs); }
@media (max-width: 640px) {
  .client-head__id { gap: var(--space-3); align-items: flex-start; }
  .client-head__logo { width: 44px; height: 44px; }
}

/* A deactivated account's choices: bring it back, or delete it for good. */
.access-status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.access-actions { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.access-action { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); padding: var(--space-3) var(--space-4); }
.access-action + .access-action { border-top: 1px solid var(--border); }
.access-action__text { flex: 1 1 280px; min-width: 0; }
.access-action__text h3 { margin-bottom: 2px; }
.access-action form { margin: 0; }
.access-action--danger { background: color-mix(in srgb, var(--danger-tint) 35%, transparent); }
.access-action--danger h3 { color: var(--danger); }

/* An archived task's Restore and Delete, in place of its status. */
.archived-actions { display: inline-flex; align-items: center; gap: var(--space-1); }
.archived-actions__delete { width: var(--control-h-sm); padding: 0; justify-content: center; }
.banner__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.banner__actions form { margin: 0; }

/* Deleting an archived project: what goes with it, then its name typed back. */
.danger-zone { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.danger-zone__head { display: flex; align-items: flex-start; gap: var(--space-3); margin-bottom: var(--space-4); }
.danger-zone__icon {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%; background: var(--danger-tint); color: var(--danger);
}
.danger-zone__icon .icon { width: 20px; height: 20px; }
.danger-zone__title { font-size: var(--text-xl); margin-bottom: 4px; }
.danger-zone__label { font-size: var(--text-xs); color: var(--text-muted); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: var(--space-2); }
.danger-zone__list { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-4); padding-left: var(--space-4); list-style: disc; color: var(--text); }
.danger-zone__list li::marker { color: var(--danger); }
.danger-zone__form { padding-top: var(--space-4); border-top: 1px solid var(--border); }
.danger-zone__name { padding: 1px 6px; border-radius: var(--radius-sm); background: var(--surface-sunken); font-weight: var(--weight-strong); user-select: all; }
.danger-zone .btn--danger:disabled { opacity: 0.45; box-shadow: none; cursor: not-allowed; }

/* Studio Tasks access on a team member's page: in-house or freelance. */
.team-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-2); margin: 0 0 var(--space-3); padding: 0; border: 0; min-width: 0; }
.team-choice__option {
  display: flex; align-items: flex-start; gap: var(--space-2); padding: var(--space-3);
  border: 1px solid var(--border); border-radius: var(--radius-md); cursor: pointer;
  transition: border-color 0.12s var(--ease), background-color 0.12s var(--ease);
}
.team-choice__option:hover { background: var(--surface-hover); }
.team-choice__option:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary-tint) 25%, transparent); }
.team-choice__option input { margin-top: 3px; flex: none; }
.team-choice__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.team-choice__title { display: inline-flex; align-items: center; gap: 6px; font-weight: var(--weight-strong); }
.team-choice__title .icon { width: 16px; height: 16px; }
.team-choice__help { color: var(--text-muted); font-size: var(--text-sm); }

/* Deleted for good: who did it, and when. */
.deletion-log { margin-top: var(--card-gap); }
.deletion-log h2 { margin-bottom: var(--space-2); }
.deletion-log__icon { display: inline-flex; margin-right: 6px; color: var(--danger); vertical-align: -2px; }
.deletion-log__icon .icon { width: 14px; height: 14px; }
.deletion-log__by { color: var(--text-muted); font-size: var(--text-sm); padding-left: 20px; }

/* Deleting an organisation: what stays (its projects) is said plainly too. */
.danger-zone__keep { display: flex; align-items: flex-start; gap: var(--space-2); margin: calc(var(--space-2) * -1) 0 var(--space-4); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--surface-hover); color: var(--text-muted); font-size: var(--text-sm); }
.danger-zone__keep .icon { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--success, var(--text-muted)); }
.delete-card { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.delete-card h2 { color: var(--danger); margin-bottom: var(--space-2); }
.delete-card .muted { margin-bottom: var(--space-3); }

/* A task row's "Move between sections" menu (⇅): beside the title, shown on hover, on
   keyboard focus and while open; always on touch screens, which have no hover. */
.move-menu { margin-block: -6px; }
.move-menu__button { opacity: 0; transition: opacity 0.12s var(--ease); }
.task-row:hover .move-menu__button, .move-menu__button:focus-visible, .move-menu[open] .move-menu__button { opacity: 1; }
@media (hover: none) { .move-menu__button { opacity: 0.6; } }
.move-menu__panel { width: 260px; max-height: min(420px, 70vh); overflow-y: auto; }
.move-menu__title { margin: 0; padding: var(--space-1) var(--space-2) var(--space-2); color: var(--text-muted); font-size: var(--text-sm); font-weight: var(--weight-strong); }
.move-menu__item:disabled[aria-current] { opacity: 1; }
.move-menu__tick { display: inline-flex; flex: none; width: 16px; }
.move-menu__name { min-width: 0; overflow-wrap: anywhere; }
.move-menu__item--none { margin-top: var(--space-1); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-md) var(--radius-md); }
.move-menu__item--none .move-menu__name { color: var(--text-muted); }

/* The task form saves itself; this line says where that stands. */
.autosave-status { display: flex; align-items: center; gap: 6px; min-height: 24px; margin: 0; color: var(--text-muted); font-size: var(--text-sm); }
.autosave-status .icon { width: 15px; height: 15px; color: var(--done-solid); }
.autosave-status[data-state="error"] { color: var(--danger); }

/* A task's right-click menu (app.js, "Task right-click menu"): floating glass at the
   pointer, like the other menus, with "Convert to" opening its own list beside it. */
.task-menu, .task-menu__list--sub {
  padding: var(--space-2); border-radius: var(--radius-lg);
  background: var(--glass-sheen), var(--glass-fill-strong);
  border: 1px solid var(--glass-rim); box-shadow: var(--shadow-menu);
  -webkit-backdrop-filter: var(--glass-blur-strong); backdrop-filter: var(--glass-blur-strong);
}
.task-menu { position: fixed; z-index: 70; min-width: 230px; max-width: calc(100vw - 16px); animation: menu-rise 0.14s var(--ease); }
.task-menu[hidden], .task-menu__list--sub[hidden] { display: none; }
.task-menu:focus { outline: none; }
.task-menu__list { display: flex; flex-direction: column; }
.task-menu__item {
  display: flex; align-items: center; gap: var(--space-2); width: 100%; padding: 7px var(--space-2);
  background: none; border: 0; border-radius: var(--radius-md); color: var(--text);
  font: inherit; font-size: var(--text-md); text-align: left; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.task-menu__item .icon { flex: none; width: 16px; height: 16px; color: var(--text-muted); }
.task-menu__item:hover, .task-menu__item:focus-visible, .task-menu__item[aria-expanded="true"] { background: var(--surface-sunken); }
.task-menu__item:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.task-menu__item[aria-disabled="true"] { opacity: 0.5; cursor: default; }
.task-menu__item[aria-disabled="true"]:hover { background: none; }
/* The type a task already is: ticked, not dimmed. */
.task-menu__item[aria-checked="true"] { opacity: 1; }
.task-menu__item--danger, .task-menu__item--danger .icon { color: var(--danger); }
.task-menu__more, .task-menu__note { margin-left: auto; }
.task-menu__note { display: inline-flex; }
.task-menu__tick { display: inline-flex; flex: none; width: 16px; }
.task-menu__tick .icon { color: var(--text); }
.task-menu__sep { height: 1px; margin: var(--space-1) calc(var(--space-2) * -1); background: var(--border); }
.task-menu__sub { position: relative; }
.task-menu__list--sub { position: absolute; z-index: 1; left: calc(100% + var(--space-2)); top: calc(var(--space-2) * -1 - 1px); min-width: 180px; }
.task-menu__list--sub.opens-left { left: auto; right: calc(100% + var(--space-2)); }
.task-menu__list--sub.opens-below { left: var(--space-5); top: 100%; }
.task-menu__loading { margin: 0; padding: 7px var(--space-2); color: var(--text-muted); font-size: var(--text-sm); }
/* The task whose menu is open. */
.task-row.has-menu { background: var(--surface-hover); }
.board-card.has-menu, .has-menu:is(.gantt__bar, .cal-item, .tl-bar, .tl-marker) { box-shadow: 0 0 0 2px var(--focus-ring); }
.task-link.has-menu { border-radius: var(--radius-sm); background: var(--surface-hover); }
@media (prefers-reduced-motion: reduce) { .task-menu { animation: none; } }

/* Journal: the writing room for tinywoolf.com/journal. Its stages wear the task statuses'
   colours: Idea like To do, Writing like In progress, In review like internal review,
   Ready like waiting (it waits for the website), Published like done. */
.flash--warning { background: var(--status-waiting_client-bg); color: var(--status-waiting_client-text); }
.journal-summary { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; gap: var(--space-4); margin-bottom: var(--space-5); }
.journal-summary__card { display: grid; align-content: start; gap: var(--space-3); }
.journal-summary__main { display: grid; align-content: start; gap: var(--space-4); min-width: 0; }
/* "Want to be a Joournal contributor?" above Contributors, and the admins' list of who asked. */
.journal-invite { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-5); }
.journal-invite__text { flex: 1 1 320px; display: grid; gap: var(--space-1); }
.journal-invite__text p { margin: 0; }
.journal-invite__sent { display: flex; align-items: flex-start; gap: 6px; color: var(--status-done-text); }
.journal-invite__sent .icon { flex: none; margin-top: 2px; width: 16px; height: 16px; }
/* The Journal for a freelancer who isn't a contributor yet (journal/published.html). */
.journal-published { display: grid; gap: var(--space-4); max-width: 820px; }
.journal-live__list { display: grid; margin: var(--space-3) 0 0; padding: 0; list-style: none; }
.journal-live__item { display: grid; gap: 4px; padding: var(--space-4) 0; border-top: 1px solid var(--border); }
.journal-live__item:first-child { border-top: 0; padding-top: 0; }
.journal-live__item .journal-card__eyebrow { margin: 0; }
.journal-live__title { margin: 0; font-size: var(--text-lg); }
.journal-live__title a { color: var(--text); text-decoration: none; }
.journal-live__title a:hover { color: var(--link); text-decoration: underline; }
.journal-live__excerpt { margin: 0; color: var(--text-secondary); }
.journal-live__link { display: inline-flex; align-items: center; gap: 4px; width: fit-content; font-size: var(--text-sm); }
.journal-live__link .icon { width: 14px; height: 14px; }
.journal-requests { display: grid; margin: 0; padding: 0; list-style: none; }
.journal-request { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--border); }
.journal-request:first-child { border-top: 0; padding-top: 0; }
.journal-request__who { flex: 1 1 180px; display: grid; min-width: 0; }
.journal-request__who .muted { font-size: var(--text-sm); }
.journal-request__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.journal-summary__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.journal-summary__head h2 { font-size: var(--text-lg); }
.journal-agreement { display: grid; gap: 6px; padding-top: var(--space-3); border-top: 1px solid var(--border); }
.journal-summary__head + .journal-agreement { padding-top: 0; border-top: 0; }
.journal-agreement__who { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-md); }
.journal-agreement__who strong { font-weight: var(--weight-strong); }
.journal-agreement__pace { padding: 1px 8px; border-radius: var(--radius-pill); font-size: var(--text-xs); background: var(--status-done-bg); color: var(--status-done-text); }
.journal-agreement.is-behind .journal-agreement__pace { background: var(--status-waiting_client-bg); color: var(--status-waiting_client-text); }
.journal-agreement__edit { margin-left: auto; display: inline-flex; padding: 4px; border-radius: 50%; color: var(--text-muted); }
.journal-agreement__edit:hover { background: var(--surface-sunken); color: var(--text); }
.journal-agreement__edit .icon { width: 16px; height: 16px; }
.journal-agreement__count { font-size: var(--text-sm); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.journal-agreement__count strong { color: var(--text); font-size: var(--text-lg); font-weight: var(--weight-strong); }
.journal-agreement__bar { position: relative; height: 8px; border-radius: var(--radius-pill); background: var(--surface-sunken); }
.journal-agreement__fill { position: absolute; inset: 0 auto 0 0; width: var(--fill); border-radius: inherit; background: var(--status-done-text); }
.journal-agreement.is-behind .journal-agreement__fill { background: var(--status-waiting_client-text); }
.journal-agreement__mark { position: absolute; top: -3px; bottom: -3px; left: var(--mark); width: 2px; border-radius: 1px; background: var(--text-muted); }
.journal-agreement__dates { font-size: var(--text-xs); color: var(--text-muted); }
.journal-categories { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.journal-categories li { display: flex; justify-content: space-between; gap: var(--space-2); padding: 7px 0; font-size: var(--text-md); }
.journal-categories li + li { border-top: 1px solid var(--border); }
.journal-categories__count { color: var(--text-muted); font-size: var(--text-sm); font-variant-numeric: tabular-nums; white-space: nowrap; }
.journal-categories__count strong { color: var(--text); font-weight: var(--weight-strong); }

.journal-board-bar { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
.journal-board-bar a { font-size: var(--text-sm); }
.journal-board {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(196px, 1fr); gap: var(--space-3);
  overflow-x: auto; padding-bottom: var(--space-3); scroll-snap-type: x proximity;
}
.journal-col {
  display: flex; flex-direction: column; min-height: 320px; scroll-snap-align: start;
  background: var(--surface-column); border: 1px solid var(--status-todo-line); border-radius: var(--radius-lg);
}
.journal-col--writing { border-color: var(--status-in_progress-line); }
.journal-col--review { border-color: var(--status-internal_review-line); }
.journal-col--ready { border-color: var(--status-waiting_client-line); }
.journal-col--published { border-color: var(--status-done-line); }
.journal-col__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-3) var(--space-3) var(--space-1); }
.journal-col__head h2 { font-family: var(--font-body); font-size: var(--text-md); font-weight: var(--weight-strong); }
.journal-col__head .count { background: var(--surface); box-shadow: 0 0 0 1px var(--border); }
.journal-col__note { margin: 0 var(--space-3) var(--space-2); font-size: var(--text-xs); color: var(--text-muted); }
.journal-col__cards { display: grid; align-content: start; gap: var(--space-2); padding: var(--space-1) var(--space-2) var(--space-2); }
.journal-col__empty {
  display: flex; align-items: center; justify-content: center; min-height: 72px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-md); color: var(--text-muted); font-size: var(--text-sm);
}
.journal-dot--idea, .journal-dot--archived { background: var(--status-todo-text); }
.journal-dot--writing { background: var(--status-in_progress-text); }
.journal-dot--review { background: var(--status-internal_review-text); }
.journal-dot--ready { background: var(--status-waiting_client-text); }
.journal-dot--published { background: var(--status-done-text); }
.journal-chip--writing { background: var(--status-in_progress-bg); color: var(--status-in_progress-text); }
.journal-chip--review { background: var(--status-internal_review-bg); color: var(--status-internal_review-text); }
.journal-chip--ready { background: var(--status-waiting_client-bg); color: var(--status-waiting_client-text); }
.journal-chip--published { background: var(--status-done-bg); color: var(--status-done-text); }
.journal-card {
  position: relative; display: grid; gap: 6px; min-width: 0; padding: var(--space-3);
  background: var(--glass-sheen), var(--glass-fill-strong); border: 1px solid var(--glass-rim); border-radius: 14px;
  box-shadow: var(--shadow-card); transition: box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
}
.journal-card:hover { box-shadow: var(--shadow-raised); transform: translateY(-1px); }
.journal-card:focus-within { box-shadow: var(--shadow-raised); }
.journal-card__eyebrow { font-size: var(--text-xs); color: var(--text-muted); }
.journal-card__title { font-family: var(--font-body); font-size: var(--text-md); line-height: 1.4; overflow-wrap: anywhere; }
.journal-card__title a { color: var(--text); text-decoration: none; }
/* The whole card is the link's target; the link stays the one thing to tab to. */
.journal-card__title a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.journal-card__title a:hover { text-decoration: underline; }
.journal-card__foot { display: flex; align-items: center; gap: var(--space-2); padding-top: 6px; border-top: 1px solid var(--border); font-size: var(--text-sm); min-width: 0; }
.journal-card__who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.journal-card__comments { flex: none; margin-left: auto; padding: 0 7px; border-radius: var(--radius-pill); background: var(--surface-sunken); color: var(--text-muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }

.journal-entry-head__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); }
.journal-entry { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: var(--space-4); align-items: start; }
.journal-entry__main, .journal-entry__side { display: grid; gap: var(--space-4); min-width: 0; }
.journal-section-title { font-size: var(--text-lg); margin-bottom: var(--space-3); }
.journal-section-note { margin: calc(var(--space-2) * -1) 0 var(--space-3); font-size: var(--text-sm); }
.journal-editor { display: grid; gap: var(--space-4); }
.journal-editor__saved { margin-top: calc(var(--space-2) * -1); }
.journal-side h2 { font-size: var(--text-lg); margin-bottom: var(--space-3); display: flex; align-items: center; gap: var(--space-2); }
.journal-side > p { font-size: var(--text-sm); }
.journal-side > p + p, .journal-side > p + ul, .journal-side > ul + p { margin-top: var(--space-2); }
/* "Ideas, questions…" above the comment box, as far from it as a list of comments is. */
.journal-side > p + .comment-form { margin-top: var(--space-3); }
.journal-stage { display: flex; gap: var(--space-2); }
.journal-stage select { flex: 1; min-width: 0; }
.journal-stage-notes { display: grid; gap: 6px; margin: var(--space-3) 0 0; font-size: var(--text-xs); color: var(--text-muted); }
.journal-stage-notes div { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: var(--space-2); }
.journal-stage-notes dt { font-weight: var(--weight-strong); }
.journal-stage-notes dd { margin: 0; }
.journal-stage-notes .is-current { color: var(--text); }
.journal-address { font-size: var(--text-sm); overflow-wrap: anywhere; }
.journal-missing { margin: 0; padding-left: 1.2em; font-size: var(--text-md); }
.journal-missing li + li { margin-top: 2px; }
.journal-complete { display: flex; align-items: center; gap: var(--space-2); color: var(--status-done-text); font-size: var(--text-md); }
.journal-complete .icon { width: 16px; height: 16px; }
.journal-comment-delete { margin: 4px 0 0 34px; }
.journal-comment-delete .link-button { color: var(--text-muted); font-size: var(--text-xs); }
.journal-danger { margin-top: var(--space-1); }
.journal-publish { display: grid; gap: var(--space-2); margin-top: var(--space-3); }
.journal-sent { color: var(--text-muted); }
.journal-live { display: flex; align-items: center; gap: var(--space-2); color: var(--status-done-text); font-size: var(--text-md); }
.journal-live .icon { width: 16px; height: 16px; }
/* A note under one action, then the next action: set the pair apart. */
.journal-publish > .field__help + form { margin-top: var(--space-2); }
.journal-rebuild { display: grid; justify-items: start; gap: var(--space-2); margin-top: var(--space-2); }

.journal-story { display: grid; gap: var(--space-3); margin: 0 0 var(--space-3); padding: 0; list-style: none; counter-reset: none; }
.journal-block { padding: var(--space-3) var(--space-4) var(--space-1); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface-hover); scroll-margin-top: var(--space-6); }
.journal-block--image { border-style: dashed; }
.journal-block__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-2); }
.journal-block__kind { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); font-weight: var(--weight-strong); color: var(--text-muted); }
.journal-block__kind .icon { width: 16px; height: 16px; }
.journal-block__tools { display: inline-flex; gap: 2px; }
.journal-block__tools .icon-button:disabled { opacity: 0.35; cursor: default; background: none; }
.icon-button--danger:hover { color: var(--danger); background: var(--danger-tint); }
.journal-story__empty { margin-bottom: var(--space-3); color: var(--text-muted); font-size: var(--text-md); }
.journal-story__add .btn--primary { margin-left: auto; }

.journal-read .preserve-lines { font-size: var(--text-md); line-height: 1.55; }
.journal-preview { display: grid; gap: var(--space-3); font-size: var(--text-md); line-height: 1.6; }
.journal-preview h3 { margin-top: var(--space-2); font-size: var(--text-lg); }
.journal-preview__eyebrow { font-size: var(--text-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.journal-preview__excerpt { color: var(--text-muted); }
.journal-preview__image { margin: 0; padding: var(--space-3); border: 1px dashed var(--border-strong); border-radius: var(--radius-md); }
.journal-preview__path { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); overflow-wrap: anywhere; }
.journal-preview__path .icon { flex: none; width: 16px; height: 16px; color: var(--text-muted); }
.journal-preview__image figcaption { margin-top: 4px; font-size: var(--text-sm); color: var(--text-muted); }
.journal-preview__credits { padding-top: var(--space-3); border-top: 1px solid var(--border); }

@media (max-width: 1000px) {
  .journal-entry { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .journal-summary { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .journal-board { grid-auto-columns: minmax(78%, 1fr); }
  .journal-block { padding-inline: var(--space-3); }
}

/* Team's board: a card per person, founders on the first row, at most four to a row
   (accounts/team_list.html, _person_card.html). Both grids share their columns, so the
   founders' cards are the same size as everyone else's. */
.page-head__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.people-board {
  --board-gap: var(--space-4);
  display: grid; gap: var(--board-gap); margin: 0 0 var(--board-gap); padding: 0; list-style: none;
  grid-template-columns: repeat(auto-fill, minmax(max(148px, calc((100% - 3 * var(--board-gap)) / 4)), 1fr));
}
.people-board__divider { margin: var(--space-5) 0 calc(var(--space-5) + 2px); border: 0; border-top: 1px solid var(--border-strong); }
/* The photo rounds its own top corners, so the card needn't clip. */
.person-card {
  position: relative; display: flex; flex-direction: column; padding: 0;
  transition: box-shadow 0.18s var(--ease), transform 0.18s var(--ease);
}
.person-card:hover { box-shadow: var(--shadow-raised); transform: translateY(-1px); }
.person-card:has(a:focus-visible) { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.person-card a:focus-visible { outline: none; }
.person-card__photo {
  display: grid; place-items: center; aspect-ratio: 1 / 1; overflow: hidden;
  border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0;
}
.person-card__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.person-card__initials { font-size: clamp(32px, 4vw, 48px); font-weight: var(--weight-strong); letter-spacing: 0.02em; }
.person-card__body { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3) var(--space-4) var(--space-4); min-width: 0; }
.person-card__name { font-size: var(--text-lg); font-weight: var(--weight-strong); line-height: 1.3; overflow-wrap: anywhere; }
.person-card__name a { color: var(--text); text-decoration: none; }
.person-card__name .adgi-badge { margin-left: 6px; vertical-align: -3px; }
.person-card__title { color: var(--text-secondary); font-size: var(--text-md); }
.person-card__time {
  display: flex; align-items: center; gap: 6px; margin-top: var(--space-2); min-width: 0;
  color: var(--text-muted); font-size: var(--text-sm); font-variant-numeric: tabular-nums;
}
.person-card__time > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-card__time .icon { flex: none; width: 14px; height: 14px; }
@media (prefers-reduced-motion: reduce) { .person-card:hover { transform: none; } }
@media (max-width: 640px) { .people-board { --board-gap: var(--space-3); } }
@container (max-width: 210px) {
  .person-card__body { padding: var(--space-2) var(--space-3) var(--space-3); }
  .person-card__name { font-size: var(--text-md); }
  .person-card__title { font-size: var(--text-sm); }
  .person-card__place { display: none; }
}

/* A person's profile, in the side panel or on its own page (accounts/_profile.html). */
.profile__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.profile__head .eyebrow { margin: 0; }
.profile__photo {
  display: grid; place-items: center; width: min(240px, 100%); aspect-ratio: 1 / 1; overflow: hidden;
  border-radius: var(--radius-lg); box-shadow: 0 0 0 0.5px var(--border);
}
.profile__photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.profile__photo span { font-size: 64px; font-weight: var(--weight-strong); letter-spacing: 0.02em; }
.profile__name { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-4); }
.profile__name h2 { margin: 0; font-size: var(--text-xl); }
.profile__name h2:focus { outline: none; }
.profile__title { margin: 2px 0 0; color: var(--text-secondary); font-size: var(--text-md); }
.profile__facts { display: grid; gap: var(--space-3); margin: var(--space-4) 0 0; padding: var(--space-4) 0 0; border-top: 1px solid var(--border); list-style: none; font-size: var(--text-md); }
.profile__facts li { display: flex; align-items: flex-start; gap: var(--space-2); }
.profile__facts .icon, .profile__adgi { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--text-muted); }
.profile__adgi { border-radius: 4px; }
.profile__facts strong { font-weight: var(--weight-strong); font-variant-numeric: tabular-nums; }
.profile__meta { display: block; color: var(--text-muted); font-size: var(--text-sm); }
.profile__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-5); }
.portal-contacts .adgi-badge { margin-left: 6px; vertical-align: -4px; }

/* Profile photo crop (app.js): a square frame to place a new photo in before it's uploaded. */
.photo-crop {
  width: min(420px, calc(100vw - 2 * var(--space-4))); max-width: none; padding: var(--space-5);
  border: 1px solid var(--glass-rim); border-radius: var(--radius-xl); color: var(--text);
  background: var(--surface); box-shadow: var(--shadow-panel);
}
.photo-crop::backdrop { background: var(--backdrop); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.photo-crop__title { margin: 0; font-size: var(--text-lg); }
.photo-crop__note { margin: var(--space-1) 0 var(--space-4); color: var(--text-muted); font-size: var(--text-sm); }
.photo-crop__stage {
  position: relative; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; border-radius: var(--radius-lg);
  background: var(--surface-sunken); cursor: grab; touch-action: none; user-select: none;
}
.photo-crop__stage.is-dragging { cursor: grabbing; }
.photo-crop__image { position: absolute; top: 0; left: 0; max-width: none; transform-origin: 0 0; pointer-events: none; }
/* The circle small avatars cut: light on dark photos, with a faint dark edge for light ones. */
.photo-crop__ring {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.85), 0 0 0 1px rgba(0, 0, 0, 0.18);
}
.photo-crop__zoom { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-4); color: var(--text-muted); font-size: var(--text-sm); }
.photo-crop__zoom input { flex: 1; accent-color: var(--primary); }
.photo-crop .form-actions { margin-top: var(--space-4); }

/* "Joournal": the Journal's name as it's styled on its page and in the sidebar, the "oo" in
   italic. Read out as "Journal"; everywhere else it's spelled plainly. */
.journal-wordmark i { font-style: italic; }
/* The headings' font (Effra) barely leans its italic "o", so a heading's "oo" gets a little
   more slant; the sidebar's own italic already reads clearly. */
:is(h1, h2).journal-wordmark i, :is(h1, h2) .journal-wordmark i { display: inline-block; transform: skewX(-10deg); }
