@import url('tokens.css');

/* Portal-level tokens. tokens.css is generated by the design system, so overrides live here. */
:root {
  --text-muted: var(--ink-600);          /* ink-500 failed 4.5:1 on every surface */
  --red-600: #c2353a;
  --amber-400: #fdb022;
  --amber-700: #a15c07;
  --green-700: #0e7a48;
  --red-800: #9b2226;
  --text-danger: var(--red-600);
  --status-warning-text: var(--amber-700);
  --status-success-text: var(--green-700);
  --status-danger-text: var(--red-800);
  --brand-solid: var(--blue-600);        /* white text on blue-500 is only 4.17:1 */
  --brand-solid-hover: var(--blue-700);
  --surface-overlay: rgba(255, 255, 255, .82);
  --backdrop: rgba(26, 30, 39, .45);
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
  --dur-fast: 150ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--surface-page);
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3 { font-family: var(--font-display); color: var(--text-strong); letter-spacing: var(--tracking-tight); line-height: var(--leading-snug); margin: 0; font-weight: 600; }
a { color: var(--text-link); }
button { font: inherit; }
[hidden] { display: none !important; }
.icon { width: 18px; height: 18px; stroke-width: 1.9; flex: none; }
.muted { color: var(--text-muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  border: 1px solid transparent; border-radius: var(--radius-pill);
  padding: 10px 20px; font-weight: var(--fw-semibold); font-size: var(--text-sm);
  cursor: pointer; text-decoration: none; white-space: nowrap; -webkit-tap-highlight-color: transparent;
  transition-property: background-color, border-color, color, box-shadow, scale;
  transition-duration: var(--dur-fast); transition-timing-function: var(--ease-out);
}
.btn:not(:disabled):active { scale: .97; }
.btn:has(> svg:first-child) { padding-inline-start: 18px; }
.btn:has(> svg:last-child:not(:first-child)) { padding-inline-end: 18px; }
.btn-primary { background: var(--brand-solid); color: var(--on-brand); }
@media (hover: hover) { .btn-primary:hover { background: var(--brand-solid-hover); box-shadow: var(--shadow-brand); } }
.btn-primary:disabled { background: var(--ink-300); box-shadow: none; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--text-body); }
@media (hover: hover) { .btn-ghost:hover { background: var(--brand-subtle); color: var(--brand-active); } }
.btn-secondary { background: var(--surface-card); border-color: var(--border-default); color: var(--text-strong); }
@media (hover: hover) { .btn-secondary:hover { border-color: var(--brand); color: var(--brand-active); } }
.btn-block { width: 100%; padding: 13px 20px; font-size: var(--text-base); white-space: normal; text-align: center; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--space-4); }
.field label { font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--text-strong); }
.field .hint { font-size: var(--text-xs); color: var(--text-muted); }
.input, .textarea, .select {
  width: 100%; border: 1px solid var(--border-default); border-radius: var(--radius-md);
  background: var(--surface-card); color: var(--text-strong); padding: 11px 14px; font: inherit;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.textarea { min-height: 120px; resize: vertical; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--blue-100); }
.input:focus-visible, .textarea:focus-visible, .select:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 1px; }

/* ---------- Auth screens ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: var(--space-5) var(--space-4); }
.auth-card {
  width: 100%; max-width: 420px; background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-md); padding: var(--space-6);
}
.auth-card .logo { height: 34px; display: block; margin-bottom: var(--space-6); }
.auth-card h1 { font-size: var(--text-2xl); margin-bottom: var(--space-2); }
.auth-card p.lead { margin: 0 0 var(--space-5); color: var(--text-body); }
.auth-foot { margin-top: var(--space-5); font-size: var(--text-xs); color: var(--text-muted); text-align: center; }
.notice { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-4); border-radius: var(--radius-md); background: var(--brand-subtle); color: var(--blue-800); font-size: var(--text-sm); margin-bottom: var(--space-4); }
.notice.error { background: var(--red-50); color: var(--status-danger-text); }
.notice .icon { margin-top: 2px; }

/* ---------- App shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10; background: var(--surface-overlay);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 12px var(--space-4); display: flex; align-items: center; gap: var(--space-4); }
.topbar .logo { height: 28px; display: block; }
.topbar .spacer { flex: 1; }
.client-pill { font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--text-strong); padding: 2px 0 2px var(--space-4); border-left: 1px solid var(--border-subtle); }
.me { display: flex; align-items: center; gap: var(--space-2); }
.me .name { font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--text-strong); }

main.page:focus { outline: none; }
main.page { max-width: 1120px; margin: 0 auto; padding: var(--space-6) var(--space-4) var(--space-10); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-6); }
.page-head h1 { font-size: var(--text-3xl); }
.page-head p { margin: var(--space-2) 0 0; }
.section-title { font-size: var(--text-lg); margin: var(--space-8) 0 var(--space-4); display: flex; align-items: center; gap: var(--space-2); }
.section-title .count { font-family: var(--font-sans); font-size: var(--text-xs); font-weight: var(--fw-bold); color: var(--text-muted); background: var(--surface-sunken); border-radius: var(--radius-pill); padding: 2px 9px; }

/* ---------- Cards ---------- */
.card { background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: var(--space-5); }
.project-card { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-4); text-decoration: none; color: inherit; transition: box-shadow var(--dur-fast) var(--ease-out); }
@media (hover: hover) { .project-card:hover { box-shadow: var(--shadow-lg); } }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .project-card { transition-property: box-shadow, translate; }
  .project-card:hover { translate: 0 -2px; }
}
.project-card .card-row .btn-ghost { padding: 8px 12px; margin-inline-end: -12px; }
.project-card h2 { font-size: var(--text-xl); }
.project-card .desc { margin: 0; font-size: var(--text-sm); color: var(--text-body); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }

.progress { display: flex; flex-direction: column; gap: 6px; }
.progress-label { display: flex; justify-content: space-between; font-size: var(--text-xs); font-weight: var(--fw-semibold); color: var(--text-muted); }
.progress-track { height: 8px; border-radius: var(--radius-pill); background: var(--surface-sunken); overflow: hidden; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--brand); }

.next { border-radius: var(--radius-md); background: var(--surface-page); border: 1px solid var(--border-subtle); padding: var(--space-3) var(--space-4); display: flex; flex-direction: column; gap: 6px; }
.next .label { font-size: var(--text-xs); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-muted); }
.next .title { font-weight: var(--fw-semibold); color: var(--text-strong); }
.next .meta { display: flex; align-items: center; gap: var(--space-2) var(--space-3); flex-wrap: wrap; font-size: var(--text-xs); color: var(--text-muted); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: var(--radius-pill); padding: 3px 10px; font-size: var(--text-xs); font-weight: var(--fw-semibold); white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.in_progress { background: var(--brand-subtle); color: var(--blue-700); }
.badge.todo, .badge.requested { background: var(--surface-sunken); color: var(--ink-700); }
.badge.waiting_client { background: var(--amber-50); color: var(--status-warning-text); }
.badge.done { background: var(--green-50); color: var(--status-success-text); }
.badge.cancelled { background: var(--surface-sunken); color: var(--ink-500); text-decoration: line-through; }
.formula { font-size: var(--text-xs); font-weight: var(--fw-semibold); color: var(--text-muted); border: 1px solid var(--border-subtle); border-radius: var(--radius-pill); padding: 3px 10px; white-space: nowrap; }

/* ---------- Avatars ---------- */
.avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; object-fit: cover; background: var(--blue-100); color: var(--blue-800); display: inline-grid; place-items: center; font-size: 12px; font-weight: var(--fw-bold); border: 2px solid var(--surface-card); }
.avatar.consultant { background: var(--brand); color: var(--white); }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; border-width: 1.5px; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.bubbles { display: flex; align-items: center; }
.bubbles .avatar + .avatar { margin-left: -8px; }
.bubbles-group { display: flex; align-items: center; gap: var(--space-3); }

.people { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.person { display: flex; align-items: center; gap: var(--space-3); background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-pill); padding: 5px 16px 5px 5px; }
.person .who { display: flex; flex-direction: column; line-height: 1.25; }
.person .who strong { font-size: var(--text-sm); color: var(--text-strong); }
.person .who span { font-size: var(--text-xs); color: var(--text-muted); }

/* ---------- Waiting-on-you strip ---------- */
.todo-strip { padding: var(--space-5); border-left: 3px solid var(--warning); }
.todo-strip h2 { font-size: var(--text-lg); margin-bottom: var(--space-3); display: flex; align-items: center; gap: var(--space-2); }
.todo-strip ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.todo-strip li { display: grid; grid-template-columns: 7px 1fr; gap: var(--space-3); align-items: baseline; }
.todo-strip li .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--warning); transform: translateY(-2px); }
.todo-strip li .line { display: flex; align-items: center; gap: var(--space-2) var(--space-3); flex-wrap: wrap; }
.todo-strip li a { color: var(--text-strong); font-weight: var(--fw-semibold); text-decoration: none; }
@media (hover: hover) { .todo-strip li a:hover { color: var(--brand-active); } }

/* ---------- Project detail ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--text-muted); text-decoration: none; margin-bottom: var(--space-4); }
@media (hover: hover) { .back:hover { color: var(--brand-active); } }
.detail-head { padding: var(--space-6); display: grid; grid-template-columns: 1fr 280px; gap: var(--space-6); }
.detail-head h1 { font-size: var(--text-3xl); margin: var(--space-2) 0 var(--space-3); }
.detail-head .desc { margin: 0; white-space: pre-line; }
.detail-side { display: flex; flex-direction: column; gap: var(--space-4); }
.detail-side .label { font-size: var(--text-xs); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-muted); margin-bottom: var(--space-2); }

.tasks { display: flex; flex-direction: column; gap: var(--space-3); }
.task { padding: var(--space-4) var(--space-5); }
.task-main { display: grid; grid-template-columns: 168px minmax(0, 1fr) auto; align-items: center; gap: var(--space-4); }
.task-main > .badge { justify-self: start; }
.task-name { font-weight: var(--fw-semibold); color: var(--text-strong); }
.task-meta { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; font-size: var(--text-xs); color: var(--text-muted); margin-top: 4px; }
.task-meta .icon { width: 14px; height: 14px; }
.task-meta span { display: inline-flex; align-items: center; gap: 4px; }
.task-owner { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-body); white-space: nowrap; }
.task-body { max-width: 70ch; margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--border-subtle); font-size: var(--text-sm); white-space: pre-line; }
.task-body .comment { margin-top: var(--space-2); padding: var(--space-3); border-radius: var(--radius-md); background: var(--brand-subtle); color: var(--blue-900); }
.task.done .task-name { color: var(--text-muted); }
.task details summary { list-style: none; cursor: pointer; font-size: var(--text-xs); font-weight: var(--fw-semibold); color: var(--text-link); margin-top: 6px; display: inline-flex; align-items: center; gap: 4px; }
.task details summary::-webkit-details-marker { display: none; }
.empty { padding: var(--space-6); text-align: center; color: var(--text-muted); font-size: var(--text-sm); }

/* ---------- Modal & toast ---------- */
.modal-backdrop { position: fixed; inset: 0; background: var(--backdrop); display: grid; place-items: center; padding: var(--space-4); z-index: 50; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain; background: var(--surface-card); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: var(--space-6); }
.modal h2 { font-size: var(--text-xl); margin-bottom: var(--space-2); }
.modal p.lead { margin: 0 0 var(--space-5); font-size: var(--text-sm); }
.modal-actions { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }
.toast { position: fixed; left: 50%; bottom: 24px; translate: -50% 0; background: var(--surface-inverse); color: var(--text-inverse); border-radius: var(--radius-pill); padding: 12px 20px; font-size: var(--text-sm); font-weight: var(--fw-semibold); box-shadow: var(--shadow-lg); z-index: 60; display: flex; align-items: center; gap: var(--space-2); max-width: calc(100vw - 32px); }

.loading { min-height: 60vh; display: grid; place-items: center; }
.loading img { width: 64px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

footer.site { text-align: center; font-size: var(--text-xs); color: var(--text-muted); padding: 0 var(--space-4) var(--space-6); }

@media (max-width: 760px) {
  .page-head h1, .detail-head h1 { font-size: var(--text-2xl); }
  .detail-head { grid-template-columns: 1fr; padding: var(--space-5); }
  .grid { grid-template-columns: 1fr; }
  .task-main { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
  .todo-strip li .line a { flex-basis: 100%; }
  .page-head .btn { width: 100%; }
  .me .name, .client-pill { display: none; }
  .auth-card { padding: var(--space-5); }
}

/* ---------- View switch ---------- */
.view-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; margin: var(--space-8) 0 var(--space-4); }
.view-bar .section-title { margin: 0; }
.view-switch { display: inline-flex; background: var(--surface-sunken); border-radius: var(--radius-pill); padding: 4px; gap: 2px; }
.view-switch button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--text-muted); font-size: var(--text-sm); font-weight: var(--fw-semibold); padding: 7px 14px; border-radius: var(--radius-pill); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.view-switch button .icon { width: 16px; height: 16px; }
@media (hover: hover) { .view-switch button:hover { color: var(--text-strong); } }
.view-switch button.active { background: var(--surface-card); color: var(--brand-active); box-shadow: var(--shadow-xs); }

/* ---------- Board (backlog) ---------- */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); align-items: start; }
.board-col { background: var(--surface-sunken); border-radius: calc(var(--radius-md) + var(--space-3)); padding: var(--space-3); }
.board-title { font-size: var(--text-base); display: flex; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-4) var(--space-3); }
.board-title .count { font-family: var(--font-sans); font-size: var(--text-xs); font-weight: var(--fw-bold); color: var(--text-muted); background: var(--surface-card); border-radius: var(--radius-pill); padding: 2px 9px; }
.board-list { display: flex; flex-direction: column; gap: var(--space-2); }
.board-card { background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); box-shadow: var(--shadow-xs); padding: var(--space-3) var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); align-items: flex-start; }
.board-card.in_progress { border-left: 3px solid var(--brand); }
.board-card.waiting_client { border-left: 3px solid var(--warning); }
.board-card.done .task-name, .board-card.cancelled .task-name { color: var(--text-muted); }
.board-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); width: 100%; flex-wrap: wrap; }
.board-foot .task-owner { font-size: var(--text-xs); }
.board-meta { display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-xs); color: var(--text-muted); }
.board-meta .icon { width: 13px; height: 13px; }
.board-empty { font-size: var(--text-sm); color: var(--text-muted); text-align: center; padding: var(--space-4); border: 1px dashed var(--border-default); border-radius: var(--radius-md); }

/* ---------- Timeline (Gantt) ---------- */
.gantt-card { padding: var(--space-4) 0 var(--space-3); overflow: hidden; }
.gantt-scroll { overflow-x: auto; }
.gantt { padding: 0 var(--space-4); }
.gantt-row { display: grid; grid-template-columns: 240px 1fr; align-items: center; min-height: 44px; }
.gantt-label { display: flex; align-items: center; gap: var(--space-2); padding-right: var(--space-3); min-width: 0; }
.gantt-name { font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--text-strong); line-height: 1.3; min-width: 0; }
.gantt-name small { display: flex; align-items: center; gap: 3px; font-size: 0.6875rem; font-weight: var(--fw-medium); color: var(--text-muted); }
.gantt-name small .icon { width: 11px; height: 11px; }
.gantt-track { position: relative; height: 44px; border-left: 1px solid var(--border-subtle); }
.gantt-head .gantt-track { height: 62px; border-left-color: transparent; }
.gantt-day { position: absolute; top: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 6px; font-size: 0.6875rem; color: var(--text-muted); }
.gantt-day.today .gantt-num { background: var(--brand-solid); color: var(--white); border-radius: var(--radius-pill); }
.gantt-num { font-weight: var(--fw-bold); color: var(--text-body); min-width: 22px; text-align: center; padding: 1px 4px; }
.gantt-dow { text-transform: uppercase; font-size: 0.6875rem; }
.gantt-month { position: absolute; top: 2px; left: 4px; white-space: nowrap; font-weight: var(--fw-bold); color: var(--text-strong); font-size: 12px; }
.gantt-shade { position: absolute; top: 0; bottom: 0; background: var(--ink-50); }
.gantt-today { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--brand); opacity: .35; }
.gantt-bar { position: absolute; top: 12px; height: 20px; border-radius: var(--radius-pill); background: var(--ink-300); min-width: 10px; box-shadow: var(--shadow-xs); }
.gantt-bar.in_progress { background: var(--brand); box-shadow: var(--shadow-brand); }
.gantt-bar.todo, .gantt-bar.requested { background: var(--ink-300); }
.gantt-bar.waiting_client { background: var(--warning); }
.gantt-bar.done { background: var(--green-500); opacity: .75; }
.gantt-bar.cancelled { background: var(--ink-200); }
.gantt-bar.open-ended { background: transparent; border: 2px dashed currentColor; box-shadow: none; }
.gantt-bar.open-ended.waiting_client { color: var(--warning); }
.gantt-bar.open-ended.todo, .gantt-bar.open-ended.requested { color: var(--ink-400); }
.gantt-bar.open-ended.in_progress { color: var(--brand); }
.gantt-bar.late { outline: 2px solid var(--danger); outline-offset: 2px; }
.gantt-group { font-family: var(--font-display); font-weight: 600; color: var(--text-strong); font-size: var(--text-sm); padding: var(--space-4) 0 var(--space-1); border-top: 1px solid var(--border-subtle); margin-top: var(--space-2); }
.gantt-head + .gantt-group { border-top: 0; margin-top: 0; }
.gantt-legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); padding: var(--space-3) var(--space-4) 0; margin-top: var(--space-2); border-top: 1px solid var(--border-subtle); font-size: var(--text-xs); color: var(--text-body); align-items: center; }
.gantt-legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 18px; height: 8px; border-radius: var(--radius-pill); display: inline-block; background: var(--ink-300); }
.swatch.in_progress { background: var(--brand); }
.swatch.waiting_client { background: var(--warning); }
.swatch.done { background: var(--green-500); }
.swatch.today-swatch { width: 2px; height: 14px; border-radius: 0; background: var(--brand); opacity: .5; }
.empty-avatar { background: var(--surface-sunken); }

@media (max-width: 760px) {
  .board { grid-template-columns: 1fr; }
  .gantt-row { grid-template-columns: 150px 1fr; }
  .view-switch button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- Compact project header ---------- */
.detail-head { display: block; padding: var(--space-5) var(--space-5) 0; }
.detail-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-5); }
.detail-title { min-width: 0; }
.detail-tags { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.detail-head h1 { font-size: var(--text-2xl); margin: var(--space-2) 0 var(--space-1); }
.detail-head .desc { font-size: var(--text-sm); color: var(--text-body); max-width: 760px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
.detail-foot { display: flex; align-items: center; gap: var(--space-3) var(--space-6); flex-wrap: wrap; margin: var(--space-4) calc(-1 * var(--space-5)) 0; padding: var(--space-3) var(--space-5); border-top: 1px solid var(--border-subtle); background: var(--surface-page); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.detail-progress { flex: 1 1 220px; min-width: 180px; max-width: 360px; }
.participants { display: flex; flex-direction: column; gap: 4px; }
.participants-label { font-size: 0.6875rem; font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-muted); }
.participants-row { display: flex; align-items: center; gap: var(--space-2); }
.participants-row .avatar { border-color: var(--surface-page); }
.participants-names { font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--text-strong); }
.detail-head.closed h1 { color: var(--text-body); }

/* ---------- Finished projects ---------- */
.closed-title .icon { color: var(--success); }
.closed-list { padding: 0; overflow: hidden; }
.closed-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: center; gap: var(--space-4); padding: var(--space-3) var(--space-5); text-decoration: none; color: inherit; transition: background-color var(--dur-fast) var(--ease-out); }
.closed-row + .closed-row { border-top: 1px solid var(--border-subtle); }
@media (hover: hover) { .closed-row:hover { background: var(--surface-page); } }
.closed-row > .icon { color: var(--text-muted); }
.closed-check { width: 26px; height: 26px; border-radius: 50%; background: var(--green-50); color: var(--success); display: grid; place-items: center; }
.closed-check .icon { width: 15px; height: 15px; stroke-width: 2.5; }
.closed-name { font-weight: var(--fw-semibold); color: var(--text-strong); }
.closed-meta { font-size: var(--text-xs); color: var(--text-muted); white-space: nowrap; }
.closed-people .avatar { width: 26px; height: 26px; font-size: 10px; }

@media (max-width: 760px) {
  .detail-top { flex-direction: column; }
  .detail-top .btn { width: 100%; }
  .detail-head { padding: var(--space-4) var(--space-4) 0; }
  .detail-foot { margin: var(--space-4) calc(-1 * var(--space-4)) 0; padding: var(--space-3) var(--space-4); }
  .closed-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .closed-meta { grid-column: 2; white-space: normal; }
  .closed-people { display: none; }
}

/* ENABLE IT people get a brand-blue ring around their photo. */
.avatar.consultant { border-color: var(--surface-card); box-shadow: 0 0 0 2px var(--brand); }
.avatar.consultant.sm { box-shadow: 0 0 0 1.5px var(--brand); }
.participants-row .avatar.consultant { border-color: var(--surface-page); }
.bubbles .avatar.consultant { position: relative; z-index: 1; }

/* Larger portraits everywhere. */
.avatar { width: 40px; height: 40px; font-size: 13px; }
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.avatar.lg { width: 52px; height: 52px; font-size: 16px; }
.bubbles .avatar + .avatar { margin-left: -10px; }
.participants-row .avatar { width: 44px; height: 44px; }
.closed-people .avatar { width: 32px; height: 32px; font-size: 11px; }
.topbar .me .avatar { width: 34px; height: 34px; }
.gantt-label .avatar { width: 32px; height: 32px; }

/* Blue ring sits directly on the photo, no white gap. */
.avatar.consultant, .participants-row .avatar.consultant { border: 2px solid var(--brand); box-shadow: none; }
.avatar.consultant.sm { border-width: 1.5px; box-shadow: none; }

/* ---------- Main navigation ---------- */
.mainnav { display: flex; gap: 2px; margin-left: var(--space-2); }
.mainnav a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius-pill); font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--text-muted); text-decoration: none; -webkit-tap-highlight-color: transparent; transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.mainnav a .icon { width: 16px; height: 16px; }
@media (hover: hover) { .mainnav a:hover { color: var(--text-strong); background: var(--surface-sunken); } }
.mainnav a.active { color: var(--brand-active); background: var(--brand-subtle); }

/* ---------- Invoices ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: var(--space-4); margin-bottom: var(--space-5); }
.stat { padding: var(--space-4) var(--space-5); display: flex; flex-direction: column; gap: 2px; }
.stat.attention { border-left: 3px solid var(--warning); }
.stat-label { font-size: var(--text-xs); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-muted); }
.stat-value { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 600; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.stat-sub { font-size: var(--text-xs); color: var(--text-muted); }
.invoice-list { padding: 0; overflow: hidden; }
.invoice-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 150px auto; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-5); }
.invoice-row + .invoice-row { border-top: 1px solid var(--border-subtle); }
.invoice-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.invoice-number { font-weight: var(--fw-bold); color: var(--text-strong); font-variant-numeric: tabular-nums; }
.invoice-meta { font-size: var(--text-xs); color: var(--text-muted); }
.invoice-lines { font-size: var(--text-sm); color: var(--text-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.invoice-amount { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.invoice-amount strong { color: var(--text-strong); }
.invoice-amount span { font-size: var(--text-xs); color: var(--text-muted); }
.late-text { color: var(--text-danger); font-weight: var(--fw-semibold); }

@media (max-width: 760px) {
  .mainnav { margin-left: 0; }
  .mainnav a { padding: 8px 10px; }
  .mainnav a span { display: none; }
  .invoice-row { grid-template-columns: minmax(0, 1fr) auto; padding: var(--space-4); }
  .invoice-row .badge { grid-row: 2; justify-self: start; }
  .invoice-row .btn { grid-column: 2; grid-row: 2; }
  .invoice-lines { white-space: normal; }
}
.invoice-row > .badge { justify-self: start; }
.btn-sm { padding: 6px 14px; font-size: var(--text-xs); }
.btn-sm:has(> svg:first-child) { padding-inline-start: 12px; }
.btn-sm .icon { width: 15px; height: 15px; }
.task-actions { margin-top: var(--space-2); }

/* Waiting for the client's validation */
.badge.to_validate { background: var(--amber-50); color: var(--status-warning-text); }
.board-card.to_validate { border-left: 3px solid var(--warning); }
.gantt-bar.to_validate, .swatch.to_validate { background: repeating-linear-gradient(135deg, var(--warning) 0 4px, var(--amber-400) 4px 8px); }
.gantt-bar.open-ended.to_validate { color: var(--amber-400); background: transparent; }
.board { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .board { grid-template-columns: 1fr; } }

/* ---------- Review fixes (better-* skills, 01/12/2026) ---------- */
/* Long names without spaces (URLs, file names) must wrap instead of widening the page. */
.task-name, .project-card h2, .closed-name, .next .title,
.todo-strip li a, .detail-head h1, .gantt-name, .invoice-lines { overflow-wrap: anywhere; }
.card-row > h2, .task-main > div { min-width: 0; }

h1, h2, h3, .task-name, .closed-name { text-wrap: balance; }
p, .desc, .task-body, .notice span { text-wrap: pretty; }
.progress-label, .count, .gantt-num, .closed-meta, .board-meta { font-variant-numeric: tabular-nums; }

/* Next-task meta: due date with its icon, owner grouped with their picture */
.next .meta .who, .next .meta .due { display: inline-flex; align-items: center; gap: 6px; }
.next .meta .due .icon { width: 14px; height: 14px; }
@media (min-width: 761px) { .todo-strip .proj::before { content: '· '; } }

/* Project description: "Lire la suite" */
.detail-head .desc.open { -webkit-line-clamp: unset; display: block; }
.detail-head .more { border: 0; background: none; padding: 0; margin-top: 2px; color: var(--text-link); font-size: var(--text-xs); font-weight: var(--fw-semibold); cursor: pointer; }

/* Project footer: three labels on one style and baseline */
.detail-foot { align-items: flex-start; }
.detail-progress .progress-label span:first-child { font-size: 0.6875rem; font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: var(--tracking-wide); }

#logout { padding: 10px; }

/* Skip link */
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 100; background: var(--surface-card); padding: 8px 12px; border-radius: 8px; box-shadow: var(--shadow-md); }

/* Modal and toast: short enter, shorter exit */
.modal-backdrop { transition: opacity 300ms var(--ease-out); }
.modal { transition: opacity 300ms var(--ease-out); }
@starting-style { .modal-backdrop, .modal { opacity: 0; } }
.modal-backdrop.closing, .modal-backdrop.closing .modal { opacity: 0; transition-duration: var(--dur-fast); }
.toast { transition: opacity 250ms var(--ease-out); }
@starting-style { .toast { opacity: 0; } }
.toast.leaving { opacity: 0; transition-duration: var(--dur-fast); }
@media (prefers-reduced-motion: no-preference) {
  .modal { transition-property: opacity, scale, translate; }
  @starting-style { .modal { scale: .98; translate: 0 8px; } }
  .modal-backdrop.closing .modal { scale: .99; translate: 0 0; }
  .toast { transition-property: opacity, translate; }
  @starting-style { .toast { translate: -50% 8px; } }
}
@media (prefers-reduced-motion: reduce) {
  .loading img { animation: none; opacity: .6; }
}

/* "Détails" chevron turns when open */
.task details summary .icon { transition: rotate var(--dur-fast) var(--ease-out); }
.task details[open] summary .icon { rotate: 180deg; }

@media (max-width: 760px) {
  .board-empty { display: none; }
}
@media (max-width: 480px) {
  .topbar-inner { flex-wrap: wrap; row-gap: 8px; }
  .mainnav { order: 3; width: 100%; margin-left: 0; }
  .mainnav a span { display: inline; } /* the nav has its own row here, labels fit */
}

/* ---------- Task detail panel ---------- */
/* The task name is a button; on cards its ::after covers the whole card so any click opens the panel. */
.task-open { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.openable { position: relative; }
.task-open.stretched::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.task-open:focus-visible { outline: none; }
.task-open.stretched:focus-visible::after { outline: 2px solid var(--border-focus); outline-offset: 2px; }
.task-open:not(.stretched):focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; border-radius: 4px; }
.openable a, .openable .btn { position: relative; z-index: 1; }
.openable { transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
@media (hover: hover) {
  .openable:hover { border-color: var(--border-default); box-shadow: var(--shadow-md); }
  .gantt-name .task-open:hover { color: var(--brand-active); }
}

html:has(.drawer-backdrop), html:has(.modal-backdrop) { overflow: hidden; }
.drawer-backdrop { position: fixed; inset: 0; z-index: 50; background: var(--backdrop); display: flex; justify-content: flex-end; transition: opacity 250ms var(--ease-out); }
.drawer { width: min(460px, 100%); height: 100%; background: var(--surface-card); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; transition: opacity 250ms var(--ease-out); }
@starting-style { .drawer-backdrop, .drawer { opacity: 0; } }
.drawer-backdrop.closing, .drawer-backdrop.closing .drawer { opacity: 0; transition-duration: var(--dur-fast); }
@media (prefers-reduced-motion: no-preference) {
  .drawer { transition-property: opacity, translate; }
  @starting-style { .drawer { translate: 24px 0; } }
  .drawer-backdrop.closing .drawer { translate: 16px 0; }
}
.drawer-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-3) var(--space-3) var(--space-5); border-bottom: 1px solid var(--border-subtle); }
.drawer-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.drawer-close { padding: 10px; }
.drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-5); }
.drawer-project { margin: 0 0 var(--space-1); font-size: 0.6875rem; font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-muted); }
.drawer h2 { font-size: var(--text-xl); overflow-wrap: anywhere; }
.drawer h3 { font-family: var(--font-sans); font-size: 0.6875rem; font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-muted); margin-bottom: var(--space-2); }
.drawer section p { margin: 0; font-size: var(--text-sm); }
.drawer-actions { margin-top: var(--space-3); }
.drawer-people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.drawer-person { display: flex; align-items: center; gap: var(--space-3); }
.drawer-person strong { display: block; font-size: var(--text-sm); color: var(--text-strong); }
.drawer-person small { display: block; font-size: var(--text-xs); color: var(--text-muted); }
.drawer-facts { margin: 0; padding: var(--space-4) 0; border-block: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: var(--space-2); }
.drawer-facts div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: var(--space-3); font-size: var(--text-sm); }
.drawer-facts dt { color: var(--text-muted); }
.drawer-facts dd { margin: 0; color: var(--text-strong); font-weight: var(--fw-medium); overflow-wrap: anywhere; }
.drawer-text { font-size: var(--text-sm); line-height: var(--leading-relaxed); overflow-wrap: anywhere; }
.drawer-text p, .drawer section .drawer-text p { margin: 0 0 var(--space-2); }
.drawer-text ul { margin: 0 0 var(--space-3); padding-left: 1.2em; display: flex; flex-direction: column; gap: 4px; }
.drawer-text > :last-child, .drawer section .drawer-text > :last-child { margin-bottom: 0; }
.drawer-comment { padding: var(--space-3); border-radius: var(--radius-md); background: var(--brand-subtle); color: var(--blue-900); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--text-link); cursor: pointer; text-align: left; }
@media (hover: hover) { .link-btn:hover { text-decoration: underline; } }
.badge.late { background: var(--red-50); color: var(--text-danger); }
@media (max-width: 480px) {
  .drawer-facts div { grid-template-columns: minmax(0, 1fr); gap: 0; }
}

/* ---------- To do on the client's side (validate a delivery or carry out a task) ---------- */
.todo-section { margin-bottom: var(--space-6); }
.detail-head + .todo-section { margin-top: var(--space-8); }
.todo-section .section-title { margin-top: 0; }
.todo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(440px, 100%), 1fr)); gap: var(--space-4); }
.todo-card { padding: var(--space-5); border-left: 3px solid var(--warning); display: flex; flex-direction: column; gap: var(--space-3); }
.todo-card.in_progress { border-left-color: var(--brand); }
.todo-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.todo-card-heading { min-width: 0; }
.todo-card-project { margin: 0 0 2px; font-size: 0.6875rem; font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-muted); }
.todo-card-title { font-size: var(--text-lg); }
@media (hover: hover) { .todo-card-title .task-open:hover { color: var(--brand-active); } }
.todo-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); font-size: var(--text-sm); color: var(--text-body); }
.todo-card-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.todo-card-meta .icon { width: 15px; height: 15px; }
.actions-box { display: flex; flex-direction: column; gap: var(--space-3); }
.drawer .actions-box { padding: var(--space-4); border-radius: var(--radius-md); background: var(--surface-page); border: 1px solid var(--border-subtle); }
.drawer .actions-box:has(.actions-text) { background: var(--amber-50); border-color: var(--amber-400); }
.actions-text { margin: 0; font-size: var(--text-sm); color: var(--text-body); }
.actions-note { margin: 0; display: flex; align-items: center; gap: 6px; font-size: var(--text-xs); font-weight: var(--fw-semibold); color: var(--status-warning-text); }
.actions-note .icon { width: 14px; height: 14px; }
.actions-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.actions-row .btn { padding: 8px 14px; }
.actions-row .btn .icon { width: 16px; height: 16px; }
.action-form { display: flex; flex-direction: column; gap: 6px; }
.action-form > label, .file-field label { font-size: var(--text-sm); font-weight: var(--fw-semibold); color: var(--text-strong); }
.action-form .hint { font-size: var(--text-xs); color: var(--text-muted); }
.action-form .textarea { min-height: 100px; }
.action-form .notice { margin: 0; }
.file-field { display: flex; flex-direction: column; gap: 4px; margin-top: var(--space-2); }
.file-input { font: inherit; font-size: var(--text-sm); color: var(--text-body); }
.file-input::file-selector-button { font: inherit; font-weight: var(--fw-semibold); margin-right: var(--space-3); padding: 6px 14px; border-radius: var(--radius-pill); border: 1px solid var(--border-default); background: var(--surface-card); color: var(--text-strong); cursor: pointer; }
.actions-form-buttons { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-2); }
.file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.file-list li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); font-size: var(--text-sm); }
.file-list a { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow-wrap: anywhere; font-weight: var(--fw-semibold); }
.file-list .icon { width: 15px; height: 15px; flex: none; }
@media (max-width: 480px) { .actions-row .btn { flex: 1 1 100%; } }

/* ---------- Related tasks in the detail panel ---------- */
.rel-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rel { width: 100%; display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: var(--space-3); padding: 10px 12px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--surface-card); font: inherit; font-size: var(--text-sm); text-align: left; color: var(--text-strong); cursor: pointer; transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out); }
@media (hover: hover) { .rel:hover { border-color: var(--border-default); background: var(--surface-page); } }
.rel-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-300); }
.rel-dot.in_progress { background: var(--brand); }
.rel-dot.waiting_client, .rel-dot.to_validate { background: var(--warning); }
.rel-dot.done { background: var(--success); }
.rel-name { font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.rel-status { font-size: var(--text-xs); color: var(--text-muted); white-space: nowrap; }

/* ---------- Gantt dependency arrows ---------- */
.gantt { position: relative; }
.gantt-bar { z-index: 2; }
.gantt-links { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none; overflow: visible; }
.gantt-links path { fill: none; stroke: var(--ink-400); stroke-width: 1.5; }
.gantt-links marker path { fill: var(--ink-400); stroke: none; }
.swatch.link-swatch { width: 18px; height: 0; border-radius: 0; border-top: 1.5px solid var(--ink-400); background: none; }

/* Planning: lighter labels — one line per task, dependencies are shown by the arrows */
.gantt-row { min-height: 52px; }
.gantt-track { height: 52px; }
.gantt-bar { top: 16px; }
.gantt-label { gap: var(--space-3); }
.gantt-label .avatar { width: 28px; height: 28px; }
.gantt-name { font-weight: var(--fw-medium); min-width: 0; }
.gantt-name .task-open { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
.gantt-row + .gantt-row:not(.gantt-head) .gantt-label { border-top: 1px solid var(--ink-100); align-self: stretch; }
@media (min-width: 761px) { .gantt-row { grid-template-columns: 290px 1fr; } }
/* Cards in a row share the same height; the actions always sit at the bottom, whatever the title length. */
.todo-card > .actions-box { margin-top: auto; }

/* List view: status groups are sub-headings of "Tâches", not section titles */
.task-group + .task-group { margin-top: var(--space-6); }
.group-title { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-3); font-family: var(--font-sans); font-size: var(--text-xs); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-muted); }
.group-title .count { font-size: 0.6875rem; font-weight: var(--fw-bold); color: var(--text-muted); background: var(--surface-sunken); border-radius: var(--radius-pill); padding: 1px 8px; letter-spacing: 0; }

/* ---------- Heading scale (one level = one style, everywhere) ----------
   1. Page title (h1): dashboard, project, invoices           → 2xl
   2. Section title (h2): "À faire de votre côté", "Projets", "Tâches" → xl
   3. Card title (h3): project card, to-do card, drawer task  → lg
   4. Group / label: list groups, board columns, gantt groups,
      "Avancement", "Prochaine tâche", participants           → xs uppercase, muted */
.page-head h1, .detail-head h1 { font-size: var(--text-2xl); }
.section-title, .view-bar .section-title { font-size: var(--text-xl); }
.project-card h3, .todo-card-title, .drawer h2 { font-size: var(--text-lg); }
.project-card .progress-label span:first-child { font-size: 0.6875rem; font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: var(--tracking-wide); }
.board-title.group-title { padding: var(--space-2) var(--space-2) var(--space-3); margin: 0; }
.gantt-group.group-title { padding: var(--space-4) 0 var(--space-1); margin: var(--space-2) 0 0; border-top: 1px solid var(--border-subtle); }
.gantt-head + .gantt-group.group-title { border-top: 0; margin-top: 0; }

/* ---------- Projects: one grid, finished ones behind a filter ---------- */
.view-tools { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--border-default); border-radius: var(--radius-pill); background: var(--surface-card); color: var(--text-muted); font: inherit; font-size: var(--text-sm); font-weight: var(--fw-semibold); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.filter-chip .icon { width: 16px; height: 16px; }
.filter-chip .count { font-size: 0.6875rem; font-weight: var(--fw-bold); background: var(--surface-sunken); border-radius: var(--radius-pill); padding: 1px 8px; color: var(--text-muted); }
.filter-chip[aria-pressed="true"] { background: var(--brand-subtle); border-color: var(--blue-200); color: var(--brand-active); }
@media (hover: hover) { .filter-chip:hover { color: var(--text-strong); border-color: var(--border-strong); } }
.project-card.closed h3 { color: var(--text-body); }
.project-card.closed .progress-fill { background: var(--success); }
@media (max-width: 760px) { .filter-chip { padding: 7px 12px; } }

/* Simplified cards */
.project-card .card-people { margin-top: auto; }
.detail-tags:empty { display: none; }
.board-list:empty { display: none; }
.drawer-facts:empty { display: none; }
.card-empty { margin: 0; font-size: var(--text-sm); }
.board-dep { max-width: 100%; }
.board-dep { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.board-dep svg { vertical-align: -2px; margin-right: 4px; }
.action-dialog { z-index: 55; }
.modal-kicker { margin: 0 0 2px; font-size: 0.6875rem; font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-muted); overflow-wrap: anywhere; }
.action-dialog .modal h2 { margin-bottom: var(--space-5); }
.action-dialog .actions-error .notice { margin: 0 0 var(--space-3); }
.todo-card > .todo-card-meta { margin-top: auto; }
