/* WorkJunction shared design-token system.
   Ported verbatim from design/export/Work junction/index.html — see
   docs/design-handoff-style-system.md for the source-of-truth doc. */

:root, [data-theme="dark"] {
  --bg: #020617; --panel: #080f1e; --panel-2: #0d1629; --panel-3: #121e30;
  --panel-4: #182338; --panel-5: #1e2d42;
  --ink: #e8edf5; --ink-2: #c3cbda; --muted: #8fa3bf; --muted-2: #4e637d; --muted-3: #2d3f52;
  --border: rgba(255,255,255,.07); --border-strong: rgba(255,255,255,.14); --hairline: rgba(255,255,255,.045);
  --accent: #10b981; --accent-hover: #34d399; --accent-soft: rgba(16,185,129,.12);
  --accent-softer: rgba(16,185,129,.06); --accent-border: rgba(16,185,129,.28);
  --accent-glow: rgba(16,185,129,.35); --accent-ink: #022c22; --on-accent: #022c22;
  --focus-ring: #60a5fa;
  --danger: #ef4444; --danger-soft: rgba(239,68,68,.10); --danger-border: rgba(239,68,68,.22);
  --warning: #f59e0b; --warning-soft: rgba(245,158,11,.10); --warning-border: rgba(245,158,11,.22);
  --info: #3b82f6; --info-soft: rgba(59,130,246,.10); --info-border: rgba(59,130,246,.22);
  --violet: #8b5cf6; --violet-soft: rgba(139,92,246,.10); --violet-border: rgba(139,92,246,.22);
  --radius: 6px; --radius-lg: 8px; --radius-xl: 10px;
  --shadow-soft: 0 1px 0 rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --shadow-pop: 0 12px 32px -8px rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.4);
  --shadow-glow: 0 0 24px rgba(16,185,129,.10);
  --font-sans: "DM Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-display: "Bricolage Grotesque", "DM Sans", sans-serif;
}

[data-theme="light"] {
  --bg: #f6f7f9; --panel: #ffffff; --panel-2: #fafbfc; --panel-3: #f3f5f8;
  --panel-4: #eceff3; --panel-5: #e4e7ec;
  --ink: #0a0f1c; --ink-2: #2a3142; --muted: #5a6478; --muted-2: #8a93a4; --muted-3: #aeb5c1;
  --border: #e4e7ec; --border-strong: #d1d6df; --hairline: #eef0f3;
  --accent-soft: rgba(16,185,129,.10); --accent-softer: rgba(16,185,129,.05);
  --accent-border: rgba(16,185,129,.30); --accent-glow: rgba(16,185,129,.18); --on-accent: #022c22;
  --focus-ring: #2563eb;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

h1, h2, h3, h4 { margin: 0; }
h1 { font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: 0; }
h2 { font-family: var(--font-display); font-size: 16px; font-weight: 600; }
h3 { font-size: 13px; font-weight: 600; }
h4 { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.display { font-family: var(--font-display); letter-spacing: 0; }

/* ---------- Layout shell (document-scroll adaptation, not 100vh/overflow:hidden SPA) ---------- */
.app {
  display: grid; grid-template-columns: 232px 1fr;
  min-height: 100vh; min-height: 100dvh;
}
.main-col { display: flex; flex-direction: column; min-width: 0; }
.scroll-area { flex: 1; min-width: 0; }

/* ---------- Cards / panels ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); min-width: 0;
}
.hairline { border-top: 1px solid var(--hairline); }
.panel-header {
  padding: 12px 14px; border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
}
.panel-header h2, .panel-header h3 { font-size: 13px; }
.panel-body { padding: 14px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px;
  border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--panel-2);
  color: var(--ink); font-size: 12.5px; font-weight: 500; font-family: inherit;
  cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--panel-3); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: 0 0 18px var(--accent-glow); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-sm { height: 26px; padding: 0 9px; font-size: 11.5px; }
.btn-icon { width: 30px; padding: 0; justify-content: center; }
.btn-danger { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger); }

button:not([class]) {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 30px; padding: 0 11px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background: var(--panel-2);
  color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 500;
  cursor: pointer;
}
button:not([class]):hover { background: var(--panel-3); }
button:not([class]):disabled { opacity: .5; cursor: not-allowed; }
.current-timer form button:not([class]),
#current-timer form button:not([class]),
.setup-form > button:not([class]) {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent);
  font-weight: 600;
}
.current-timer form button:not([class]):hover,
#current-timer form button:not([class]):hover,
.setup-form > button:not([class]):hover {
  background: var(--accent-hover); border-color: var(--accent-hover);
  box-shadow: 0 0 18px var(--accent-glow);
}
.setup-form > button:not([class]) { justify-self: start; min-width: 148px; }
.current-timer-submit,
.current-timer-stop-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 0 13px; border-radius: var(--radius);
  border: 1px solid var(--accent); background: var(--accent);
  color: var(--on-accent); font: inherit; font-size: 12.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.current-timer-submit:hover {
  background: var(--accent-hover); border-color: var(--accent-hover);
  box-shadow: 0 0 18px var(--accent-glow);
}
.current-timer-stop-button {
  border-color: var(--danger-border); background: var(--danger-soft);
  color: var(--danger);
}
.current-timer-stop-button:hover { background: rgba(248, 113, 113, .18); }

/* ---------- Forms / inputs / selects ---------- */
input, textarea, select {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--ink); outline: none;
  font: inherit; padding: 7px 10px;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent-border); box-shadow: 0 0 0 3px var(--accent-softer);
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.field input, .field textarea, .field select { width: 100%; }
.field-error { color: var(--danger); font-size: 11px; margin-top: 2px; }
.field.has-error input, .field.has-error textarea, .field.has-error select {
  border-color: var(--danger-border); box-shadow: 0 0 0 3px var(--danger-soft);
}
.form-error-banner {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 14px;
  background: var(--danger-soft); border: 1px solid var(--danger-border);
  border-radius: var(--radius); color: var(--danger); font-size: 12.5px;
}
.errorlist { list-style: none; margin: 4px 0 0; padding: 0; color: var(--danger); font-size: 11px; }

.setup-form {
  display: grid; gap: 10px; margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--hairline);
}
.setup-form h3 { margin-bottom: 2px; }
.setup-card {
  padding: 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel-2);
}
.setup-form-heading {
  margin: 0; color: var(--ink); font-size: 13px; font-weight: 700;
}
.setup-form-submit {
  justify-self: start; min-width: 148px;
}
.setup-field {
  min-width: 0;
}
.workspace-setup-form,
.client-setup-form {
  min-width: 0;
}
.setup-form label,
.current-timer form label,
.inline-form label,
.approval-form label {
  display: grid; gap: 4px; color: var(--ink-2); font-size: 12.5px; font-weight: 500;
}
.setup-field.has-error input,
.setup-field.has-error select {
  border-color: var(--danger-border);
  box-shadow: 0 0 0 3px var(--danger-soft);
}
.setup-field textarea {
  min-height: 74px; resize: vertical;
}
.project-member-field-error { display: grid; gap: 2px; margin-top: 2px; }
.current-timer-shell {
  display: grid; gap: 10px; min-width: 0;
}
.current-timer-empty-state {
  align-items: flex-start; margin: 0; padding: 0; border: 0; background: transparent;
  text-align: left; color: var(--muted);
}
.current-timer-empty-state .empty-state-icon {
  display: none;
}
.current-timer-empty-state .empty-state-title {
  color: var(--muted); font-size: 12.5px; font-weight: 500;
}
.current-timer-empty-state .empty-state-body {
  max-width: none; font-size: 12px;
}
.current-timer-running {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 12px;
}
.current-timer-state {
  display: inline-flex; align-items: center; gap: 6px; justify-self: start;
  height: 24px; padding: 0 8px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--panel-2);
  color: var(--muted); font-size: 11px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
}
.current-timer-state-dot {
  width: 7px; height: 7px; border-radius: 999px; background: var(--muted-2);
}
.current-timer-state-running {
  border-color: var(--accent-border); background: var(--accent-softer);
  color: var(--accent);
}
.current-timer-state-running .current-timer-state-dot {
  background: var(--accent); box-shadow: 0 0 10px var(--accent-glow);
}
.current-timer-main {
  display: grid; gap: 2px; min-width: 0;
}
.current-timer-main strong {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink); font-size: 14px; font-weight: 650;
}
.current-timer-main span {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted); font-size: 12px;
}
#current-timer form,
.current-timer form,
.current-timer-form {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px; align-items: end;
}
#current-timer form .field,
.current-timer form .field,
.current-timer-form .field {
  margin-bottom: 0; min-width: 0;
}
#current-timer form .errorlist,
.current-timer form .errorlist,
.current-timer-form .errorlist { grid-column: 1 / -1; }
.current-timer-field-error { display: grid; gap: 2px; }
.current-timer-stop-form {
  display: flex; align-items: center; justify-content: flex-end; margin: 0;
}
.inline-form, .approval-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.project-member form, .notification-actions form { margin: 0; }

/* ---------- Tables ---------- */
table.tbl, table.data-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.tbl thead th, table.data-table thead th, table.tbl th, table.data-table th {
  text-align: left; font-weight: 600; color: var(--muted-2); font-size: 10.5px;
  letter-spacing: .06em; text-transform: uppercase; padding: 9px 12px;
  border-bottom: 1px solid var(--border); background: var(--panel-2);
}
table.tbl tbody td, table.data-table tbody td, table.tbl td, table.data-table td {
  padding: 10px 12px; border-bottom: 1px solid var(--hairline); vertical-align: middle;
}
table.tbl tbody tr:hover, table.data-table tbody tr:hover { background: var(--panel-2); }
table.tbl tbody tr:last-child td, table.data-table tbody tr:last-child td { border-bottom: 0; }
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow-x: auto; }
.table-primary-link { color: var(--ink); font-weight: 600; text-decoration: none; }
.table-primary-link:hover { text-decoration: underline; color: var(--ink); }
.table-muted { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ---------- Badges / status pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px;
  border-radius: 4px; font-size: 10.5px; font-weight: 500; letter-spacing: .01em;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--muted);
  white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.neutral { color: var(--muted); }
.badge.ok      { background: var(--accent-soft);  border-color: var(--accent-border);  color: var(--accent-hover); }
.badge.info    { background: var(--info-soft);    border-color: var(--info-border);    color: #93c5fd; }
.badge.warn    { background: var(--warning-soft); border-color: var(--warning-border); color: #fcd34d; }
.badge.danger  { background: var(--danger-soft);  border-color: var(--danger-border);  color: #fca5a5; }
.badge.violet  { background: var(--violet-soft);  border-color: var(--violet-border);  color: #c4b5fd; }
[data-theme="light"] .badge.ok     { color: #047857; }
[data-theme="light"] .badge.info   { color: #2563eb; }
[data-theme="light"] .badge.warn   { color: #b45309; }
[data-theme="light"] .badge.danger { color: #b91c1c; }
[data-theme="light"] .badge.violet { color: #6d28d9; }

/* Compatibility mapping for existing per-status badge classes already used
   in workspace/timekeeping partials (badge-priority-*, badge-status-*,
   badge-visibility-*, badge-approval-submitted) — maps them onto the same
   6 semantic badge variants above without requiring template markup changes. */
.badge-priority-low, .badge-priority-normal,
.badge-status-open, .badge-visibility-internal {
  background: var(--panel-2); border-color: var(--border); color: var(--muted);
}
.badge-priority-high, .badge-approval-submitted, .badge-status-in_progress {
  background: var(--warning-soft); border-color: var(--warning-border); color: #fcd34d;
}
.badge-priority-urgent, .badge-status-blocked {
  background: var(--danger-soft); border-color: var(--danger-border); color: #fca5a5;
}
.badge-status-done, .badge-visibility-client {
  background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-hover);
}
[data-theme="light"] .badge-priority-high, [data-theme="light"] .badge-approval-submitted,
[data-theme="light"] .badge-status-in_progress { color: #b45309; }
[data-theme="light"] .badge-priority-urgent, [data-theme="light"] .badge-status-blocked { color: #b91c1c; }
[data-theme="light"] .badge-status-done, [data-theme="light"] .badge-visibility-client { color: #047857; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px;
  border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border);
  font-size: 11.5px; color: var(--muted); font-weight: 500; cursor: pointer;
}
.chip.active { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }

/* ---------- Empty states ---------- */
.empty-state {
  padding: 40px 24px; display: flex; flex-direction: column; align-items: center;
  text-align: center; gap: 8px; color: var(--muted); margin: 0;
}
.empty-state-icon {
  width: 36px; height: 36px; border-radius: 10px; background: var(--panel-2);
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
}
.empty-state svg {
  width: 18px; height: 18px; stroke: var(--muted); fill: none; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.empty-state-title { font-size: 14px; font-weight: 600; color: var(--ink); }
.empty-state-body { font-size: 13px; max-width: 360px; }
.empty-state-action { margin-top: 4px; }
.empty-state-compact { padding: 24px 16px; }
p.empty-state { display: block; padding: 8px 0; text-align: left; color: var(--muted); }
.dashboard-empty-state {
  min-width: 0; padding: 18px 14px; border: 1px solid var(--hairline);
  border-radius: var(--radius); background: var(--panel-2);
}
.dashboard-empty-state .empty-state-icon {
  width: 32px; height: 32px; border-radius: 8px;
}
.dashboard-empty-state .empty-state-title {
  font-size: 13px; line-height: 1.3;
}
.dashboard-empty-state .empty-state-body {
  max-width: 320px; font-size: 12px; line-height: 1.45;
}

/* ---------- Drawers / modals ---------- */
.drawer-overlay { position: fixed; inset: 0; background: rgba(2,6,23,.55); backdrop-filter: blur(3px); z-index: 50; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 560px; background: var(--panel);
  border-left: 1px solid var(--border); box-shadow: var(--shadow-pop); z-index: 51;
  display: flex; flex-direction: column;
}
.command-palette-overlay[hidden] { display: none !important; }
.command-palette-state[hidden],
.command-palette-clear[hidden] { display: none !important; }
.command-palette-overlay { position: fixed; inset: 0; z-index: 200; }
.command-palette-backdrop {
  position: absolute; inset: 0; background: rgba(2, 6, 23, .62);
  backdrop-filter: blur(4px);
}
.command-palette-dialog {
  position: absolute; top: 14vh; left: 50%; width: min(640px, calc(100vw - 32px));
  max-height: min(680px, 78vh); display: flex; flex-direction: column; overflow: hidden;
  transform: translateX(-50%); border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl); background: var(--panel); box-shadow: var(--shadow-pop);
  animation: command-palette-pop .16s cubic-bezier(.4, 0, .2, 1);
}
.command-palette-input-row {
  height: 50px; display: flex; align-items: center; gap: 10px; padding: 0 14px;
  border-bottom: 1px solid var(--hairline); background: var(--panel-2);
}
.command-palette-search-icon,
.command-palette-clear svg {
  width: 16px; height: 16px; display: inline-flex; flex: none; color: var(--muted);
}
.command-palette-search-icon svg,
.command-palette-clear svg {
  width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.command-palette-input {
  flex: 1; min-width: 0; height: 100%; border: 0; border-radius: 0;
  background: transparent; color: var(--ink); font-size: 14px;
}
.command-palette-input:focus { box-shadow: none; border-color: transparent; }
.command-palette-escape { flex: none; }
.command-palette-body {
  min-height: 180px; max-height: 52vh; overflow-y: auto; padding: 6px;
}
.command-palette-results { display: grid; gap: 2px; }
.command-palette-section {
  padding: 10px 10px 4px; color: var(--muted-2); font-size: 10px;
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.command-palette-row {
  width: 100%; min-height: 44px; display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border: 0; border-radius: var(--radius); background: transparent;
  color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.command-palette-row:hover,
.command-palette-row.active {
  background: var(--accent-soft); color: var(--accent-hover);
}
.command-palette-row:disabled {
  cursor: not-allowed; opacity: .55; background: transparent; color: var(--muted);
}
.command-palette-glyph {
  width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  flex: none; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel-3); color: var(--muted); font-size: 11px; font-weight: 700;
}
.command-palette-glyph.command {
  border-color: var(--accent-border); background: var(--accent-softer); color: var(--accent);
}
.command-palette-copy { min-width: 0; flex: 1; display: grid; gap: 2px; }
.command-palette-title,
.command-palette-hint {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.command-palette-title { font-size: 13px; font-weight: 600; color: currentColor; }
.command-palette-hint { font-size: 11.5px; color: var(--muted); }
.command-palette-meta { color: var(--muted-2); flex: none; }
.command-palette-state {
  min-height: 180px; display: grid; place-items: center; gap: 4px; padding: 30px 20px;
  color: var(--muted); text-align: center; font-size: 13px;
}
.command-palette-state strong { display: block; color: var(--ink-2); font-size: 14px; }
.command-palette-state span { display: block; }
.command-palette-footer {
  min-height: 38px; display: flex; align-items: center; gap: 14px; padding: 8px 14px;
  border-top: 1px solid var(--hairline); background: var(--panel-2);
  color: var(--muted-2); font-size: 11px;
}
.command-palette-result-count { margin-left: auto; }
@keyframes command-palette-pop {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- Sidebar / topbar ---------- */
.sidebar-aside {
  background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 0;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-scrim { display: none; }
.sidebar-workspace {
  height: 56px; display: flex; align-items: center; padding: 8px;
  border-bottom: 1px solid var(--border); flex: none; position: relative;
}
.workspace-switcher {
  width: 100%; min-width: 0; min-height: 40px; display: flex; align-items: center; gap: 10px;
  padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel-2); color: var(--ink); cursor: pointer; text-align: left;
  font-family: inherit;
}
.workspace-switcher:hover,
.workspace-switcher[aria-expanded="true"] { background: var(--panel-3); border-color: var(--border-strong); }
.workspace-avatar {
  width: 28px; height: 28px; border-radius: 6px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e3a5f, #0d5c3a);
  color: var(--accent-hover); font-size: 10.5px; font-weight: 700;
  letter-spacing: .04em; box-shadow: 0 0 12px rgba(16,185,129,.18);
}
.workspace-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; line-height: 1.15; }
.workspace-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink); font-size: 13px; font-weight: 600;
}
.workspace-meta {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted); font-size: 10.5px;
}
.shell-menu-caret {
  width: 14px; height: 14px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted-2); flex: none; transition: transform .13s ease, color .13s ease;
}
.shell-menu-caret svg,
.shell-menu-icon svg {
  width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
[aria-expanded="true"] > .shell-menu-caret { transform: rotate(180deg); color: var(--accent); }
.shell-menu[hidden] { display: none !important; }
.shell-menu {
  position: absolute; left: 8px; right: 8px; z-index: 90; display: grid; gap: 2px;
  padding: 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  background: var(--panel-2);
  box-shadow: 0 18px 48px rgba(0,0,0,.34); backdrop-filter: blur(14px);
  animation: shell-menu-pop .14s cubic-bezier(.4, 0, .2, 1);
}
.workspace-shell-menu { top: calc(100% + 6px); }
.profile-shell-menu {
  position: fixed; left: 8px; right: auto; bottom: 64px; width: 216px;
}
.shell-menu-heading {
  padding: 4px 8px 5px; color: var(--muted-2); font-size: 10px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
}
.shell-menu-item {
  width: 100%; min-width: 0; min-height: 34px; display: flex; align-items: center; gap: 9px;
  padding: 7px 8px; border: 0; border-radius: var(--radius); background: transparent;
  color: var(--ink-2); font: inherit; text-align: left; cursor: pointer;
}
.shell-menu-item:hover,
.shell-menu-item:focus-visible {
  background: var(--panel-2); color: var(--ink); outline: none;
}
.shell-menu-icon {
  width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center;
  flex: none; color: var(--muted);
}
.shell-menu-title,
.shell-menu-subtitle {
  display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.shell-menu-title { font-size: 12.5px; font-weight: 600; color: currentColor; }
.shell-menu-subtitle { margin-top: 2px; color: var(--muted-2); font-size: 10.5px; }
.shell-menu-divider { height: 1px; margin: 5px 4px; background: var(--hairline); }
.shell-menu-danger { color: var(--danger); }
.shell-menu-danger .shell-menu-icon { color: currentColor; }
@keyframes shell-menu-pop {
  from { opacity: 0; transform: translateY(-4px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.sidebar-brand {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px 16px;
  font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--ink);
}
.sidebar-brand-mark {
  width: 26px; height: 26px; border-radius: 7px; background: var(--accent-soft);
  border: 1px solid var(--accent-border); color: var(--accent);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.sidebar-nav {
  display: flex; flex-direction: column; gap: 1px; padding: 4px 8px;
  overflow: auto; flex: 1; min-height: 0;
}
.sidebar-section-label {
  padding: 8px 8px 4px; color: var(--muted); font-size: 10px;
  font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
}
.sidebar-link {
  display: flex; align-items: center; gap: 9px; min-height: 32px;
  padding: 7px 10px; border-radius: var(--radius);
  color: var(--muted); font-size: 12.5px; font-weight: 500; position: relative;
}
.sidebar-link:hover { background: var(--panel-2); color: var(--ink); }
.sidebar-link.active { background: var(--accent-soft); color: var(--accent-hover); font-weight: 600; }
.sidebar-link.active::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 2px; height: 56%;
  transform: translateY(-50%); border-radius: 0 2px 2px 0;
  background: var(--accent); box-shadow: 0 0 8px var(--accent-glow);
}
.sidebar-icon {
  width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center;
  flex: none; color: currentColor;
}
.sidebar-icon svg, .topbar-search-icon svg, .topbar-action-icon svg {
  width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.sidebar-footer {
  margin-top: auto; padding: 8px; border-top: 1px solid var(--border);
  display: grid; gap: 6px; flex: none; position: relative; z-index: 100;
}
.sidebar-profile {
  width: 100%; min-width: 0; display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 0; border-radius: var(--radius); color: var(--ink);
  background: transparent; cursor: pointer; text-align: left; font-family: inherit;
}
.sidebar-profile:hover,
.sidebar-profile.active,
.sidebar-profile[aria-expanded="true"] { background: var(--panel-2); color: var(--ink); }
.sidebar-profile-avatar, .topbar-user-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  border: 1px solid var(--border); background: linear-gradient(135deg, #1e4d8c, #0d5c3a);
  color: var(--accent-hover); font-weight: 700;
}
.sidebar-profile-avatar { width: 28px; height: 28px; border-radius: 50%; font-size: 10px; }
.sidebar-profile-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; line-height: 1.2; }
.sidebar-profile-name, .sidebar-profile-role {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-profile-name { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.sidebar-profile-role { font-size: 10.5px; color: var(--muted); }
.sidebar-logout { width: 100%; justify-content: flex-start; }

.topbar {
  height: 52px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 16px 0 20px;
  border-bottom: 1px solid var(--border); background: var(--panel);
  position: sticky; top: 0; z-index: 10;
}
.topbar-mobile-nav-toggle { display: none; }
.topbar-title {
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  min-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar-search {
  display: flex; align-items: center; gap: 8px; height: 30px; width: 360px; max-width: 42vw;
  padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel-2); color: var(--muted); font: inherit; font-size: 13px;
  cursor: pointer; text-align: left;
}
.topbar-search:hover { border-color: var(--border-strong); color: var(--ink-2); }
.topbar-search-icon { width: 14px; height: 14px; color: var(--muted); flex: none; }
.topbar-action-icon { width: 13px; height: 13px; display: inline-flex; flex: none; }
.topbar-search-text {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar-search-kbd { flex: none; }
.topbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.topbar-action-group { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar-action-group .btn { white-space: nowrap; }
.topbar-quick-create { position: relative; flex: none; }
.topbar-create-action { gap: 6px; padding-right: 8px; }
.topbar-create-action .shell-menu-caret { width: 12px; height: 12px; }
.topbar-quick-create-menu {
  top: calc(100% + 6px); left: auto; right: 0; width: 236px;
  max-width: min(236px, calc(100vw - 24px));
}
.topbar-create-menu-item { padding-right: 8px; }
.topbar-create-menu-copy { min-width: 0; flex: 1; }
.topbar-create-menu-shortcut { margin-left: auto; color: var(--muted-2); }
.topbar-timer-slot { min-width: 0; flex: none; }
.topbar-timer-action {
  border-color: var(--accent-border); background: var(--accent-soft);
  color: var(--accent); font-weight: 600;
}
.topbar-timer-action:hover {
  border-color: var(--accent); background: rgba(52, 211, 153, .14); color: var(--accent-hover);
}
.topbar-timer-running {
  height: 30px; max-width: min(270px, 28vw); display: inline-flex; align-items: stretch;
  padding: 0; overflow: hidden; border: 1px solid var(--accent-border);
  border-radius: var(--radius); background: var(--accent-soft); color: var(--ink);
}
.topbar-timer-main {
  min-width: 0; display: flex; align-items: center; gap: 8px; padding: 0 10px 0 12px;
}
.topbar-timer-pulse {
  width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, .38); animation: topbar-timer-pulse 1.4s infinite;
}
.topbar-timer-copy {
  min-width: 0; display: flex; flex-direction: column; line-height: 1.05;
}
.topbar-timer-project,
.topbar-timer-description {
  max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar-timer-project { color: var(--muted); font-size: 11px; font-weight: 600; }
.topbar-timer-description { color: var(--ink); font-size: 12px; font-weight: 600; }
.topbar-timer-elapsed {
  flex: none; color: var(--accent); font-size: 13px; font-weight: 800;
}
.topbar-timer-stop-form { display: flex; margin: 0; }
.topbar-timer-stop-button {
  width: 30px; height: 100%; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-left: 1px solid var(--accent-border); border-radius: 0;
  background: var(--accent); color: #04130d; cursor: pointer;
}
.topbar-timer-stop-button:hover { background: var(--accent-hover); }
.topbar-timer-stop-button svg {
  width: 11px; height: 11px; fill: currentColor; stroke: none;
}
@keyframes topbar-timer-pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .38); }
  70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
.topbar-notification-action {
  position: relative; color: var(--muted); flex: none;
}
.topbar-notification-action:hover,
.topbar-notification-action.has-active-notifications {
  color: var(--ink); background: var(--panel-3);
}
.topbar-notification-dot {
  position: absolute; top: 5px; right: 6px; width: 7px; height: 7px;
  border: 1.5px solid var(--panel); border-radius: 50%; background: var(--danger);
  box-shadow: 0 0 0 2px var(--danger-soft);
}
.notification-drawer {
  position: fixed; top: 52px; right: 16px; z-index: 120;
  width: min(420px, calc(100vw - 24px)); max-height: min(680px, calc(100vh - 76px));
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden; border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  background: var(--panel); box-shadow: var(--shadow-lg);
  animation: shell-menu-pop .14s ease-out;
}
.notification-drawer.hidden,
.notification-drawer[hidden] { display: none; }
.notification-drawer-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 14px; border-bottom: 1px solid var(--border); background: var(--panel-2);
}
.notification-drawer-eyebrow {
  margin: 0 0 3px; color: var(--accent); font-size: 10.5px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
}
.notification-drawer-header h2 {
  margin: 0; color: var(--ink); font-family: var(--font-display);
  font-size: 17px; line-height: 1.2;
}
.notification-drawer-header-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex: none;
}
.notification-drawer-header-actions form { margin: 0; }
.notification-drawer-body {
  min-height: 0; overflow: auto; padding: 10px; background: var(--panel);
}
.notification-drawer-list { display: grid; gap: 8px; }
.notification-drawer-row {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px; align-items: start; padding: 12px 12px 12px 18px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel-2);
}
.notification-drawer-row.is-unread {
  border-color: var(--accent-border); background: var(--accent-soft);
}
.notification-drawer-row.is-unread::before {
  content: ""; position: absolute; left: 7px; top: 17px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow);
}
.notification-drawer-main { display: grid; min-width: 0; gap: 6px; }
.notification-drawer-title-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
}
.notification-drawer-title-row strong {
  min-width: 0; color: var(--ink); font-size: 13px; line-height: 1.3;
  overflow-wrap: anywhere;
}
.notification-drawer-main p {
  margin: 0; color: var(--ink-2); font-size: 12.5px; line-height: 1.45;
  overflow-wrap: anywhere;
}
.notification-drawer-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px 10px;
  color: var(--muted-2); font-size: 11.5px;
}
.notification-drawer-actions {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end;
  gap: 6px; max-width: 130px;
}
.notification-drawer-actions form { margin: 0; }
.notification-drawer-actions .btn { width: 100%; justify-content: center; }
.notification-drawer-empty-state {
  align-items: flex-start; margin: 0; padding: 20px 16px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--panel-2); text-align: left;
}
.notification-drawer-empty-state .empty-state-icon {
  width: 32px; height: 32px; border-radius: 8px;
  color: var(--accent); background: var(--accent-softer);
  border-color: var(--accent-border);
}
.notification-drawer-empty-state .empty-state-title { font-size: 13px; }
.notification-drawer-empty-state .empty-state-body {
  max-width: 320px; font-size: 12px; line-height: 1.45;
}
.notification-drawer-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-top: 1px solid var(--border);
  color: var(--muted-2); font-size: 11.5px; background: var(--panel-2);
}
.notification-drawer-footer a {
  flex: none; color: var(--accent); font-weight: 700; text-decoration: none;
}
.notification-drawer-footer a:hover { color: var(--accent-hover); }
.notifications-page { min-width: 0; }
.notifications-page-kicker {
  margin: 0 0 4px; color: var(--accent); font-size: 11px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
}
.notifications-page-header .page-header-right form { margin: 0; }
.notifications-page-body {
  display: grid; gap: 16px; min-width: 0;
}
.notifications-page-summary {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
}
.notifications-page-metric { min-height: 112px; }
.notifications-page-panel {
  display: grid; gap: 0; min-width: 0; overflow: hidden;
}
.notifications-page-panel-header {
  align-items: flex-start; padding: 14px 16px;
}
.notifications-page-panel-header h2 {
  margin: 0; color: var(--ink); font-family: var(--font-display);
  font-size: 18px; line-height: 1.2;
}
.notifications-page-panel-header p { margin: 4px 0 0; }
.notifications-page-list {
  display: grid; gap: 10px; padding: 12px; border-top: 1px solid var(--border);
}
.notifications-page-row {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px; align-items: start; min-width: 0; padding: 14px 14px 14px 20px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel-2);
}
.notifications-page-row.is-unread {
  border-color: var(--accent-border); background: var(--accent-soft);
}
.notifications-page-row.is-unread::before {
  content: ""; position: absolute; left: 8px; top: 19px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow);
}
.notifications-page-row-main {
  display: grid; gap: 7px; min-width: 0;
}
.notifications-page-title-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
}
.notifications-page-title-row strong {
  color: var(--ink); font-size: 14px; line-height: 1.3; overflow-wrap: anywhere;
}
.notifications-page-row-main p {
  margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.45;
  overflow-wrap: anywhere;
}
.notifications-page-meta {
  display: flex; flex-wrap: wrap; gap: 7px 10px; color: var(--muted-2);
  font-size: 11.5px;
}
.notifications-page-actions {
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px;
  max-width: 240px;
}
.notifications-page-actions form { margin: 0; }
.notifications-page-empty-state {
  margin: 12px; border: 1px dashed var(--border-strong);
  border-radius: var(--radius); background: var(--panel-2);
}
.topbar-action-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-user {
  height: 30px; max-width: 150px; min-width: 0; display: flex; align-items: center; gap: 7px; padding: 0 9px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel-2); color: var(--ink-2); font-size: 12.5px; font-weight: 500;
}
.topbar-user:hover { background: var(--panel-3); color: var(--ink); }
.topbar-user-avatar { width: 18px; height: 18px; border-radius: 50%; font-size: 8.5px; }
.topbar-user span:not(.topbar-user-avatar) {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kbd {
  display: inline-flex; align-items: center; height: 18px; padding: 0 5px;
  border: 1px solid var(--border); border-radius: 4px; background: var(--panel-3);
  color: var(--muted); font-size: 10px; font-weight: 600;
}

.page-header {
  padding: 20px 24px 16px; display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; border-bottom: 1px solid var(--border); background: var(--bg);
}
.page-header h1 { font-size: 22px; }
.page-header-right { display: flex; gap: 8px; align-items: center; }
.page-body { padding: 20px 24px 48px; min-width: 0; }

/* ---------- Client portal shell ---------- */
.portal-shell {
  width: min(1040px, calc(100% - 48px)); margin: 0 auto; padding: 32px 0 48px;
}
.portal-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 18px;
}
.portal-brand {
  display: inline-flex; align-items: center; gap: 10px; min-width: 0;
  color: var(--ink); text-decoration: none;
}
.portal-brand-mark {
  width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto;
  border: 1px solid var(--accent-border); border-radius: 8px;
  background: var(--accent); color: white; font-family: var(--font-display);
  font-size: 12px; font-weight: 800; letter-spacing: .04em;
}
.portal-brand-text {
  display: grid; gap: 1px; min-width: 0; line-height: 1.15;
}
.portal-brand-text strong {
  min-width: 0; color: var(--ink); font-family: var(--font-display); font-size: 15px;
  overflow-wrap: anywhere;
}
.portal-brand-text span {
  min-width: 0; color: var(--muted-2); font-size: 11.5px; font-weight: 650;
  overflow-wrap: anywhere;
}
.portal-nav {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0;
}
.portal-project-nav {
  flex-wrap: wrap; justify-content: flex-end;
}
.portal-nav a {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--panel);
  color: var(--ink-2); font-size: 12px; font-weight: 700; text-decoration: none;
}
.portal-nav a:hover,
.portal-nav a:focus-visible {
  color: var(--ink); border-color: var(--accent-border);
  background: var(--accent-softer);
}
.portal-header.page-header {
  padding: 0 0 16px; margin-bottom: 8px; border-bottom: 1px solid var(--border);
  background: transparent;
}
.portal-header > div { min-width: 0; }
.portal-header h1 { overflow-wrap: anywhere; }
.portal-eyebrow {
  margin: 0 0 3px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
}
.portal-subtitle p { margin: 4px 0 0; }
.client-portal-notification-feed {
  overflow: hidden; margin-bottom: 16px;
}
.client-portal-overview {
  overflow: hidden; margin-bottom: 16px; padding: 16px;
}
.portal-overview-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px; margin-bottom: 14px;
}
.portal-overview-copy {
  display: grid; gap: 4px; min-width: 0;
}
.portal-overview-kicker {
  margin: 0; color: var(--accent); font-size: 10.5px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
}
.portal-overview-copy h2 {
  margin: 0; color: var(--ink); font-family: var(--font-display);
  font-size: 20px; line-height: 1.15; overflow-wrap: anywhere;
}
.portal-overview-copy p {
  max-width: 560px; margin: 0; color: var(--muted); font-size: 12.5px;
  line-height: 1.45;
}
.portal-overview-contact {
  display: grid; gap: 2px; min-width: 190px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2);
}
.portal-overview-contact span {
  color: var(--muted-2); font-size: 11px; font-weight: 650;
  overflow-wrap: anywhere;
}
.portal-overview-contact strong {
  color: var(--ink); font-size: 13px; line-height: 1.25; overflow-wrap: anywhere;
}
.portal-overview-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px; margin-bottom: 10px;
}
.portal-overview-card {
  min-width: 0; display: grid; gap: 3px; padding: 12px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2);
}
.portal-overview-card span,
.portal-overview-feature-list span {
  color: var(--muted-2); font-size: 10.5px; font-weight: 800;
  letter-spacing: .05em; text-transform: uppercase;
}
.portal-overview-card strong {
  color: var(--ink); font-family: var(--font-display);
  font-size: 18px; line-height: 1.2;
}
.portal-overview-card small {
  color: var(--muted); font-size: 11.5px; line-height: 1.35;
}
.portal-overview-feature-list {
  list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px; margin: 0; padding: 0;
}
.portal-overview-feature-list li {
  min-width: 0; display: grid; gap: 2px; padding: 10px 11px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--panel);
}
.portal-overview-feature-list strong {
  color: var(--ink); font-size: 12px; line-height: 1.25; overflow-wrap: anywhere;
}
.portal-notification-feed-header {
  align-items: flex-start;
}
.portal-notification-feed-header p {
  margin: 3px 0 0; font-size: 12px;
}
.portal-notification-feed-body { padding: 12px; }
.portal-notification-summary {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px; margin-bottom: 10px;
}
.portal-notification-summary-card {
  min-width: 0; display: grid; gap: 2px; padding: 9px 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel-2);
}
.portal-notification-summary-card span {
  color: var(--muted-2); font-size: 10.5px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
}
.portal-notification-summary-card strong {
  color: var(--ink); font-family: var(--font-display);
  font-size: 14px; line-height: 1.2;
}
.portal-notification-policy {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  margin: 0 0 12px; color: var(--muted-2); font-size: 11.5px;
}
.portal-notification-policy span {
  display: inline-flex; align-items: center; gap: 5px;
}
.portal-notification-policy span + span::before {
  content: ""; width: 4px; height: 4px; border-radius: 50%;
  background: var(--border-strong);
}
.portal-notification-list {
  display: grid; gap: 8px;
}
.portal-notification-row {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px; align-items: start; padding: 12px 12px 12px 18px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel);
}
.portal-notification-row.is-unread {
  border-color: var(--accent-border); background: var(--accent-soft);
}
.portal-notification-row.is-unread::before {
  content: ""; position: absolute; left: 7px; top: 17px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow);
}
.portal-notification-main { min-width: 0; display: grid; gap: 6px; }
.portal-notification-title-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
}
.portal-notification-title-row strong {
  min-width: 0; color: var(--ink); font-size: 13px; line-height: 1.3;
  overflow-wrap: anywhere;
}
.portal-notification-title-row .badge { flex: 0 0 auto; }
.portal-notification-main p {
  margin: 0; color: var(--ink-2); font-size: 12.5px; line-height: 1.45;
  overflow-wrap: anywhere;
}
.portal-notification-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px 10px;
  color: var(--muted-2); font-size: 11.5px;
}
.portal-notification-context-badge {
  display: inline-flex; align-items: center; min-height: 20px; padding: 0 7px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--panel-2); color: var(--ink-2); font-weight: 650;
}
.portal-notification-meta a { color: var(--accent); font-weight: 650; }
.portal-notification-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 6px;
}
.portal-notification-actions form { margin: 0; }
.portal-notification-empty-state {
  align-items: flex-start; margin: 0; padding: 18px 16px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--panel); text-align: left;
}
.portal-notification-empty-state .empty-state-icon {
  width: 32px; height: 32px; border-radius: 8px;
  color: var(--accent); background: var(--accent-softer);
  border-color: var(--accent-border);
}
.portal-notification-empty-state .empty-state-icon svg {
  stroke: currentColor;
}
.portal-notification-empty-state .empty-state-title {
  font-size: 13px; line-height: 1.3;
}
.portal-notification-empty-state .empty-state-body {
  max-width: 420px; font-size: 12px; line-height: 1.45;
}
.client-portal-dashboard { overflow: hidden; }
.client-portal-dashboard .panel-body { padding: 16px; }
.portal-panel-title { margin: 0; }
.client-portal-project-empty-state,
.project-portal-empty-state {
  border: 1px dashed var(--border-strong); border-radius: var(--radius-lg);
  background: var(--panel); padding: 34px 18px;
}
.client-portal-project-empty-state .empty-state-icon,
.project-portal-empty-state .empty-state-icon {
  color: var(--accent); background: var(--accent-softer);
  border-color: var(--accent-border);
}
.client-portal-project-empty-state .empty-state-icon svg,
.project-portal-empty-state .empty-state-icon svg {
  stroke: currentColor;
}
.portal-summary-grid {
  display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin: 20px 0;
}
.portal-metric strong {
  display: block; color: var(--ink); font-family: var(--font-display);
  font-size: 17px; font-weight: 700; line-height: 1.2;
}
.portal-metric span { display: block; margin-top: 3px; font-size: 12px; }
.portal-section { margin-top: 16px; overflow: hidden; }
.portal-section h2 { margin-bottom: 12px; }
.portal-approval-panel {
  display: grid; gap: 8px; min-width: 0;
}
.portal-approval-status {
  display: grid; gap: 3px; min-width: 0;
}
.portal-approval-label {
  color: var(--muted-2); font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.portal-approval-status strong {
  color: var(--ink); font-size: 13px; line-height: 1.25;
}
.portal-approval-reason {
  color: var(--muted); font-size: 12px; line-height: 1.35;
  overflow-wrap: anywhere;
}
.portal-approval-form {
  display: flex; flex-wrap: wrap; align-items: end; gap: 6px; margin: 0;
}
.portal-approval-reason-field {
  display: grid; gap: 4px; min-width: 180px; margin: 0;
  color: var(--muted-2); font-size: 10.5px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
}
.portal-approval-form input[type="text"] { width: 100%; }
.portal-contact-comment-panel {
  display: grid; gap: 8px; min-width: 0;
}
.portal-contact-comment-heading {
  display: grid; gap: 3px; min-width: 0;
}
.portal-contact-comment-heading strong {
  color: var(--ink); font-size: 13px; font-weight: 700; line-height: 1.25;
  overflow-wrap: anywhere;
}
.portal-contact-comment-meta {
  color: var(--muted); font-size: 12px; line-height: 1.35;
}
.portal-contact-comment-form {
  display: grid; gap: 7px; min-width: 220px; margin: 0;
}
.portal-contact-comment-field {
  display: grid; gap: 5px; margin: 0;
  color: var(--muted-2); font-size: 10.5px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
}
.portal-contact-comment-field textarea {
  width: 100%; min-height: 76px; resize: vertical;
}
.portal-contact-comment-error {
  margin: 0; color: var(--danger); font-size: 12px; font-weight: 700;
  line-height: 1.35;
}
.portal-contact-comment-submit {
  justify-self: start;
}
.portal-desktop-table { display: block; }
.portal-mobile-list { display: none; }
.portal-mobile-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); padding: 12px; min-width: 0;
}
.portal-mobile-card-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
}
.portal-mobile-card-header strong {
  color: var(--ink); font-weight: 650; line-height: 1.3; min-width: 0;
  overflow-wrap: anywhere;
}
.portal-mobile-card-header .badge { flex: 0 0 auto; margin-top: 1px; }
.portal-mobile-card-text { margin: 9px 0 0; overflow-wrap: anywhere; }
.portal-mobile-card-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 12px; margin: 10px 0 0;
}
.portal-mobile-card-grid > div { min-width: 0; }
.portal-mobile-card-grid dt {
  color: var(--muted-2); font-size: 10.5px; font-weight: 650;
  letter-spacing: .06em; text-transform: uppercase;
}
.portal-mobile-card-grid dd {
  margin: 2px 0 0; color: var(--ink); font-size: 13px; overflow-wrap: anywhere;
}
.portal-project-card .portal-mobile-card-grid dd {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.portal-mobile-actions { margin-top: 10px; }
.portal-invoice-actions {
  display: flex; align-items: center; justify-content: flex-start; gap: 8px;
}
.portal-invoice-download-link {
  justify-content: center;
}

/* ---------- Account pages ---------- */
.account-page { min-width: 0; }
.account-kicker {
  margin: 0 0 4px; color: var(--muted-2); font-size: 10.5px;
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.account-page-body { display: grid; justify-items: start; padding-top: 20px; }
.account-region {
  width: min(640px, 100%); display: grid; gap: 16px; min-width: 0;
}
.account-region-narrow { width: min(520px, 100%); }
.account-card { min-width: 0; overflow: hidden; }
.account-anchor-target { scroll-margin-top: 72px; }
.account-card-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 12px 16px; background: var(--panel-2); border-bottom: 1px solid var(--hairline);
}
.account-card-header p {
  margin: 2px 0 0; font-size: 11.5px; line-height: 1.4;
}
.account-card-header .badge { flex: none; }
.account-card-body,
.account-form {
  display: grid; gap: 14px; padding: 14px 16px 16px;
}
.account-summary-list {
  margin: 0; padding: 0; display: grid;
}
.account-preference-list {
  margin: 0; padding: 0; display: grid;
}
.account-summary-list > div,
.account-preference-list > div {
  display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 16px;
  padding: 12px 16px; border-bottom: 1px solid var(--hairline);
}
.account-summary-list > div:last-child,
.account-preference-list > div:last-child { border-bottom: 0; }
.account-summary-list dt,
.account-preference-list dt {
  color: var(--muted-2); font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.account-summary-list dd,
.account-preference-list dd {
  margin: 0; min-width: 0; color: var(--ink-2); font-size: 12.5px;
  overflow-wrap: anywhere;
}
.account-shortcut-list,
.account-changelog-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.account-shortcut-list li,
.account-changelog-list li {
  display: grid;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.45;
}
.account-shortcut-list li {
  grid-template-columns: 100px minmax(0, 1fr);
  align-items: center;
}
.account-shortcut-list li:last-child,
.account-changelog-list li:last-child { border-bottom: 0; }
.account-changelog-list strong {
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
}
.account-changelog-list span { color: var(--muted); }
.account-action-row {
  display: flex; justify-content: flex-end; gap: 8px; min-width: 0;
}
.account-action-row .btn { min-width: 136px; justify-content: center; }
.account-status { display: grid; justify-items: start; gap: 14px; }
.account-status p { margin: 0; }
.account-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-xl);
}
.account-status-icon.ok {
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent-hover);
}
.account-status-svg {
  width: 20px;
  height: 20px;
}
.account-password-field { min-width: 0; }
.account-password-input-shell {
  position: relative;
  width: 100%;
}
.account-password-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  display: inline-flex;
  width: 14px;
  height: 14px;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}
.account-password-icon svg,
.account-password-toggle svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}
.account-password-input-shell input {
  width: 100%;
  padding-left: 34px;
  padding-right: 38px;
  background: var(--panel-2);
}
.account-password-toggle {
  position: absolute;
  right: 4px;
  top: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.account-password-toggle:hover,
.account-password-toggle:focus-visible {
  background: var(--panel-3);
  color: var(--ink);
  outline: none;
}
.account-password-toggle[aria-pressed="true"] .auth-eye,
.account-password-toggle .auth-eye-off {
  display: none;
}
.account-password-toggle[aria-pressed="true"] .auth-eye-off {
  display: block;
}

/* ---------- Workspace settings / audit pages ---------- */
.workspace-settings-page,
.workspace-audit-page { min-width: 0; }
.workspace-settings-kicker,
.workspace-audit-kicker {
  margin: 0 0 4px; color: var(--muted-2); font-size: 10.5px;
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.workspace-settings-header > div { min-width: 0; }
.workspace-settings-header .muted { overflow-wrap: anywhere; }
.workspace-settings-page-body,
.workspace-audit-page-body { display: grid; justify-items: start; padding-top: 20px; }
.workspace-settings-layout {
  width: min(1100px, 100%); display: grid;
  grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start;
}
.workspace-settings-nav {
  min-width: 0; display: grid; gap: 4px; padding-top: 2px;
}
.workspace-settings-nav .sidebar-section-label { display: block; padding: 0 0 8px; }
.workspace-settings-nav-group {
  display: grid; gap: 4px;
}
.workspace-settings-nav-group + .workspace-settings-nav-group {
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--hairline);
}
.workspace-settings-nav-group-label {
  padding: 0 10px 4px; color: var(--muted-2); font-size: 10px;
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.workspace-settings-nav-link {
  min-height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px;
  border-radius: var(--radius); color: var(--ink-2); font-size: 13px; font-weight: 600;
  text-decoration: none;
}
.workspace-settings-nav-link-count {
  min-width: 18px; height: 18px; padding: 0 6px; border: 1px solid var(--hairline);
  border-radius: 999px; background: var(--panel-2); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; line-height: 1;
}
.workspace-settings-nav-link:hover,
.workspace-settings-nav-link.active {
  background: var(--accent-soft); color: var(--accent-hover);
}
.workspace-settings-nav-link.active {
  box-shadow: inset 2px 0 0 var(--accent);
}
.workspace-settings-nav-link.active .workspace-settings-nav-link-count {
  border-color: var(--accent-border); color: var(--accent-hover);
}
.workspace-settings-region {
  width: min(720px, 100%); display: grid; gap: 16px; min-width: 0;
}
.workspace-settings-card,
.workspace-audit-region { min-width: 0; overflow: hidden; }
.workspace-settings-card { scroll-margin-top: 76px; }
.workspace-settings-card-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 12px 16px; background: var(--panel-2); border-bottom: 1px solid var(--hairline);
}
.workspace-settings-card-header p {
  margin: 2px 0 0; font-size: 11.5px; line-height: 1.4;
}
.workspace-settings-summary {
  margin: 0; padding: 0; display: grid;
}
.workspace-settings-summary > div {
  display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px;
  padding: 12px 16px; border-bottom: 1px solid var(--hairline);
}
.workspace-settings-summary > div:last-child { border-bottom: 0; }
.workspace-settings-summary dt {
  color: var(--muted-2); font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.workspace-settings-summary dd {
  margin: 0; color: var(--ink-2); font-size: 12.5px; overflow-wrap: anywhere;
}
.workspace-settings-metrics {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px;
  background: var(--hairline);
}
.workspace-settings-metrics > div {
  min-width: 0; display: grid; gap: 2px; padding: 16px; background: var(--panel);
}
.workspace-settings-metric-value {
  color: var(--ink); font-size: 26px; line-height: 1; font-weight: 700;
}
.workspace-settings-metric-label {
  color: var(--muted-2); font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.workspace-settings-portal-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.workspace-settings-member-card,
.workspace-settings-role-defaults-card {
  border-color: var(--border-strong);
}
.workspace-settings-member-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.workspace-settings-member-table-wrap {
  border-top: 1px solid var(--hairline); overflow-x: auto;
}
.workspace-settings-member-table,
.workspace-settings-role-defaults-table {
  min-width: 720px;
}
.workspace-settings-member-main {
  min-width: 0; display: grid; gap: 5px;
}
.workspace-settings-member-main strong {
  overflow-wrap: anywhere;
}
.workspace-settings-member-role-list {
  min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
}
.workspace-settings-role-pill {
  display: inline-flex; align-items: center; min-height: 20px; padding: 2px 7px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--panel-2); color: var(--ink-2); font-size: 11px;
  font-weight: 700; white-space: nowrap;
}
.workspace-settings-rate-card {
  border-color: var(--accent-border);
}
.workspace-settings-rate-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-top: 1px solid var(--hairline);
}
.workspace-settings-rate-precedence {
  min-width: 0; color: var(--ink-2); font-size: 12px; line-height: 1.45;
}
.workspace-settings-rate-table-wrap {
  border-top: 1px solid var(--hairline); overflow-x: auto;
}
.workspace-settings-rate-table {
  min-width: 780px;
}
.workspace-settings-integration-card {
  border-color: var(--border-strong);
}
.workspace-settings-integration-form {
  padding: 16px; border-top: 1px solid var(--hairline);
}
.workspace-settings-integration-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
}
.workspace-settings-integration-form select[multiple] {
  min-height: 154px; padding: 8px;
}
.workspace-settings-integration-secret {
  display: grid; gap: 10px; margin: 14px 16px 0; padding: 12px;
  border: 1px solid var(--accent-border); border-radius: var(--radius);
  background: var(--accent-soft);
}
.workspace-settings-integration-secret strong {
  display: block; color: var(--ink); font-size: 13px; margin-bottom: 3px;
}
.workspace-settings-integration-secret p {
  margin: 0; color: var(--ink-2); font-size: 12px; line-height: 1.45;
}
.workspace-settings-integration-secret code,
.workspace-settings-integration-code {
  display: block; max-width: 100%; color: var(--ink); font-family: var(--font-mono);
  font-size: 11.5px; line-height: 1.5; overflow-wrap: anywhere;
}
.workspace-settings-integration-secret code {
  padding: 9px 10px; border: 1px solid var(--accent-border);
  border-radius: var(--radius); background: var(--panel);
}
.workspace-settings-integration-table-wrap {
  border-top: 1px solid var(--hairline); overflow-x: auto;
}
.workspace-settings-integration-table {
  min-width: 760px;
}
.workspace-settings-integration-table td {
  vertical-align: middle;
}
.workspace-settings-scope-details {
  position: relative;
}
.workspace-settings-scope-details summary {
  width: max-content; cursor: pointer; list-style: none;
}
.workspace-settings-scope-details summary::-webkit-details-marker {
  display: none;
}
.workspace-settings-scope-details summary:focus-visible {
  outline: 2px solid var(--focus-ring); outline-offset: 3px; border-radius: var(--radius-sm);
}
.workspace-settings-scope-badge::after {
  content: ""; width: 5px; height: 5px; border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-1px);
}
.workspace-settings-scope-details[open] .workspace-settings-scope-badge::after {
  transform: rotate(225deg) translate(-1px, -1px);
}
.workspace-settings-scope-list {
  display: flex; flex-direction: column; align-items: flex-start; gap: 5px;
  max-width: min(420px, 70vw); margin-top: 8px; padding: 8px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel-2); list-style: none;
}
.workspace-settings-scope-list code {
  overflow-wrap: anywhere; white-space: normal;
}
.workspace-settings-integration-table td:first-child strong,
.workspace-settings-integration-table td:first-child code {
  margin-bottom: 2px;
}
.workspace-settings-integration-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--hairline);
}
.workspace-settings-integration-row-action {
  margin: 0; display: flex; justify-content: flex-end;
}
.workspace-settings-integration-empty {
  display: grid; gap: 4px; padding: 16px; border-top: 1px solid var(--hairline);
  color: var(--ink-2); font-size: 12px; line-height: 1.45;
}
.workspace-settings-integration-empty strong {
  color: var(--ink); font-size: 13px;
}
.workspace-settings-integration-empty p { margin: 0; }
.workspace-settings-billing-card {
  border-color: var(--border-strong);
}
.workspace-settings-billing-form {
  padding: 16px; border-top: 1px solid var(--hairline);
}
.workspace-settings-billing-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
}
.workspace-settings-billing-wide {
  grid-column: 1 / -1;
}
.workspace-settings-billing-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--hairline);
}
.workspace-settings-billing-note {
  min-width: 0; color: var(--ink-2); font-size: 12px; line-height: 1.45;
}
.workspace-settings-billing-toggle .project-settings-checkbox {
  margin-top: 1px;
}
.workspace-settings-numbering-card {
  border-color: var(--accent-border);
}
.workspace-settings-numbering-form {
  padding: 16px; border-top: 1px solid var(--hairline);
}
.workspace-settings-numbering-form-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
}
.workspace-settings-numbering-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--hairline);
}
.workspace-settings-numbering-preview-line {
  min-width: 0; color: var(--ink-2); font-size: 12px;
}
.workspace-settings-numbering-preview-line strong {
  color: var(--accent-hover);
}
.workspace-settings-numbering-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px;
  background: var(--hairline);
}
.workspace-settings-numbering-item {
  min-width: 0; display: grid; gap: 5px; padding: 14px 16px;
  background: var(--panel);
}
.workspace-settings-numbering-label {
  color: var(--muted-2); font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.workspace-settings-numbering-value {
  color: var(--ink); font-size: 18px; line-height: 1.15; font-weight: 700;
  overflow-wrap: anywhere;
}
.workspace-settings-numbering-hint {
  color: var(--muted); font-size: 11.5px; line-height: 1.4;
}
.workspace-settings-numbering-preview {
  background: var(--accent-soft);
}
.workspace-settings-numbering-preview .workspace-settings-numbering-value {
  color: var(--accent-hover);
}
.workspace-settings-numbering-note {
  padding: 11px 16px; border-top: 1px solid var(--hairline);
  color: var(--ink-2); font-size: 12px; line-height: 1.45;
}
.workspace-portal-contact-feedback,
.workspace-portal-grant-feedback {
  margin: 14px 16px 0;
}
.workspace-portal-login-link {
  display: grid; gap: 10px; margin: 14px 16px 0; padding: 12px;
  border: 1px solid var(--accent-border); border-radius: var(--radius);
  background: var(--accent-soft); color: var(--ink);
}
.workspace-portal-login-link strong {
  display: block; font-size: 13px; margin-bottom: 3px;
}
.workspace-portal-login-link p {
  margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45;
}
.workspace-portal-login-link-main {
  min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: start; gap: 12px;
}
.workspace-portal-login-link-action {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; flex-wrap: wrap;
}
.workspace-portal-login-link-action .btn {
  justify-content: center; min-width: 118px;
}
.workspace-portal-login-copy-status {
  background: var(--panel); white-space: nowrap;
}
.workspace-portal-login-link-url {
  display: grid; gap: 5px; min-width: 0;
  color: var(--muted-2); font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.workspace-portal-login-link-url input {
  width: 100%; min-width: 0; text-transform: none; letter-spacing: 0;
  font-size: 12px; font-weight: 500; color: var(--ink-2);
}
.workspace-portal-contact-form,
.workspace-portal-grant-form {
  display: grid; gap: 12px; padding: 14px 16px;
  border-top: 1px solid var(--hairline);
}
.workspace-portal-contact-form-actions,
.workspace-portal-grant-form-actions {
  align-items: center; justify-content: space-between; gap: 10px;
}
.workspace-portal-grant-note {
  flex: 1 1 auto; margin: 0; color: var(--muted); font-size: 11.5px;
  line-height: 1.4;
}
.workspace-portal-grant-list {
  display: grid;
}
.workspace-portal-contact-list {
  display: grid;
}
.workspace-portal-contact-row,
.workspace-portal-grant-row {
  min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px; align-items: start; padding: 14px 16px;
  border-top: 1px solid var(--hairline);
}
.workspace-portal-contact-title,
.workspace-portal-grant-title {
  min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  color: var(--ink); font-size: 13px; font-weight: 700;
}
.workspace-portal-contact-meta,
.workspace-portal-grant-meta {
  min-width: 0; display: flex; flex-wrap: wrap; gap: 6px 10px;
  margin-top: 4px; color: var(--muted); font-size: 11.5px; line-height: 1.45;
}
.workspace-portal-contact-meta span,
.workspace-portal-grant-meta span {
  min-width: 0; overflow-wrap: anywhere;
}
.workspace-portal-contact-meta span + span::before,
.workspace-portal-grant-meta span + span::before {
  content: "·"; margin-right: 10px; color: var(--muted-2);
}
.workspace-portal-grant-label {
  margin-top: 8px; color: var(--ink-2); font-size: 12px; font-weight: 600;
}
.workspace-portal-grant-flags {
  display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px;
  max-width: 260px;
}
.workspace-portal-grant-actions {
  display: flex; justify-content: flex-end; grid-column: 2;
}
.workspace-portal-contact-actions {
  display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px;
  grid-column: 2;
}
.workspace-portal-contact-actions form,
.workspace-portal-grant-actions form {
  margin: 0;
}
.workspace-settings-empty {
  padding: 16px; border-top: 1px solid var(--hairline);
}
.workspace-settings-empty p { margin: 0; font-size: 12px; }
.workspace-audit-region {
  width: 100%; padding: 14px; display: grid; gap: 14px;
}
.workspace-audit-log {
  display: grid; gap: 14px; min-width: 0;
}
.workspace-audit-summary {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; min-width: 0;
}
.workspace-audit-summary h2 {
  margin: 0; color: var(--ink); font-family: var(--font-display);
  font-size: 20px; line-height: 1.1;
}
.workspace-audit-summary p { margin: 5px 0 0; }
.workspace-audit-summary .badge { flex: none; margin-top: 1px; }
.workspace-audit-filter-panel {
  display: grid; gap: 12px; min-width: 0; padding: 12px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--panel-2);
}
.workspace-audit-filter-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.workspace-audit-filter-header h3 {
  margin: 0; color: var(--ink); font-size: 13px; font-weight: 700;
}
.workspace-audit-filter-header p {
  margin: 3px 0 0; font-size: 11.5px; line-height: 1.35;
}
.workspace-audit-filter-form {
  display: grid; grid-template-columns: minmax(170px, 1.1fr) repeat(2, minmax(140px, 1fr)) auto;
  gap: 10px; align-items: end; min-width: 0;
}
.workspace-audit-filter-form label {
  min-width: 0; margin: 0;
}
.workspace-audit-filter-form input,
.workspace-audit-filter-form select {
  width: 100%; min-height: 34px;
}
.workspace-audit-filter-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  min-width: 0;
}
.workspace-audit-export-form {
  display: flex; justify-content: flex-end; margin: 0; min-width: 0;
}
.workspace-audit-export-action { align-self: flex-end; }
.workspace-audit-log-table-wrap {
  margin: 0; overflow-x: auto;
}
.workspace-audit-log-table {
  min-width: 980px; table-layout: fixed;
}
.workspace-audit-log-table th:nth-child(1),
.workspace-audit-log-table td:nth-child(1) { width: 148px; }
.workspace-audit-log-table th:nth-child(2),
.workspace-audit-log-table td:nth-child(2) { width: 170px; }
.workspace-audit-log-table th:nth-child(3),
.workspace-audit-log-table td:nth-child(3) { width: 190px; }
.workspace-audit-log-table th:nth-child(4),
.workspace-audit-log-table td:nth-child(4) { width: 108px; }
.workspace-audit-log-table th:nth-child(5),
.workspace-audit-log-table td:nth-child(5) { width: 134px; }
.workspace-audit-log-table th,
.workspace-audit-log-table td {
  vertical-align: top;
}
.workspace-audit-log-table code,
.workspace-audit-mobile-card code {
  white-space: normal; overflow-wrap: anywhere;
}
.workspace-audit-mobile-list {
  min-width: 0;
}
.workspace-audit-mobile-card {
  color: var(--ink);
}
.workspace-audit-mobile-title {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px; min-width: 0;
}
.workspace-audit-mobile-title strong {
  min-width: 0; overflow-wrap: anywhere; color: var(--ink);
  font-size: 13px; font-weight: 700; line-height: 1.3;
}
.workspace-audit-mobile-title .badge {
  flex: none; margin-top: 1px;
}
.workspace-audit-mobile-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 12px; margin: 2px 0 0;
}
.workspace-audit-mobile-grid > div { min-width: 0; }
.workspace-audit-mobile-grid dt,
.workspace-audit-mobile-detail > span {
  color: var(--muted-2); font-size: 10px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.workspace-audit-mobile-grid dd,
.workspace-audit-mobile-detail > div {
  margin: 2px 0 0; color: var(--ink); font-size: 12.5px; overflow-wrap: anywhere;
}
.workspace-audit-mobile-detail {
  display: grid; gap: 2px; min-width: 0;
}
.workspace-audit-empty-state {
  margin: 0;
}

/* ---------- Invoice SMTP settings page ---------- */
.smtp-settings-page { min-width: 0; }
.smtp-settings-kicker {
  margin: 0 0 4px; color: var(--muted-2); font-size: 10.5px;
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.smtp-settings-header > div:first-child { min-width: 0; }
.smtp-settings-header .muted { overflow-wrap: anywhere; }
.smtp-settings-header .page-header-right { align-items: flex-end; }
.smtp-settings-page-body { padding-top: 20px; }
.smtp-settings-layout { width: min(1180px, 100%); }
.smtp-settings-region {
  width: min(900px, 100%); display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
  gap: 16px; align-items: start; min-width: 0;
}
.smtp-settings-card,
.smtp-settings-status-card { min-width: 0; overflow: hidden; }
.smtp-settings-card-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 12px 16px; background: var(--panel-2); border-bottom: 1px solid var(--hairline);
}
.smtp-settings-card-header p {
  margin: 2px 0 0; font-size: 11.5px; line-height: 1.4;
}
.smtp-settings-card-header .badge { flex: none; }
.smtp-settings-form {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px; padding: 14px 16px 16px;
}
.smtp-settings-field-wide,
.smtp-settings-actions { grid-column: 1 / -1; }
.smtp-settings-field-error { display: grid; gap: 2px; margin-top: 2px; }
.smtp-settings-toggle-field {
  margin-bottom: 0; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--panel-2);
}
.smtp-settings-toggle-field label {
  display: flex; align-items: center; gap: 8px; color: var(--ink-2);
}
.smtp-settings-toggle-field input {
  flex: none; width: auto;
}
.smtp-settings-password-state {
  width: fit-content; margin-top: 6px;
}
.smtp-settings-actions {
  display: flex; justify-content: flex-end; gap: 8px;
}
.smtp-settings-actions .btn { min-width: 180px; justify-content: center; }
.smtp-settings-summary-list {
  display: grid; margin: 0; padding: 0;
}
.smtp-settings-summary-list > div {
  display: grid; gap: 3px; padding: 12px 16px; border-bottom: 1px solid var(--hairline);
}
.smtp-settings-summary-list > div:last-child { border-bottom: 0; }
.smtp-settings-summary-list dt {
  color: var(--muted-2); font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.smtp-settings-summary-list dd {
  margin: 0; color: var(--ink-2); font-size: 12.5px; overflow-wrap: anywhere;
}

/* ---------- Tasks page ---------- */
.tasks-page { min-width: 0; }
.tasks-page-body { display: grid; gap: 20px; }
.tasks-workbench { overflow: visible; }
.tasks-workbench-header { align-items: flex-start; gap: 12px; }
.tasks-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tasks-view-toggle {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel-2);
}
.tasks-view-toggle a {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 28px; min-width: 72px; padding: 0 10px; border-radius: calc(var(--radius) - 3px);
  color: var(--muted); font-size: 12px; font-weight: 600; text-decoration: none;
}
.tasks-view-toggle a:hover {
  color: var(--ink); background: rgba(255,255,255,.05);
}
.tasks-view-toggle a[aria-current="page"] {
  color: var(--on-accent); background: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}
.tasks-create-disclosure {
  margin: 0; position: relative;
}
.tasks-create-disclosure > summary {
  display: inline-flex; align-items: center; min-height: 26px; padding: 0 9px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--panel-2); color: var(--ink); cursor: pointer; font-size: 11.5px;
  font-weight: 500; list-style: none;
}
.tasks-create-disclosure > summary::-webkit-details-marker { display: none; }
.tasks-create-disclosure[open] > summary {
  color: var(--accent); background: var(--accent-soft); border-color: var(--accent-border);
}
.tasks-header .tasks-create-disclosure > summary {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent);
  font-weight: 600;
}
.tasks-header .tasks-create-disclosure > summary:hover {
  background: var(--accent-hover); border-color: var(--accent-hover);
  box-shadow: 0 0 18px var(--accent-glow);
}
.tasks-header .tasks-create-disclosure[open] > summary {
  color: var(--on-accent); background: var(--accent); border-color: var(--accent);
}
.tasks-create-form {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 20;
  width: min(760px, calc(100vw - 320px)); padding: 12px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: 0 18px 48px rgba(0,0,0,.28);
}
.tasks-create-form .work-item-create-form,
.dashboard-create-work-item .work-item-create-form {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
}
.work-item-create-heading,
.work-item-create-field-wide,
.work-item-create-errors {
  grid-column: 1 / -1;
}
.tasks-create-form .work-item-create-heading,
.dashboard-create-work-item .work-item-create-heading { display: none; }
.work-item-create-field {
  display: grid; gap: 4px; min-width: 0; color: var(--ink-2);
}
.work-item-create-field label {
  font-size: 12.5px; font-weight: 500; color: var(--ink-2);
}
.work-item-create-control {
  width: 100%; min-width: 0;
}
.work-item-create-description-control { min-height: 68px; }
.work-item-create-field-error {
  display: grid; gap: 2px; margin-top: 2px;
}
.work-item-create-submit { justify-self: start; }
.work-item-create-empty-state {
  margin: 0; align-items: flex-start; text-align: left;
}
.work-item-create-empty-state .empty-state-body {
  max-width: 360px;
}
.tasks-filter-bar {
  display: grid; grid-template-columns: auto minmax(180px, 1.2fr) repeat(3, minmax(140px, .8fr)) auto;
  gap: 10px; align-items: end; padding: 10px; margin-bottom: 16px;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel-2);
}
.tasks-filter-label {
  min-height: 34px; display: inline-flex; align-items: center; gap: 7px; padding-right: 10px;
  border-right: 1px solid var(--hairline); color: var(--muted-2); font-size: 11px;
  font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.tasks-filter-icon {
  width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.tasks-filter-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.tasks-filter-bar label {
  display: grid; gap: 4px; color: var(--ink-2); font-size: 12px; font-weight: 500;
}
.tasks-filter-bar input,
.tasks-filter-bar select {
  width: 100%; min-height: 34px; font-size: 12.5px;
}
.tasks-filter-bar .btn { min-height: 34px; justify-content: center; }
.tasks-list-region { min-width: 0; }
.tasks-current-timer {
  min-width: 0;
}
.tasks-current-timer:empty {
  display: none;
}
.tasks-current-timer .current-timer-shell {
  margin-bottom: 14px;
}
.work-item-table-actions {
  width: 52px;
  text-align: right;
}
.work-item-timer-action {
  display: inline-flex;
  justify-content: flex-end;
  margin: 0;
}
.work-item-timer-action .btn {
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
}
.work-item-timer-action svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}
.work-item-kanban {
  display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 12px;
  align-items: start; min-width: 0;
}
.work-item-kanban-column {
  min-width: 0; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--panel-2); overflow: hidden;
}
.work-item-kanban-column-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 44px; padding: 10px 12px; border-bottom: 1px solid var(--hairline);
}
.work-item-kanban-column-header h3 {
  margin: 0; color: var(--ink); font-size: 13px; line-height: 1.2;
}
.work-item-kanban-dropzone {
  display: grid; gap: 8px; align-content: start; min-height: 180px; padding: 10px;
  transition: background-color .16s ease, box-shadow .16s ease;
}
.work-item-kanban-dropzone.is-drop-target {
  background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-border);
}
.work-item-kanban-card {
  display: grid; gap: 8px; min-width: 0; padding: 11px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); color: var(--ink); text-decoration: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.14);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease, opacity .16s ease;
}
.work-item-kanban-card:hover {
  border-color: var(--border-strong); box-shadow: 0 12px 28px rgba(0,0,0,.2);
  transform: translateY(-1px);
}
.work-item-kanban-card[draggable="true"] { cursor: grab; }
.work-item-kanban-card.is-dragging {
  cursor: grabbing; opacity: .62; transform: rotate(.4deg) scale(.99);
}
.work-item-kanban-card.is-updating {
  opacity: .78; pointer-events: none;
}
.work-item-kanban-card.is-update-error {
  border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger);
}
.work-item-kanban-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  min-width: 0;
}
.work-item-kanban-card-link {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.work-item-kanban-card-link:hover {
  color: inherit;
}
.work-item-kanban-timer-action {
  align-self: start;
}
.work-item-kanban-project {
  min-width: 0; color: var(--muted-2); font-size: 11px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.work-item-kanban-card strong {
  color: var(--ink); font-size: 13.5px; line-height: 1.25; overflow-wrap: anywhere;
}
.work-item-kanban-muted {
  color: var(--muted); font-size: 12px; line-height: 1.35; overflow-wrap: anywhere;
}
.work-item-kanban-badges,
.work-item-kanban-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0;
}
.work-item-kanban-meta {
  color: var(--muted); font-size: 12px; line-height: 1.35;
}
.work-item-kanban-status-action {
  min-width: 0; margin: 0; padding-top: 8px; border-top: 1px solid var(--hairline);
}
.work-item-kanban-status-action > summary {
  width: fit-content; min-height: 30px; list-style: none;
}
.work-item-kanban-status-action > summary::-webkit-details-marker { display: none; }
.work-item-kanban-status-action[open] > summary {
  color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft);
}
.work-item-kanban-status-form {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px;
  align-items: end; min-width: 0; margin-top: 8px;
}
.work-item-kanban-status-form label {
  display: grid; gap: 4px; min-width: 0; color: var(--ink-2);
  font-size: 11.5px; font-weight: 600;
}
.work-item-kanban-status-form select {
  width: 100%; min-width: 0; min-height: 32px;
}
.work-item-kanban-status-form .btn {
  min-height: 32px; justify-content: center;
}
.work-item-kanban-empty {
  min-height: 88px; display: grid; place-items: center; padding: 14px;
  border: 1px dashed var(--border); border-radius: var(--radius);
  color: var(--muted); font-size: 12.5px; text-align: center;
}

/* ---------- Projects page ---------- */
.projects-page { min-width: 0; }
.projects-page-body { display: grid; gap: 20px; }
.projects-workbench { overflow: visible; }
.projects-workbench-header { align-items: flex-start; gap: 12px; }
.projects-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.projects-filter-bar {
  display: grid; grid-template-columns: auto minmax(150px, 1.1fr) repeat(4, minmax(126px, .75fr)) auto auto;
  gap: 10px; align-items: end; padding: 10px;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel-2);
}
.projects-filter-label {
  min-height: 34px; display: inline-flex; align-items: center; gap: 7px; padding-right: 10px;
  border-right: 1px solid var(--hairline); color: var(--muted-2); font-size: 11px;
  font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.projects-filter-icon {
  width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.projects-filter-icon svg,
.projects-folder-icon svg {
  width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7;
}
.projects-filter-bar label {
  display: grid; gap: 4px; color: var(--ink-2); font-size: 12px; font-weight: 500;
}
.projects-filter-bar input,
.projects-filter-bar select {
  width: 100%; min-height: 34px; font-size: 12.5px;
}
.projects-filter-actions { display: inline-flex; gap: 6px; align-items: center; }
.projects-filter-actions .btn { min-height: 34px; justify-content: center; }
.projects-filter-summary {
  min-height: 34px; display: inline-flex; align-items: center; white-space: nowrap;
  font-size: 12px; justify-self: end;
}
.projects-table-wrap { overflow-x: auto; }
.projects-table { min-width: 960px; table-layout: fixed; }
.projects-folder-col { width: 34px; text-align: center; }
.projects-table th:nth-child(2), .projects-table td:nth-child(2) { width: 220px; }
.projects-table th:nth-child(3), .projects-table td:nth-child(3) { width: 92px; }
.projects-table th:nth-child(4), .projects-table td:nth-child(4) { width: 72px; }
.projects-table th:nth-child(5), .projects-table td:nth-child(5) { width: 94px; }
.projects-table th:nth-child(6), .projects-table td:nth-child(6) { width: 184px; }
.projects-table th:nth-child(7), .projects-table td:nth-child(7) { width: 80px; }
.projects-table th:nth-child(8), .projects-table td:nth-child(8) { width: 72px; }
.projects-table th:nth-child(9), .projects-table td:nth-child(9) { width: 112px; }
.projects-client-row td {
  padding: 8px 12px; background: var(--panel-2);
  border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
}
.projects-client-heading { display: flex; align-items: center; gap: 8px; min-width: 0; }
.projects-client-heading strong { color: var(--ink-2); font-size: 12px; }
.projects-client-marker {
  width: 8px; height: 8px; flex: 0 0 auto; border-radius: 2px; background: var(--accent);
}
.projects-client-count { margin-left: auto; font-size: 11px; white-space: nowrap; }
.projects-data-row { cursor: default; }
.projects-folder-icon {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px;
  color: var(--accent); border-radius: 4px; background: var(--accent-softer);
}
.projects-name-cell { display: grid; gap: 4px; min-width: 0; }
.projects-name-line,
.projects-members-line {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0;
}
.projects-avatar-stack { display: inline-flex; align-items: center; padding-left: 2px; }
.projects-avatar-stack span {
  width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center;
  margin-left: -2px; border: 1px solid var(--panel); border-radius: 50%;
  background: var(--panel-4); color: var(--ink-2); font-size: 8px; font-weight: 700;
}
.projects-number-cell { font-weight: 500; text-align: right; }
.projects-warning-value { color: var(--warning); }
.projects-budget-cell {
  display: grid; grid-template-columns: 58px 30px minmax(74px, auto);
  align-items: center; gap: 8px; min-width: 0;
}
.projects-budget-progress {
  display: block; width: 58px; height: 6px; appearance: none;
  border: 0; border-radius: 999px; overflow: hidden; background: var(--panel-3);
}
.projects-budget-progress::-webkit-progress-bar {
  border-radius: 999px; background: var(--panel-3);
}
.projects-budget-progress::-webkit-progress-value {
  border-radius: 999px; background: var(--accent);
}
.projects-budget-progress::-moz-progress-bar {
  border-radius: 999px; background: var(--accent);
}
.projects-mobile-budget {
  display: flex; align-items: center; gap: 8px; min-width: 0; margin-top: 2px;
}
.projects-mobile-name-link {
  min-width: 0; color: var(--ink); text-decoration: none;
}
.projects-mobile-name-link:hover {
  color: var(--accent); text-decoration: underline;
}
.projects-mobile-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; margin-top: 4px;
}
.projects-mobile-actions .btn {
  min-height: 30px;
}
.projects-pm-pill {
  display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px;
  margin-right: 6px; border-radius: 50%; background: var(--panel-4);
  color: var(--ink-2); font-size: 9px; font-weight: 700;
}
.projects-table td:nth-child(7) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.projects-current-timer {
  min-width: 0;
}
.projects-current-timer:empty {
  display: none;
}
.projects-actions-cell {
  display: flex; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap;
}
.project-timer-action {
  display: inline-flex; justify-content: flex-end; margin: 0;
}
.project-timer-action .btn {
  width: 30px; height: 30px; min-height: 30px; padding: 0;
}
.project-timer-action svg {
  width: 13px; height: 13px; fill: currentColor;
}
.project-task-create-action {
  position: relative; display: inline-flex; justify-content: flex-end; margin: 0;
}
.project-task-create-action > summary {
  list-style: none; cursor: pointer;
}
.project-task-create-action > summary::-webkit-details-marker {
  display: none;
}
.project-task-create-summary {
  gap: 5px;
}
.project-task-create-summary svg {
  width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2;
}
.project-task-create-action[open] > summary {
  color: var(--on-accent); background: var(--accent); border-color: var(--accent);
}
.project-task-create-form {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 30;
  display: grid; gap: 8px; width: 260px; padding: 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); box-shadow: 0 18px 48px rgba(0,0,0,.28);
}
.project-task-create-form input {
  width: 100%; min-height: 34px; font-size: 12.5px;
}
.project-task-create-form .btn {
  justify-content: center;
}
.project-task-create-errors {
  display: grid; gap: 2px; font-size: 12px;
}
.project-row-more-menu-shell {
  position: relative; display: inline-flex; justify-content: flex-end; margin: 0;
}
.project-row-more-menu-trigger {
  width: 30px; height: 30px; min-height: 30px; padding: 0;
}
.project-row-more-menu-icon {
  width: 14px; height: 14px; flex: none; fill: currentColor;
}
.project-row-more-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 40;
  display: grid; gap: 4px; width: min(190px, calc(100vw - 32px)); padding: 6px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); box-shadow: var(--shadow);
  animation: shell-menu-pop .14s ease-out;
}
.project-row-more-menu[hidden] {
  display: none;
}
.project-row-more-menu-item {
  display: flex; align-items: center; min-height: 32px; min-width: 0;
  padding: 0 9px; border-radius: var(--radius);
  color: var(--ink-2); font-size: 12.5px; font-weight: 600;
  text-decoration: none;
}
.project-row-more-menu-item:hover,
.project-row-more-menu-item:focus-visible {
  color: var(--ink); background: var(--panel-2);
}
.project-row-more-menu-item:focus-visible {
  outline: 2px solid var(--accent); outline-offset: -2px;
}
.project-template-catalog-panel { scroll-margin-top: 18px; }
.project-template-catalog-panel .panel-header { align-items: flex-start; }
.project-template-catalog-panel .project-templates { display: grid; gap: 12px; }
.project-template-catalog-panel .project-templates > h3 { display: none; }
.project-templates-intro {
  margin: 0; font-size: 12.5px; line-height: 1.45;
}
.project-templates-project-empty-state {
  align-items: flex-start; margin: 0; padding: 18px 16px;
  border: 1px solid var(--hairline); border-radius: var(--radius);
  background: var(--panel-2); text-align: left;
}
.project-templates-project-empty-state .empty-state-icon {
  width: 32px; height: 32px; border-radius: 8px;
  color: var(--accent); background: var(--accent-softer);
  border-color: var(--accent-border);
}
.project-templates-project-empty-state .empty-state-icon svg {
  stroke: currentColor;
}
.project-templates-project-empty-state .empty-state-title {
  font-size: 13px; line-height: 1.3;
}
.project-templates-project-empty-state .empty-state-body {
  max-width: 420px; font-size: 12px; line-height: 1.45;
}
.project-templates-table-wrap { overflow-x: auto; }
.project-templates-table { min-width: 760px; }
.project-template-launch-details {
  display: grid; gap: 8px; min-width: 230px;
}
.project-template-launch-summary {
  min-height: 32px; display: inline-flex; align-items: center; justify-content: center;
  width: 100%; padding: 0 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--panel-2); color: var(--ink);
  font-size: 12px; font-weight: 700; cursor: pointer; list-style: none;
}
.project-template-launch-summary::-webkit-details-marker { display: none; }
.project-template-launch-summary:hover {
  border-color: var(--accent-border); background: var(--accent-soft);
}
.project-template-launch-form {
  display: grid; gap: 8px; min-width: 0; margin: 8px 0 0; padding: 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel-2);
}
.project-template-launch-field {
  display: grid; gap: 4px; margin: 0;
  color: var(--ink-2); font-size: 12px; font-weight: 600;
}
.project-template-launch-field.has-error {
  color: var(--danger);
}
.project-template-launch-field span {
  color: var(--muted-2); font-size: 10px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.project-template-launch-field.has-error span {
  color: var(--danger);
}
.project-template-launch-field input,
.project-template-launch-field select {
  width: 100%;
}
.project-template-launch-field.has-error input,
.project-template-launch-field.has-error select {
  border-color: var(--danger-border);
  box-shadow: 0 0 0 3px var(--danger-soft);
}
.project-template-launch-submit {
  justify-content: center;
}
.project-template-launch-errors {
  display: grid; gap: 2px; margin: 0; color: var(--danger); font-size: 12px; font-weight: 700;
  line-height: 1.35;
}
.project-template-mobile-launch-errors { margin-top: 2px; }
.project-templates-mobile-list { min-width: 0; }
.project-template-mobile-card {
  color: var(--ink);
}
.project-template-mobile-card p {
  margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.45;
  overflow-wrap: anywhere;
}
.project-template-mobile-title {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px; min-width: 0;
}
.project-template-mobile-title strong {
  min-width: 0; overflow-wrap: anywhere; color: var(--ink);
  font-size: 13px; font-weight: 700; line-height: 1.3;
}
.project-template-mobile-title .badge { flex: none; margin-top: 1px; }
.project-template-mobile-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px; margin: 2px 0 0;
}
.project-template-mobile-grid > div { min-width: 0; }
.project-template-mobile-wide { grid-column: 1 / -1; }
.project-template-mobile-grid dt {
  color: var(--muted-2); font-size: 10px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.project-template-mobile-grid dd {
  margin: 2px 0 0; color: var(--ink); font-size: 12.5px; overflow-wrap: anywhere;
}
.project-template-mobile-launch-form {
  display: grid; gap: 8px; min-width: 0; margin: 4px 0 0; padding-top: 10px;
  border-top: 1px solid var(--hairline);
}
.project-template-mobile-launch-form label {
  display: grid; gap: 4px; color: var(--ink-2); font-size: 12px; font-weight: 500;
}
.project-template-mobile-launch-form input,
.project-template-mobile-launch-form select {
  width: 100%;
}
.project-template-mobile-launch-form button:not([class]) {
  min-height: 34px; justify-content: center;
}

/* ---------- Clients page ---------- */
.clients-page {
  min-width: 0; min-height: 100%; display: grid; grid-template-columns: 320px minmax(0, 1fr);
}
.clients-list-rail {
  min-width: 0; display: flex; flex-direction: column; border-right: 1px solid var(--border);
  background: var(--panel);
}
.clients-rail-header {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--hairline);
}
.clients-rail-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.clients-rail-title h1 { margin: 0; font-size: 18px; line-height: 1.2; }
.client-create-panel {
  padding: 10px 12px; border-bottom: 1px solid var(--hairline);
  background: var(--panel);
}
.client-create-panel > summary {
  width: 100%; cursor: pointer; list-style: none; justify-content: center;
}
.client-create-panel > summary::-webkit-details-marker {
  display: none;
}
.client-create-panel[open] > summary {
  margin-bottom: 10px;
}
.client-create-panel-body {
  animation: shell-menu-pop .14s ease-out;
}
.client-create-panel .client-setup-form {
  margin-top: 0; padding-top: 0; border-top: 0;
}
.client-create-panel .setup-form-heading {
  font-size: 12.5px;
}
.client-create-panel .setup-field textarea {
  min-height: 68px;
}
.client-create-panel .setup-form-submit {
  width: 100%; justify-content: center;
}
.clients-search {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid var(--hairline);
}
.clients-search label { min-width: 0; margin: 0; }
.clients-search input { width: 100%; min-height: 34px; }
.client-list {
  min-height: 0; overflow: auto; display: grid; align-content: start; gap: 2px; padding: 8px;
}
.client-list-button {
  min-width: 0; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px; align-items: center; padding: 10px; border: 1px solid transparent;
  border-radius: var(--radius); color: var(--ink); text-decoration: none;
}
.client-list-button:hover,
.client-list-button.active {
  border-color: var(--accent-border); background: var(--accent-soft);
}
.client-avatar,
.client-contact-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  border: 1px solid var(--accent-border); background: var(--accent-softer);
  color: var(--accent); font-weight: 800;
}
.client-avatar {
  width: 32px; height: 32px; border-radius: 7px; font-size: 11px;
}
.client-list-copy {
  min-width: 0; display: grid; gap: 2px;
}
.client-list-copy strong {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; line-height: 1.25;
}
.client-list-copy span {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted); font-size: 11.5px;
}
.client-list-amount {
  color: var(--accent); font-size: 11.5px; font-weight: 800; white-space: nowrap;
}
.client-detail-panel {
  min-width: 0; display: grid; align-content: start; gap: 16px; padding: 20px;
}
.clients-detail-header { margin: 0; padding: 0; }
.clients-copy-portal-action {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0;
}
.clients-copy-portal-link {
  min-width: 118px; justify-content: center;
}
.clients-copy-portal-status {
  flex: none;
}
.client-billing-identity {
  display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 8px 0 0;
  color: var(--ink-2); font-size: 12px;
}
.client-billing-identity div { min-width: 0; }
.client-billing-identity dt {
  color: var(--muted-2); font-size: 10px; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase;
}
.client-billing-identity dd {
  margin: 2px 0 0; max-width: min(360px, 100%); overflow-wrap: anywhere;
}
.client-billing-identity-form {
  min-width: 0; display: grid; gap: 10px;
}
.client-billing-identity-field {
  min-width: 0; display: grid; gap: 4px; margin: 0;
  color: var(--ink-2); font-size: 12px; font-weight: 600;
}
.client-billing-identity-field input,
.client-billing-identity-field textarea {
  width: 100%; min-height: 34px; font-size: 12.5px;
  border-radius: var(--radius); background: var(--panel-2);
}
.client-billing-identity-field textarea {
  padding: 9px 10px; resize: vertical; line-height: 1.4;
}
.client-billing-identity-field.has-error span {
  color: var(--danger);
}
.client-billing-identity-field.has-error input,
.client-billing-identity-field.has-error textarea {
  border-color: var(--danger-border);
  box-shadow: 0 0 0 3px var(--danger-soft);
}
.client-billing-identity-split {
  min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.client-billing-identity-actions {
  display: flex; justify-content: flex-end; gap: 8px; min-width: 0;
}
.client-billing-identity-actions .btn {
  min-width: 120px; justify-content: center;
}
.client-billing-identity-field-error {
  display: grid; gap: 2px; margin-top: 2px;
}
.client-stat-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
}
.client-detail-grid {
  min-width: 0; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .85fr);
  gap: 16px; align-items: start;
}
.client-detail-main,
.client-detail-side {
  min-width: 0; display: grid; gap: 16px;
}
.client-projects-table { min-width: 620px; }
.client-invoices-table { min-width: 560px; }
.client-card-title-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-width: 0;
}
.client-card-facts {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 8px 0 0;
}
.client-card-facts dt {
  color: var(--muted-2); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.client-card-facts dd { margin: 2px 0 0; color: var(--ink-2); font-size: 12px; }
.client-contact-list { display: grid; gap: 2px; }
.client-contact-row {
  min-width: 0; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--hairline);
}
.client-contact-row:last-child { border-bottom: 0; }
.client-contact-row strong,
.client-contact-row .muted {
  display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.client-contact-avatar {
  width: 30px; height: 30px; border-radius: 50%; font-size: 11px;
}
.client-portal-preview .panel-header { align-items: flex-start; }
.client-portal-preview .panel-header p { margin: 2px 0 0; font-size: 12px; }
.client-portal-shell {
  overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg);
}
.client-portal-shell-header {
  display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px; align-items: center;
  padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--panel-2);
  font-size: 12px;
}
.client-portal-shell-header .client-avatar { width: 28px; height: 28px; font-size: 10px; }
.client-portal-project-list { display: grid; gap: 8px; padding: 12px; }
.client-portal-project {
  min-width: 0; display: grid; gap: 5px; padding: 10px; border: 1px solid var(--hairline);
  border-radius: var(--radius-sm); background: var(--panel);
}
.client-portal-project strong,
.client-portal-project .muted {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.client-portal-flags {
  display: flex; flex-wrap: wrap; gap: 5px; min-width: 0;
}
.client-rate-list {
  display: grid; gap: 8px; margin: 0;
}
.client-rate-rules .panel-body {
  display: grid; gap: 10px;
}
.client-rate-list > div {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--hairline);
}
.client-rate-list > div:last-child { padding-bottom: 0; border-bottom: 0; }
.client-rate-list dt { color: var(--muted); font-size: 12px; }
.client-rate-list dd { margin: 0; color: var(--ink); font-size: 12.5px; }
.clients-empty-state { margin: 0; }
.clients-page-empty { align-self: center; justify-self: center; max-width: 520px; }

@media (max-width: 1040px) {
  .clients-page { grid-template-columns: 1fr; }
  .clients-list-rail { border-right: 0; border-bottom: 1px solid var(--border); }
  .client-list {
    grid-auto-flow: column; grid-auto-columns: minmax(220px, 280px);
    overflow-x: auto; overflow-y: hidden; padding-bottom: 10px;
  }
  .client-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .client-detail-panel { padding: 14px; }
  .clients-rail-header,
  .clients-search,
  .clients-detail-header,
  .client-stat-grid { grid-template-columns: 1fr; }
  .clients-rail-header,
  .clients-detail-header { display: grid; align-items: start; }
  .clients-detail-header .page-header-right {
    width: 100%; display: grid; grid-template-columns: 1fr; gap: 8px;
  }
  .clients-search .btn,
  .clients-rail-header .btn,
  .clients-detail-header .btn { width: 100%; justify-content: center; }
  .clients-copy-portal-action {
    width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px;
  }
  .clients-copy-portal-status {
    justify-self: start;
  }
  .client-billing-identity-split { grid-template-columns: 1fr; }
  .client-billing-identity-actions,
  .client-billing-identity-actions .btn { width: 100%; }
  .client-stat-grid { gap: 8px; }
  .client-card-facts { grid-template-columns: 1fr; }
  .client-contact-row { grid-template-columns: 30px minmax(0, 1fr); }
  .client-contact-row .badge { grid-column: 2; justify-self: start; }
}

/* ---------- Product feedback capture ---------- */
.feedback-capture-dialog {
  width: min(920px, calc(100vw - 48px));
  height: min(620px, calc(100dvh - 72px));
  max-width: none; max-height: none; margin: auto; padding: 0;
  overflow: hidden; border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl); background: var(--panel); color: var(--ink);
  box-shadow: 0 24px 64px -12px rgba(0,0,0,.7), 0 6px 16px rgba(0,0,0,.45);
}
.feedback-capture-dialog::backdrop {
  background: rgba(2,6,23,.62); backdrop-filter: blur(4px);
}
.feedback-capture-dialog [hidden] { display: none !important; }
.feedback-capture-dialog[open] { animation: feedback-dialog-in .14s ease-out; }
.feedback-capture-form {
  width: 100%; height: 100%; display: grid;
  grid-template-columns: 52% 48%; grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}
.feedback-capture-header {
  grid-column: 1 / -1; min-height: 48px; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--panel);
}
.feedback-capture-header h2 { font-size: 14px; }
.feedback-capture-heading-icon,
.feedback-capture-header button svg,
.feedback-capture-toolbar button svg {
  width: 15px; height: 15px; display: inline-flex; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.feedback-capture-heading-icon { color: var(--accent); }
.feedback-capture-context {
  margin-left: auto; color: var(--muted); font-size: 12px;
}
.feedback-capture-editor {
  min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr);
  border-right: 1px solid var(--border); background: var(--panel-2);
}
.feedback-capture-preview {
  grid-row: 2; min-width: 0; min-height: 0; position: relative;
  display: grid; place-items: center; overflow: hidden; background: var(--bg);
}
#feedback-annotation-canvas {
  display: block; width: auto; height: auto; max-width: 100%; max-height: 100%;
  touch-action: none; cursor: crosshair; background: var(--bg);
}
.feedback-capture-state {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; padding: 24px;
  text-align: center; background: var(--panel-2); color: var(--muted);
}
.feedback-capture-state strong { color: var(--ink); font-size: 14px; }
.feedback-capture-state > span:not(.feedback-capture-spinner) {
  max-width: 320px; font-size: 12.5px;
}
.feedback-capture-state-actions {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
}
.feedback-capture-spinner {
  width: 28px; height: 28px; border: 2px solid var(--border-strong);
  border-top-color: var(--accent); border-radius: 50%; animation: feedback-spin .7s linear infinite;
}
.feedback-capture-toolbar {
  grid-row: 1; min-height: 44px; display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; border-bottom: 1px solid var(--border); background: var(--panel);
}
.feedback-tool-button[aria-pressed="true"] {
  border-color: var(--accent-border); background: var(--accent-soft); color: var(--accent);
}
.feedback-toolbar-divider { width: 1px; height: 18px; margin: 0 2px; background: var(--border); }
.feedback-toolbar-spacer { flex: 1; }
.feedback-capture-fields {
  min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 14px;
  padding: 16px; overflow-y: auto; background: var(--panel);
}
.feedback-kind-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.feedback-kind-fieldset legend,
.feedback-capture-fields .field > label {
  display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px;
  font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.feedback-kind-options {
  display: inline-flex; padding: 2px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--panel-2);
}
.feedback-kind-options label { position: relative; cursor: pointer; }
.feedback-kind-options input {
  position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
}
.feedback-kind-options span {
  min-height: 32px; display: inline-flex; align-items: center; padding: 6px 12px;
  border: 1px solid transparent; border-radius: 4px; color: var(--muted);
  font-size: 12.5px; font-weight: 500;
}
.feedback-kind-options input:checked + span {
  border-color: var(--border-strong); background: var(--panel); color: var(--ink);
  box-shadow: var(--shadow-soft);
}
.feedback-kind-options input:focus-visible + span {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.feedback-capture-fields .field { margin: 0; }
.feedback-capture-fields input[type="text"],
.feedback-capture-fields input[name="title"],
.feedback-capture-fields textarea { width: 100%; }
.feedback-description-field { flex: 1; min-height: 118px; }
.feedback-description-field textarea {
  min-height: 110px; height: 100%; resize: vertical; line-height: 1.5;
}
.feedback-page-context { margin: 0; color: var(--muted); font-size: 11.5px; }
.feedback-capture-footer {
  grid-column: 2; display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 12px 16px; border-top: 1px solid var(--border); background: var(--panel-2);
}
.feedback-capture-note { flex: 1; margin: 0; color: var(--muted); font-size: 11.5px; }
.feedback-submit-button { min-width: 120px; justify-content: center; }
.feedback-capture-open { overflow: hidden; }
@keyframes feedback-dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes feedback-spin { to { transform: rotate(360deg); } }

@media (max-width: 1024px) {
  .feedback-capture-dialog {
    width: 100vw; height: 100dvh; max-width: none; max-height: none;
    border: 0; border-radius: 0;
  }
  .feedback-capture-form {
    display: flex; flex-direction: column; min-height: 0;
  }
  .feedback-capture-header { flex: none; min-height: 52px; padding: 8px 14px; }
  .feedback-capture-context { display: none; }
  .feedback-capture-editor {
    flex: 0 0 38dvh; min-height: 224px; display: grid;
    grid-template-rows: minmax(180px, 1fr) auto; border-right: 0;
  }
  .feedback-capture-preview { grid-row: 1; }
  .feedback-capture-toolbar {
    grid-row: 2; min-height: 52px; border-top: 1px solid var(--border); border-bottom: 0;
  }
  .feedback-capture-fields { flex: 1 1 auto; padding: 14px; }
  .feedback-capture-footer { flex: none; flex-wrap: wrap; padding: 10px 14px; }
  .feedback-capture-note { flex-basis: 100%; }
  .feedback-capture-dialog .btn,
  .feedback-capture-dialog .btn-sm,
  .feedback-kind-options span { min-height: 44px; }
  .feedback-capture-dialog .btn-icon { min-width: 44px; }
}

@media (max-width: 480px) {
  .feedback-capture-editor { flex-basis: 36dvh; min-height: 210px; }
  .feedback-capture-toolbar { overflow-x: auto; }
  .feedback-capture-toolbar .btn { flex: none; }
  .feedback-kind-options { width: 100%; }
  .feedback-kind-options label { flex: 1; }
  .feedback-kind-options span { width: 100%; justify-content: center; padding-inline: 8px; }
  .feedback-capture-footer .btn { flex: 1; }
  .feedback-submit-button { min-width: 0; }
}

@media (max-width: 1024px) and (max-height: 500px) {
  .feedback-capture-form { overflow-y: auto; }
  .feedback-capture-header { position: sticky; top: 0; z-index: 2; }
  .feedback-capture-editor {
    flex: none; min-height: 144px; height: 45dvh;
  }
  .feedback-capture-fields { flex: none; min-height: 260px; overflow: visible; }
  .feedback-capture-footer {
    position: sticky; bottom: 0; z-index: 2; background: var(--panel-2);
  }
  .feedback-capture-note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .feedback-capture-dialog[open],
  .feedback-capture-spinner { animation: none; }
}

/* ---------- Product feedback tracker ---------- */
.feedback-page { min-width: 0; }
.feedback-page-header { align-items: flex-start; }
.feedback-page-header p {
  margin: 5px 0 0; color: var(--muted); font-size: 12.5px;
}
.feedback-list-body { padding: 20px; }
.feedback-filter-bar {
  display: flex; align-items: center; gap: 8px; min-width: 0; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--panel);
}
.feedback-filter-label {
  display: inline-flex; align-items: center; gap: 7px; flex: none; padding-right: 10px;
  border-right: 1px solid var(--hairline); color: var(--muted); font-size: 10.5px;
  font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}
.feedback-filter-field {
  display: grid; gap: 3px; min-width: 0; flex: 0 1 180px; color: var(--muted);
  font-size: 10px; font-weight: 700;
}
.feedback-filter-field > span { padding-left: 2px; }
.feedback-filter-field select,
.feedback-filter-field input { width: 100%; }
.feedback-search-field { flex: 1 1 220px; }
.feedback-filter-label svg,
.feedback-page-label svg,
.feedback-detail-header svg,
.feedback-comment-composer button svg,
.feedback-screenshot-header > svg {
  width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.feedback-filter-bar select { min-width: 138px; }
.feedback-filter-bar input { min-width: 160px; flex: 1 1 180px; }
.feedback-filter-bar .btn { flex: none; }
.feedback-result-count {
  margin-left: auto; flex: none; color: var(--muted); font-size: 11.5px;
}
.feedback-results { min-width: 0; margin-top: 16px; }
.feedback-card-list { display: grid; gap: 8px; min-width: 0; }
.feedback-card {
  display: grid; gap: 11px; min-width: 0; padding: 12px 14px;
  transition: border-color .12s ease, background .12s ease;
}
.feedback-card:hover { border-color: var(--border-strong); background: var(--panel-2); }
.feedback-card-heading,
.feedback-card-meta {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  min-width: 0;
}
.feedback-card-heading > div { min-width: 0; }
.feedback-card h2 { font-size: 13.5px; line-height: 1.3; }
.feedback-card h2 a { color: var(--ink); overflow-wrap: anywhere; }
.feedback-card h2 a:hover { color: var(--accent); }
.feedback-page-label {
  display: flex; align-items: center; gap: 5px; min-width: 0; margin: 4px 0 0;
  color: var(--muted); font-size: 11.5px; overflow-wrap: anywhere;
}
.feedback-card-meta { align-items: center; flex-wrap: wrap; }
.feedback-card-meta time { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.feedback-reporter {
  display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--ink-2);
  font-size: 11.5px;
}
.feedback-avatar { width: 20px; height: 20px; flex: none; font-size: 8px; }
.feedback-kind-bug {
  color: #fca5a5; border-color: var(--danger-border); background: var(--danger-soft);
}
.feedback-kind-feature {
  color: #c4b5fd; border-color: var(--violet-border); background: var(--violet-soft);
}
.feedback-state-submitted,
.feedback-state-reviewing { color: #93c5fd; border-color: var(--info-border); background: var(--info-soft); }
.feedback-state-reviewing { color: #c4b5fd; border-color: var(--violet-border); background: var(--violet-soft); }
.feedback-state-accepted,
.feedback-state-in_progress { color: #fcd34d; border-color: var(--warning-border); background: var(--warning-soft); }
.feedback-state-completed { color: var(--accent-hover); border-color: var(--accent-border); background: var(--accent-soft); }
.feedback-state-declined,
.feedback-state-duplicate { color: #fca5a5; border-color: var(--danger-border); background: var(--danger-soft); }
[data-theme="light"] .feedback-kind-bug,
[data-theme="light"] .feedback-state-declined,
[data-theme="light"] .feedback-state-duplicate { color: #b91c1c; }
[data-theme="light"] .feedback-kind-feature,
[data-theme="light"] .feedback-state-reviewing { color: #6d28d9; }
[data-theme="light"] .feedback-state-submitted { color: #2563eb; }
[data-theme="light"] .feedback-state-accepted,
[data-theme="light"] .feedback-state-in_progress { color: #b45309; }
[data-theme="light"] .feedback-state-completed { color: #047857; }
.feedback-queue-table-wrap { overflow-x: auto; }
.feedback-queue-table { min-width: 820px; }
.feedback-queue-table th:first-child { width: 30%; }
.feedback-queue-table th:nth-child(2) { width: 120px; }
.feedback-queue-table th:nth-child(3) { width: 150px; }
.feedback-queue-table th:nth-child(4) { width: 130px; }
.feedback-queue-table th:nth-child(5) { width: 180px; }
.feedback-queue-table th:last-child { width: 110px; }
.feedback-queue-table tbody th {
  padding: 10px 12px; border-bottom: 1px solid var(--hairline); text-align: left;
  font-weight: 500;
}
.feedback-queue-table tbody th a { color: var(--ink); }
.feedback-table-page {
  max-width: 180px; overflow: hidden; color: var(--muted); text-overflow: ellipsis;
  white-space: nowrap;
}
.feedback-queue-table time { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.feedback-queue-table thead th { color: var(--muted); }
.feedback-empty-state { min-height: 220px; justify-content: center; }

.feedback-detail-header {
  min-width: 0; padding: 18px 28px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.feedback-detail-header nav {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  color: var(--muted); font-size: 11.5px;
}
.feedback-detail-header nav a { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.feedback-detail-header nav a:hover { color: var(--ink); }
.feedback-detail-badges { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 8px; }
.feedback-detail-header h1 { max-width: 900px; overflow-wrap: anywhere; }
.feedback-detail-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  align-items: start; gap: 16px; min-width: 0; padding: 20px;
}
.feedback-detail-main,
.feedback-detail-rail { display: grid; gap: 16px; min-width: 0; }
.feedback-detail-panel,
.feedback-comments-panel,
.feedback-details-panel,
.feedback-review-panel,
.feedback-history-panel { min-width: 0; overflow: hidden; }
.feedback-detail-panel .panel-header,
.feedback-comments-panel .panel-header,
.feedback-details-panel .panel-header,
.feedback-review-panel .panel-header,
.feedback-history-panel .panel-header { align-items: flex-start; padding: 12px 14px; }
.feedback-detail-panel .panel-header p,
.feedback-review-panel .panel-header p {
  margin: 3px 0 0; color: var(--muted); font-size: 11.5px; font-weight: 400;
}
.feedback-description { padding: 14px; color: var(--ink-2); line-height: 1.55; overflow-wrap: anywhere; }
.feedback-screenshot-header > svg { width: 14px; height: 14px; flex: none; color: var(--muted); }
.feedback-screenshot-panel figure { margin: 0; padding: 8px; border-top: 1px solid var(--border); }
.feedback-screenshot-panel img {
  display: block; width: 100%; height: auto; max-height: 620px; object-fit: contain;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg);
}
.feedback-screenshot-panel figcaption {
  display: inline-flex; margin-top: 8px; padding: 4px 7px; border: 1px solid var(--border);
  border-radius: 4px; color: var(--muted); font-size: 10.5px;
}
.feedback-screenshot-empty { border-top: 1px solid var(--border); }
.feedback-comments-list { display: grid; gap: 14px; padding: 14px; }
.feedback-comment { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 9px; }
.feedback-comment-avatar { width: 26px; height: 26px; font-size: 9px; }
.feedback-comment p { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.feedback-comment-meta { margin-bottom: 3px !important; color: var(--muted) !important; font-size: 11.5px; }
.feedback-comment-meta strong { color: var(--ink); }
.feedback-empty-copy { margin: 0; color: var(--muted); }
.feedback-comment-composer form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.feedback-form-label {
  display: block; color: var(--muted); font-size: 11px; font-weight: 700;
}
.feedback-comment-composer .feedback-form-label { grid-column: 1 / -1; }
.feedback-comment-composer textarea { grid-column: 1; min-height: 62px; resize: vertical; }
.feedback-comment-composer .field-error { grid-column: 1 / -1; }
.feedback-comment-composer .btn { align-self: end; }
.feedback-comment-composer .btn svg { flex: none; }
.feedback-details-panel dl { display: grid; gap: 10px; margin: 0; padding: 14px; }
.feedback-details-panel dl > div {
  display: grid; grid-template-columns: minmax(86px, auto) minmax(0, 1fr); gap: 10px;
  align-items: start;
}
.feedback-details-panel dt { color: var(--muted); }
.feedback-details-panel dd {
  display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0;
  margin: 0; text-align: right; overflow-wrap: anywhere;
}
.feedback-detail-reporter > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.feedback-review-panel form { display: grid; gap: 9px; padding: 12px 14px; }
.feedback-review-panel textarea { min-height: 62px; resize: vertical; }
.feedback-review-panel select { width: 100%; }
.feedback-review-panel .btn { justify-self: start; }
.feedback-history-panel ol { display: grid; gap: 0; margin: 0; padding: 14px 14px 2px; list-style: none; }
.feedback-history-panel li {
  position: relative; display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 8px;
  min-width: 0; padding-bottom: 14px; color: var(--muted); font-size: 11.5px;
}
.feedback-history-panel li:not(:last-child)::after {
  content: ""; position: absolute; left: 3px; top: 9px; bottom: 0; width: 2px;
  background: var(--hairline);
}
.feedback-history-dot { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: var(--muted-2); }
.feedback-history-panel strong { color: var(--ink); }
.feedback-history-submitted .feedback-history-dot { background: var(--info); }
.feedback-history-reviewing .feedback-history-dot { background: var(--violet); }
.feedback-history-accepted .feedback-history-dot,
.feedback-history-in_progress .feedback-history-dot { background: var(--warning); }
.feedback-history-completed .feedback-history-dot { background: var(--accent); }
.feedback-history-declined .feedback-history-dot,
.feedback-history-duplicate .feedback-history-dot { background: var(--danger); }
.feedback-history-empty { display: block !important; }
.feedback-page input:focus-visible,
.feedback-page textarea:focus-visible,
.feedback-page select:focus-visible,
.feedback-page button:focus-visible,
.feedback-page a:focus-visible {
  outline: 2px solid var(--info); outline-offset: 2px;
}
.feedback-page input::placeholder,
.feedback-page textarea::placeholder { color: var(--muted); opacity: 1; }

@media (min-width: 1200px) {
  .is-feedback-queue .feedback-card-list { display: none; }
}

@media (max-width: 1199px) {
  .feedback-queue-table-wrap { display: none; }
}

@media (max-width: 900px) {
  .feedback-list-body,
  .feedback-detail-layout { padding: 16px; }
  .feedback-filter-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feedback-filter-label { grid-column: 1 / -1; padding: 0 0 8px; border-right: 0; border-bottom: 1px solid var(--hairline); }
  .feedback-filter-bar select,
  .feedback-filter-bar input { width: 100%; min-width: 0; min-height: 44px; }
  .feedback-filter-field { width: 100%; max-width: none; }
  .feedback-filter-bar .btn { min-height: 44px; }
  .feedback-result-count { margin-left: 0; align-self: center; }
  .feedback-detail-header { padding: 16px; }
  .feedback-detail-layout { grid-template-columns: 1fr; }
  .feedback-detail-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feedback-history-panel { grid-column: 1 / -1; }
  .feedback-card { min-height: 96px; padding: 13px; }
  .feedback-card h2 a { display: inline-flex; min-height: 44px; align-items: center; }
  .feedback-comment-composer .btn { min-height: 44px; }
  .feedback-review-panel .btn { min-height: 44px; }
}

@media (max-width: 600px) {
  .feedback-filter-bar { grid-template-columns: 1fr; }
  .feedback-filter-label { grid-column: auto; }
  .feedback-result-count { order: 10; }
  .feedback-card-heading { align-items: flex-start; }
  .feedback-card-meta time { flex-basis: auto; }
  .feedback-detail-rail { grid-template-columns: 1fr; }
  .feedback-history-panel { grid-column: auto; }
  .feedback-comment-composer form { grid-template-columns: 1fr; }
  .feedback-comment-composer .btn { width: 100%; justify-content: center; }
}

@media (min-width: 761px) and (max-width: 900px) {
  .clients-rail-header { display: flex; align-items: center; }
  .clients-search { grid-template-columns: minmax(0, 1fr) auto; }
  .clients-search .btn { width: auto; }
  .clients-detail-header .page-header-right {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .clients-copy-portal-action {
    width: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px;
  }
  .clients-copy-portal-link { width: 100%; }
  .client-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-billing-identity-split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .client-card-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .client-contact-row { grid-template-columns: 30px minmax(0, 1fr) auto; }
  .client-contact-row .badge { grid-column: auto; justify-self: auto; }
}

/* ---------- Invoice detail ---------- */
.invoice-detail-page {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 24px 40px;
}
.invoice-detail-header {
  padding: 18px 0 20px;
  border-bottom: 1px solid var(--hairline);
}
.invoice-detail-breadcrumbs,
.invoice-detail-title-line,
.invoice-detail-heading-row,
.invoice-detail-title-group,
.invoice-detail-header-actions,
.invoice-detail-panel-title,
.invoice-detail-panel-actions,
.invoice-detail-document-brand {
  display: flex;
  align-items: center;
}
.invoice-detail-breadcrumbs { gap: 8px; color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.invoice-detail-heading-row { justify-content: space-between; align-items: flex-start; gap: 18px; }
.invoice-detail-title-group { align-items: flex-start; gap: 12px; min-width: 0; }
.invoice-detail-kicker { margin: 0 0 4px; color: var(--muted-2); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.invoice-detail-client-marker {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 44px; height: 44px; border-radius: 10px;
  background: linear-gradient(135deg, #14532d, #0f766e); color: #d1fae5;
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
}
.invoice-detail-title-line { gap: 10px; flex-wrap: wrap; }
.invoice-detail-title-line h1 { font-size: 23px; }
.invoice-detail-subtitle { display: flex; flex-wrap: wrap; gap: 7px; margin: 5px 0 0; font-size: 12.5px; }
.invoice-detail-header-actions { justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.invoice-detail-header-actions form { margin: 0; }
.invoice-detail-menu-wrap { position: relative; }
.invoice-detail-more-menu { top: calc(100% + 8px); left: auto; right: 0; width: 240px; }
.invoice-detail-feedback {
  margin-top: 14px; padding: 10px 12px; border: 1px solid var(--accent-border);
  border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-hover);
  font-size: 12px; font-weight: 600;
}
.invoice-detail-overdue {
  display: flex; align-items: center; gap: 11px; margin-top: 16px; padding: 12px 14px;
  border: 1px solid var(--danger-border); border-radius: var(--radius-lg);
  background: var(--danger-soft); color: var(--ink);
}
.invoice-detail-overdue-icon {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 24px; height: 24px; border-radius: 50%; background: var(--danger); color: white; font-weight: 700;
}
.invoice-detail-overdue div { flex: 1; min-width: 0; }
.invoice-detail-overdue strong { color: var(--danger); font-size: 12.5px; }
.invoice-detail-overdue p { margin: 3px 0 0; color: var(--muted); font-size: 11.5px; }
.invoice-detail-overdue form { margin: 0; }
.invoice-detail-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; padding-top: 20px;
}
.invoice-detail-main-column,
.invoice-detail-sidebar { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.invoice-detail-sidebar { position: sticky; top: 18px; }
.invoice-detail-panel-header { min-height: 48px; }
.invoice-detail-panel-title { gap: 8px; min-width: 0; }
.invoice-detail-panel-title h2 { font-size: 13px; }
.invoice-detail-panel-icon { color: var(--muted); font-size: 14px; }
.invoice-detail-panel-title .badge { margin-left: 2px; }
.invoice-detail-panel-actions { gap: 4px; }
.invoice-detail-preview-panel { overflow: hidden; }
.invoice-detail-preview-document {
  padding: 28px 32px 32px; background: var(--panel-2); min-width: 0;
}
.invoice-detail-document-head,
.invoice-detail-payment-hero,
.invoice-detail-parties,
.invoice-detail-meta-grid,
.invoice-detail-totals {
  display: grid; gap: 18px;
}
.invoice-detail-document-head { grid-template-columns: minmax(0, 1fr) minmax(180px, .7fr); align-items: start; }
.invoice-detail-document-brand { gap: 8px; font-size: 15px; }
.invoice-detail-document-logo {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border-radius: 7px; background: var(--accent); color: var(--on-accent); font-size: 10px; font-weight: 700;
}
.invoice-detail-document-head p { margin: 9px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.55; }
.invoice-detail-document-number { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; text-align: right; }
.invoice-detail-document-number strong { font-size: 25px; color: var(--ink); }
.invoice-detail-payment-hero {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) auto; align-items: center;
  margin: 24px 0; padding: 16px; border: 1px solid var(--accent-border); border-radius: var(--radius-lg);
  background: var(--accent-soft);
}
.invoice-detail-payment-hero > div { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.invoice-detail-payment-hero strong { color: var(--accent-hover); font-size: 23px; }
.invoice-detail-payment-hero .num:not(strong) { color: var(--ink); font-size: 12px; }
.invoice-detail-qr { width: 62px; height: 62px; padding: 3px; border-radius: 4px; background: #fff; object-fit: contain; }
.invoice-detail-qr-empty { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); font-size: 10px; }
.invoice-detail-parties { grid-template-columns: 1fr 1fr; padding: 14px 0; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.invoice-detail-parties > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.invoice-detail-parties strong { font-size: 13px; }
.invoice-detail-parties span:not(.eyebrow) { color: var(--muted); font-size: 11.5px; overflow-wrap: anywhere; }
.eyebrow { color: var(--muted-2); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.invoice-detail-meta-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 15px 0; }
.invoice-detail-meta-grid > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.invoice-detail-meta-grid span { color: var(--muted-2); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.invoice-detail-meta-grid strong { color: var(--ink-2); font-size: 11.5px; overflow-wrap: anywhere; }
.invoice-detail-line-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.invoice-detail-line-table { width: 100%; min-width: 590px; border-collapse: collapse; font-size: 11.5px; }
.invoice-detail-line-table th { padding: 9px 10px; background: var(--panel-3); color: var(--muted-2); font-size: 9.5px; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.invoice-detail-line-table td { padding: 10px; border-top: 1px solid var(--hairline); color: var(--ink-2); vertical-align: top; }
.invoice-detail-line-table td:first-child { min-width: 180px; }
.invoice-detail-line-table td:nth-last-child(-n+3), .invoice-detail-line-table th:nth-last-child(-n+3) { text-align: right; }
.invoice-detail-line-table td strong, .invoice-detail-line-table td small { display: block; }
.invoice-detail-line-table td small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.invoice-detail-line-editor-row td { padding-top: 0; background: var(--panel-2); }
.invoice-detail-line-editor { display: flex; align-items: end; gap: 7px; }
.invoice-detail-line-editor label { color: var(--muted); font-size: 10px; }
.invoice-detail-line-editor input { flex: 1; min-width: 0; height: 27px; }
.invoice-detail-totals { justify-content: end; max-width: 310px; margin: 18px 0 0 auto; gap: 8px; }
.invoice-detail-totals > div { display: flex; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 12px; }
.invoice-detail-totals .invoice-detail-total-row { padding-top: 10px; border-top: 2px solid var(--ink-2); color: var(--ink); font-size: 14px; font-weight: 700; }
.invoice-detail-totals .invoice-detail-total-row strong { font-size: 17px; }
.invoice-detail-summary-panel,
.invoice-detail-action-panel,
.invoice-detail-timeline-panel,
.invoice-detail-audit-panel { padding: 16px; }
.invoice-detail-summary-panel { display: flex; flex-direction: column; gap: 4px; }
.invoice-detail-total-value { margin-top: 1px; color: var(--ink); font-size: 27px; }
.invoice-detail-summary-list { display: grid; gap: 9px; margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--hairline); }
.invoice-detail-summary-list div { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.invoice-detail-summary-list dt { color: var(--muted); font-size: 11.5px; }
.invoice-detail-summary-list dd { margin: 0; color: var(--ink-2); font-size: 11.5px; text-align: right; }
.invoice-detail-action-panel { display: flex; flex-direction: column; gap: 8px; }
.invoice-detail-action-panel h2, .invoice-detail-timeline-panel h2 { font-size: 13px; }
.invoice-detail-action-panel p { margin: 0 0 2px; font-size: 11.5px; line-height: 1.45; }
.invoice-detail-action-panel label { color: var(--muted); font-size: 10.5px; }
.invoice-detail-action-panel input, .invoice-detail-action-panel select { width: 100%; min-width: 0; }
.invoice-detail-timeline-panel { overflow: hidden; }
.invoice-detail-timeline { display: grid; gap: 0; margin: 14px 0 0; padding: 0; list-style: none; }
.invoice-detail-timeline li { position: relative; display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 8px; padding: 0 0 15px; }
.invoice-detail-timeline li:last-child { padding-bottom: 0; }
.invoice-detail-timeline li:not(:last-child)::after { position: absolute; top: 15px; bottom: 0; left: 6px; width: 1px; background: var(--hairline); content: ""; }
.invoice-detail-timeline-marker { z-index: 1; width: 13px; height: 13px; border: 2px solid var(--accent); border-radius: 50%; background: var(--panel); }
.invoice-detail-timeline strong, .invoice-detail-timeline span, .invoice-detail-timeline small { display: block; overflow-wrap: anywhere; }
.invoice-detail-timeline strong { color: var(--ink-2); font-size: 11.5px; }
.invoice-detail-timeline span { margin-top: 3px; color: var(--muted); font-size: 10.5px; }
.invoice-detail-timeline small { margin-top: 4px; color: var(--muted-2); font-size: 9.5px; }
.invoice-detail-audit-panel p { margin: 7px 0 12px; font-size: 11.5px; line-height: 1.45; }
.invoice-detail-entries-panel { overflow: hidden; }
.invoice-detail-entries-table { min-width: 640px; }
.invoice-detail-mobile-entry-list { display: none; }
.invoice-detail-mobile-entry { display: grid; gap: 4px; padding: 12px 14px; border-bottom: 1px solid var(--hairline); }
.invoice-detail-mobile-entry:last-child { border-bottom: 0; }
.invoice-detail-mobile-entry span { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.invoice-detail-empty-row, .invoice-detail-empty-panel { color: var(--muted); text-align: center; }
.invoice-detail-empty-panel { padding: 24px 14px; font-size: 12px; }
.invoice-number-link { color: inherit; text-decoration: none; }
.invoice-number-link:hover { text-decoration: underline; }

@media (max-width: 1040px) {
  .invoice-detail-layout { grid-template-columns: 1fr; }
  .invoice-detail-sidebar { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .invoice-detail-timeline-panel, .invoice-detail-audit-panel { grid-column: span 1; }
}

@media (max-width: 900px) {
  .invoice-detail-page { padding: 0 12px 28px; }
  .invoice-detail-header { padding-top: 12px; }
  .invoice-detail-heading-row { display: block; }
  .invoice-detail-title-group { margin-bottom: 14px; }
  .invoice-detail-header-actions { justify-content: flex-start; }
  .invoice-detail-header-actions .btn, .invoice-detail-header-actions form { max-width: 100%; }
  .invoice-detail-overdue { align-items: flex-start; flex-wrap: wrap; }
  .invoice-detail-overdue form { width: 100%; margin-left: 35px; }
  .invoice-detail-overdue form .btn { width: 100%; justify-content: center; }
  .invoice-detail-preview-document { padding: 18px 14px 20px; }
  .invoice-detail-document-head { grid-template-columns: 1fr; gap: 16px; }
  .invoice-detail-document-number { align-items: flex-start; text-align: left; }
  .invoice-detail-payment-hero { grid-template-columns: minmax(0, 1fr) auto; }
  .invoice-detail-payment-hero > div:nth-child(2) { grid-column: 1 / -1; order: 3; }
  .invoice-detail-parties { grid-template-columns: 1fr; gap: 12px; }
  .invoice-detail-meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .invoice-detail-line-editor { align-items: stretch; flex-wrap: wrap; }
  .invoice-detail-line-editor label { width: 100%; }
  .invoice-detail-line-editor input { flex-basis: calc(100% - 74px); }
  .invoice-detail-totals { max-width: none; }
  .invoice-detail-sidebar { display: flex; }
  .invoice-detail-mobile-entry-list { display: block; }
  .invoice-detail-entries-panel .responsive-hide-mobile { display: none; }
  .invoice-detail-more-menu { position: fixed; top: auto; right: 12px; bottom: 12px; left: 12px; width: auto; }
}

/* ---------- Project settings page ---------- */
.project-settings-page { min-width: 0; }
.project-settings-kicker {
  margin: 0 0 4px; color: var(--muted-2); font-size: 10.5px;
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.project-settings-header-actions { flex-wrap: wrap; justify-content: flex-end; }
.project-settings-page-body { display: grid; justify-items: start; padding-top: 20px; }
.project-settings-region {
  width: min(880px, 100%); min-width: 0;
}
.project-settings {
  width: 100%; display: grid; gap: 16px; min-width: 0;
}
.project-settings-stack { align-content: start; }
.project-settings-page .project-settings-fragment-title { display: none; }
.project-settings-fragment-title {
  display: grid; gap: 3px; padding: 0 2px;
}
.project-settings-fragment-title p { margin: 0; font-size: 12px; }
.project-settings-card {
  min-width: 0; overflow: hidden; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.project-settings-card--basics { border-color: var(--border-strong); }
.project-settings-card--portal { border-color: var(--accent-border); }
.project-settings-card--status .project-settings-card-header,
.project-settings-card--overview .project-settings-card-header,
.project-settings-card--rates .project-settings-card-header {
  background: var(--panel-2);
}
.project-settings-card-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 12px 16px; background: var(--panel-2); border-bottom: 1px solid var(--hairline);
}
.project-settings-card-header p {
  margin: 2px 0 0; font-size: 11.5px; line-height: 1.4;
}
.project-settings-card-header .btn { flex: none; }
.project-settings-card-body { min-width: 0; }
.project-settings-rate-link-hint {
  margin: 0; padding: 9px 16px; border-bottom: 1px solid var(--hairline);
  color: var(--muted); font-size: 11.5px; line-height: 1.4;
}
.project-settings-form,
.project-settings-portal-form {
  display: grid; gap: 0; padding: 0 16px 14px;
}
.project-settings-field {
  display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px;
  align-items: start; margin: 0; padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
}
.project-settings-field-compact {
  grid-template-columns: 150px minmax(0, 1fr); padding-top: 0;
}
.project-settings-field-text {
  min-width: 0; display: grid; gap: 3px; padding-top: 7px;
}
.project-settings-field-label {
  color: var(--ink-2); font-size: 12.5px; font-weight: 500;
}
.project-settings-field-hint {
  color: var(--muted); font-size: 11px; line-height: 1.4; font-weight: 400;
}
.project-settings-field-control {
  display: grid; gap: 4px; min-width: 0;
}
.project-settings-field-control-short { max-width: 240px; }
.project-settings-field-control input:not([type="checkbox"]),
.project-settings-field-control select,
.project-settings-field-control textarea {
  width: 100%; min-height: 34px; font-size: 12.5px;
  border-radius: var(--radius); background: var(--panel-2);
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.project-settings-field-control textarea {
  padding: 9px 10px; resize: vertical; line-height: 1.4;
}
.project-settings-field-control input[name="key"] {
  text-transform: uppercase; font-weight: 700; letter-spacing: .04em;
}
.project-settings-file-picker {
  position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  min-width: 0;
}
.project-settings-file-picker-input {
  position: absolute; left: 0; top: 0; width: 1px; height: 1px; margin: 0; padding: 0;
  border: 0; opacity: 0; overflow: hidden; clip-path: inset(50%);
  white-space: nowrap;
}
.project-settings-file-picker-button {
  flex: none; min-width: 104px; justify-content: center; cursor: pointer;
}
.project-settings-file-picker-input:focus-visible + .project-settings-file-picker-button {
  outline: 0; box-shadow: 0 0 0 3px var(--accent-softer);
}
.project-settings-file-name {
  flex: 1 1 150px; min-width: 0; overflow-wrap: anywhere;
  min-height: 28px; display: inline-flex; align-items: center;
  padding: 0 8px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--panel-2);
  color: var(--ink-2); font-size: 11.5px; font-weight: 600;
}
.project-settings-file-name.is-empty {
  color: var(--muted);
}
.project-settings-field.has-error .project-settings-field-label {
  color: var(--danger);
}
.project-settings-field.has-error .project-settings-field-control input:not([type="checkbox"]),
.project-settings-field.has-error .project-settings-field-control select,
.project-settings-field.has-error .project-settings-field-control textarea {
  border-color: var(--danger-border);
  box-shadow: 0 0 0 3px var(--danger-soft);
}
.project-settings-field-error { display: grid; gap: 2px; margin-top: 2px; }
.project-settings-field-error-banner { margin: 14px 0 0; }
.project-settings-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 14px;
}
.project-settings-actions .btn { min-width: 128px; justify-content: center; }
.project-settings-save-bar {
  position: sticky; bottom: 12px; z-index: 7; align-items: center;
  margin-top: 14px; padding: 10px; border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg); background: var(--panel);
  box-shadow: var(--shadow-pop);
}
.project-settings-dirty-indicator {
  margin-right: auto; display: inline-flex; align-items: center; min-height: 24px;
  padding: 0 8px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--panel-2); color: var(--muted); font-size: 11px; font-weight: 700;
  white-space: nowrap;
}
.project-settings-form.is-dirty .project-settings-save-bar,
.project-settings-portal-form.is-dirty .project-settings-save-bar {
  border-color: var(--warning-border); background: var(--warning-soft);
}
.project-settings-form.is-dirty .project-settings-dirty-indicator,
.project-settings-portal-form.is-dirty .project-settings-dirty-indicator {
  border-color: var(--warning-border); background: var(--panel);
  color: var(--warning);
}
.project-settings-empty-state {
  align-items: flex-start; margin: 0; padding: 18px 16px;
  text-align: left; border-top: 1px solid var(--hairline);
}
.project-settings-empty-state .empty-state-icon {
  width: 32px; height: 32px; border-radius: 8px;
}
.project-settings-empty-state .empty-state-title {
  font-size: 13px; line-height: 1.3;
}
.project-settings-empty-state .empty-state-body {
  max-width: 460px; font-size: 12px; line-height: 1.45;
}
.project-settings-readonly-empty-state .empty-state-icon {
  color: var(--muted); background: var(--panel-2);
}
.project-settings-readonly-empty-state .empty-state-icon svg {
  stroke: currentColor;
}
.project-settings-portal-empty-state .empty-state-icon,
.project-settings-rates-empty-state .empty-state-icon {
  color: var(--accent); background: var(--accent-softer);
  border-color: var(--accent-border);
}
.project-settings-portal-empty-state .empty-state-icon svg,
.project-settings-rates-empty-state .empty-state-icon svg {
  stroke: currentColor;
}
.project-settings-preservation {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, auto); gap: 14px;
  margin: 14px 16px 0; padding: 12px;
  border: 1px solid var(--warning-border); border-radius: var(--radius);
  background: var(--warning-soft);
}
.project-settings-preservation p {
  margin: 3px 0 0; color: var(--ink-2); font-size: 12px;
}
.project-settings-preservation ul {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 5px;
  color: var(--muted); font-size: 11.5px;
}
.project-settings-summary-list {
  margin: 0; padding: 0; display: grid;
}
.project-settings-summary-list > div {
  display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 16px;
  padding: 12px 16px; border-bottom: 1px solid var(--hairline);
}
.project-settings-summary-list > div:last-child { border-bottom: 0; }
.project-settings-summary-list dt {
  color: var(--muted-2); font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.project-settings-summary-list dd {
  margin: 0; min-width: 0; color: var(--ink-2); font-size: 12.5px;
}
.project-settings-summary-list dd .table-muted { display: block; }
.project-settings-portal-contact-summary {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--hairline);
  background: var(--panel);
}
.project-settings-portal-contact-summary > div {
  min-width: 0; display: grid; gap: 4px;
}
.project-settings-portal-contact-label {
  color: var(--muted-2); font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.project-settings-portal-contact-count {
  color: var(--ink); font-size: 13px; line-height: 1.25; font-weight: 700;
}
.project-settings-portal-contact-list {
  margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.45;
}
.project-settings-portal-contact-list span {
  color: var(--ink-2); font-weight: 600;
}
.project-settings-portal-list,
.project-settings-rate-list {
  display: grid; gap: 12px; padding: 14px 16px;
}
.project-settings-portal-card,
.project-settings-rate-row {
  display: grid; gap: 10px; min-width: 0; padding: 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel-2);
}
.project-settings-portal-summary,
.project-settings-rate-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.project-settings-portal-summary h4,
.project-settings-rate-row h4 { color: var(--ink); }
.project-settings-portal-summary a {
  display: inline-flex; font-size: 12px; font-weight: 500;
}
.project-settings-portal-link-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 5px;
}
.project-settings-copy-link {
  min-width: 104px; justify-content: center;
}
.project-settings-copy-status {
  min-height: 24px; display: inline-flex; align-items: center;
  padding: 0 8px; border: 1px solid var(--accent-border);
  border-radius: 999px; background: var(--accent-softer);
  color: var(--accent-hover); font-size: 11px; font-weight: 700;
}
.project-settings-copy-status[hidden] { display: none; }
.project-settings-copy-status.is-error {
  border-color: var(--danger-border); background: var(--danger-soft); color: var(--danger);
}
.project-settings-portal-badges,
.project-settings-rate-values {
  display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: wrap;
}
.project-settings-portal-meta {
  margin: 0; padding-top: 8px; border-top: 1px solid var(--hairline);
  color: var(--muted); font-size: 11.5px;
}
.project-settings-toggle-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  padding-top: 12px; border-top: 1px solid var(--hairline);
}
.project-settings-checkbox {
  min-width: 0; display: flex; align-items: center; gap: 8px; margin: 0;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); color: var(--ink-2); font-size: 12px; font-weight: 500;
  cursor: pointer; transition: border-color .18s ease, background .18s ease;
}
.project-settings-checkbox-inline { width: fit-content; max-width: 100%; }
.project-settings-checkbox:has(input:checked) {
  border-color: var(--accent-border); background: var(--accent-softer);
}
.project-settings-checkbox input {
  flex: none;
}
.project-settings-toggle-control {
  appearance: none; position: relative; width: 34px; height: 20px; margin: 0;
  border: 1px solid var(--border); border-radius: 999px; background: var(--panel-4);
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.project-settings-checkbox input::before,
.project-settings-toggle-control::before {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px;
  border-radius: 999px; background: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.28);
  transition: transform .18s ease, background .18s ease;
}
.project-settings-checkbox input:checked,
.project-settings-toggle-control:checked {
  border-color: var(--accent-border); background: var(--accent);
}
.project-settings-checkbox input:checked::before,
.project-settings-toggle-control:checked::before {
  transform: translateX(14px); background: var(--on-accent);
}
.project-settings-toggle-control:focus-visible {
  outline: 0; box-shadow: 0 0 0 3px var(--accent-softer);
}
.project-settings-checkbox span {
  min-width: 0; overflow-wrap: anywhere;
}
.project-settings-rate-row p { margin: 2px 0 0; font-size: 11.5px; }
.project-settings-rate-values span {
  min-height: 24px; display: inline-flex; align-items: center; padding: 0 8px;
  border: 1px solid var(--border); border-radius: 4px;
  background: var(--panel); color: var(--ink-2); font-size: 11.5px; font-weight: 500;
}

/* ---------- Time pages ---------- */
.time-page { min-width: 0; }
.time-kicker {
  margin: 0 0 4px; color: var(--muted-2); font-size: 10.5px;
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.time-header-actions { flex-wrap: wrap; justify-content: flex-end; }
.time-page-body { display: grid; gap: 16px; padding-top: 20px; }
.time-timer-strip { overflow: hidden; }
.time-timer-strip .panel-header { align-items: flex-start; }
.time-timer-strip .panel-header p { margin: 3px 0 0; font-size: 12px; }
.time-timer-empty-state {
  align-items: flex-start; margin: 0; padding: 14px;
  border: 1px solid var(--hairline); border-radius: var(--radius);
  background: var(--panel-2); text-align: left;
}
.time-timer-empty-state .empty-state-icon {
  width: 30px; height: 30px; border-radius: 8px;
}
.time-timer-empty-state .empty-state-title {
  font-size: 13px; line-height: 1.3;
}
.time-timer-empty-state .empty-state-body {
  max-width: 360px; font-size: 12px; line-height: 1.45;
}
.time-metric-strip {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
}
.time-approvals-page .time-metric-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.time-metric {
  display: grid; gap: 4px; min-width: 0; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--panel);
}
.time-metric span {
  color: var(--muted-2); font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.time-metric strong {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink); font-size: 16px; font-weight: 700;
}
.time-metric small { color: var(--muted); font-size: 11.5px; }
.time-ledger-panel,
.time-approvals-region { overflow: hidden; }
.time-ledger-header { align-items: flex-start; }
.time-ledger-header p { margin: 3px 0 0; font-size: 12px; }
.manual-time-panel { overflow: hidden; }
.manual-time-header { align-items: flex-start; }
.manual-time-header p { margin: 3px 0 0; font-size: 12px; }
.manual-time-form {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(170px, 1.1fr) repeat(3, minmax(120px, .8fr));
  gap: 12px;
  padding: 14px;
}
.manual-time-form .field {
  display: grid; gap: 6px; min-width: 0;
}
.manual-time-form label,
.manual-time-toggle {
  color: var(--muted); font-size: 11px; font-weight: 650;
  letter-spacing: .04em; text-transform: uppercase;
}
.manual-time-form input[type="text"],
.manual-time-form input[type="date"],
.manual-time-form input[type="time"],
.manual-time-form select {
  width: 100%; min-height: 34px; color: var(--ink);
  border-color: var(--border-strong); background-color: var(--panel-2);
}
.manual-time-description-field {
  grid-column: span 2;
}
.manual-time-field-error { display: grid; gap: 2px; }
.manual-time-toggle {
  align-self: end; display: inline-flex; align-items: center; gap: 8px;
  min-height: 34px; padding: 0 10px; border: 1px solid var(--border);
  border-radius: 7px; background: var(--panel-2);
}
.manual-time-toggle input {
  width: 14px; height: 14px; accent-color: var(--accent);
}
.manual-time-actions {
  display: flex; align-items: end; justify-content: flex-end;
}
.manual-time-actions .btn { width: 100%; justify-content: center; }
.manual-time-success {
  margin: 12px 14px 0; padding: 9px 11px; border: 1px solid var(--accent-border);
  border-radius: 7px; background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 650;
}
.manual-time-empty-state { margin: 14px; }
.time-week-panel { overflow: hidden; }
.time-week-header { align-items: flex-start; }
.time-week-header p { margin: 3px 0 0; font-size: 12px; }
.time-week-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.time-week-nav,
.time-week-person-form,
.time-week-submit-form,
.time-week-helper {
  display: flex; align-items: center; gap: 8px; min-width: 0;
}
.time-week-range {
  display: grid; gap: 1px; min-width: 0; margin-left: 4px; line-height: 1.15;
}
.time-week-range strong {
  color: var(--ink); font-size: 13px; font-weight: 650; white-space: nowrap;
}
.time-week-range span,
.time-week-person-form label,
.time-week-helper {
  color: var(--muted); font-size: 11.5px;
}
.time-week-person-form select {
  min-height: 30px; max-width: 210px; color: var(--ink);
  border-color: var(--border-strong); background-color: var(--panel-2);
}
.time-week-submit-form {
  justify-content: flex-end;
}
.time-week-submit-meta {
  color: var(--muted); font-size: 11.5px; white-space: nowrap;
}
.time-week-scroll {
  overflow-x: auto; overscroll-behavior-x: contain; background: var(--panel);
}
.time-week-grid { min-width: 920px; }
.time-week-grid-head,
.time-week-row,
.time-week-totals-row {
  display: grid; grid-template-columns: minmax(240px, 1.6fr) repeat(7, minmax(76px, 1fr)) 86px;
}
.time-week-grid-head {
  background: var(--panel-2); border-bottom: 1px solid var(--border);
}
.time-week-task-heading,
.time-week-total-heading,
.time-week-daily-label {
  padding: 10px 14px; color: var(--muted); font-size: 11px; font-weight: 650;
  letter-spacing: .04em; text-transform: uppercase;
}
.time-week-total-heading {
  text-align: right; border-left: 1px solid var(--border);
}
.time-week-day-heading {
  display: grid; justify-items: center; gap: 1px; min-width: 0;
  padding: 8px 10px; border-left: 1px solid var(--hairline);
}
.time-week-day-heading span {
  color: var(--muted); font-size: 10.5px; font-weight: 650;
  letter-spacing: .06em; text-transform: uppercase;
}
.time-week-day-heading strong {
  color: var(--ink); font-size: 14px; font-weight: 650;
}
.time-week-day-heading.is-today,
.time-week-cell.is-today,
.time-week-day-total.is-today { background: var(--accent-soft); }
.time-week-day-heading.is-today span,
.time-week-day-heading.is-today strong { color: var(--accent); }
.time-week-day-heading.is-weekend span,
.time-week-day-heading.is-weekend strong { color: var(--muted-2); }
.time-week-row { border-bottom: 1px solid var(--hairline); }
.time-week-row:last-of-type { border-bottom: 0; }
.time-week-task-cell {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 10px 14px;
}
.time-week-project-swatch {
  width: 8px; height: 8px; flex: none; border-radius: 2px;
  background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.time-week-task-cell > div {
  display: grid; gap: 2px; min-width: 0; line-height: 1.25;
}
.time-week-task-cell strong,
.time-week-task-cell span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.time-week-task-cell strong {
  color: var(--ink); font-size: 12.5px; font-weight: 650;
}
.time-week-task-cell span { color: var(--muted); font-size: 11.5px; }
.time-week-cell {
  min-width: 0; min-height: 44px; padding: 10px 8px;
  border: 0; border-left: 1px solid var(--hairline); border-radius: 0;
  background: var(--panel); color: var(--muted-2);
  cursor: pointer; transition: background .12s ease, color .12s ease;
}
.time-week-cell:hover,
.time-week-cell:focus-visible {
  background: var(--panel-2); color: var(--accent);
}
.time-week-cell.has-time { color: var(--ink); font-weight: 650; }
.time-week-cell.is-weekend:not(.is-today) { background: var(--panel-2); }
.time-week-row-total,
.time-week-week-total,
.time-week-day-total {
  display: flex; align-items: center; justify-content: center;
  min-width: 0; padding: 10px 8px; border-left: 1px solid var(--hairline);
  color: var(--ink); font-size: 12.5px; font-weight: 650;
}
.time-week-row-total,
.time-week-week-total {
  justify-content: flex-end; padding-right: 12px;
  border-left-color: var(--border); background: var(--panel-2);
}
.time-week-totals-row {
  border-top: 1px solid var(--border); background: var(--panel-2);
}
.time-week-daily-label {
  display: flex; align-items: center; gap: 8px; letter-spacing: 0; text-transform: none;
}
.time-week-daily-label strong {
  color: var(--ink-2); font-size: 12px; font-weight: 650;
}
.time-week-daily-label span {
  color: var(--muted); font-size: 11px; font-weight: 500;
}
.time-week-week-total { color: var(--accent); background: var(--panel); }
.time-week-empty { width: min(420px, 100%); padding: 18px; }
.time-week-empty .empty-state {
  align-items: flex-start; text-align: left;
}
.time-week-helper {
  flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--hairline);
  background: var(--panel);
}
.time-week-helper span {
  display: inline-flex; align-items: center; gap: 6px;
}
.time-week-helper i {
  display: inline-block; width: 10px; height: 10px; border-radius: 2px;
}
.time-week-legend-today {
  background: var(--accent-soft); border: 1px solid var(--accent-border);
}
.time-week-legend-weekend {
  background: var(--panel-2); border: 1px solid var(--hairline);
}
.time-entry-filter-panel { overflow: hidden; }
.time-entry-filter-form {
  display: grid; grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(130px, 1fr)) auto;
  gap: 10px; align-items: end; padding: 14px;
}
.time-entry-filter-form label {
  display: grid; gap: 5px; min-width: 0;
  color: var(--muted-2); font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.time-entry-filter-form input,
.time-entry-filter-form select {
  width: 100%; min-width: 0; height: 34px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel-2); color: var(--ink); font: inherit;
  font-size: 12.5px; font-weight: 500; letter-spacing: 0; text-transform: none;
}
.time-entry-filter-form input::placeholder {
  color: var(--muted); font-weight: 400;
}
.time-entry-filter-actions {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; min-width: max-content;
}
.time-entry-filter-status {
  display: grid; gap: 6px; min-width: 0; padding: 12px 14px 0;
}
.time-entry-filter-status p { margin: 0; font-size: 11.5px; }
.time-entry-active-filters {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0;
}
.time-entry-active-filters > .muted {
  flex: none; font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.time-entry-bulk-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 9px; min-width: 0;
  margin: 12px 14px 0; padding: 9px 11px;
  border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius);
  background: #111827; color: white;
  box-shadow: 0 16px 40px rgba(0,0,0,.24);
}
.time-entry-bulk-bar[hidden] { display: none; }
.time-entry-bulk-count {
  color: white; font-size: 12.5px; font-weight: 700; white-space: nowrap;
}
.time-entry-bulk-spacer { flex: 1; min-width: 0; }
.time-entry-bulk-bar .btn {
  border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.08);
  color: white;
}
.time-entry-bulk-bar .btn-primary {
  border-color: var(--accent); background: var(--accent); color: #052e24;
}
.time-entry-bulk-bar .btn:disabled {
  cursor: not-allowed; opacity: .55;
}
.time-entries-region { min-width: 0; }
.time-entries { display: grid; gap: 16px; padding: 14px; }
.time-entry-day { display: grid; gap: 8px; min-width: 0; }
.time-entry-day-header {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 0 2px;
}
.time-entry-day-header p { margin: 1px 0 0; font-size: 11.5px; }
.time-entry-table-wrap { border-radius: var(--radius); }
.time-entry-table { min-width: 900px; table-layout: fixed; }
.time-entry-table th:nth-child(1) { width: 58px; }
.time-entry-table th:nth-child(2) { width: 150px; }
.time-entry-table th:nth-child(4) { width: 95px; }
.time-entry-table th:nth-child(5) { width: 100px; }
.time-entry-table th:nth-child(6) { width: 135px; }
.time-entry-table th:nth-child(7) { width: 115px; }
.time-entry-table th:nth-child(8) { width: 180px; }
.time-entry-select-cell input,
.time-entry-mobile-select input {
  width: 15px; height: 15px; accent-color: var(--accent);
}
.time-entry-user-cell,
.time-entry-description-cell,
.time-entry-duration-cell,
.time-entry-status-stack {
  display: grid; gap: 3px; min-width: 0;
}
.time-entry-user-cell strong,
.time-entry-description-cell strong,
.time-entry-duration-cell strong {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink); font-size: 13px; font-weight: 600;
}
.time-entry-description-cell .table-muted {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.time-entry-desktop-actions,
.time-entry-mobile-actions {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.time-entry-desktop-actions { justify-content: flex-end; }
.time-entry-desktop-actions form,
.time-entry-mobile-actions form { margin: 0; }
.time-entry-empty-action { justify-self: end; }
.time-entry-inline-detail {
  min-width: 0;
}
.time-entry-rate-card {
  display: grid; gap: 10px; min-width: 0; margin-top: 8px; padding: 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel-2);
}
.time-entry-rate-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; min-width: 0;
}
.time-entry-rate-header h3 {
  margin: 0; color: var(--ink); font-size: 13px; font-weight: 700;
}
.time-entry-rate-header p {
  min-width: 0; margin: 3px 0 0; overflow-wrap: anywhere; font-size: 11.5px;
}
.time-entry-rate-source {
  flex: none; max-width: 48%; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.time-entry-rate-grid {
  display: grid; gap: 6px; min-width: 0; margin: 0;
}
.time-entry-rate-row {
  display: grid; grid-template-columns: minmax(90px, .8fr) minmax(0, 1.2fr);
  gap: 10px; align-items: center; min-width: 0; padding: 8px 10px;
  border: 1px solid var(--hairline); border-radius: var(--radius);
  background: var(--panel);
}
.time-entry-rate-row dt {
  color: var(--muted-2); font-size: 10px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.time-entry-rate-row dd {
  min-width: 0; margin: 0; color: var(--ink); font-size: 12.5px;
  font-weight: 600; overflow-wrap: anywhere;
}
.time-entry-rate-note {
  margin: 0; color: var(--muted); font-size: 11.5px; line-height: 1.35;
}
.time-entry-rate-empty {
  margin: 0; padding: 12px; border: 1px dashed var(--border);
  border-radius: var(--radius); background: var(--panel);
  color: var(--muted); font-size: 12px; line-height: 1.35;
}
.time-entry-mobile-list { min-width: 0; }
.time-entry-mobile-card { color: var(--ink); }
.time-entry-mobile-title {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px; min-width: 0;
}
.time-entry-mobile-title-main { min-width: 0; }
.time-entry-mobile-select {
  display: grid; grid-template-columns: auto minmax(0, 1fr);
  align-items: start; gap: 8px; min-width: 0;
}
.time-entry-mobile-title strong {
  min-width: 0; overflow-wrap: anywhere; font-size: 13px; line-height: 1.3;
}
.time-entry-mobile-title .badge { flex: none; margin-top: 1px; }
.time-entry-mobile-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px; margin: 2px 0 0;
}
.time-entry-mobile-grid > div { min-width: 0; }
.time-entry-mobile-grid dt {
  color: var(--muted-2); font-size: 10px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.time-entry-mobile-grid dd {
  margin: 2px 0 0; color: var(--ink); font-size: 12.5px; overflow-wrap: anywhere;
}
.time-entry-mobile-actions { justify-content: flex-start; margin-top: 2px; }
.time-entry-empty-state {
  padding: 36px 20px;
}
.time-entry-empty-state .empty-state-icon {
  background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent);
}
.time-entry-empty-state .empty-state-icon svg { stroke: currentColor; }

/* ---------- Project time ---------- */
.project-time-page { min-width: 0; }
.project-time-page-header > div:first-child { min-width: 0; }
.project-time-page-header h1 { overflow-wrap: anywhere; }
.project-time-page-body { display: grid; gap: 16px; min-width: 0; padding-top: 20px; }
.project-time-panel {
  overflow: hidden; min-width: 0;
}
.project-time {
  display: grid; gap: 14px; min-width: 0; padding: 18px;
}
.project-time-summary {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; min-width: 0;
}
.project-time-summary h2 {
  margin: 0; color: var(--ink); font-family: var(--font-display);
  font-size: 20px; line-height: 1.1;
}
.project-time-summary p { margin: 5px 0 0; }
.project-time-summary-actions {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; min-width: 0;
}
.project-time-summary-actions form { margin: 0; }
.project-time-summary-actions .btn {
  height: auto; min-height: 44px; padding-block: 8px;
  justify-content: center; line-height: 1.25; text-align: center;
}
.project-time-filter-bar {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 8px; min-width: 0; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--panel);
}
.project-time-filter-label {
  color: var(--muted-2); font-size: 10px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.project-time-project-chip,
.project-time-filter-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 12px; border-radius: var(--radius);
  font-size: 12px; font-weight: 600; text-decoration: none;
}
.project-time-project-chip {
  border: 1px solid var(--accent-border); background: var(--accent-soft);
  color: var(--accent);
}
.project-time-filter-options {
  display: flex; align-items: center; flex: 1 1 420px; flex-wrap: wrap;
  gap: 6px; min-width: 0;
}
.project-time-filter-chip {
  border: 1px solid var(--border); background: var(--panel-2); color: var(--muted);
}
.project-time-filter-chip:hover,
.project-time-filter-chip.active {
  border-color: var(--accent-border); background: var(--accent-soft); color: var(--accent);
}
.project-time-filter-count {
  margin-left: auto; color: var(--muted); font-size: 11.5px; white-space: nowrap;
}
.project-time-list-card {
  overflow: hidden; min-width: 0; border: 1px solid var(--border);
  border-radius: var(--radius-lg); background: var(--panel);
}
.project-time-card-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-bottom: 1px solid var(--hairline);
}
.project-time-card-header h3 {
  margin: 0; color: var(--ink); font-size: 13px; font-weight: 700;
}
.project-time-card-header p {
  margin: 3px 0 0; font-size: 11.5px; line-height: 1.35;
}
.project-time-table-wrap {
  margin: 0; border: 0; border-radius: 0;
}
.project-time-table {
  min-width: 1040px; table-layout: fixed;
}
.project-time-table th,
.project-time-table td {
  vertical-align: top; overflow-wrap: anywhere;
}
.project-time-table th:nth-child(1) { width: 80px; }
.project-time-table th:nth-child(2) { width: 220px; }
.project-time-table th:nth-child(3) { width: 120px; }
.project-time-table th:nth-child(4) { width: 150px; }
.project-time-table th:nth-child(n+5) { width: 94px; }
.project-time-description-cell {
  display: grid; gap: 3px; min-width: 180px;
}
.project-time-description-cell strong {
  min-width: 0; overflow-wrap: anywhere; color: var(--ink); font-weight: 600;
}
.project-time-empty-state {
  padding: 34px 20px;
}
.project-time-empty-state .empty-state-icon {
  background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent);
}
.project-time-empty-state .empty-state-icon svg { stroke: currentColor; }
.project-time-mobile-list { min-width: 0; }
.project-time-mobile-card { color: var(--ink); }
.project-time-mobile-card .table-muted {
  min-width: 0; overflow-wrap: anywhere;
}
.project-time-mobile-title {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px; min-width: 0;
}
.project-time-mobile-title strong {
  min-width: 0; overflow-wrap: anywhere; font-size: 13px; line-height: 1.3;
}
.project-time-mobile-title .badge { flex: none; margin-top: 1px; }
.project-time-mobile-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px; margin: 2px 0 0;
}
.project-time-mobile-grid > div { min-width: 0; }
.project-time-mobile-grid dt {
  color: var(--muted-2); font-size: 10px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.project-time-mobile-grid dd {
  margin: 2px 0 0; color: var(--ink); font-size: 12.5px; overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .project-time-summary-actions {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%;
  }
  .project-time-summary-actions .btn { width: 100%; }
  .project-time-filter-bar {
    display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center;
  }
  .project-time-project-chip { justify-self: start; }
  .project-time-filter-options {
    display: grid; grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%;
  }
  .project-time-filter-count { grid-column: 1 / -1; margin-left: 0; }
}

/* ---------- Project reports ---------- */
.project-reports-page { min-width: 0; }
.project-reports-page-header > div:first-child { min-width: 0; }
.project-reports-page-header h1 { overflow-wrap: anywhere; }
.project-reports-page-body { display: grid; gap: 16px; min-width: 0; padding-top: 20px; }
.project-reports-panel {
  overflow: hidden; min-width: 0;
}
.project-reports {
  display: grid; gap: 14px; min-width: 0; padding: 18px;
}
.project-reports-summary {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; min-width: 0;
}
.project-reports-summary h2 {
  margin: 0; color: var(--ink); font-family: var(--font-display);
  font-size: 20px; line-height: 1.1;
}
.project-reports-summary p { margin: 5px 0 0; }
.project-reports-action-card,
.project-reports-list-card {
  overflow: hidden; min-width: 0; border: 1px solid var(--border);
  border-radius: var(--radius-lg); background: var(--panel);
}
.project-reports-card-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-bottom: 1px solid var(--hairline);
}
.project-reports-card-header h3 {
  margin: 0; color: var(--ink); font-size: 13px; font-weight: 700;
}
.project-reports-card-header p {
  margin: 3px 0 0; font-size: 11.5px; line-height: 1.35;
}
.project-reports-actions {
  display: grid; grid-template-columns: minmax(220px, 1.3fr) repeat(2, minmax(180px, 1fr));
  align-items: end; gap: 12px; min-width: 0; padding: 14px;
}
.project-report-action-form {
  display: grid; gap: 8px; min-width: 0; margin: 0;
}
.project-report-action-form .field { min-width: 0; margin: 0; }
.project-report-action-form input { width: 100%; min-height: 34px; }
.project-report-action-form .btn {
  height: auto; min-height: 44px; padding-block: 8px;
  justify-content: center; line-height: 1.25; text-align: center;
}
.project-reports-metric-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.project-reports-table-wrap {
  margin: 0; border: 0; border-radius: 0;
}
.project-reports-table th,
.project-reports-table td {
  vertical-align: top;
}
.project-reports-table td:first-child {
  min-width: 160px;
}
.project-report-inline-actions {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end;
}
.project-report-inline-actions form {
  margin: 0;
}
.project-report-inline-actions .btn {
  min-height: 30px; white-space: nowrap;
}
.project-reports-empty-state {
  padding: 34px 20px;
}
.project-reports-empty-state .empty-state-icon {
  background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent);
}
.project-reports-empty-state .empty-state-icon svg { stroke: currentColor; }
.project-reports-mobile-list { min-width: 0; }
.project-reports-mobile-card {
  color: var(--ink);
}
.project-reports-mobile-card p {
  margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.45;
}
.project-reports-mobile-title {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px; min-width: 0;
}
.project-reports-mobile-title strong {
  min-width: 0; overflow-wrap: anywhere; font-size: 13px; line-height: 1.3;
}
.project-reports-mobile-title .badge {
  flex: none; margin-top: 1px;
}
.project-reports-mobile-source-actions {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px; margin-top: auto; padding-top: 4px;
}
.project-reports-mobile-source-actions form { min-width: 0; margin: 0; }
.project-reports-mobile-source-actions .btn {
  width: 100%; min-width: 0; min-height: 44px;
  justify-content: center; white-space: nowrap;
}

/* ---------- Team capacity ---------- */
.team-capacity-page,
.team-member-page { min-width: 0; }
.team-capacity-page-body,
.team-member-page-body {
  display: grid; gap: 16px; min-width: 0; padding-top: 20px;
}
.team-capacity-panel,
.team-member-panel {
  overflow: hidden; min-width: 0;
}
.team-capacity,
.team-member-detail {
  display: grid; gap: 14px; min-width: 0; padding: 18px;
}
.team-capacity-summary,
.team-member-summary {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; min-width: 0;
}
.team-capacity-summary h2,
.team-member-summary h2 {
  margin: 0; color: var(--ink); font-family: var(--font-display);
  font-size: 20px; line-height: 1.1;
}
.team-capacity-summary p,
.team-member-summary p { margin: 5px 0 0; }
.team-capacity-card,
.team-member-card {
  overflow: hidden; min-width: 0; border: 1px solid var(--border);
  border-radius: var(--radius-lg); background: var(--panel);
}
.team-capacity-card-header,
.team-member-card-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-bottom: 1px solid var(--hairline);
}
.team-capacity-card-header h3,
.team-member-card-header h3 {
  margin: 0; color: var(--ink); font-size: 13px; font-weight: 700;
}
.team-capacity-card-header p,
.team-member-card-header p {
  margin: 3px 0 0; font-size: 11.5px; line-height: 1.35;
}
.team-capacity-metric-strip,
.team-member-metric-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.team-capacity-metric-strip .time-metric strong,
.team-member-metric-strip .time-metric strong {
  overflow: visible; text-overflow: clip; white-space: normal;
  overflow-wrap: anywhere; line-height: 1.2;
}
.team-capacity-table-wrap,
.team-capacity-schedule-wrap,
.team-member-projects-wrap,
.team-member-time-off-wrap,
.team-member-time-off-requests-wrap {
  margin: 0; border: 0; border-radius: 0;
}
.team-capacity-table th,
.team-capacity-table td,
.team-capacity-schedule th,
.team-capacity-schedule td,
.team-member-projects th,
.team-member-projects td,
.team-member-time-off th,
.team-member-time-off td,
.team-member-time-off-requests th,
.team-member-time-off-requests td {
  vertical-align: top;
}
.team-capacity-schedule th:not(:first-child),
.team-capacity-schedule td:not(:first-child) {
  min-width: 150px;
}
.team-capacity-empty-state,
.team-member-empty-state {
  padding: 28px 18px;
}
.team-capacity-empty-state .empty-state-icon,
.team-member-empty-state .empty-state-icon {
  background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent);
}
.team-capacity-empty-state .empty-state-icon svg,
.team-member-empty-state .empty-state-icon svg { stroke: currentColor; }
.team-capacity-mobile-list,
.team-capacity-schedule-mobile-list,
.team-member-mobile-list {
  min-width: 0;
}
.team-capacity-mobile-card,
.team-capacity-schedule-mobile-card,
.team-member-mobile-card {
  color: var(--ink);
}
.team-capacity-mobile-title,
.team-member-mobile-title {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px; min-width: 0;
}
.team-capacity-mobile-title a,
.team-member-mobile-title strong {
  min-width: 0; overflow-wrap: anywhere; color: var(--ink);
  font-size: 13px; font-weight: 700; line-height: 1.3;
}
.team-capacity-mobile-title .badge,
.team-member-mobile-title .badge {
  flex: none; margin-top: 1px;
}
.team-capacity-mobile-grid,
.team-member-mobile-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px; margin: 2px 0 0;
}
.team-capacity-mobile-grid > div,
.team-member-mobile-grid > div { min-width: 0; }
.team-capacity-mobile-grid dt,
.team-member-mobile-grid dt {
  color: var(--muted-2); font-size: 10px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.team-capacity-mobile-grid dd,
.team-member-mobile-grid dd {
  margin: 2px 0 0; color: var(--ink); font-size: 12.5px; overflow-wrap: anywhere;
}
.team-capacity-day-list {
  display: grid; gap: 8px; min-width: 0; margin-top: 4px;
}
.team-capacity-day-card {
  display: grid; gap: 7px; min-width: 0; padding: 10px;
  border: 1px solid var(--hairline); border-radius: var(--radius);
  background: rgba(15, 23, 42, .24);
}
.team-capacity-day-card.is-overbooked {
  border-color: rgba(251, 113, 133, .42);
  background: rgba(127, 29, 29, .18);
}
.team-capacity-day-heading,
.team-capacity-day-metrics {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; min-width: 0;
}
.team-capacity-day-heading strong {
  color: var(--ink); font-size: 12.5px;
}
.team-capacity-day-heading span,
.team-capacity-day-metrics span {
  min-width: 0; color: var(--muted); font-size: 11.5px; overflow-wrap: anywhere;
}
.team-capacity-block-list {
  margin-top: 0;
}
.team-member-week-list {
  display: grid; gap: 8px; min-width: 0; padding: 12px;
}
.team-member-week-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr);
  gap: 10px; min-width: 0; padding: 10px;
  border: 1px solid var(--hairline); border-radius: var(--radius);
  background: rgba(15, 23, 42, .24);
}
.team-member-week-card strong {
  color: var(--ink); font-size: 13px; white-space: nowrap;
}
.team-member-week-card div {
  display: grid; gap: 2px; min-width: 0;
}
.team-member-week-card span {
  color: var(--ink); font-size: 12.5px; overflow-wrap: anywhere;
}
.team-member-week-card small {
  color: var(--muted); font-size: 11.5px; overflow-wrap: anywhere;
}

/* ---------- Project client view ---------- */
.project-client-view-page { min-width: 0; }
.project-client-view-page-header > div,
.project-client-view-page-header h1,
.project-client-view-page-header p { min-width: 0; overflow-wrap: anywhere; }
.project-client-view-page-body {
  display: grid; gap: 16px; min-width: 0; padding-top: 20px;
}
.project-client-view-panel {
  overflow: visible; min-width: 0; border: 0; background: transparent;
  box-shadow: none;
}
.project-client-view {
  display: grid; gap: 16px; min-width: 0;
}
.project-client-view-preview-banner {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 12px; min-width: 0; padding: 11px 14px;
  border: 1px solid color-mix(in oklab, var(--info) 28%, var(--border));
  border-radius: var(--radius-lg); background: var(--info-soft); color: var(--info);
}
.project-client-view-preview-icon {
  width: 18px; height: 18px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.project-client-view-preview-copy { min-width: 0; }
.project-client-view-preview-copy h2 {
  margin: 0; color: var(--info); font-size: 13px; line-height: 1.3;
}
.project-client-view-preview-copy > p {
  margin: 2px 0 0; color: var(--ink-2); font-size: 12.5px; line-height: 1.45;
  overflow-wrap: anywhere;
}
.project-client-view-preview-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px 10px;
  margin-top: 7px; color: var(--muted); font-size: 11px;
}
.project-client-view-preview-meta > span:not(.badge) {
  position: relative; padding-left: 10px;
}
.project-client-view-preview-meta > span:not(.badge)::before {
  position: absolute; top: 50%; left: 0; width: 3px; height: 3px;
  border-radius: 50%; background: currentColor; content: "";
}
.project-client-view-preview-banner .btn,
.project-client-view-header-actions .btn,
.project-client-view-contact-bar .btn,
.project-client-view-invoice-list .btn {
  min-height: 44px; justify-content: center;
}
.project-client-view-portal-shell {
  display: grid; gap: 0; width: min(100%, 760px); min-width: 0; margin: 0 auto;
  overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--panel);
}
.project-client-view-identity {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 12px; min-width: 0; padding: 18px 20px;
  border-bottom: 1px solid var(--hairline);
}
.project-client-view-client-mark {
  display: grid; place-items: center; width: 38px; height: 38px;
  border: 1px solid color-mix(in oklab, var(--accent) 35%, var(--border));
  border-radius: var(--radius-lg); background: var(--accent-soft); color: var(--accent);
  font-size: 12px; font-weight: 800;
}
.project-client-view-identity > div { min-width: 0; }
.project-client-view-client-name {
  margin: 0 0 2px; color: var(--muted); font-size: 11px; font-weight: 700;
  text-transform: uppercase; overflow-wrap: anywhere;
}
.project-client-view-identity h3 {
  margin: 0; color: var(--ink); font-family: var(--font-display);
  font-size: 20px; line-height: 1.2; overflow-wrap: anywhere;
}
.project-client-view-identity .muted {
  margin: 3px 0 0; font-size: 11.5px;
}
.project-client-view-metric-strip {
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 0; border-bottom: 1px solid var(--hairline);
}
.project-client-view-metric-strip .time-metric {
  min-height: 94px; border: 0; border-right: 1px solid var(--hairline);
  border-radius: 0; background: var(--panel-2);
}
.project-client-view-metric-strip .time-metric:last-child { border-right: 0; }
.project-client-view-metric-strip .time-metric strong {
  overflow: visible; text-overflow: clip; white-space: normal;
  overflow-wrap: anywhere; line-height: 1.2;
}
.project-client-view-card-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 0;
}
.project-client-view-card {
  min-width: 0; border: 0; border-bottom: 1px solid var(--hairline);
  background: transparent;
}
.project-client-view-card-grid > .project-client-view-card + .project-client-view-card {
  border-left: 1px solid var(--hairline);
}
.project-client-view-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; min-width: 0; padding: 14px 16px 10px;
}
.project-client-view-card-header > div { min-width: 0; }
.project-client-view-card-header h3 {
  margin: 0; color: var(--ink); font-size: 13px; font-weight: 700;
}
.project-client-view-card-header p {
  margin: 3px 0 0; font-size: 11.5px; line-height: 1.35;
}
.project-client-view-progress-list {
  display: grid; gap: 0; margin: 0; padding: 0 16px 14px; list-style: none;
}
.project-client-view-progress-list li {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px;
  min-width: 0; padding: 9px 0; border-bottom: 1px solid var(--hairline);
}
.project-client-view-progress-list li:last-child { border-bottom: 0; }
.project-client-view-progress-icon {
  display: grid; place-items: center; width: 18px; height: 18px; margin-top: 1px;
  color: var(--info);
}
.project-client-view-progress-icon.is-done { color: var(--accent); }
.project-client-view-progress-icon svg,
.project-client-view-file-main > svg {
  width: 16px; height: 16px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.project-client-view-progress-copy { display: grid; gap: 2px; min-width: 0; }
.project-client-view-progress-copy strong {
  color: var(--ink); font-size: 12.5px; line-height: 1.4; overflow-wrap: anywhere;
}
.project-client-view-progress-copy small { color: var(--muted); overflow-wrap: anywhere; }
.project-client-view-update-list { display: grid; gap: 0; padding: 0 16px 14px; }
.project-client-view-update-list article {
  min-width: 0; padding: 9px 0; border-bottom: 1px solid var(--hairline);
}
.project-client-view-update-list article:last-child { border-bottom: 0; }
.project-client-view-update-list article > div {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.project-client-view-update-list strong,
.project-client-view-update-list p,
.project-client-view-update-list small { overflow-wrap: anywhere; }
.project-client-view-update-list strong { color: var(--ink); font-size: 12px; }
.project-client-view-update-list article > div span,
.project-client-view-update-list small { color: var(--muted); font-size: 10.5px; }
.project-client-view-update-list p {
  margin: 5px 0; color: var(--ink-2); font-size: 12.5px; line-height: 1.45;
}
.project-client-view-wide-card { grid-column: 1 / -1; }
.project-client-view-file-list,
.project-client-view-invoice-list { display: grid; min-width: 0; padding: 0 16px 14px; }
.project-client-view-file-list article,
.project-client-view-invoice-list article {
  display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 52px;
  padding: 8px 0; border-bottom: 1px solid var(--hairline);
}
.project-client-view-file-list article:last-child,
.project-client-view-invoice-list article:last-child { border-bottom: 0; }
.project-client-view-file-main {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center;
  gap: 9px; min-width: 0; margin-right: auto;
}
.project-client-view-file-main > svg { color: var(--muted); }
.project-client-view-file-main > div,
.project-client-view-invoice-list article > div { display: grid; gap: 2px; min-width: 0; }
.project-client-view-file-main strong,
.project-client-view-file-main a,
.project-client-view-invoice-list strong {
  color: var(--ink); font-size: 12.5px; overflow-wrap: anywhere;
}
.project-client-view-file-main small,
.project-client-view-invoice-list small { color: var(--muted); overflow-wrap: anywhere; }
.project-client-view-invoice-list article > span {
  margin-left: auto; color: var(--ink); font-size: 12.5px; white-space: nowrap;
}
.project-client-view-contact-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  min-width: 0; padding: 14px 16px; background: var(--panel-2);
}
.project-client-view-contact-bar > div { display: grid; gap: 2px; min-width: 0; }
.project-client-view-contact-bar strong { color: var(--ink); font-size: 12.5px; }
.project-client-view-contact-bar span {
  color: var(--muted); font-size: 11.5px; overflow-wrap: anywhere;
}
.project-client-view-empty-state {
  padding: 34px 20px;
}
.project-client-view-empty-state .empty-state-icon {
  background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent);
}
.project-client-view-empty-state .empty-state-icon svg { stroke: currentColor; }

/* ---------- Workspace assistant ---------- */
.workspace-assistant-page { min-width: 0; }
.workspace-assistant-page-body {
  display: grid; gap: 16px; min-width: 0; padding-top: 20px;
}
.workspace-assistant-panel {
  overflow: hidden; min-width: 0;
}
.workspace-assistant {
  display: grid; gap: 14px; min-width: 0; padding: 18px;
}
.workspace-assistant-summary {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; min-width: 0;
}
.workspace-assistant-summary h2 {
  margin: 0; color: var(--ink); font-family: var(--font-display);
  font-size: 20px; line-height: 1.1;
}
.workspace-assistant-summary p { margin: 5px 0 0; }
.workspace-assistant-card {
  overflow: hidden; min-width: 0; border: 1px solid var(--border);
  border-radius: var(--radius-lg); background: var(--panel);
}
.workspace-assistant-card-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-bottom: 1px solid var(--hairline);
}
.workspace-assistant-card-header h3 {
  margin: 0; color: var(--ink); font-size: 13px; font-weight: 700;
}
.workspace-assistant-card-header p {
  margin: 3px 0 0; font-size: 11.5px; line-height: 1.35;
}
.workspace-assistant-metric-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.workspace-assistant-metric-strip .time-metric strong {
  overflow: visible; text-overflow: clip; white-space: normal;
  overflow-wrap: anywhere; line-height: 1.2;
}
.workspace-assistant-table-wrap {
  margin: 0; border: 0; border-radius: 0;
}
.workspace-assistant-table th,
.workspace-assistant-table td {
  vertical-align: top;
}
.workspace-assistant-table code,
.workspace-assistant-mobile-card code {
  white-space: normal; overflow-wrap: anywhere;
}
.workspace-assistant-mobile-list {
  min-width: 0;
}
.workspace-assistant-mobile-card {
  color: var(--ink);
}
.workspace-assistant-mobile-title {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px; min-width: 0;
}
.workspace-assistant-mobile-title strong {
  min-width: 0; overflow-wrap: anywhere; color: var(--ink);
  font-size: 13px; font-weight: 700; line-height: 1.3;
}
.workspace-assistant-mobile-title .badge {
  flex: none; margin-top: 1px;
}
.workspace-assistant-mobile-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px; margin: 2px 0 0;
}
.workspace-assistant-mobile-grid > div { min-width: 0; }
.workspace-assistant-mobile-wide { grid-column: 1 / -1; }
.workspace-assistant-mobile-grid dt {
  color: var(--muted-2); font-size: 10px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.workspace-assistant-mobile-grid dd {
  margin: 2px 0 0; color: var(--ink); font-size: 12.5px; overflow-wrap: anywhere;
}

/* ---------- Workspace report drill-down ---------- */
.workspace-report-drill-page { min-width: 0; }
.workspace-report-drill-page-body { display: grid; gap: 16px; min-width: 0; padding-top: 20px; }
.workspace-report-drill-panel {
  overflow: hidden; min-width: 0;
}
.workspace-report-drill {
  display: grid; gap: 14px; min-width: 0; padding: 18px;
}
.workspace-report-drill-summary {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; min-width: 0;
}
.workspace-report-drill-summary h2 {
  margin: 0; color: var(--ink); font-family: var(--font-display);
  font-size: 20px; line-height: 1.1;
}
.workspace-report-drill-summary p { margin: 5px 0 0; }
.workspace-report-drill-summary-card,
.workspace-report-drill-list-card {
  overflow: hidden; min-width: 0; border: 1px solid var(--border);
  border-radius: var(--radius-lg); background: var(--panel);
}
.workspace-report-drill-summary-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px; margin: 0; padding: 14px;
}
.workspace-report-drill-summary-grid > div {
  min-width: 0; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--panel-2);
}
.workspace-report-drill-summary-grid dt,
.workspace-report-drill-mobile-grid dt {
  color: var(--muted-2); font-size: 10px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.workspace-report-drill-summary-grid dd,
.workspace-report-drill-mobile-grid dd {
  margin: 3px 0 0; color: var(--ink); font-size: 12.5px; overflow-wrap: anywhere;
}
.workspace-report-drill-card-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-bottom: 1px solid var(--hairline);
}
.workspace-report-drill-card-header h3 {
  margin: 0; color: var(--ink); font-size: 13px; font-weight: 700;
}
.workspace-report-drill-card-header p {
  margin: 3px 0 0; font-size: 11.5px; line-height: 1.35;
}
.workspace-report-drill-table-wrap {
  margin: 0; border: 0; border-radius: 0;
}
.workspace-report-drill-time th,
.workspace-report-drill-time td,
.workspace-report-drill-invoices th,
.workspace-report-drill-invoices td {
  vertical-align: top;
}
.workspace-report-drill-mobile-list { min-width: 0; }
.workspace-report-drill-mobile-card {
  color: var(--ink);
}
.workspace-report-drill-mobile-title {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px; min-width: 0;
}
.workspace-report-drill-mobile-title strong {
  min-width: 0; overflow-wrap: anywhere; font-size: 13px; line-height: 1.3;
}
.workspace-report-drill-mobile-title .badge {
  flex: none; margin-top: 1px;
}
.workspace-report-drill-mobile-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px; margin: 2px 0 0;
}
.workspace-report-drill-mobile-grid > div { min-width: 0; }
.workspace-report-drill-empty-state {
  padding: 34px 20px;
}
.workspace-report-drill-empty-state .empty-state-icon {
  background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent);
}
.workspace-report-drill-empty-state .empty-state-icon svg { stroke: currentColor; }
.time-review-heading {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-bottom: 1px solid var(--hairline);
}
.time-review-heading p { margin: 3px 0 0; font-size: 12px; }
.time-action-error {
  align-items: flex-start; flex-wrap: wrap; margin: 10px 14px 0;
}
.time-action-error strong { flex: none; font-weight: 700; }
.time-action-error span { min-width: 0; overflow-wrap: anywhere; }
.time-approval-bulk-bar {
  display: grid; grid-template-columns: minmax(180px, 320px) minmax(0, 1fr) auto auto;
  gap: 8px; align-items: center; padding: 10px 14px;
  border-bottom: 1px solid var(--hairline); background: var(--panel-2);
}
.time-approval-bulk-bar input { width: 100%; min-height: 32px; }
.time-approval-bulk-spacer { min-width: 0; }
.time-approval-member {
  display: grid; gap: 10px; padding: 14px; border-bottom: 1px solid var(--hairline);
}
.time-approval-member:last-child { border-bottom: 0; }
.time-approval-member-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.time-approval-table-wrap { border-radius: var(--radius); }
.time-approval-table { min-width: 820px; table-layout: fixed; }
.time-approval-table th:nth-child(1), .time-approval-table td:nth-child(1) { width: 72px; }
.time-approval-table th:nth-child(2), .time-approval-table td:nth-child(2) { width: 180px; }
.time-approval-table th:nth-child(4), .time-approval-table td:nth-child(4) { width: 110px; }
.time-approval-table th:nth-child(5), .time-approval-table td:nth-child(5) { width: 118px; }
.time-approval-table th:nth-child(6), .time-approval-table td:nth-child(6) { width: 280px; }
.time-approval-table strong {
  display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink); font-weight: 600;
}
.time-approval-table .row-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap;
}
.time-approval-table .row-actions form {
  margin: 0; display: inline-flex; align-items: center; gap: 6px;
}
.time-approval-reject-form input { width: 132px; min-height: 30px; }
.time-approval-mobile-list { padding-top: 0; }
.time-approval-card {
  gap: 10px; background: var(--panel-2);
}
.time-approval-card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.time-approval-card-select {
  display: flex; align-items: flex-start; gap: 9px; min-width: 0; margin: 0;
}
.time-approval-card-select input {
  flex: none; margin-top: 2px;
}
.time-approval-card-title {
  display: grid; gap: 2px; min-width: 0;
}
.time-approval-card-title strong {
  min-width: 0; overflow-wrap: anywhere; color: var(--ink); font-weight: 650;
}
.time-approval-card-title small {
  color: var(--muted); font-size: 11.5px;
}
.time-approval-card-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  margin: 0;
}
.time-approval-card-grid dt {
  color: var(--muted-2); font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.time-approval-card-grid dd {
  margin: 2px 0 0; color: var(--ink-2); font-size: 12.5px; overflow-wrap: anywhere;
}
.time-approval-card-actions {
  display: grid; gap: 7px;
}
.time-approval-card-actions form {
  margin: 0; display: flex; align-items: center; gap: 6px;
}
.time-approval-card-actions .time-approval-reject-form {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
}
.time-approval-card-actions .btn {
  justify-content: center;
}
.time-approval-empty-state {
  align-items: flex-start; margin: 0; padding: 18px 14px;
  border-top: 1px solid var(--hairline); text-align: left;
}
.time-approval-empty-state .empty-state-icon {
  width: 32px; height: 32px; border-radius: 8px;
  color: var(--accent); background: var(--accent-softer);
  border-color: var(--accent-border);
}
.time-approval-empty-state .empty-state-icon svg {
  stroke: currentColor;
}
.time-approval-empty-state .empty-state-title {
  font-size: 13px; line-height: 1.3;
}
.time-approval-empty-state .empty-state-body {
  max-width: 420px; font-size: 12px; line-height: 1.45;
}
.badge-approval-approved {
  background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-hover);
}
.badge-approval-draft {
  background: var(--panel-2); border-color: var(--border); color: var(--muted);
}
.badge-approval-rejected {
  background: var(--danger-soft); border-color: var(--danger-border); color: #fca5a5;
}

/* ---------- Reports page ---------- */
.reports-page { min-width: 0; }
.reports-page-body { padding-top: 20px; }
.reports-header { align-items: flex-end; }
.reports-header-copy { display: grid; gap: 5px; min-width: 0; }
.reports-kicker-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.reports-header-actions { flex-wrap: wrap; justify-content: flex-end; }
.reports-header-export { margin: 0; }
.reports-layout {
  display: grid; grid-template-columns: 256px minmax(0, 1fr);
  gap: 20px; align-items: start;
}
.reports-rail {
  display: flex; flex-direction: column; gap: 14px; position: sticky; top: 72px; min-width: 0;
}
.reports-rail-panel { overflow: hidden; }
.reports-rail-heading {
  min-height: 38px; padding: 9px 12px; border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  color: var(--muted-2); font-size: 10.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
}
.reports-nav { display: flex; flex-direction: column; }
.reports-nav-item {
  display: flex; align-items: flex-start; gap: 10px; min-width: 0;
  padding: 10px 12px 10px 9px; border-left: 3px solid transparent;
  border-bottom: 1px solid var(--hairline); color: var(--ink);
}
.reports-nav-item:last-child { border-bottom: 0; }
.reports-nav-item:hover { background: var(--panel-2); color: var(--ink); }
.reports-nav-item.active {
  background: var(--accent-soft); border-left-color: var(--accent); color: var(--accent);
}
.reports-nav-icon {
  width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center;
  flex: none; margin-top: 2px; color: currentColor;
}
.reports-nav-icon svg,
.reports-filter-icon svg {
  width: 100%; height: 100%; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.reports-nav-item span:last-child { min-width: 0; display: grid; gap: 1px; }
.reports-nav-item strong { font-size: 12.5px; font-weight: 600; color: currentColor; }
.reports-nav-item small {
  color: var(--muted); font-size: 10.5px; line-height: 1.35;
}
.reports-saved-view-list { display: flex; flex-direction: column; }
.reports-saved-view-row {
  display: grid; gap: 5px; padding: 9px 12px; border-bottom: 1px solid var(--hairline);
}
.reports-saved-view-row:last-child { border-bottom: 0; }
.reports-saved-view-apply { margin: 0; }
.reports-saved-view-apply button {
  width: 100%; min-height: 24px; padding: 0; justify-content: flex-start;
  border: 0; background: transparent; color: var(--ink-2); font-size: 12.5px;
  text-align: left;
}
.reports-saved-view-apply button:hover { background: transparent; color: var(--accent); }
.reports-saved-view-schedule { margin: 0; }
.reports-saved-view-schedule .btn {
  width: 100%; min-height: 22px; justify-content: flex-start; padding: 0;
  font-size: 10.5px;
}
.reports-saved-view-empty-state {
  align-items: flex-start; margin: 0; padding: 14px 12px;
  border-top: 1px solid var(--hairline); text-align: left;
}
.reports-saved-view-empty-state .empty-state-icon {
  width: 30px; height: 30px; border-radius: 8px;
  color: var(--accent); background: var(--accent-softer);
  border-color: var(--accent-border);
}
.reports-saved-view-empty-state .empty-state-icon svg {
  stroke: currentColor;
}
.reports-saved-view-empty-state .empty-state-title {
  font-size: 12.5px; line-height: 1.3;
}
.reports-saved-view-empty-state .empty-state-body {
  max-width: 220px; font-size: 11.5px; line-height: 1.45;
}
.reports-saved-view-empty-state .empty-state-action {
  min-height: 28px; margin-top: 2px; justify-content: center;
}
.reports-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.reports-filter-bar {
  display: grid; grid-template-columns: auto minmax(126px, .9fr) repeat(3, minmax(130px, 1fr)) auto auto auto;
  gap: 10px; align-items: end; padding: 10px;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel-2);
}
.reports-filter-label {
  min-height: 34px; display: inline-flex; align-items: center; gap: 7px; padding-right: 10px;
  border-right: 1px solid var(--hairline); color: var(--muted-2); font-size: 11px;
  font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.reports-filter-icon {
  width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.reports-filter-bar label {
  display: grid; gap: 4px; color: var(--ink-2); font-size: 12px; font-weight: 500;
}
.reports-filter-bar input:not([type="checkbox"]),
.reports-filter-bar select {
  width: 100%; min-height: 34px; font-size: 12.5px;
}
.reports-checkbox {
  min-height: 34px; display: inline-flex !important; grid-template-columns: none;
  grid-auto-flow: column; justify-content: start; align-items: center; gap: 7px;
  padding: 0 9px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); color: var(--muted);
}
.reports-checkbox input { width: auto; min-height: 0; margin: 0; }
.reports-filter-actions { display: inline-flex; gap: 6px; align-items: center; }
.reports-filter-actions .btn { min-height: 34px; justify-content: center; }
.reports-active-filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.reports-active-filters > .muted {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.reports-results { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.reports-section { scroll-margin-top: 74px; overflow: hidden; }
.reports-section-header { align-items: flex-start; }
.reports-section-header p { margin: 3px 0 0; font-size: 12px; }
.reports-metric-strip {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px;
}
.reports-metric {
  display: grid; gap: 3px; min-width: 0; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel-2);
}
.reports-metric span {
  color: var(--muted-2); font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.reports-metric strong {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink); font-size: 15px; font-weight: 700;
}
.reports-compare-summary { overflow: hidden; }
.reports-compare-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
}
.reports-compare-card {
  display: grid; gap: 4px; min-width: 0; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel-2);
}
.reports-compare-card > span {
  color: var(--muted-2); font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.reports-compare-card strong {
  min-width: 0; overflow-wrap: anywhere;
  color: var(--ink); font-size: 15px; font-weight: 700;
}
.reports-compare-card small {
  min-width: 0; overflow-wrap: anywhere;
  color: var(--muted); font-size: 11.5px;
}
.reports-compare-delta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  color: var(--accent); font-size: 12px; font-weight: 700;
}
.reports-compare-delta span {
  color: var(--muted); font-size: 11px; font-weight: 600;
}
.reports-table-wrap { overflow-x: auto; }
.reports-table-wrap table { min-width: 760px; }
.reports-unbilled-panel-section { display: grid; gap: 10px; margin-top: 16px; }
.reports-unbilled-panel-section:first-child { margin-top: 0; }
.reports-unbilled-aging-section { padding-top: 4px; }
.reports-subsection-heading {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.reports-subsection-heading h3 { margin: 0; color: var(--ink); font-size: 13px; }
.reports-subsection-heading p { margin: 3px 0 0; font-size: 11.5px; }
.workspace-report-unbilled { min-width: 860px !important; }
.workspace-report-unbilled td:first-child { min-width: 170px; }
.reports-unbilled-bar {
  height: 5px; margin-top: 7px; overflow: hidden; border-radius: 99px;
  background: var(--panel-3);
}
.reports-unbilled-bar > span {
  display: block; height: 100%; min-width: 3px; border-radius: inherit;
  background: var(--accent);
}
.reports-unbilled-bar-fill-0 { width: 0%; min-width: 0 !important; }
.reports-unbilled-bar-fill-5 { width: 5%; }
.reports-unbilled-bar-fill-10 { width: 10%; }
.reports-unbilled-bar-fill-15 { width: 15%; }
.reports-unbilled-bar-fill-20 { width: 20%; }
.reports-unbilled-bar-fill-25 { width: 25%; }
.reports-unbilled-bar-fill-30 { width: 30%; }
.reports-unbilled-bar-fill-35 { width: 35%; }
.reports-unbilled-bar-fill-40 { width: 40%; }
.reports-unbilled-bar-fill-45 { width: 45%; }
.reports-unbilled-bar-fill-50 { width: 50%; }
.reports-unbilled-bar-fill-55 { width: 55%; }
.reports-unbilled-bar-fill-60 { width: 60%; }
.reports-unbilled-bar-fill-65 { width: 65%; }
.reports-unbilled-bar-fill-70 { width: 70%; }
.reports-unbilled-bar-fill-75 { width: 75%; }
.reports-unbilled-bar-fill-80 { width: 80%; }
.reports-unbilled-bar-fill-85 { width: 85%; }
.reports-unbilled-bar-fill-90 { width: 90%; }
.reports-unbilled-bar-fill-95 { width: 95%; }
.reports-unbilled-bar-fill-100 { width: 100%; }
.reports-aging-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
}
.reports-aging-card {
  display: grid; gap: 4px; min-width: 0; padding: 12px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel-2);
}
.reports-aging-card > span {
  color: var(--muted-2); font-size: 10px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
}
.reports-aging-card strong { color: var(--ink); font-size: 17px; }
.reports-aging-card small { color: var(--muted); font-size: 10.5px; }
.reports-aging-accent strong { color: var(--accent); }
.reports-aging-warning strong { color: var(--warning); }
.reports-aging-danger strong { color: var(--danger); }
.reports-metric-comparison { color: var(--accent) !important; overflow-wrap: anywhere; }
.reports-mobile-list { min-width: 0; }
.reports-mobile-card {
  color: var(--ink);
}
.reports-summary-mobile-card {
  background: var(--panel-2);
}
.reports-mobile-title {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px; min-width: 0;
}
.reports-mobile-title strong {
  min-width: 0; overflow-wrap: anywhere; color: var(--ink);
  font-size: 13px; font-weight: 700; line-height: 1.3;
}
.reports-mobile-title .badge {
  flex: none; margin-top: 1px;
}
.reports-mobile-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px; margin: 2px 0 0;
}
.reports-mobile-grid > div { min-width: 0; }
.reports-mobile-wide { grid-column: 1 / -1; }
.reports-mobile-grid dt {
  color: var(--muted-2); font-size: 10px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.reports-mobile-grid dd {
  margin: 2px 0 0; color: var(--ink); font-size: 12.5px; overflow-wrap: anywhere;
}
.reports-save-view-panel { scroll-margin-top: 74px; overflow: hidden; }
.reports-save-view-panel > summary {
  min-height: 42px; padding: 10px 14px; display: flex; align-items: center;
  border-bottom: 1px solid transparent; cursor: pointer; list-style: none;
  color: var(--ink); font-size: 13px; font-weight: 600;
}
.reports-save-view-panel > summary::-webkit-details-marker { display: none; }
.reports-save-view-panel[open] > summary { border-bottom-color: var(--hairline); }
.reports-save-view-form {
  display: grid; grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px; align-items: end; padding: 14px;
}
.reports-save-view-form label {
  display: grid; gap: 4px; color: var(--ink-2); font-size: 12px; font-weight: 500;
}
.reports-save-view-form input[type="text"] { width: 100%; min-height: 34px; }

/* ---------- Invoices page ---------- */
.invoices-page { min-width: 0; }
.invoices-page-body { display: grid; gap: 16px; }
.invoices-page-body > #invoices { min-width: 0; }
.invoices-header-actions { flex-wrap: wrap; justify-content: flex-end; }
.invoices-draft-panel:empty { display: none; }
.invoices-draft-panel {
  max-width: 980px; padding: 12px; border: 1px solid var(--border);
  border-radius: var(--radius-lg); background: var(--panel);
}
.invoice-draft-empty-state {
  padding: 30px 20px;
}
.invoice-draft-empty-state .empty-state-icon {
  background: var(--panel-2); color: var(--accent);
}
.invoice-draft-empty-state .empty-state-icon svg {
  stroke: currentColor;
}
.invoice-draft-empty-actions {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  flex-wrap: wrap; margin-top: 4px;
}
.invoice-draft-form-region {
  display: grid; gap: 12px; min-width: 0;
}
.invoice-draft-create-shell {
  display: grid; gap: 14px; min-width: 0;
}
.invoice-draft-form {
  display: grid; gap: 16px; min-width: 0;
}
.invoice-draft-form-heading {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.invoice-draft-form-heading .badge,
.invoice-draft-section-header .badge {
  align-self: flex-start; white-space: nowrap;
}
.invoice-draft-form-heading h3 {
  margin: 0; color: var(--ink); font-size: 15px; font-weight: 700;
}
.invoice-draft-form-heading p {
  margin: 4px 0 0; font-size: 12px; line-height: 1.35;
}
.invoice-draft-stepper {
  display: flex; align-items: center; gap: 0; min-width: 0;
  margin: 0; padding: 0; list-style: none;
}
.invoice-draft-step {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  color: var(--muted-2); font-size: 12px; font-weight: 500;
}
.invoice-draft-step:not(:last-child)::after {
  content: ""; display: block; width: 42px; height: 1px;
  margin: 0 10px; background: var(--border);
}
.invoice-draft-step.is-active {
  color: var(--ink);
}
.invoice-draft-step.is-active:not(:last-child)::after {
  background: var(--accent-border);
}
.invoice-draft-step-number {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; flex: none;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--panel); color: var(--muted-2);
  font-size: 11px; font-weight: 700;
}
.invoice-draft-step.is-active .invoice-draft-step-number {
  border-color: var(--accent); background: var(--accent); color: #fff;
}
.invoice-draft-step-copy {
  display: grid; gap: 1px; min-width: 0;
}
.invoice-draft-step-copy strong {
  color: currentColor; font-size: 12.5px; font-weight: 650;
}
.invoice-draft-step-copy small {
  color: var(--muted); font-size: 11px; line-height: 1.25;
}
.invoice-draft-create-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 260px;
  gap: 14px; align-items: start; min-width: 0;
}
.invoice-draft-create-main {
  display: grid; gap: 14px; min-width: 0;
}
.invoice-draft-client-field {
  display: grid; gap: 5px; max-width: 380px; color: var(--ink-2);
  font-size: 12px; font-weight: 600;
}
.invoice-draft-client-field.has-error {
  color: var(--danger);
}
.invoice-draft-client-field select {
  min-height: 34px; width: 100%;
}
.invoice-draft-client-field.has-error select {
  border-color: var(--danger-border);
  box-shadow: 0 0 0 3px var(--danger-soft);
}
.invoice-draft-section {
  min-width: 0; overflow: hidden; border: 1px solid var(--border);
  border-radius: var(--radius-lg); background: var(--panel-2);
}
.invoice-draft-section.has-error {
  border-color: var(--danger-border);
  box-shadow: 0 0 0 3px var(--danger-soft);
}
.invoice-draft-period-section,
.invoice-draft-grouping-section,
.invoice-draft-preview-section {
  background: var(--panel-2);
}
.invoice-draft-control-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 10px; align-items: end; padding: 12px; background: var(--panel);
}
.invoice-draft-control-grid .field {
  display: grid; gap: 5px; color: var(--ink-2); font-size: 12px; font-weight: 600;
}
.invoice-draft-period-field.has-error {
  color: var(--danger);
}
.invoice-draft-control-grid input[type="date"] {
  min-height: 34px; width: 100%;
}
.invoice-draft-period-field.has-error input[type="date"] {
  border-color: var(--danger-border);
  box-shadow: 0 0 0 3px var(--danger-soft);
}
.invoice-draft-field-error {
  display: grid; gap: 2px; margin: 0;
}
.invoice-draft-client-field + .invoice-draft-field-error {
  max-width: 380px;
}
.invoice-draft-section > .invoice-draft-field-error {
  padding: 0 12px 12px; background: var(--panel);
}
.invoice-draft-section-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 11px 12px; border-bottom: 1px solid var(--hairline);
}
.invoice-draft-section-header h4 {
  margin: 0; color: var(--ink); font-size: 13px; font-weight: 700;
}
.invoice-draft-section-header p {
  margin: 3px 0 0; font-size: 11.5px; line-height: 1.35;
}
.invoice-draft-items {
  display: grid; min-width: 0; background: var(--panel);
}
.invoice-draft-item-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px;
  align-items: center; min-width: 0; padding: 10px 12px;
  border-top: 1px solid var(--hairline);
}
.invoice-draft-item-row:first-child { border-top: 0; }
.invoice-draft-item-select {
  display: flex; align-items: flex-start; gap: 9px; min-width: 0; margin: 0;
  color: var(--ink); font-size: 12.5px; font-weight: 500;
}
.invoice-draft-item-select input {
  width: 14px; height: 14px; margin-top: 2px; flex: none; accent-color: var(--accent);
}
.invoice-draft-item-main {
  display: grid; gap: 2px; min-width: 0;
}
.invoice-draft-item-main strong,
.invoice-draft-item-main small {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.invoice-draft-item-main strong { color: var(--ink); font-size: 12.5px; font-weight: 600; }
.invoice-draft-item-main small { color: var(--muted); font-size: 11.5px; }
.invoice-draft-grouping-options {
  display: grid; gap: 8px; padding: 12px; background: var(--panel);
}
.invoice-draft-grouping-option {
  display: flex; align-items: flex-start; gap: 10px; min-width: 0;
  padding: 10px 11px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--panel-2);
}
.invoice-draft-grouping-option:has(input:checked) {
  border-color: var(--accent-border); background: var(--accent-soft);
}
.invoice-draft-grouping-option input {
  width: 14px; height: 14px; margin-top: 2px; flex: none; accent-color: var(--accent);
}
.invoice-draft-grouping-option span {
  display: grid; gap: 2px; min-width: 0;
}
.invoice-draft-grouping-option strong {
  color: var(--ink); font-size: 12.5px; font-weight: 650;
}
.invoice-draft-grouping-option small {
  color: var(--muted); font-size: 11.5px; line-height: 1.35;
}
.invoice-draft-preview-list {
  display: grid; background: var(--panel);
}
.invoice-draft-preview-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px;
  align-items: center; min-width: 0; padding: 11px 12px;
  border-top: 1px solid var(--hairline);
}
.invoice-draft-preview-row:first-child { border-top: 0; }
.invoice-draft-preview-row strong,
.invoice-draft-preview-row small {
  display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.invoice-draft-preview-row strong { color: var(--ink); font-size: 12.5px; font-weight: 650; }
.invoice-draft-preview-row small { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.invoice-draft-preview-row > span {
  color: var(--ink); font-size: 12.5px; font-weight: 700; white-space: nowrap;
}
.invoice-draft-preview-row.is-empty {
  grid-template-columns: 1fr; color: var(--muted);
}
.invoice-draft-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
}
.invoice-draft-summary {
  position: sticky; top: 16px; display: grid; gap: 12px;
  min-width: 0; padding: 14px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--panel); box-shadow: var(--shadow-sm);
}
.invoice-draft-summary-title {
  display: grid; gap: 3px;
}
.invoice-draft-summary-title span {
  color: var(--muted); font-size: 11px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
}
.invoice-draft-summary-title strong {
  color: var(--ink); font-size: 15px;
}
.invoice-draft-summary-list {
  display: grid; gap: 8px; margin: 0; padding: 12px 0;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.invoice-draft-summary-list div {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px;
  min-width: 0;
}
.invoice-draft-summary-list dt {
  color: var(--muted); font-size: 12px;
}
.invoice-draft-summary-list dd {
  margin: 0; color: var(--ink); font-size: 12px; font-weight: 600;
  min-width: 0; overflow: hidden; text-align: right; text-overflow: ellipsis;
  white-space: nowrap;
}
.invoice-draft-preflight {
  display: grid; gap: 5px; padding: 10px 11px;
  border: 1px solid var(--accent-border); border-radius: var(--radius);
  background: var(--accent-soft);
}
.invoice-draft-preflight span {
  color: var(--accent); font-size: 11px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
}
.invoice-draft-preflight p {
  margin: 0; color: var(--ink-2); font-size: 12px; line-height: 1.45;
}
.retainer-panel {
  display: grid; gap: 14px; min-width: 0;
}
.retainer-form-card,
.retainer-list-section {
  min-width: 0; overflow: hidden; border: 1px solid var(--border);
  border-radius: var(--radius-lg); background: var(--panel);
}
.retainer-card-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-bottom: 1px solid var(--hairline);
}
.retainer-card-header h3 {
  color: var(--ink); font-size: 13px; font-weight: 700;
}
.retainer-card-header p {
  margin: 3px 0 0; font-size: 11.5px; line-height: 1.35;
}
.retainer-card-header .badge { flex: none; }
.retainer-form {
  display: grid; gap: 14px; min-width: 0; padding: 14px;
}
.retainer-field-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px; min-width: 0;
}
.retainer-field-grid .field { min-width: 0; margin: 0; }
.retainer-field-wide { grid-column: 1 / -1; }
.retainer-field-error { display: grid; gap: 2px; margin-top: 2px; }
.retainer-field-grid input:not([type="checkbox"]),
.retainer-field-grid select {
  width: 100%; min-height: 34px;
}
.retainer-toggle-field {
  justify-content: end; min-height: 59px;
}
.retainer-toggle-control {
  display: inline-flex; align-items: center; gap: 8px; min-height: 34px;
  padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel-2); color: var(--ink-2);
}
.retainer-toggle-control input {
  width: 14px; height: 14px; padding: 0; margin: 0; accent-color: var(--accent);
}
.retainer-toggle-control label {
  margin: 0; color: var(--ink-2); font-size: 12px; font-weight: 600;
}
.retainer-actions {
  display: flex; justify-content: flex-end; min-width: 0;
}
.retainer-list {
  display: grid; gap: 10px; min-width: 0; padding: 12px;
}
.retainer-card {
  display: grid; gap: 12px; min-width: 0; padding: 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel-2);
}
.retainer-title-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: start; gap: 10px; min-width: 0;
}
.retainer-title-row > div {
  display: grid; gap: 2px; min-width: 0;
}
.retainer-title-row strong,
.retainer-title-row span {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.retainer-title-row strong {
  color: var(--ink); font-size: 13px; font-weight: 700;
}
.retainer-title-row > div > span {
  color: var(--muted); font-size: 11.5px;
}
.retainer-title-row > .badge { justify-self: end; }
.retainer-metric-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px; min-width: 0;
}
.retainer-metric-grid > div {
  display: grid; gap: 3px; min-width: 0; padding: 8px 9px;
  border: 1px solid var(--hairline); border-radius: var(--radius);
  background: var(--panel);
}
.retainer-metric-grid span {
  color: var(--muted-2); font-size: 10px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.retainer-metric-grid strong {
  min-width: 0; overflow-wrap: anywhere; color: var(--ink);
  font-size: 11.5px; font-weight: 700; line-height: 1.25;
}
.retainer-action-form {
  display: flex; justify-content: flex-end; margin: 0;
}
.retainer-empty-state {
  padding: 30px 20px;
}
.retainer-empty-state .empty-state-icon {
  background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent);
}
.retainer-empty-state .empty-state-icon svg { stroke: currentColor; }
.expense-panel {
  display: grid; gap: 14px; min-width: 0;
}
.expense-form-card,
.expense-list-section {
  min-width: 0; overflow: hidden; border: 1px solid var(--border);
  border-radius: var(--radius-lg); background: var(--panel);
}
.expense-card-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-bottom: 1px solid var(--hairline);
}
.expense-card-header h3 {
  color: var(--ink); font-size: 13px; font-weight: 700;
}
.expense-card-header p {
  margin: 3px 0 0; font-size: 11.5px; line-height: 1.35;
}
.expense-card-header .badge { flex: none; }
.expense-form {
  display: grid; gap: 14px; min-width: 0; padding: 14px;
}
.expense-field-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px; min-width: 0;
}
.expense-field-grid .field { min-width: 0; margin: 0; }
.expense-field-wide { grid-column: 1 / -1; }
.expense-field-error { display: grid; gap: 2px; margin-top: 2px; }
.expense-field-grid input:not([type="checkbox"]),
.expense-field-grid select {
  width: 100%; min-height: 34px;
}
.expense-toggle-field {
  justify-content: end; min-height: 59px;
}
.expense-toggle-control {
  display: inline-flex; align-items: center; gap: 8px; min-height: 34px;
  padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel-2); color: var(--ink-2);
}
.expense-toggle-control input {
  width: 14px; height: 14px; padding: 0; margin: 0; accent-color: var(--accent);
}
.expense-toggle-control label {
  margin: 0; color: var(--ink-2); font-size: 12px; font-weight: 600;
}
.expense-actions {
  display: flex; justify-content: flex-end; min-width: 0;
}
.expense-list {
  display: grid; gap: 10px; min-width: 0; padding: 12px;
}
.expense-card {
  display: grid; gap: 12px; min-width: 0; padding: 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel-2);
}
.expense-title-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: start; gap: 10px; min-width: 0;
}
.expense-title-row > div {
  display: grid; gap: 2px; min-width: 0;
}
.expense-title-row strong,
.expense-title-row span {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.expense-title-row strong {
  color: var(--ink); font-size: 13px; font-weight: 700;
}
.expense-title-row > div > span {
  color: var(--muted); font-size: 11.5px;
}
.expense-title-row > .badge { justify-self: end; }
.expense-metric-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px; min-width: 0;
}
.expense-metric-grid > div {
  display: grid; gap: 3px; min-width: 0; padding: 8px 9px;
  border: 1px solid var(--hairline); border-radius: var(--radius);
  background: var(--panel);
}
.expense-metric-grid span {
  color: var(--muted-2); font-size: 10px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.expense-metric-grid strong {
  min-width: 0; overflow-wrap: anywhere; color: var(--ink);
  font-size: 11.5px; font-weight: 700; line-height: 1.25;
}
.expense-empty-state {
  padding: 30px 20px;
}
.expense-empty-state .empty-state-icon {
  background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent);
}
.expense-empty-state .empty-state-icon svg { stroke: currentColor; }
.invoices-list-region { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.invoices-metric-strip {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
}
.invoices-metric {
  display: grid; gap: 4px; min-width: 0; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--panel);
}
.invoices-metric span {
  color: var(--muted); font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.invoices-metric strong {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink); font-size: 16px; font-weight: 700;
}
.invoices-metric small { color: var(--muted); font-size: 11.5px; }
.invoices-filter-bar {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px; align-items: center; padding: 10px;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel-2);
}
.invoices-filter-label {
  min-height: 34px; display: inline-flex; align-items: center; gap: 7px; padding-right: 10px;
  border-right: 1px solid var(--hairline); color: var(--muted); font-size: 11px;
  font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.invoices-filter-icon {
  width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.invoices-filter-icon svg {
  width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.invoices-status-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.invoices-status-chips .chip { color: var(--muted); }
.invoices-status-chips .chip.active { color: var(--accent); }
.invoices-filter-summary { white-space: nowrap; font-size: 12px; }
.invoices-workbench { overflow: visible; }
.invoices-workbench-header { align-items: flex-start; gap: 12px; }
.invoices-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.invoices-workbench-body { min-width: 0; }
.invoices-table-wrap { overflow-x: auto; }
.invoices-table { min-width: 1060px; table-layout: fixed; }
.invoices-table th:nth-child(1), .invoices-table td:nth-child(1) { width: 122px; }
.invoices-table th:nth-child(2), .invoices-table td:nth-child(2) { width: 230px; }
.invoices-table th:nth-child(3), .invoices-table td:nth-child(3) { width: 102px; }
.invoices-table th:nth-child(4), .invoices-table td:nth-child(4) { width: 122px; }
.invoices-table th:nth-child(5), .invoices-table td:nth-child(5) { width: 112px; }
.invoices-table th:nth-child(6), .invoices-table td:nth-child(6) { width: 102px; }
.invoices-table th:nth-child(8), .invoices-table td:nth-child(8) { width: 94px; }
.invoice-row,
.invoices-mobile-card {
  scroll-margin-block: 88px;
}
.invoice-row.is-selected {
  outline: 1px solid var(--accent-border); outline-offset: -1px;
  background: var(--accent-soft);
}
.invoice-row.is-selected .invoices-number,
.invoices-mobile-card.is-selected strong {
  color: var(--accent);
}
.invoices-number { color: var(--ink); font-weight: 700; }
.invoices-client-cell { display: flex; align-items: center; gap: 9px; min-width: 0; }
.invoices-client-cell > span:last-child { display: grid; gap: 1px; min-width: 0; }
.invoices-client-cell strong,
.invoices-client-cell small {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.invoices-client-cell small { color: var(--muted); font-size: 11.5px; }
.invoices-client-marker {
  width: 8px; height: 8px; flex: none; border-radius: 2px; background: var(--accent);
}
.invoices-amount { text-align: right; font-weight: 700; color: var(--ink); }
.invoices-payment-cell { display: grid; gap: 3px; min-width: 0; color: var(--ink-2); }
.invoices-payment-cell span,
.invoices-payment-cell small,
.invoices-payment-cell code {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.invoices-payment-cell small { color: var(--muted); font-size: 11.5px; }
.invoices-payment-cell code,
.invoices-mobile-card code {
  display: block; max-width: 100%; padding: 4px 6px; border: 1px solid var(--border);
  border-radius: 4px; background: var(--panel-2); color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px;
}
.invoices-actions-cell { text-align: right; vertical-align: top; }
.invoices-row-actions { position: relative; display: inline-block; text-align: left; }
.invoice-action-trigger {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 28px; min-width: 82px; padding: 0 8px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--panel-2); color: var(--ink); cursor: pointer;
  font-size: 11.5px; font-weight: 600; list-style: none;
}
.invoice-action-trigger::-webkit-details-marker { display: none; }
.invoice-action-icon,
.invoice-action-caret {
  width: 17px; height: 17px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.invoice-action-icon svg,
.invoice-action-caret svg {
  width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.invoice-action-icon circle { fill: currentColor; stroke: none; }
.invoice-action-label { line-height: 1; }
.invoice-action-caret { transition: transform .16s ease, color .16s ease; }
.invoices-row-actions[open] .invoice-action-trigger {
  color: var(--accent); background: var(--accent-soft); border-color: var(--accent-border);
  box-shadow: 0 0 0 3px var(--accent-softer);
}
.invoices-row-actions[open] .invoice-action-caret {
  transform: rotate(180deg); color: var(--accent);
}
.invoices-row-action-menu {
  position: fixed; top: 0; left: 0; z-index: 80;
  width: 292px; max-height: calc(100vh - 24px); display: grid; gap: 0; padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--panel); box-shadow: var(--shadow-pop);
}
.invoices-row-actions[open] .invoices-row-action-menu {
  animation: invoice-action-menu-pop .14s ease-out;
}
@keyframes invoice-action-menu-pop {
  from { opacity: 0; transform: translateY(-4px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.invoice-action-section {
  display: grid; gap: 8px; padding: 9px 8px;
}
.invoice-action-section + .invoice-action-section {
  border-top: 1px solid var(--hairline);
}
.invoice-action-section-title {
  color: var(--muted-2); font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.invoice-action-section-buttons {
  display: grid; gap: 6px;
}
.invoice-action-inline-form,
.invoices-payment-form {
  margin: 0; display: grid; gap: 8px;
}
.invoices-row-action-menu .btn { width: 100%; justify-content: center; }
.invoice-line-edit-list {
  display: grid; gap: 8px; min-width: 0;
}
.invoice-line-edit-form {
  display: grid; gap: 7px; min-width: 0; margin: 0;
}
.invoice-line-edit-form + .invoice-line-edit-form {
  padding-top: 8px; border-top: 1px solid var(--hairline);
}
.invoice-line-edit-field {
  display: grid; gap: 4px; min-width: 0;
}
.invoice-line-edit-field span {
  color: var(--muted-2); font-size: 10.5px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
}
.invoice-line-edit-field input {
  width: 100%; min-height: 32px; padding: 6px 8px; font-size: 12px;
}
.invoice-line-edit-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 5px; min-width: 0;
}
.invoice-line-edit-meta span {
  min-height: 21px; display: inline-flex; align-items: center; max-width: 100%;
  padding: 0 7px; border: 1px solid var(--hairline); border-radius: 4px;
  background: var(--panel-2); color: var(--muted); font-size: 10.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.invoice-payment-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
}
.invoice-payment-field {
  display: grid; gap: 4px; min-width: 0;
}
.invoice-payment-field-wide { grid-column: 1 / -1; }
.invoice-payment-field label {
  color: var(--muted-2); font-size: 10.5px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
}
.invoice-payment-field input,
.invoice-payment-field select {
  width: 100%; min-height: 32px; padding: 6px 8px; font-size: 12px;
}
.invoice-payment-hint {
  color: var(--muted); font-size: 11px; line-height: 1.35;
}
.invoice-payment-submit { margin-top: 1px; }
.invoices-empty-state {
  padding: 38px 24px;
}
.invoices-empty-state .empty-state-icon {
  background: var(--accent-soft); border-color: var(--accent-border);
  color: var(--accent); box-shadow: 0 0 28px var(--accent-glow);
}
.invoices-empty-state .empty-state-icon svg {
  stroke: currentColor;
}
.invoices-empty-steps {
  width: min(100%, 520px); display: grid; gap: 9px; margin-top: 14px;
}
.invoices-empty-step {
  display: grid; grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px; padding: 10px 12px; text-align: left;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel-2);
}
.invoices-empty-step .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 999px;
  background: var(--accent-soft); border: 1px solid var(--accent-border);
  color: var(--accent); font-size: 11px; font-weight: 700;
}
.invoices-empty-step strong {
  display: block; color: var(--ink); font-size: 12.5px; font-weight: 600;
  grid-column: 2;
}
.invoices-empty-step small {
  display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px;
  line-height: 1.35; grid-column: 2;
}
.invoices-mobile-card { min-width: 0; color: var(--ink); }
.invoices-mobile-card .table-muted {
  min-width: 0; overflow-wrap: anywhere;
}
.invoices-mobile-card.is-selected {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-softer);
}
.invoices-mobile-title {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}

/* ---------- Rates page ---------- */
.rates-page { min-width: 0; }
.rates-page-body { padding-top: 20px; }
.rates-header-actions { flex-wrap: wrap; justify-content: flex-end; }
.rates-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 276px;
  gap: 20px; align-items: start;
}
.rates-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.rates-panel-header { align-items: flex-start; }
.rates-panel-header p { margin: 3px 0 0; font-size: 12px; }
.rates-panel-body { min-width: 0; }
.rate-matrix { display: grid; gap: 12px; }
.rates-section-intro { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.rates-section-intro p { margin: 2px 0 0; font-size: 12px; }
.rates-matrix-table-wrap { overflow-x: auto; }
.rate-matrix-table { min-width: 780px; table-layout: fixed; }
.rate-matrix-table th:nth-child(1), .rate-matrix-table td:nth-child(1) { width: 92px; }
.rate-matrix-table th:nth-child(2), .rate-matrix-table td:nth-child(2) { width: 138px; }
.rate-matrix-table th:nth-child(4), .rate-matrix-table td:nth-child(4),
.rate-matrix-table th:nth-child(5), .rate-matrix-table td:nth-child(5) { width: 154px; }
.rate-matrix-table th:nth-child(6), .rate-matrix-table td:nth-child(6) { width: 112px; }
.rates-precedence-pill {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent-soft); border: 1px solid var(--accent-border);
  color: var(--accent); font-size: 11px; font-weight: 700;
}
.rates-card-title {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.rates-matrix-empty-state,
.rate-source-empty-state,
.rate-rule-history-empty-state {
  align-items: flex-start; margin: 0; padding: 18px 14px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--panel); text-align: left;
}
.rates-matrix-empty-state .empty-state-icon,
.rate-source-empty-state .empty-state-icon,
.rate-rule-history-empty-state .empty-state-icon {
  width: 32px; height: 32px; border-radius: 8px;
  color: var(--accent); background: var(--accent-softer);
  border-color: var(--accent-border);
}
.rates-matrix-empty-state .empty-state-icon svg,
.rate-source-empty-state .empty-state-icon svg,
.rate-rule-history-empty-state .empty-state-icon svg {
  stroke: currentColor;
}
.rates-matrix-empty-state .empty-state-title,
.rate-source-empty-state .empty-state-title,
.rate-rule-history-empty-state .empty-state-title {
  font-size: 13px; line-height: 1.3;
}
.rates-matrix-empty-state .empty-state-body,
.rate-source-empty-state .empty-state-body,
.rate-rule-history-empty-state .empty-state-body {
  max-width: 460px; font-size: 12px; line-height: 1.45;
}
.rates-rail {
  display: flex; flex-direction: column; gap: 14px; position: sticky; top: 72px; min-width: 0;
}
.rates-rail-panel { overflow: hidden; }
.rates-rail-heading {
  min-height: 38px; padding: 9px 12px; border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center; color: var(--muted-2);
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.rates-precedence-list {
  list-style: none; margin: 0; padding: 0; display: grid;
}
.rates-precedence-list li {
  display: grid; gap: 2px; padding: 9px 12px; border-bottom: 1px solid var(--hairline);
}
.rates-precedence-list li:last-child { border-bottom: 0; }
.rates-precedence-list strong { color: var(--ink-2); font-size: 12.5px; }
.rates-precedence-list span,
.rates-rail-copy p { color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.rates-rail-copy { display: grid; gap: 10px; padding: 12px; }
.rates-rail-copy p { margin: 0; }
.rate-rule-form-region { display: grid; gap: 16px; min-width: 0; }
.rate-rule-feedback-list {
  display: flex; flex-wrap: wrap; gap: 8px; min-width: 0;
}
.rate-rule-feedback {
  margin: 0; padding: 8px 10px; border: 1px solid var(--accent-border);
  border-radius: var(--radius); background: var(--accent-soft);
  color: var(--accent-hover); font-size: 12px; font-weight: 600;
}
.rate-rule-form-region > p.empty-state {
  padding: 10px 12px; border: 1px solid var(--accent-border); border-radius: var(--radius);
  background: var(--accent-soft); color: var(--accent-hover);
}
.rate-rule-create-panel {
  display: grid; gap: 12px; min-width: 0; padding: 14px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--panel-2);
}
.rate-rule-create-heading {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; min-width: 0;
}
.rate-rule-create-heading h3 {
  margin: 0; color: var(--ink); font-size: 13px; font-weight: 700;
}
.rate-rule-create-heading p {
  margin: 3px 0 0; font-size: 12px; line-height: 1.35;
}
.rate-rule-create-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
  min-width: 0;
}
.rate-rule-create-card {
  display: grid; gap: 10px; align-content: start; min-width: 0; margin: 0;
  padding: 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel);
}
.rate-rule-card-header {
  display: grid; gap: 2px; min-width: 0;
}
.rate-rule-card-header h4 {
  margin: 0; color: var(--ink); font-size: 13px; font-weight: 700;
}
.rate-rule-card-header p {
  margin: 0; font-size: 11.5px; line-height: 1.4;
}
.rate-rule-field-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px; min-width: 0;
}
.rate-rule-field {
  min-width: 0;
}
.rate-rule-field label {
  display: grid; gap: 4px; min-width: 0; color: var(--ink-2);
  font-size: 12px; font-weight: 500;
}
.rate-rule-field:first-child {
  grid-column: 1 / -1;
}
.rate-rule-field-error {
  display: grid; gap: 2px; margin: 0; font-size: 11.5px;
}
.rate-rule-empty-state {
  padding: 12px; border: 1px dashed var(--border); border-radius: var(--radius);
  background: var(--panel); color: var(--muted);
}
.rate-rule-empty-state .empty-state-title {
  font-size: 13px; line-height: 1.3;
}
.rate-rule-empty-state .empty-state-body {
  max-width: 420px; font-size: 12px; line-height: 1.45;
}
.rate-rule-form-region > form,
.rate-rule-form-region > section:not(.rate-rule-create-panel) {
  padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--panel-2); min-width: 0;
}
.rate-rule-form-region > form {
  display: grid; grid-template-columns: repeat(2, minmax(160px, 1fr)) auto;
  gap: 10px; align-items: end;
}
.rate-rule-form-region > form h3,
.rate-rule-form-region > form h4 {
  grid-column: 1 / -1;
}
.rate-rule-form-region form label {
  display: grid; gap: 4px; color: var(--ink-2); font-size: 12px; font-weight: 500;
}
.rate-rule-form-region form input:not([type="checkbox"]),
.rate-rule-form-region form select {
  width: 100%; min-height: 34px; font-size: 12.5px;
}
.rate-rule-form-region form button:not([class]) { min-height: 34px; justify-content: center; }
.rate-rule-form-region section { display: grid; gap: 12px; }
.rate-rule-form-region section h3 { font-size: 13px; }
.rate-rule-form-region section > p.empty-state {
  padding: 0; font-size: 12px; color: var(--muted);
}
.rate-source-panel { display: grid; gap: 12px; }
.rate-source-panel-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; min-width: 0;
}
.rate-source-panel-header h3 {
  margin: 0; color: var(--ink); font-size: 13px; font-weight: 700;
}
.rate-source-copy {
  margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4;
}
.rate-source-summary { flex: none; max-width: 220px; white-space: normal; text-align: right; }
.rate-source-active-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  min-width: 0; padding: 8px 10px; border: 1px solid var(--accent-border);
  border-radius: var(--radius); background: var(--accent-soft);
}
.rate-source-active-filters strong {
  color: var(--accent-hover); font-size: 11.5px; font-weight: 700;
}
.rate-source-filter-chip {
  display: inline-flex; min-height: 24px; align-items: center; padding: 0 8px;
  border: 1px solid var(--accent-border); border-radius: 999px;
  color: var(--accent-hover); font-size: 11.5px; font-weight: 600;
}
.rate-rule-form-region .rate-source-filter-form {
  display: grid; gap: 10px;
}
.rate-source-filter-form h4 {
  margin: 0; color: var(--ink-2); font-size: 12px; font-weight: 700;
}
.rate-source-filter-grid {
  display: grid; grid-template-columns: repeat(3, minmax(130px, 1fr));
  gap: 10px; min-width: 0;
}
.rate-source-action-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
}
.rate-source-action-row .btn { justify-content: center; }
.rate-source-row-list { gap: 10px; }
.rate-rule-form-region .rate-source-row {
  display: grid; gap: 10px; padding: 12px;
}
.rate-source-row-heading {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; min-width: 0;
}
.rate-source-row-heading strong {
  min-width: 0; color: var(--ink); font-size: 13px; font-weight: 700;
}
.rate-source-row-heading .badge { flex: none; }
.rate-source-row-metrics {
  display: flex; flex-wrap: wrap; gap: 7px; min-width: 0;
}
.rate-source-row-metrics span {
  display: inline-flex; min-height: 24px; align-items: center; padding: 0 8px;
  border: 1px solid var(--hairline); border-radius: 999px;
  color: var(--ink-2); background: rgba(11, 18, 32, .38);
  font-size: 11.5px; font-weight: 600;
}
.rate-source-row-metrics-empty span:first-child {
  color: var(--warning); border-color: rgba(245, 158, 11, .38);
  background: rgba(245, 158, 11, .1);
}
.rate-source-candidate-list {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px; min-width: 0;
}
.rate-source-candidate {
  display: grid; gap: 3px; min-width: 0; padding: 8px;
  border: 1px solid var(--hairline); border-radius: var(--radius-sm);
  background: var(--panel-2);
}
.rate-source-candidate span {
  color: var(--muted-2); font-size: 10.5px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.rate-source-candidate strong {
  color: var(--ink-2); font-size: 12px; font-weight: 700; line-height: 1.35;
}
.rate-source-candidate small {
  color: var(--muted); font-size: 11.5px; line-height: 1.35;
}
.rate-rule-management-panel,
.rate-rule-history-panel {
  display: grid; gap: 12px;
}
.rate-rule-project-panel,
.rate-rule-client-panel,
.rate-rule-member-panel,
.rate-rule-role-panel {
  min-width: 0;
}
.rate-rule-management-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; min-width: 0;
}
.rate-rule-management-header h3 {
  margin: 0; color: var(--ink); font-size: 13px; font-weight: 700;
}
.rate-rule-management-header p {
  margin: 3px 0 0; font-size: 12px; line-height: 1.4;
}
.rate-rule-card-list,
.rate-rule-history-list {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 10px;
}
.rate-rule-card,
.rate-rule-history-card {
  display: grid; gap: 10px; min-width: 0; padding: 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel);
}
.rate-rule-inactive-card {
  background: rgba(15, 23, 42, .48);
}
.rate-rule-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; min-width: 0;
}
.rate-rule-card-header strong {
  min-width: 0; color: var(--ink); font-size: 13px; font-weight: 700;
}
.rate-rule-card-header .badge { flex: none; }
.rate-rule-card-metrics,
.rate-rule-history-change-list {
  display: flex; flex-wrap: wrap; gap: 7px; min-width: 0;
}
.rate-rule-card-metrics span,
.rate-rule-history-change-list span {
  display: inline-flex; min-height: 24px; align-items: center; padding: 0 8px;
  border: 1px solid var(--hairline); border-radius: 999px;
  color: var(--ink-2); background: rgba(11, 18, 32, .38);
  font-size: 11.5px; font-weight: 600;
}
.rate-rule-card-form {
  display: grid; grid-template-columns: repeat(2, minmax(140px, 1fr)) auto;
  gap: 8px; align-items: end; min-width: 0; margin: 0; padding-top: 8px;
  border-top: 1px solid var(--hairline);
}
.rate-rule-card-field {
  display: grid; gap: 4px; min-width: 0; color: var(--ink-2);
  font-size: 12px; font-weight: 500;
}
.rate-rule-card-field input {
  width: 100%; min-height: 34px; font-size: 12.5px;
}
.rate-rule-card-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin: 0;
}
.rate-rule-history-filter-form {
  display: grid; gap: 10px; align-items: end;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.rate-rule-history-filter-field {
  display: grid; gap: 4px; color: var(--ink-2); font-size: 12px; font-weight: 500;
}
.rate-rule-history-filter-field select,
.rate-rule-history-filter-field input {
  width: 100%; min-height: 34px; font-size: 12.5px;
}
.rate-rule-history-meta {
  color: var(--muted); font-size: 11.5px; font-weight: 600;
}
.rate-rule-form-region .rate-rules {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 10px;
}
.rate-rule-form-region .rate-rules li {
  display: grid; gap: 7px; padding: 12px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--panel);
}
.rate-rule-form-region .rate-rules li > strong {
  color: var(--ink); font-size: 13px; font-weight: 700;
}
.rate-rule-form-region .rate-rules li > span {
  color: var(--muted); font-size: 12px;
}
.rate-rule-form-region .rate-rules li form {
  display: grid; grid-template-columns: repeat(2, minmax(140px, 1fr)) auto;
  gap: 8px; align-items: end; margin-top: 4px; padding-top: 8px;
  border-top: 1px solid var(--hairline);
}
.rate-rule-form-region .rate-rules li form:has(button:only-child) {
  display: block;
}
.rate-history-summary { margin: 0; color: var(--muted); font-size: 12px; }

/* ---------- Work item detail ---------- */
.work-item-detail-page { min-width: 0; }
.work-item-detail-hero {
  padding: 20px 28px 0; background: var(--bg); border-bottom: 1px solid var(--border);
}
.work-item-breadcrumb {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  min-width: 0; overflow: hidden; color: var(--muted); font-size: 12px;
}
.work-item-breadcrumb span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-item-hero-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; min-width: 0; padding-bottom: 18px;
}
.work-item-hero-copy { min-width: 0; flex: 1; }
.work-item-hero-copy h1 {
  font-size: 26px; line-height: 1.2; letter-spacing: 0;
  overflow-wrap: anywhere;
}
.work-item-status-strip {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px;
}
.work-item-command-row {
  position: relative; display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; flex-wrap: wrap;
}
.work-item-copy-link-action {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0;
}
.work-item-copy-link-action .btn {
  gap: 6px; white-space: nowrap;
}
.work-item-copy-link-icon {
  width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.work-item-copy-link-status {
  white-space: nowrap;
}
.work-item-header-status-form,
.work-item-header-timer-form {
  display: inline-flex; margin: 0; min-width: 0;
}
.work-item-header-status-form .btn,
.work-item-header-timer-form .btn {
  gap: 6px; white-space: nowrap;
}
.work-item-header-action-icon {
  width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.work-item-header-timer-submit .work-item-header-action-icon {
  fill: currentColor; stroke: none;
}
.work-item-more-menu-shell {
  position: relative; display: inline-flex; min-width: 0;
}
.work-item-more-menu-trigger {
  width: 34px; padding: 0; flex: none;
}
.work-item-more-menu-icon {
  width: 14px; height: 14px; flex: none; fill: currentColor;
}
.work-item-more-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 40;
  display: grid; gap: 4px; width: min(220px, calc(100vw - 32px)); padding: 6px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel); box-shadow: var(--shadow);
  animation: shell-menu-pop .14s ease-out;
}
.work-item-more-menu[hidden] { display: none; }
.work-item-more-menu-item {
  display: flex; align-items: center; min-height: 32px; min-width: 0;
  padding: 0 9px; border-radius: var(--radius);
  color: var(--ink-2); font-size: 12.5px; font-weight: 600;
  text-decoration: none;
}
.work-item-more-menu-item:hover,
.work-item-more-menu-item:focus-visible {
  color: var(--ink); background: var(--panel-2); outline: none;
}
.work-item-detail-body { padding: 24px; }
.work-item-detail-grid {
  display: grid; grid-template-columns: 250px minmax(0, 1fr) 320px;
  gap: 24px; align-items: start; max-width: 1480px; margin: 0 auto;
}
.work-item-property-rail,
.work-item-side-rail {
  display: flex; flex-direction: column; gap: 16px;
  position: sticky; top: 72px; min-width: 0;
}
.work-item-main-column { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.work-item-property-list { display: flex; flex-direction: column; gap: 14px; }
.work-item-property-card {
  display: grid; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--hairline);
}
.work-item-property-card:last-child { padding-bottom: 0; border-bottom: 0; }
.work-item-property-card h3 {
  color: var(--muted-2); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
}
.work-item-property-value {
  min-width: 0; color: var(--ink-2); font-size: 12.5px; font-weight: 500;
  overflow-wrap: anywhere;
}
.work-item-reporter-card,
.work-item-team-card,
.work-item-watchers-card { gap: 9px; }
.work-item-person-row,
.work-item-team-member {
  display: grid; grid-template-columns: 24px minmax(0, 1fr);
  align-items: center; gap: 8px; min-width: 0;
}
.work-item-person-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--panel-3);
  color: var(--ink); font-size: 10px; font-weight: 700; text-transform: uppercase;
}
.work-item-team-avatar-stack {
  display: grid; gap: 7px; min-width: 0;
}
.work-item-team-member-label {
  min-width: 0; color: var(--ink-2); font-size: 12.5px; font-weight: 500;
  line-height: 1.25; overflow-wrap: anywhere;
}
.work-item-watchers-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; min-width: 0;
}
.work-item-watchers-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--panel-2); color: var(--muted); font-size: 10.5px;
  font-weight: 700;
}
.work-item-watcher-list {
  display: grid; gap: 7px; min-width: 0;
}
.work-item-watcher-row {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center; gap: 8px; min-width: 0;
}
.work-item-watcher-label {
  min-width: 0; color: var(--ink-2); font-size: 12.5px; font-weight: 500;
  line-height: 1.25; overflow-wrap: anywhere;
}
.work-item-detail-page .work-item-watcher-remove-form {
  display: inline-flex; margin: 0; padding: 0; border: 0;
}
.work-item-watcher-remove {
  height: 24px; padding: 0 7px; font-size: 11px;
}
.work-item-tracked-card { gap: 9px; }
.work-item-tracked-summary { display: grid; gap: 6px; min-width: 0; }
.work-item-tracked-percent { color: var(--muted); font-size: 11px; font-weight: 600; }
.work-item-tracked-progress {
  width: 100%; height: 5px; overflow: hidden; appearance: none;
  border: 0; border-radius: 999px; background: var(--panel-2);
}
.work-item-tracked-progress::-webkit-progress-bar {
  border-radius: inherit; background: var(--panel-2);
}
.work-item-tracked-progress::-webkit-progress-value {
  border-radius: inherit; background: var(--accent);
}
.work-item-tracked-progress::-moz-progress-bar {
  border-radius: inherit; background: var(--accent);
}
.work-item-edit-disclosure { margin-top: 4px; }
.work-item-edit-disclosure > summary {
  display: inline-flex; align-items: center; min-height: 24px; padding: 0 7px;
  border: 1px solid transparent; border-radius: var(--radius);
  color: var(--muted); cursor: pointer; font-size: 11.5px; font-weight: 500;
  list-style: none;
}
.work-item-edit-disclosure > summary:hover {
  color: var(--ink-2); background: var(--panel-2); border-color: var(--border);
}
.work-item-edit-disclosure > summary::-webkit-details-marker { display: none; }
.work-item-edit-disclosure[open] > summary {
  margin-bottom: 8px; color: var(--accent); background: var(--accent-soft);
  border-color: var(--accent-border);
}
.work-item-block-editor { margin-top: 12px; }
.work-item-description-copy {
  min-width: 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.6;
  overflow-wrap: anywhere;
  padding-bottom: 12px; border-bottom: 1px solid var(--hairline);
}
.work-item-detail-page p { margin: 0; }
.work-item-detail-page .meta {
  color: var(--muted); font-size: 11.5px; margin-top: 4px;
}
.work-item-detail-page form {
  display: grid; gap: 8px; margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--hairline);
}
.work-item-detail-page form label {
  display: grid; gap: 5px; color: var(--ink-2); font-size: 12px; font-weight: 500;
}
.work-item-detail-page form input:not([type="checkbox"]),
.work-item-detail-page form textarea,
.work-item-detail-page form select {
  width: 100%;
}
.work-item-detail-page form input[type="checkbox"] { width: auto; }
.work-item-detail-page .work-item-property-fragment {
  display: grid; gap: 8px; min-width: 0;
}
.work-item-detail-page .work-item-property-current {
  margin: 0; color: var(--ink-2); font-size: 12.5px; font-weight: 500;
  line-height: 1.35; overflow-wrap: anywhere;
}
.work-item-detail-page .work-item-property-current-muted {
  color: var(--muted);
}
.work-item-detail-page .work-item-edit-disclosure .work-item-property-current {
  display: none;
}
.work-item-detail-page .work-item-property-form {
  display: grid; gap: 9px; min-width: 0; margin-top: 8px; padding: 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel-2);
}
.work-item-detail-page .work-item-edit-disclosure[open] .work-item-property-form {
  animation: work-item-property-form-in .16s ease-out;
}
.work-item-detail-page .work-item-property-field {
  display: grid; gap: 5px; min-width: 0; margin: 0;
  color: var(--ink-2); font-size: 12px; font-weight: 600;
}
.work-item-detail-page .work-item-property-field.has-error,
.work-item-detail-page .work-item-property-toggle.has-error {
  color: var(--danger);
}
.work-item-detail-page .work-item-property-control {
  min-width: 0; min-height: 34px; font-size: 12.5px;
}
.work-item-detail-page .work-item-property-field.has-error .work-item-property-control {
  border-color: var(--danger-border);
  box-shadow: 0 0 0 3px var(--danger-soft);
}
.work-item-detail-page .work-item-property-toggle {
  display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 9px;
  align-items: start; min-width: 0; margin: 0; color: var(--ink-2);
}
.work-item-detail-page .work-item-property-toggle-input {
  width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent);
}
.work-item-detail-page .work-item-property-toggle.has-error .work-item-property-toggle-input {
  outline: 2px solid var(--danger-border); outline-offset: 2px;
}
.work-item-detail-page .work-item-property-toggle-copy {
  display: grid; gap: 2px; min-width: 0; font-size: 12px; font-weight: 600;
  line-height: 1.35;
}
.work-item-detail-page .work-item-property-help {
  color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.35;
}
.work-item-detail-page .work-item-property-actions {
  display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
}
.work-item-detail-page .work-item-property-submit {
  min-width: 96px; justify-content: center;
}
.work-item-detail-page .work-item-property-errors,
.work-item-detail-page .work-item-property-field-error {
  display: grid; gap: 2px; margin: 0;
}
@keyframes work-item-property-form-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .work-item-detail-page .work-item-edit-disclosure[open] .work-item-property-form {
    animation: none;
  }
}
.work-item-detail-page .work-item-subtasks,
.work-item-detail-page .work-item-time-log {
  display: grid; gap: 10px; min-width: 0;
}
.work-item-attachment-upload-disclosure {
  margin: 0 0 10px; padding: 9px 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel-2);
}
.work-item-attachment-upload-disclosure > summary {
  display: inline-flex; align-items: center; min-height: 24px;
  color: var(--accent); cursor: pointer; font-size: 12px; font-weight: 700;
  list-style: none;
}
.work-item-attachment-upload-disclosure > summary::-webkit-details-marker { display: none; }
.work-item-attachment-upload-disclosure[open] > summary { margin-bottom: 8px; }
.work-item-detail-page .work-item-attachment-upload-form {
  display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0;
}
.work-item-detail-page .work-item-attachment-field {
  display: grid; gap: 5px; min-width: 0; color: var(--ink-2);
  font-size: 12px; font-weight: 600;
}
.work-item-detail-page .work-item-attachment-field.has-error { color: var(--danger); }
.work-item-attachment-upload-input {
  width: 100%; min-width: 0; color: var(--muted); font-size: 12px;
}
.work-item-attachment-field-error { margin: 0; }
.work-item-attachment-actions {
  display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
}
.work-item-attachment-submit { justify-content: center; min-width: 130px; }
.work-item-timer-shell {
  display: grid; gap: 10px; min-width: 0; margin-bottom: 12px;
}
.work-item-timer-card {
  display: grid; gap: 10px; min-width: 0; padding: 10px;
  border: 1px solid var(--accent-border); border-radius: var(--radius);
  background: var(--accent-soft);
}
.work-item-timer-copy {
  display: grid; gap: 3px; min-width: 0;
}
.work-item-timer-copy strong {
  min-width: 0; color: var(--ink); font-size: 12.5px; font-weight: 700; line-height: 1.25;
  overflow-wrap: anywhere;
}
.work-item-timer-copy span {
  min-width: 0; color: var(--muted); font-size: 11.5px; line-height: 1.35;
  overflow-wrap: anywhere;
}
.work-item-detail-page .work-item-timer-form {
  display: flex; justify-content: flex-start; margin: 0; padding: 0; border: 0;
}
.work-item-timer-submit {
  justify-content: center; min-width: 110px;
}
.work-item-detail-page .work-item-subtask-summary,
.work-item-detail-page .work-item-time-log-summary {
  display: flex; align-items: baseline; gap: 4px; min-width: 0;
  color: var(--muted); font-size: 11px;
}
.work-item-detail-page .work-item-subtask-count,
.work-item-detail-page .work-item-time-log-total {
  color: var(--ink-2); font-size: 12px; font-weight: 650;
}
.work-item-detail-page .work-item-subtask-list,
.work-item-detail-page .work-item-time-entry-list {
  display: grid; gap: 0; min-width: 0;
}
.work-item-detail-page .work-item-subtask-row {
  display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 8px;
  align-items: start; min-width: 0; padding: 8px 0;
  border-top: 1px solid var(--hairline);
}
.work-item-detail-page .work-item-subtask-row:first-child {
  border-top: 0;
}
.work-item-detail-page .work-item-subtask-marker {
  width: 14px; height: 14px; margin-top: 2px; border: 1px solid var(--border-strong);
  border-radius: 4px; background: var(--panel-2); flex: none;
}
.work-item-detail-page .work-item-subtask-status-in_progress .work-item-subtask-marker {
  border-color: var(--accent-border); background: var(--accent-soft);
}
.work-item-detail-page .work-item-subtask-status-blocked .work-item-subtask-marker {
  border-color: var(--warning-border); background: var(--warning-soft);
}
.work-item-detail-page .work-item-subtask-status-done .work-item-subtask-marker {
  border-color: var(--accent); background: var(--accent);
}
.work-item-detail-page .work-item-subtask-main {
  display: grid; gap: 4px; min-width: 0; line-height: 1.25;
}
.work-item-detail-page .work-item-subtask-link {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink-2); font-size: 12.5px; font-weight: 600;
}
.work-item-detail-page .work-item-subtask-link:hover {
  color: var(--ink);
}
.work-item-detail-page .work-item-subtask-status {
  justify-self: start; display: inline-flex; align-items: center; min-height: 19px;
  padding: 0 6px; border: 1px solid var(--border); border-radius: 4px;
  background: var(--panel-2); color: var(--muted); font-size: 10.5px;
  font-weight: 600;
}
.work-item-detail-page .work-item-subtask-disclosure {
  margin-top: 0;
}
.work-item-detail-page .work-item-subtask-form {
  display: grid; gap: 9px; min-width: 0; margin-top: 8px; padding: 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel-2);
}
.work-item-detail-page .work-item-subtask-field {
  display: grid; gap: 5px; min-width: 0; color: var(--ink-2);
  font-size: 12px; font-weight: 600;
}
.work-item-detail-page .work-item-subtask-field.has-error {
  color: var(--danger);
}
.work-item-detail-page .work-item-subtask-control {
  min-width: 0; min-height: 34px; font-size: 12.5px;
}
.work-item-detail-page .work-item-subtask-field.has-error .work-item-subtask-control {
  border-color: var(--danger-border);
  box-shadow: 0 0 0 3px var(--danger-soft);
}
.work-item-detail-page textarea.work-item-subtask-control {
  min-height: 58px;
}
.work-item-detail-page .work-item-subtask-actions {
  display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
}
.work-item-detail-page .work-item-subtask-submit {
  min-width: 96px; justify-content: center;
}
.work-item-detail-page .work-item-subtask-errors,
.work-item-detail-page .work-item-subtask-field-error {
  display: grid; gap: 2px; margin: 0;
}
.work-item-detail-page .work-item-time-entry-row {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 9px;
  align-items: center; min-width: 0; padding: 10px 0;
  border-top: 1px solid var(--hairline);
}
.work-item-detail-page .work-item-time-entry-row:first-child {
  border-top: 0;
}
.work-item-detail-page .work-item-time-entry-avatar {
  width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--info-border); border-radius: 50%; background: var(--info-soft);
  color: var(--ink); font-size: 9px; font-weight: 800; line-height: 1;
}
.work-item-detail-page .work-item-time-entry-main {
  display: grid; gap: 4px; min-width: 0; line-height: 1.25;
}
.work-item-detail-page .work-item-time-entry-title {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink); font-size: 12.5px; font-weight: 650;
}
.work-item-detail-page .work-item-time-entry-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px;
  min-width: 0; color: var(--muted); font-size: 10.5px; line-height: 1.35;
}
.work-item-detail-page .work-item-time-entry-meta > span:not(:last-child)::after {
  content: "·"; margin-left: 6px; color: var(--muted-2);
}
.work-item-detail-page .work-item-time-entry-meta .badge {
  min-height: 18px; padding: 0 6px; font-size: 10px;
}
.work-item-detail-page .work-item-time-entry-duration {
  color: var(--ink-2); font-size: 12.5px; font-weight: 700; white-space: nowrap;
}
.work-item-detail-page .work-item-time-entry-rejection {
  color: var(--danger); font-size: 10.5px; overflow-wrap: anywhere;
}
.work-item-detail-page ul {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 8px;
}
.work-item-detail-page li {
  padding: 9px 0; border-bottom: 1px solid var(--hairline);
}
.work-item-detail-page li:last-child { border-bottom: 0; }
.work-item-detail-page .attachments a { color: var(--ink); font-weight: 600; }
.work-item-detail-page .work-item-attachment-summary {
  margin: 0 0 8px;
}
.work-item-detail-page .work-item-attachment-list {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}
.work-item-detail-page .work-item-attachment-card {
  display: flex; align-items: center; gap: 9px; min-width: 0; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel-2);
}
.work-item-detail-page .work-item-attachment-icon {
  width: 30px; height: 30px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 6px; background: var(--panel-3);
  color: var(--accent);
}
.work-item-detail-page .work-item-attachment-icon svg,
.work-item-detail-page .work-item-attachment-download svg,
.work-item-detail-page .work-item-attachment-delete svg {
  width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.work-item-detail-page .work-item-attachment-main {
  min-width: 0; flex: 1; display: grid; gap: 3px; line-height: 1.2;
}
.work-item-detail-page .work-item-attachment-link {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink); font-size: 12.5px; font-weight: 600;
}
.work-item-detail-page .work-item-attachment-meta {
  display: flex; flex-wrap: wrap; gap: 4px 6px; min-width: 0; font-size: 10.5px; line-height: 1.35;
}
.work-item-detail-page .work-item-attachment-meta span:not(:last-child)::after {
  content: "·"; margin-left: 6px; color: var(--muted-2);
}
.work-item-detail-page .work-item-attachment-target,
.work-item-detail-page .work-item-attachment-uploader,
.work-item-detail-page .work-item-attachment-date {
  min-width: 0; overflow-wrap: anywhere;
}
.work-item-detail-page .work-item-attachment-delete-form {
  flex: none; margin: 0; padding: 0; border: 0;
}
.work-item-detail-page .work-item-attachment-download,
.work-item-detail-page .work-item-attachment-delete {
  width: 24px; height: 24px; min-height: 24px; flex: none; padding: 0;
}
.work-item-detail-page .work-item-attachment-delete { color: var(--danger); }
.work-item-detail-page .work-item-activity-list {
  display: grid; gap: 0;
}
.work-item-detail-page .work-item-activity-row {
  display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 9px;
  position: relative; min-width: 0; padding: 0 0 12px; border-bottom: 0;
}
.work-item-detail-page .work-item-activity-row:last-child {
  padding-bottom: 0;
}
.work-item-detail-page .work-item-activity-row.has-connector::before {
  content: ""; position: absolute; left: 9px; top: 22px; bottom: 0; width: 2px;
  background: var(--hairline);
}
.work-item-detail-page .work-item-activity-marker {
  position: relative; z-index: 1; width: 20px; height: 20px;
}
.work-item-detail-page .work-item-activity-dot {
  width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--panel); border-radius: 50%; background: var(--panel-3);
  color: var(--ink-2); font-size: 9px; font-weight: 700; line-height: 1;
}
.work-item-detail-page .work-item-activity-content {
  min-width: 0; display: grid; gap: 3px; padding-top: 2px;
  color: var(--muted); font-size: 12px; line-height: 1.4;
}
.work-item-detail-page .work-item-activity-line {
  min-width: 0; overflow-wrap: anywhere;
}
.work-item-detail-page .work-item-activity-actor {
  color: var(--ink-2); font-weight: 700;
}
.work-item-detail-page .work-item-activity-action {
  color: var(--muted);
}
.work-item-detail-page .work-item-activity-meta {
  display: flex; flex-wrap: wrap; gap: 4px 6px; min-width: 0;
  color: var(--muted-2); font-size: 10.5px; line-height: 1.35;
}
.work-item-detail-page .work-item-activity-source::after {
  content: "·"; margin-left: 6px; color: var(--muted-2);
}
.work-item-detail-page .work-item-activity-timestamp {
  min-width: 0; overflow-wrap: anywhere;
}
.work-item-detail-page .comment {
  padding: 10px 0;
}
.work-item-detail-page .comment > span {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; margin-top: 6px;
  border: 1px solid var(--border); border-radius: 4px; color: var(--muted); background: var(--panel-2);
  font-size: 10.5px; font-weight: 500;
}
.work-item-detail-page .work-item-comment-list {
  display: grid; gap: 10px;
}
.work-item-detail-page .work-item-comment-card {
  display: grid; gap: 8px; padding: 12px; border: 1px solid var(--border);
  border-radius: var(--radius-lg); background: var(--panel-2);
}
.work-item-detail-page .work-item-comment-body {
  color: var(--ink-2); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere;
}
.work-item-detail-page .work-item-comment-visibility {
  justify-self: start; margin-top: 0;
}
.work-item-detail-page .work-item-comment-attachment-list {
  gap: 6px; padding-top: 2px;
}
.work-item-detail-page .work-item-comment-attachment {
  padding: 0; border-bottom: 0;
}
.work-item-detail-page .work-item-comment-form {
  margin-top: 14px; padding: 12px; border: 1px solid var(--border);
  border-radius: var(--radius-lg); background: var(--panel-2);
}
.work-item-detail-page .work-item-comment-field {
  margin: 0;
}
.work-item-detail-page .work-item-comment-body-control {
  min-height: 92px;
}
.work-item-detail-page .work-item-comment-file-field {
  display: grid; gap: 6px; color: var(--ink-2); font-size: 12px; font-weight: 500;
}
.work-item-detail-page .work-item-comment-file-input {
  width: 100%; min-width: 0; min-height: 0; padding: 8px;
}
.work-item-detail-page .work-item-comment-actions {
  display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
}
.work-item-detail-page .work-item-comment-submit {
  min-width: 120px; justify-content: center;
}
.work-item-detail-page textarea { min-height: 92px; resize: vertical; }

/* ---------- Project files ---------- */
.project-files-page { min-width: 0; }
.project-files-page-header > div:first-child,
.project-files-page-header h1 { min-width: 0; }
.project-files-page-header h1 { overflow-wrap: anywhere; }
.project-files-kicker {
  margin: 0 0 4px; color: var(--muted-2); font-size: 10.5px;
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.project-files-page-body { min-width: 0; }
.project-files-panel {
  overflow: hidden; min-width: 0;
}
.project-files {
  display: grid; gap: 14px; min-width: 0; padding: 18px;
}
.project-files-summary {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; min-width: 0;
}
.project-files-summary h2 {
  margin: 0; color: var(--ink); font-family: var(--font-display);
  font-size: 20px; line-height: 1.1;
}
.project-files-summary p { margin: 5px 0 0; }
.project-files-upload-card,
.project-files-filter-card,
.project-files-list-card {
  overflow: hidden; min-width: 0; border: 1px solid var(--border);
  border-radius: var(--radius-lg); background: var(--panel);
}
.project-files-card-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-bottom: 1px solid var(--hairline);
}
.project-files-card-header h3 {
  margin: 0; color: var(--ink); font-size: 13px; font-weight: 700;
}
.project-files-card-header p {
  margin: 3px 0 0; font-size: 11.5px; line-height: 1.35;
}
.project-files-upload-form {
  display: grid; gap: 14px; min-width: 0; padding: 14px;
}
.project-files-field-grid,
.project-files-filter-form {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px; min-width: 0;
}
.project-files-field-grid .field,
.project-files-filter-form .field { min-width: 0; margin: 0; }
.project-files-field-wide { grid-column: 1 / -1; }
.project-files-field-grid input:not([type="checkbox"]),
.project-files-field-grid select,
.project-files-filter-form input,
.project-files-filter-form select {
  width: 100%; min-height: 34px;
}
.project-files-filter-form {
  padding: 14px; grid-template-columns: minmax(180px, 1.3fr) repeat(4, minmax(140px, 1fr)) auto;
  align-items: end;
}
.project-files-filter-form .project-files-field-wide { grid-column: auto; }
.project-files-actions,
.project-files-filter-actions {
  display: flex; justify-content: flex-end; min-width: 0;
}
.project-files-filter-actions { align-self: end; }
.project-files-table-wrap {
  margin: 0; border: 0; border-radius: 0;
}
.project-files-table th,
.project-files-table td {
  vertical-align: top;
}
.project-file-folder-group th {
  padding: 9px 14px; background: var(--panel-2); border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline); color: var(--muted-2);
  font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
}
.project-files-folder-label {
  display: inline-flex; align-items: center; min-height: 22px;
}
.project-files-name-cell {
  display: flex; align-items: center; gap: 8px; min-width: 180px;
}
.project-files-file-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; flex: none; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--panel-2); color: var(--muted);
}
.project-files-file-icon svg {
  width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.project-files-cell-stack {
  display: grid; gap: 6px; min-width: 150px;
}
.project-file-inline-form {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px;
  align-items: center; min-width: 0; margin: 0;
}
.project-file-inline-form input,
.project-file-inline-form select {
  min-width: 0; min-height: 30px; width: 100%;
}
.project-file-inline-form .btn { min-height: 30px; white-space: nowrap; }
.project-files-table td:last-child a[download] {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 30px; padding: 0 10px; border: 1px solid var(--border);
  border-radius: var(--radius); background: transparent; color: var(--ink);
  font-size: 11.5px; font-weight: 650; line-height: 1; text-decoration: none;
  white-space: nowrap;
}
.project-files-table td:last-child a[download]:hover {
  border-color: var(--border-strong); background: var(--panel-2);
}
.project-files-empty-state {
  padding: 34px 20px;
}
.project-files-empty-state .empty-state-icon {
  background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent);
}
.project-files-empty-state .empty-state-icon svg { stroke: currentColor; }
.project-files-mobile-list { min-width: 0; }
.project-files-mobile-card { color: var(--ink); }
.project-files-mobile-title {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px; min-width: 0;
}
.project-files-mobile-title strong {
  min-width: 0; overflow-wrap: anywhere; font-size: 13px; line-height: 1.3;
}
.project-files-mobile-title .badge { flex: none; margin-top: 1px; }
.project-files-mobile-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px; margin: 2px 0 0;
}
.project-files-mobile-grid > div { min-width: 0; }
.project-files-mobile-grid dt {
  color: var(--muted-2); font-size: 10px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.project-files-mobile-grid dd {
  margin: 2px 0 0; color: var(--ink); font-size: 12.5px; overflow-wrap: anywhere;
}
.project-files-download-link {
  align-self: flex-start; margin-top: 2px;
}
.project-files-mobile-management {
  border: 1px solid var(--hairline); border-radius: var(--radius);
  background: var(--panel-2); overflow: hidden;
}
.project-files-mobile-management summary {
  cursor: pointer; list-style: none; min-height: 34px; padding: 0 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  color: var(--ink); font-size: 11.5px; font-weight: 700;
}
.project-files-mobile-management summary::-webkit-details-marker { display: none; }
.project-files-mobile-management summary::after {
  content: ""; width: 7px; height: 7px; border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px);
  opacity: .7; transition: transform .12s ease;
}
.project-files-mobile-management[open] summary::after {
  transform: rotate(225deg) translateY(-1px);
}
.project-files-mobile-management-body {
  display: grid; gap: 10px; padding: 0 10px 10px;
}
.project-file-mobile-form {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: end; gap: 8px; min-width: 0; margin: 0;
}
.project-file-mobile-form .field {
  min-width: 0; margin: 0;
}
.project-file-mobile-form input,
.project-file-mobile-form select {
  min-width: 0; min-height: 32px; width: 100%;
}
.project-file-mobile-form .btn {
  min-height: 32px; white-space: nowrap;
}

/* ---------- Mobile card pattern ---------- */
.mc-list { display: none; }
.mc-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; min-height: 64px;
}

/* ---------- HTMX loading/error affordances ---------- */
.htmx-request {
  opacity: .64; pointer-events: none; position: relative;
}
.htmx-request::after {
  content: ""; position: absolute; top: 10px; right: 10px; width: 16px; height: 16px;
  border-radius: 50%; border: 2px solid var(--accent-border); border-top-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow); animation: htmx-spinner .75s linear infinite;
  z-index: 2;
}
@keyframes htmx-spinner {
  to { transform: rotate(360deg); }
}
.toast-region {
  position: fixed; right: 20px; bottom: 20px; z-index: 80;
  display: grid; gap: 8px; width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}
.htmx-status {
  position: fixed; right: 20px; bottom: 76px; z-index: 80;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 34px; width: fit-content; max-width: min(360px, calc(100vw - 32px));
  padding: 8px 12px; border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg); background: var(--panel-2);
  color: var(--accent-hover); box-shadow: var(--shadow-pop);
  font-size: 12.5px; font-weight: 600; pointer-events: none;
}
.htmx-status::before {
  content: ""; width: 12px; height: 12px; flex: none;
  border-radius: 50%; border: 2px solid var(--accent-border);
  border-top-color: var(--accent); animation: htmx-spinner .75s linear infinite;
}
.htmx-status[hidden] { display: none; }
.app-toast {
  display: flex; align-items: flex-start; gap: 12px; min-width: 0;
  padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--panel); color: var(--ink); box-shadow: var(--shadow-pop);
  pointer-events: auto;
}
.app-toast-danger {
  border-color: var(--danger-border); background: var(--panel-2);
}
.app-toast-success {
  border-color: var(--accent-border); background: var(--panel-2);
}
.app-toast-body {
  flex: 1; min-width: 0; color: var(--ink-2); font-size: 12.5px; line-height: 1.4;
}
.app-toast-danger .app-toast-body { color: #fecaca; }
[data-theme="light"] .app-toast-danger .app-toast-body { color: #991b1b; }
.app-toast-success .app-toast-body { color: var(--accent-hover); }
[data-theme="light"] .app-toast-success .app-toast-body { color: #047857; }
.app-toast-close {
  min-height: 24px; height: 24px; padding: 0 8px; flex: none;
  border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--panel-2); color: var(--muted); font: inherit; font-size: 11.5px;
  cursor: pointer;
}
.app-toast-close:hover { background: var(--panel-3); color: var(--ink); }
.htmx-error-banner {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin: 0 0 14px;
  background: var(--danger-soft); border: 1px solid var(--danger-border);
  border-radius: var(--radius); color: var(--danger); font-size: 12.5px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1500px) and (min-width: 1025px) {
  .reports-filter-bar {
    grid-template-columns: auto repeat(4, minmax(0, 1fr));
  }
  .reports-filter-actions {
    grid-column: span 3;
    justify-content: flex-end;
  }
}

@media (max-width: 1024px) and (min-width: 901px) {
  .app { grid-template-columns: 200px 1fr; }
  .topbar { padding-inline: 12px; gap: 8px; }
  .topbar-search { width: min(280px, 38vw); max-width: none; }
  .topbar-timer-action {
    width: 34px; padding-inline: 0; justify-content: center;
  }
  .topbar-timer-action .topbar-action-label { display: none; }
  .topbar-user { width: 36px; padding-inline: 0; justify-content: center; }
  .topbar-user span:not(.topbar-user-avatar) { display: none; }
  .tasks-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tasks-filter-label { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--hairline); }
  .projects-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .projects-filter-label { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--hairline); }
  .projects-filter-summary { grid-column: 1 / -1; justify-self: start; }
  .projects-filter-actions { grid-column: 1 / -1; }
  .reports-layout { grid-template-columns: 1fr; }
  .reports-rail {
    position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
  .rates-layout { grid-template-columns: 1fr; }
  .rates-rail {
    position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
  .reports-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reports-filter-label { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--hairline); }
  .reports-filter-actions { grid-column: 1 / -1; }
  .invoices-metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .invoices-filter-bar { grid-template-columns: 1fr; }
  .invoices-filter-label { border-right: 0; border-bottom: 1px solid var(--hairline); padding: 0 0 8px; }
  .invoices-filter-summary { justify-self: start; }
  .project-files-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .project-files-filter-actions {
    grid-column: 1 / -1;
  }
  .retainer-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .expense-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tasks-create-form { width: min(560px, calc(100vw - 260px)); }
  .work-item-kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-item-detail-grid { grid-template-columns: 220px minmax(0, 1fr); }
  .work-item-side-rail {
    grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    position: static;
  }
}

@media (min-width: 1025px) and (max-width: 1199px) {
  .topbar { padding-inline: 12px; gap: 8px; }
  .topbar-search { width: min(280px, 38vw); max-width: none; }
  .topbar-timer-action {
    width: 34px; padding-inline: 0; justify-content: center;
  }
  .topbar-timer-action .topbar-action-label { display: none; }
  .topbar-user { width: 36px; padding-inline: 0; justify-content: center; }
  .topbar-user span:not(.topbar-user-avatar) { display: none; }
}

@media (max-width: 900px) {
  html, body { font-size: 14px; }
  .app { grid-template-columns: 1fr; }
  .app > *,
  .sidebar-aside,
  .main-col,
  .scroll-area,
  .topbar,
  .page-header,
  .page-body {
    min-width: 0; width: 100%; max-width: 100%;
  }
  .sidebar-aside {
    position: fixed; inset: 0 auto 0 0; width: min(232px, calc(100vw - 48px));
    max-width: none; z-index: 70; height: 100vh; height: 100dvh;
    transform: translateX(-100%);
    transition: transform .2s ease, box-shadow .2s ease; border-right: 1px solid var(--border);
    border-bottom: 0; box-shadow: none;
  }
  .sidebar-aside.open {
    transform: translateX(0); box-shadow: 18px 0 48px rgba(0, 0, 0, .34);
  }
  .sidebar-scrim {
    position: fixed; inset: 0; z-index: 60; display: block; width: 100%; height: 100%;
    padding: 0; border: 0; border-radius: 0; background: rgba(2, 6, 23, .62);
    opacity: 0; pointer-events: none; transition: opacity .2s ease;
  }
  .sidebar-scrim.open { opacity: 1; pointer-events: auto; }
  .sidebar-scrim[hidden] { display: none; }
  .sidebar-workspace { height: 56px; }
  .sidebar-nav {
    flex: 1; min-height: 0; flex-direction: column; gap: 1px;
    overflow: auto; padding: 4px 8px;
  }
  .sidebar-section-label { display: block; }
  .sidebar-link { flex: none; min-height: 34px; padding: 7px 10px; }
  .sidebar-link.active::before {
    left: 8px; right: 8px; top: auto; bottom: 0; width: auto; height: 2px;
    transform: none; border-radius: 2px 2px 0 0;
  }
  .sidebar-footer { display: grid; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-mobile-nav-toggle {
    display: inline-flex; width: 34px; height: 34px; flex: none; padding: 0;
  }
  .topbar-mobile-nav-toggle svg {
    width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round;
  }
  .topbar-title { display: none; }
  .topbar-search { flex: 1; width: auto; max-width: none; min-width: 0; }
  .topbar-search-kbd { display: none; }
  .topbar-action-group { gap: 6px; flex: none; }
  .topbar-secondary-action { display: none; }
  .topbar-create-action {
    width: 34px; padding-inline: 0; justify-content: center; gap: 0;
  }
  .topbar-create-action .topbar-action-label,
  .topbar-create-action .shell-menu-caret { display: none; }
  .topbar-quick-create-menu {
    width: min(236px, calc(100vw - 24px));
  }
  .topbar-timer-action {
    width: 34px; padding-inline: 0; justify-content: center;
  }
  .topbar-timer-running {
    width: 72px; max-width: 72px;
  }
  .topbar-timer-main { gap: 6px; padding: 0 7px; }
  .topbar-timer-copy { display: none; }
  .topbar-timer-elapsed { display: none; }
  .topbar-timer-stop-button { width: 28px; }
  .topbar-timer-action .topbar-action-label { display: none; }
  .topbar-user { width: 36px; padding: 0; justify-content: center; }
  .topbar-user span:not(.topbar-user-avatar) { display: none; }
  .notification-drawer {
    top: 180px; right: 12px; width: calc(100vw - 24px);
    max-height: calc(100vh - 192px);
  }
  .notification-drawer-row {
    grid-template-columns: 1fr; gap: 10px;
  }
  .notification-drawer-actions {
    max-width: none; justify-content: stretch;
  }
  .notification-drawer-actions .btn {
    width: auto;
  }
  .notification-drawer-footer {
    align-items: flex-start; flex-direction: column;
  }
  .notifications-page-summary {
    grid-template-columns: 1fr; gap: 8px;
  }
  .notifications-page-metric {
    min-height: 0;
  }
  .notifications-page-list {
    padding: 10px;
  }
  .notifications-page-row {
    grid-template-columns: 1fr; gap: 10px; padding: 12px 12px 12px 18px;
  }
  .notifications-page-title-row {
    align-items: flex-start;
  }
  .notifications-page-actions {
    display: grid; grid-template-columns: 1fr; max-width: none;
  }
  .notifications-page-actions .btn {
    width: 100%; justify-content: center;
  }
  .command-palette-dialog {
    top: 8vh; width: calc(100vw - 20px); max-height: 84vh;
  }
  .command-palette-input-row { padding: 0 10px; }
  .command-palette-footer { flex-wrap: wrap; gap: 8px 12px; }
  .command-palette-result-count { margin-left: 0; }
  .page-header { flex-direction: column; align-items: stretch; gap: 12px; }
  .dashboard-header-actions { justify-content: stretch; }
  .dashboard-header-actions .btn { flex: 1; justify-content: center; }
  .portal-shell {
    width: 100%; padding: 20px 12px 36px;
  }
  .portal-topbar {
    flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 14px;
  }
  .portal-nav {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 6px;
  }
  .portal-nav a {
    justify-content: center; min-width: 0; padding: 0 6px;
  }
  .portal-header.page-header {
    padding-bottom: 14px; margin-bottom: 12px;
  }
  .client-portal-overview {
    margin-bottom: 12px; padding: 12px;
  }
  .portal-overview-head {
    display: grid; gap: 10px; margin-bottom: 12px;
  }
  .portal-overview-contact { min-width: 0; }
  .portal-overview-grid,
  .portal-overview-feature-list {
    grid-template-columns: 1fr; gap: 8px;
  }
  .client-portal-notification-feed { margin-bottom: 12px; }
  .portal-notification-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .portal-notification-policy { display: grid; gap: 5px; }
  .portal-notification-policy span + span::before { display: none; }
  .portal-notification-row {
    grid-template-columns: 1fr; gap: 10px; padding: 11px 11px 11px 18px;
    background: var(--panel-2);
  }
  .portal-notification-row.is-unread { background: var(--accent-soft); }
  .portal-notification-actions {
    display: grid; grid-template-columns: 1fr; gap: 6px; justify-content: stretch;
  }
  .portal-notification-actions .btn { width: 100%; justify-content: center; }
  .client-portal-project-empty-state,
  .project-portal-empty-state { padding: 28px 12px; }
  .portal-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 14px 0;
  }
  .portal-metric { padding: 10px 11px; }
  .portal-metric strong { font-size: 14px; }
  .portal-section { margin-top: 12px; }
  .portal-section .portal-desktop-table,
  .client-portal-dashboard .portal-desktop-table { display: none; }
  .portal-mobile-list { display: grid; gap: 8px; }
  .portal-mobile-card {
    padding: 11px; background: var(--panel-2);
  }
  .portal-mobile-card-grid {
    grid-template-columns: 1fr; gap: 8px; margin-top: 9px;
  }
  .portal-approval-form {
    display: grid; grid-template-columns: 1fr; align-items: stretch;
  }
  .portal-approval-reason-field { min-width: 0; }
  .portal-approval-form input[type="text"],
  .portal-approval-form .btn {
    width: 100%; justify-content: center;
  }
  .portal-contact-comment-panel {
    margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border);
  }
  .portal-contact-comment-form { min-width: 0; }
  .portal-contact-comment-submit {
    width: 100%; justify-content: center;
  }
  .account-page-body { padding-left: 12px; padding-right: 12px; }
  .account-card-header {
    flex-direction: column; align-items: flex-start; gap: 8px;
  }
  .account-summary-list > div,
  .account-preference-list > div,
  .account-shortcut-list li {
    grid-template-columns: 1fr; gap: 3px;
  }
  .account-action-row,
  .account-action-row .btn {
    width: 100%;
  }
  .account-action-row { justify-content: stretch; }
  .workspace-settings-page-body,
  .workspace-audit-page-body { padding-left: 12px; padding-right: 12px; }
  .workspace-settings-layout {
    grid-template-columns: 1fr; gap: 14px;
  }
  .workspace-settings-nav {
    display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px;
    scrollbar-width: none;
  }
  .workspace-settings-nav::-webkit-scrollbar { display: none; }
  .workspace-settings-nav .sidebar-section-label,
  .workspace-settings-nav-group-label,
  .workspace-settings-nav-link-count { display: none; }
  .workspace-settings-nav-group { display: contents; }
  .workspace-settings-nav-link { flex: 0 0 auto; white-space: nowrap; }
  .workspace-settings-nav-link.active { box-shadow: inset 0 -2px 0 var(--accent); }
  .workspace-settings-card-header {
    flex-direction: column; align-items: flex-start; gap: 8px;
  }
  .workspace-settings-summary > div {
    grid-template-columns: 1fr; gap: 3px;
  }
  .workspace-settings-metrics,
  .workspace-settings-portal-metrics,
  .workspace-settings-numbering-grid { grid-template-columns: 1fr; }
  .workspace-settings-integration-grid {
    grid-template-columns: 1fr;
  }
  .workspace-settings-integration-actions {
    align-items: stretch; flex-direction: column;
  }
  .workspace-settings-integration-actions .btn {
    width: 100%;
  }
  .workspace-settings-rate-actions {
    align-items: stretch; flex-direction: column;
  }
  .workspace-settings-rate-actions .btn {
    width: 100%;
  }
  .workspace-settings-billing-grid {
    grid-template-columns: 1fr;
  }
  .workspace-settings-billing-actions {
    align-items: stretch; flex-direction: column;
  }
  .workspace-settings-numbering-form-grid {
    grid-template-columns: 1fr;
  }
  .workspace-settings-numbering-actions {
    align-items: stretch; flex-direction: column;
  }
  .workspace-portal-login-link-main {
    grid-template-columns: 1fr;
  }
  .workspace-portal-login-link-action {
    justify-content: flex-start;
  }
  .workspace-portal-contact-row,
  .workspace-portal-grant-row {
    grid-template-columns: 1fr; gap: 10px; padding: 12px;
  }
  .workspace-portal-grant-flags {
    justify-content: flex-start; max-width: none;
  }
  .workspace-portal-contact-actions,
  .workspace-portal-grant-actions {
    justify-content: flex-start; grid-column: auto;
  }
  .workspace-portal-contact-form-actions,
  .workspace-portal-grant-form-actions {
    align-items: stretch; flex-direction: column;
  }
  .workspace-audit-region { padding: 12px; }
  .workspace-audit-summary,
  .workspace-audit-filter-header {
    flex-direction: column; align-items: stretch; gap: 8px;
  }
  .workspace-audit-summary > .badge {
    align-self: flex-start;
  }
  .workspace-audit-filter-panel {
    padding: 12px;
  }
  .workspace-audit-filter-form,
  .workspace-audit-mobile-grid {
    grid-template-columns: 1fr;
  }
  .workspace-audit-filter-actions,
  .workspace-audit-filter-actions .btn,
  .workspace-audit-export-form,
  .workspace-audit-export-action {
    width: 100%;
  }
  .workspace-audit-filter-actions {
    display: grid; grid-template-columns: 1fr 1fr; justify-content: stretch;
  }
  .workspace-audit-export-form {
    justify-content: stretch;
  }
  .workspace-audit-export-action {
    justify-content: center;
  }
  .smtp-settings-page-body { padding-left: 12px; padding-right: 12px; }
  .smtp-settings-region,
  .smtp-settings-form {
    grid-template-columns: 1fr;
  }
  .smtp-settings-card-header {
    flex-direction: column; align-items: flex-start; gap: 8px;
  }
  .smtp-settings-actions,
  .smtp-settings-actions .btn {
    width: 100%;
  }
  .smtp-settings-actions { justify-content: stretch; }
  .tasks-header .page-header-right { justify-content: stretch; }
  .tasks-header .page-header-right .btn,
  .tasks-header .tasks-create-disclosure,
  .projects-header .page-header-right .btn { flex: 1; justify-content: center; }
  .tasks-header .tasks-create-disclosure > summary { min-height: 36px; justify-content: center; }
  .tasks-page-body { padding-left: 12px; padding-right: 12px; }
  .projects-page-body { padding-left: 12px; padding-right: 12px; }
  .project-settings-page-body { padding-left: 12px; padding-right: 12px; }
  .project-files-page-body { padding-left: 12px; padding-right: 12px; }
  .project-time-page-body { padding-left: 12px; padding-right: 12px; }
  .project-reports-page-body { padding-left: 12px; padding-right: 12px; }
  .team-capacity-page-body { padding-left: 12px; padding-right: 12px; }
  .team-member-page-body { padding-left: 12px; padding-right: 12px; }
  .project-client-view-page-body { padding-left: 12px; padding-right: 12px; }
  .workspace-assistant-page-body { padding-left: 12px; padding-right: 12px; }
  .workspace-report-drill-page-body { padding-left: 12px; padding-right: 12px; }
  .project-files-header-actions {
    display: grid; grid-template-columns: 1fr 1fr; width: 100%;
  }
  .project-time-header-actions {
    display: grid; grid-template-columns: 1fr 1fr; width: 100%;
  }
  .project-reports-header-actions {
    display: grid; grid-template-columns: 1fr 1fr; width: 100%;
  }
  .team-capacity-header-actions {
    display: grid; grid-template-columns: 1fr 1fr; width: 100%;
  }
  .team-member-header-actions {
    display: grid; grid-template-columns: 1fr 1fr; width: 100%;
  }
  .project-client-view-header-actions {
    display: grid; grid-template-columns: 1fr 1fr; width: 100%;
  }
  .workspace-assistant-header-actions {
    display: grid; grid-template-columns: 1fr 1fr; width: 100%;
  }
  .workspace-report-drill-header-actions {
    display: grid; grid-template-columns: 1fr 1fr; width: 100%;
  }
  .project-files-header-actions .btn {
    width: 100%; justify-content: center;
  }
  .project-time-header-actions .btn {
    width: 100%; justify-content: center;
  }
  .project-reports-header-actions .btn {
    width: 100%; justify-content: center;
  }
  .team-capacity-header-actions .btn {
    width: 100%; justify-content: center;
  }
  .team-member-header-actions .btn {
    width: 100%; justify-content: center;
  }
  .project-client-view-header-actions .btn {
    width: 100%; justify-content: center;
  }
  .workspace-assistant-header-actions .btn {
    width: 100%; justify-content: center;
  }
  .workspace-report-drill-header-actions .btn {
    width: 100%; justify-content: center;
  }
  .project-files { padding: 12px; gap: 12px; }
  .project-time { padding: 12px; gap: 12px; }
  .project-reports { padding: 12px; gap: 12px; }
  .team-capacity { padding: 12px; gap: 12px; }
  .team-member-detail { padding: 12px; gap: 12px; }
  .project-client-view { padding: 12px; gap: 12px; }
  .workspace-assistant { padding: 12px; gap: 12px; }
  .workspace-report-drill { padding: 12px; gap: 12px; }
  .project-files-summary,
  .project-files-card-header,
  .project-time-summary,
  .project-time-card-header,
  .project-reports-summary,
  .project-reports-card-header,
  .team-capacity-summary,
  .team-capacity-card-header,
  .team-member-summary,
  .team-member-card-header,
  .project-client-view-card-header,
  .workspace-assistant-summary,
  .workspace-assistant-card-header,
  .workspace-report-drill-summary,
  .workspace-report-drill-card-header {
    flex-direction: column; align-items: stretch; gap: 8px;
  }
  .project-files-summary > .badge,
  .project-files-card-header .btn,
  .project-time-summary > .badge,
  .project-time-card-header > .badge,
  .project-reports-summary > .badge,
  .project-reports-card-header > .badge,
  .team-capacity-summary > .badge,
  .team-capacity-card-header > .badge,
  .team-member-summary > .badge,
  .team-member-card-header > .badge,
  .project-client-view-card-header > .badge,
  .workspace-assistant-summary > .badge,
  .workspace-report-drill-summary > .badge,
  .workspace-report-drill-card-header > .badge {
    align-self: flex-start;
  }
  .project-reports-actions,
  .project-reports-metric-strip,
  .team-capacity-metric-strip,
  .team-member-metric-strip,
  .project-client-view-metric-strip,
  .workspace-assistant-metric-strip,
  .workspace-report-drill-summary-grid,
  .workspace-report-drill-mobile-grid {
    grid-template-columns: 1fr;
  }
  .project-report-action-form .btn {
    width: 100%;
  }
  .project-files-field-grid,
  .project-files-filter-form {
    grid-template-columns: 1fr;
  }
  .project-files-filter-form .project-files-field-wide {
    grid-column: auto;
  }
  .project-files-actions,
  .project-files-filter-actions,
  .project-files-actions .btn,
  .project-files-filter-actions .btn {
    width: 100%;
  }
  .project-files-actions,
  .project-files-filter-actions {
    justify-content: stretch;
  }
  .project-files-actions .btn,
  .project-files-filter-actions .btn,
  .project-files-download-link {
    justify-content: center;
  }
  .project-files-mobile-grid { grid-template-columns: 1fr; }
  .project-file-mobile-form {
    grid-template-columns: 1fr;
  }
  .project-file-mobile-form .btn {
    width: 100%; justify-content: center;
  }
  .project-time-mobile-grid { grid-template-columns: 1fr; }
  .team-capacity-mobile-grid { grid-template-columns: 1fr; }
  .team-member-mobile-grid { grid-template-columns: 1fr; }
  .workspace-assistant-mobile-grid { grid-template-columns: 1fr; }
  .team-member-week-card { grid-template-columns: 1fr; }
  .project-files-download-link {
    align-self: stretch; width: 100%;
  }
  .time-page-body { padding-left: 12px; padding-right: 12px; }
  .time-header-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .time-header-actions .btn { width: 100%; justify-content: center; }
  .time-metric-strip,
  .time-approvals-page .time-metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  }
  .time-metric { padding: 10px 11px; }
  .time-entry-filter-form { grid-template-columns: 1fr; }
  .time-entry-filter-actions {
    width: 100%; justify-content: stretch;
  }
  .time-entry-filter-actions .btn {
    width: 100%; justify-content: center;
  }
  .manual-time-form {
    grid-template-columns: 1fr; gap: 10px;
  }
  .manual-time-description-field {
    grid-column: auto;
  }
  .manual-time-toggle,
  .manual-time-actions .btn {
    width: 100%;
  }
  .time-week-toolbar {
    display: grid; gap: 10px; align-items: stretch;
  }
  .time-week-nav,
  .time-week-person-form,
  .time-week-submit-form {
    flex-wrap: wrap;
  }
  .time-week-person-form select,
  .time-week-person-form .btn,
  .time-week-submit-form .btn {
    flex: 1; min-width: 0;
  }
  .time-week-submit-form {
    justify-content: flex-start;
  }
  .time-week-grid {
    min-width: 760px;
  }
  .time-entry-bulk-bar {
    display: grid; grid-template-columns: 1fr; gap: 8px;
    margin-left: 12px; margin-right: 12px;
  }
  .time-entry-bulk-bar[hidden] { display: none; }
  .time-entry-bulk-spacer { display: none; }
  .time-entry-bulk-bar .btn {
    width: 100%; justify-content: center;
  }
  .time-entries { padding: 12px; gap: 14px; }
  .time-entry-mobile-grid { grid-template-columns: 1fr; }
  .time-entry-mobile-actions .btn,
  .time-entry-mobile-actions form,
  .time-entry-mobile-actions form .btn {
    width: 100%; justify-content: center;
  }
  .time-review-heading { flex-direction: column; }
  .time-approval-bulk-bar { grid-template-columns: 1fr; }
  .time-approval-bulk-spacer { display: none; }
  .time-approval-member { padding: 12px; }
  .time-approval-table .row-actions {
    justify-content: flex-start;
  }
  .time-approval-table .row-actions form,
  .time-approval-table .row-actions .btn,
  .time-approval-reject-form input {
    width: 100%; justify-content: center;
  }
  .time-approval-card-grid { grid-template-columns: 1fr; }
  .time-approval-card-actions form,
  .time-approval-card-actions .btn,
  .time-approval-card-actions .time-approval-reject-form input {
    width: 100%;
  }
  .time-approval-card-actions .time-approval-reject-form {
    grid-template-columns: 1fr;
  }
  .project-settings-header-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .project-settings-header-actions .btn { width: 100%; justify-content: center; }
  .project-settings-card-header {
    flex-direction: column; align-items: stretch; gap: 10px;
  }
  .project-settings-card-header .btn { width: 100%; justify-content: center; }
  .project-settings-form,
  .project-settings-portal-form {
    padding-left: 12px; padding-right: 12px;
  }
  .project-settings-field,
  .project-settings-field-compact,
  .project-settings-summary-list > div,
  .project-settings-preservation {
    grid-template-columns: 1fr; gap: 7px;
  }
  .project-settings-field-label { padding-top: 0; }
  .project-settings-field-control-short { max-width: none; }
  .project-settings-actions,
  .project-settings-actions .btn { width: 100%; }
  .project-settings-actions { justify-content: stretch; }
  .project-settings-portal-list,
  .project-settings-rate-list {
    padding-left: 12px; padding-right: 12px;
  }
  .project-settings-portal-contact-summary {
    flex-direction: column; align-items: stretch; padding-left: 12px; padding-right: 12px;
  }
  .project-settings-portal-contact-summary .btn {
    width: 100%; justify-content: center;
  }
  .project-settings-portal-summary,
  .project-settings-rate-row {
    flex-direction: column; align-items: stretch;
  }
  .project-settings-portal-badges,
  .project-settings-rate-values {
    justify-content: flex-start;
  }
  .project-settings-toggle-grid { grid-template-columns: 1fr; }
  .reports-page-body { padding-left: 12px; padding-right: 12px; }
  .invoices-page-body { padding-left: 12px; padding-right: 12px; }
  .rates-page-body { padding-left: 12px; padding-right: 12px; }
  .tasks-workbench-header { flex-direction: column; align-items: stretch; }
  .tasks-view-toggle { width: 100%; }
  .tasks-view-toggle a { flex: 1 1 0; min-width: 0; }
  .tasks-create-disclosure > summary { min-height: 36px; justify-content: center; }
  .tasks-create-form { position: static; width: 100%; margin-top: 10px; box-shadow: none; }
  .tasks-create-form .work-item-create-form { grid-template-columns: 1fr; }
  .tasks-filter-bar { grid-template-columns: 1fr; }
  .tasks-filter-label { border-right: 0; border-bottom: 1px solid var(--hairline); padding: 0 0 8px; }
  .work-item-kanban { grid-template-columns: 1fr; }
  .work-item-kanban-dropzone { min-height: 120px; }
  .projects-filter-bar { grid-template-columns: 1fr; }
  .projects-filter-label { border-right: 0; border-bottom: 1px solid var(--hairline); padding: 0 0 8px; }
  .projects-filter-summary { justify-self: start; }
  .projects-filter-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .projects-filter-actions .btn { width: 100%; }
  .reports-header-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .reports-header-export { width: 100%; }
  .reports-header-actions .btn,
  .reports-header-actions button { width: 100%; justify-content: center; }
  .reports-layout { grid-template-columns: 1fr; gap: 14px; }
  .reports-rail { position: static; display: flex; gap: 12px; }
  .reports-nav-item { min-height: 56px; }
  .reports-filter-bar { grid-template-columns: 1fr; }
  .reports-filter-label { border-right: 0; border-bottom: 1px solid var(--hairline); padding: 0 0 8px; }
  .reports-filter-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reports-filter-actions .btn { width: 100%; }
  .reports-metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reports-compare-grid { grid-template-columns: 1fr; }
  .reports-aging-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reports-save-view-form { grid-template-columns: 1fr; }
  .reports-save-view-form .btn { width: 100%; justify-content: center; }
  .invoices-header-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .invoices-header-actions .btn,
  .invoices-header-actions button { width: 100%; justify-content: center; }
  .invoices-draft-panel { max-width: none; }
  .invoice-draft-stepper {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  }
  .invoice-draft-step {
    align-items: flex-start; gap: 6px;
  }
  .invoice-draft-step:not(:last-child)::after {
    display: none;
  }
  .invoice-draft-step-copy small {
    display: none;
  }
  .invoice-draft-create-layout {
    grid-template-columns: 1fr;
  }
  .invoice-draft-control-grid {
    grid-template-columns: 1fr;
  }
  .invoice-draft-control-grid .btn {
    width: 100%; justify-content: center;
  }
  .invoice-draft-summary {
    position: static; order: -1;
  }
  .invoice-draft-form-heading,
  .invoice-draft-section-header {
    flex-direction: column; align-items: stretch; gap: 8px;
  }
  .invoice-draft-client-field { max-width: none; }
  .invoice-draft-item-row {
    grid-template-columns: 1fr; align-items: stretch;
  }
  .invoice-draft-item-row .btn,
  .invoice-draft-actions,
  .invoice-draft-actions .btn {
    width: 100%; justify-content: center;
  }
  .retainer-card-header {
    flex-direction: column; align-items: stretch; gap: 8px;
  }
  .retainer-field-grid { grid-template-columns: 1fr; }
  .retainer-toggle-field { min-height: 0; justify-content: start; }
  .retainer-toggle-control,
  .retainer-actions,
  .retainer-actions .btn,
  .retainer-action-form,
  .retainer-action-form .btn {
    width: 100%; justify-content: center;
  }
  .retainer-title-row {
    grid-template-columns: 1fr; gap: 8px;
  }
  .retainer-title-row > .badge {
    justify-self: start;
  }
  .retainer-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .expense-card-header {
    flex-direction: column; align-items: stretch; gap: 8px;
  }
  .expense-field-grid,
  .expense-metric-grid {
    grid-template-columns: 1fr;
  }
  .expense-toggle-field { min-height: 0; justify-content: start; }
  .expense-toggle-control,
  .expense-actions,
  .expense-actions .btn {
    width: 100%; justify-content: center;
  }
  .expense-title-row {
    grid-template-columns: 1fr; gap: 8px;
  }
  .expense-title-row > .badge {
    justify-self: start;
  }
  .invoices-metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .invoices-metric { padding: 10px 11px; }
  .invoices-filter-bar { grid-template-columns: 1fr; }
  .invoices-filter-label { border-right: 0; border-bottom: 1px solid var(--hairline); padding: 0 0 8px; }
  .invoices-status-chips { gap: 6px; }
  .invoices-filter-summary { justify-self: start; }
  .invoices-row-actions { display: block; width: 100%; }
  .invoice-action-trigger { min-height: 36px; justify-content: center; width: 100%; }
  .invoices-row-action-menu {
    position: static; width: 100%; max-height: none; margin: 8px 0 0;
    overflow: visible; box-shadow: none;
  }
  .invoice-payment-grid { grid-template-columns: 1fr; }
  .rates-header-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .rates-header-actions .btn,
  .rates-header-actions button { width: 100%; justify-content: center; }
  .rates-header-actions button { grid-column: 1 / -1; }
  .rates-layout { grid-template-columns: 1fr; gap: 14px; }
  .rates-rail { position: static; gap: 12px; }
  .rates-section-intro { flex-direction: column; gap: 4px; }
  .rate-rule-create-heading {
    flex-direction: column; align-items: stretch; gap: 8px;
  }
  .rate-rule-create-heading > .badge {
    align-self: flex-start;
  }
  .rate-rule-create-grid,
  .rate-rule-field-grid {
    grid-template-columns: 1fr;
  }
  .rate-rule-create-card .btn {
    width: 100%; justify-content: center;
  }
  .rate-source-panel-header {
    flex-direction: column; align-items: stretch; gap: 8px;
  }
  .rate-source-summary {
    align-self: flex-start; max-width: 100%; text-align: left;
  }
  .rate-source-filter-grid,
  .rate-source-candidate-list,
  .rate-rule-form-region > form,
  .rate-rule-form-region .rate-rules li form {
    grid-template-columns: 1fr;
  }
  .rate-source-action-row .btn { width: 100%; }
  .rate-source-row-heading {
    flex-direction: column; align-items: stretch; gap: 6px;
  }
  .rate-source-row-heading .badge { align-self: flex-start; }
  .rate-rule-management-header,
  .rate-rule-card-header {
    flex-direction: column; align-items: stretch; gap: 8px;
  }
  .rate-rule-management-header .badge,
  .rate-rule-card-header .badge {
    align-self: flex-start;
  }
  .rate-rule-card-form,
  .rate-rule-history-filter-form {
    grid-template-columns: 1fr;
  }
  .rate-rule-card-actions,
  .rate-rule-card-actions .btn,
  .rate-rule-card-form .btn,
  .rate-rule-history-filter-form .btn {
    width: 100%; justify-content: center;
  }
  .rate-rule-form-region form button:not([class]) { width: 100%; }
  .projects-mobile-card { color: var(--ink); }
  .projects-mobile-title {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
  }
  .projects-mobile-actions {
    align-items: stretch;
  }
  .projects-mobile-actions .project-task-create-action {
    display: block; width: 100%;
  }
  .projects-mobile-actions .project-task-create-action > summary,
  .projects-mobile-actions .project-task-create-form .btn {
    width: 100%; justify-content: center;
  }
  .projects-mobile-actions .project-task-create-form {
    position: static; width: 100%; margin-top: 8px; box-shadow: none;
  }
  .projects-mobile-actions .project-row-more-menu-shell {
    position: relative; width: 100%;
  }
  .projects-mobile-actions .project-row-more-menu-trigger {
    width: 100%;
  }
  .projects-mobile-actions .project-row-more-menu {
    left: 0; right: 0; top: calc(100% + 8px); width: 100%;
  }
  .project-template-catalog-panel .table-wrap { border-radius: var(--radius); }
  .project-template-mobile-grid { grid-template-columns: 1fr; }
  .project-template-mobile-launch-form button:not([class]) { width: 100%; }
  .work-item-detail-hero { padding: 16px 12px 0; }
  .work-item-breadcrumb { align-items: flex-start; flex-direction: column; gap: 6px; }
  .work-item-hero-row { align-items: stretch; flex-direction: column; gap: 14px; }
  .work-item-hero-copy h1 { font-size: 23px; }
  .work-item-command-row { justify-content: stretch; width: 100%; }
  .work-item-copy-link-action {
    flex: 1 1 120px; align-items: stretch; display: grid; gap: 6px;
  }
  .work-item-header-status-form,
  .work-item-header-timer-form {
    flex: 1 1 120px;
  }
  .work-item-more-menu-shell {
    position: static; flex: 1 1 120px;
  }
  .work-item-more-menu {
    left: 0; right: 0; top: calc(100% + 8px); width: 100%;
  }
  .work-item-command-row .btn { flex: 1 1 120px; justify-content: center; }
  .work-item-copy-link-status { justify-self: center; }
  .work-item-detail-body { padding: 14px 12px 36px; }
  .work-item-detail-grid { grid-template-columns: 1fr; gap: 14px; }
  .work-item-property-rail,
  .work-item-side-rail { position: static; gap: 14px; }
  .mc-list { display: flex; flex-direction: column; gap: 8px; }
  .table-wrap.responsive-hide-mobile { display: none; }
  .btn, .btn-sm, button:not([class]) { min-height: 40px; }
  input, textarea, select { min-height: 40px; }
  .toast-region {
    right: 12px; bottom: 12px; width: calc(100vw - 24px);
  }
  .htmx-status {
    right: 12px; bottom: 68px; max-width: calc(100vw - 24px);
  }
  #current-timer form,
  .current-timer form { grid-template-columns: 1fr; }
  .current-timer-running { grid-template-columns: 1fr; align-items: start; }
  .current-timer-stop-form { justify-content: stretch; }
  .setup-form > button:not([class]),
  #current-timer form button:not([class]),
  .current-timer form button:not([class]),
  .current-timer-submit,
  .current-timer-stop-button {
    justify-self: stretch; width: 100%;
  }
  .drawer { width: 100% !important; }
}

@media (min-width: 761px) and (max-width: 1599px) {
  .team-capacity-header-actions {
    display: flex; width: auto;
  }
  .team-capacity-header-actions .btn {
    width: auto;
  }
  .team-capacity-summary,
  .team-capacity-card-header {
    flex-direction: row; align-items: flex-start; gap: 12px;
  }
  .team-capacity-metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .team-capacity-table-wrap,
  .team-capacity-schedule-wrap {
    display: none;
  }
  .team-capacity-mobile-list,
  .team-capacity-schedule-mobile-list {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start; gap: 12px;
  }
  .team-capacity-mobile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 761px) and (max-width: 1399px) {
  .project-time-summary,
  .project-time-card-header {
    flex-direction: row; align-items: flex-start; gap: 12px;
  }
  .project-time-metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .project-time-table-wrap { display: none; }
  .project-time-mobile-list {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
  }
  .project-time-mobile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 761px) and (max-width: 1199px) {
  .team-member-header-actions {
    display: flex; width: auto;
  }
  .team-member-header-actions .btn {
    width: auto;
  }
  .team-member-summary,
  .team-member-card-header {
    flex-direction: row; align-items: flex-start; gap: 12px;
  }
  .team-member-metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .team-member-projects-wrap,
  .team-member-time-off-wrap,
  .team-member-time-off-requests-wrap {
    display: none;
  }
  .team-member-mobile-list,
  .team-member-week-list {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start; gap: 12px;
  }
  .team-member-mobile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .team-member-week-card {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .project-reports-summary,
  .project-reports-card-header {
    flex-direction: row; align-items: flex-start; gap: 12px;
  }
  .project-reports-actions {
    grid-template-columns: minmax(220px, 1.3fr) repeat(2, minmax(150px, 1fr));
  }
  .project-reports-metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .project-reports-table-wrap { display: none; }
  .project-reports-mobile-list {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
  }
  .work-item-detail-hero { padding: 18px 20px 0; }
  .work-item-breadcrumb {
    align-items: center; flex-direction: row; gap: 8px;
  }
  .work-item-hero-copy h1 { font-size: 24px; }
  .work-item-command-row {
    justify-content: flex-start; width: auto;
  }
  .work-item-copy-link-action {
    display: inline-flex; flex: none; align-items: center; gap: 8px;
  }
  .work-item-header-status-form,
  .work-item-header-timer-form {
    flex: none;
  }
  .work-item-more-menu-shell {
    position: relative; flex: none;
  }
  .work-item-more-menu {
    left: auto; right: 0; width: min(220px, calc(100vw - 32px));
  }
  .work-item-command-row .btn {
    flex: none; justify-content: center;
  }
  .work-item-copy-link-status { justify-self: auto; }
}

@media (min-width: 901px) and (max-width: 1199px) {
  .work-item-hero-row {
    align-items: stretch; flex-direction: column; gap: 14px;
  }
  .work-item-command-row { width: 100%; }
}

@media (min-width: 1025px) and (max-width: 1199px) {
  .work-item-detail-grid {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .work-item-side-rail {
    grid-column: 1 / -1; display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    position: static;
  }
}

@media (min-width: 761px) and (max-width: 900px) {
  .work-item-detail-body { padding: 20px; }
  .work-item-detail-grid {
    grid-template-columns: 220px minmax(0, 1fr); gap: 16px;
  }
  .work-item-property-rail {
    position: sticky; top: 72px; gap: 14px;
  }
  .work-item-side-rail {
    grid-column: 1 / -1; display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    position: static; gap: 14px;
  }
  .portal-shell {
    width: calc(100% - 32px); padding: 24px 0 40px;
  }
  .portal-topbar {
    flex-direction: row; align-items: center; gap: 16px; margin-bottom: 18px;
  }
  .portal-nav {
    display: inline-flex; grid-template-columns: none; gap: 6px;
  }
  .portal-overview-head {
    display: flex; gap: 18px; margin-bottom: 14px;
  }
  .portal-overview-contact {
    min-width: 190px; flex: 0 0 190px;
  }
  .portal-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
  }
  .portal-overview-feature-list {
    grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  }
  .portal-notification-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .portal-notification-policy {
    display: flex; gap: 6px 10px;
  }
  .portal-notification-policy span + span::before { display: block; }
  .portal-notification-row {
    grid-template-columns: minmax(0, 1fr) auto; gap: 14px;
    padding: 12px 12px 12px 18px; background: var(--panel);
  }
  .portal-notification-actions {
    display: flex; grid-template-columns: none; gap: 6px; justify-content: flex-end;
  }
  .portal-notification-actions .btn {
    width: auto;
  }
  .portal-mobile-list-projects {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .portal-project-card .portal-mobile-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .portal-section .portal-mobile-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .portal-section .portal-mobile-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .portal-approval-form {
    display: flex; grid-template-columns: none; align-items: end;
  }
  .portal-approval-reason-field { min-width: 180px; }
  .portal-approval-form input[type="text"] { width: 100%; }
  .portal-approval-form .btn {
    width: auto; min-height: 36px;
  }
  .project-files-header-actions {
    display: flex; width: auto;
  }
  .project-files-header-actions .btn {
    width: auto;
  }
  .project-files-summary,
  .project-files-card-header {
    flex-direction: row; align-items: flex-start;
  }
  .project-files-field-grid,
  .project-files-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .project-files-filter-form .project-files-field-wide {
    grid-column: 1 / -1;
  }
  .project-files-actions,
  .project-files-filter-actions {
    width: auto; justify-content: flex-end;
  }
  .project-files-filter-actions { grid-column: 1 / -1; }
  .project-files-actions .btn,
  .project-files-filter-actions .btn {
    width: auto; min-height: 36px;
  }
  .project-files-mobile-list {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
  .project-files-mobile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .project-file-mobile-form {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .project-file-mobile-form .btn {
    width: auto; min-height: 36px;
  }
  .project-files-download-link {
    align-self: flex-start; width: auto; min-height: 36px;
  }
  .portal-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px; margin: 20px 0;
  }
  .smtp-settings-region {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
  }
  .smtp-settings-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .smtp-settings-card-header {
    flex-direction: row; align-items: flex-start;
  }
  .smtp-settings-actions,
  .smtp-settings-actions .btn {
    width: auto;
  }
  .smtp-settings-actions { justify-content: flex-end; }
  .invoice-draft-control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  }
  .invoice-draft-grouping-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .invoice-draft-summary-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .invoice-draft-form-heading,
  .invoice-draft-section-header {
    flex-direction: row; align-items: flex-start;
  }
  .invoice-draft-item-row {
    grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  }
  .invoice-draft-item-row .btn,
  .invoice-draft-actions .btn {
    width: auto;
  }
  .invoice-draft-actions {
    width: auto; justify-content: flex-end;
  }
  .invoice-detail-document-head,
  .invoice-detail-parties,
  .invoice-detail-mobile-entry-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .invoice-detail-sidebar,
  .invoice-detail-mobile-entry-list { display: grid; }
  .invoice-detail-more-menu {
    position: absolute; top: calc(100% + 8px); right: 0; bottom: auto; left: auto;
    width: 240px;
  }
  .workspace-settings-card-header {
    flex-direction: row; align-items: flex-start;
  }
  .workspace-settings-summary > div {
    grid-template-columns: 150px minmax(0, 1fr); gap: 16px;
  }
  .workspace-settings-metrics,
  .workspace-settings-numbering-grid,
  .workspace-settings-integration-grid,
  .workspace-settings-billing-grid,
  .workspace-settings-numbering-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .workspace-settings-portal-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .workspace-settings-integration-actions,
  .workspace-settings-rate-actions,
  .workspace-settings-billing-actions,
  .workspace-settings-numbering-actions {
    align-items: center; flex-direction: row;
  }
  .workspace-settings-integration-actions .btn,
  .workspace-settings-rate-actions .btn {
    width: auto;
  }
  .rate-rule-create-grid,
  .rate-rule-field-grid,
  .rate-source-candidate-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rate-source-filter-grid,
  .rate-rule-card-form,
  .rate-rule-history-filter-form,
  .rate-rule-form-region .rate-rules li form {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .rate-rule-create-card .btn,
  .rate-source-action-row .btn,
  .rate-rule-card-actions,
  .rate-rule-card-actions .btn,
  .rate-rule-card-form .btn,
  .rate-rule-history-filter-form .btn,
  .rate-rule-form-region form button:not([class]) {
    width: auto;
  }
  .invoices-header {
    flex-direction: row; align-items: center; gap: 16px;
  }
  .invoices-header .page-header-right {
    width: auto; flex: none;
  }
  .invoices-header-actions {
    display: flex; width: auto;
  }
  .invoices-header-actions .btn,
  .invoices-header-actions button {
    width: auto;
  }
  .invoices-mobile-list {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
  .tasks-header {
    flex-direction: row; align-items: center; gap: 16px;
  }
  .tasks-header .page-header-right {
    width: auto; flex: none;
  }
  .tasks-header .tasks-create-disclosure {
    flex: none;
  }
  .tasks-create-form {
    position: absolute; top: calc(100% + 8px); right: 0;
    width: min(720px, calc(100vw - 48px)); margin-top: 0;
    box-shadow: 0 18px 48px rgba(0,0,0,.28);
    animation: shell-menu-pop .14s ease-out;
  }
  .tasks-filter-bar,
  .tasks-create-form .work-item-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tasks-create-form .work-item-create-title-field {
    grid-column: 1 / -1;
  }
  .tasks-filter-label,
  .tasks-filter-bar .btn {
    grid-column: 1 / -1;
  }
  .tasks-filter-bar .btn {
    width: auto; min-width: 140px; justify-self: end;
  }
  .work-item-mobile-list {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
  .work-item-kanban {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .time-entry-filter-form,
  .manual-time-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .time-entry-filter-actions,
  .manual-time-description-field {
    grid-column: 1 / -1;
  }
  .time-entry-filter-actions {
    width: auto; justify-content: flex-end;
  }
  .time-entry-filter-actions .btn,
  .manual-time-toggle,
  .manual-time-actions .btn,
  .time-entry-mobile-actions .btn,
  .time-entry-mobile-actions form,
  .time-entry-mobile-actions form .btn {
    width: auto;
  }
  .manual-time-actions .btn {
    min-width: 140px;
  }
  .time-entry-mobile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .time-entry-bulk-bar {
    display: flex; margin-left: 14px; margin-right: 14px;
  }
  .time-entry-bulk-bar[hidden] { display: none; }
  .time-entry-bulk-spacer { display: block; }
  .time-entry-bulk-bar .btn { width: auto; }
}

@media (min-width: 901px) and (max-width: 1199px) {
  .smtp-settings-region { grid-template-columns: 1fr; }
  .invoice-draft-create-layout { grid-template-columns: 1fr; }
  .invoice-draft-stepper {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  }
  .invoice-draft-step { align-items: flex-start; gap: 6px; }
  .invoice-draft-step:not(:last-child)::after,
  .invoice-draft-step-copy small { display: none; }
  .invoice-draft-grouping-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .invoice-draft-summary {
    position: static; order: -1;
  }
  .invoice-draft-summary-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .tasks-create-form { animation: none; }
}

/* ---------- Dashboard page ---------- */
.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}
.dashboard-header { align-items: center; }
.dashboard-header-actions { flex-wrap: wrap; justify-content: flex-end; }
.dashboard-main {
  display: flex; flex-direction: column; gap: 20px; min-width: 0;
}
.dashboard-metrics {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
}
.metric-card {
  padding: 14px; min-height: 126px; display: flex; flex-direction: column; gap: 10px;
}
.metric-card-link {
  color: inherit; text-decoration: none;
  transition: border-color .14s ease, background-color .14s ease;
}
.metric-card-link:hover {
  border-color: var(--accent-border); background: var(--panel-2);
}
.metric-card-link:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.metric-label {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  color: var(--muted); font-size: 12px; font-weight: 600;
}
.metric-value {
  color: var(--ink); font-size: 24px; font-weight: 700; letter-spacing: 0;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.metric-hint { color: var(--muted); font-size: 12px; margin-top: auto; }
.metric-progress,
.dashboard-week-progress {
  display: block; width: 100%; height: 5px; appearance: none;
  border: 0; border-radius: 999px; overflow: hidden; background: var(--panel-3);
}
.metric-progress::-webkit-progress-bar,
.dashboard-week-progress::-webkit-progress-bar {
  border-radius: 999px; background: var(--panel-3);
}
.metric-progress::-webkit-progress-value,
.dashboard-week-progress::-webkit-progress-value {
  border-radius: 999px; background: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow);
}
.metric-progress::-moz-progress-bar,
.dashboard-week-progress::-moz-progress-bar {
  border-radius: 999px; background: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow);
}
.dashboard-quick-start {
  padding: 16px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px;
}
.dashboard-kicker {
  color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase;
}
.dashboard-quick-start #current-timer { min-width: 0; }
.dashboard-quick-start #current-timer > p.empty-state { display: none; }
.dashboard-quick-start .current-timer-idle > .empty-state { display: none; }
.dashboard-quick-start #current-timer form,
.dashboard-quick-start .current-timer-form {
  grid-template-columns: minmax(240px, 1.6fr) minmax(150px, .9fr) minmax(130px, .8fr) auto;
  align-items: center;
}
.dashboard-quick-start #current-timer form .field,
.dashboard-quick-start .current-timer-form .field {
  gap: 0; margin-bottom: 0;
}
.dashboard-quick-start #current-timer form .field label,
.dashboard-quick-start .current-timer-form .field label { gap: 0; font-size: 0; }
.dashboard-quick-start #current-timer form .field:nth-of-type(1) { order: 2; }
.dashboard-quick-start #current-timer form .field:nth-of-type(2) { order: 3; }
.dashboard-quick-start #current-timer form .field:nth-of-type(3) { order: 1; }
.dashboard-quick-start .current-timer-form .field:nth-of-type(1) { order: 2; }
.dashboard-quick-start .current-timer-form .field:nth-of-type(2) { order: 3; }
.dashboard-quick-start .current-timer-form .field:nth-of-type(3) { order: 1; }
.dashboard-quick-start #current-timer input,
.dashboard-quick-start #current-timer select,
.dashboard-quick-start .current-timer-form input,
.dashboard-quick-start .current-timer-form select {
  width: 100%; min-height: 34px; font-size: 12.5px;
}
.dashboard-quick-start #current-timer form button:not([class]),
.dashboard-quick-start .current-timer-submit {
  order: 4; min-width: 136px; height: 34px;
}
.dashboard-quick-start .current-timer-running {
  grid-template-columns: auto minmax(0, 1fr) auto;
}
.dashboard-activity {
  position: sticky; top: 72px; align-self: start;
}
.activity-list {
  display: grid; gap: 0; list-style: none; margin: 0; padding: 4px;
  max-height: 560px; overflow: auto;
}
.dashboard-activity-empty-item {
  list-style: none; margin: 0; padding: 0;
}
.activity-row {
  display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 8px;
  padding: 10px; border-radius: var(--radius);
}
.activity-row:hover { background: var(--panel-2); }
.activity-icon {
  width: 22px; height: 22px; border-radius: 6px; display: flex; align-items: center;
  justify-content: center; background: var(--panel-2); border: 1px solid var(--border);
  color: var(--accent);
}
.activity-title { color: var(--ink); font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.activity-summary { color: var(--muted); font-size: 12px; line-height: 1.35; margin-top: 1px; }
.activity-meta { color: var(--muted); font-size: 11px; margin-top: 4px; }
.dashboard-secondary-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px;
}
.dashboard-week-panel,
.dashboard-invoice-radar {
  padding: 16px; display: grid; gap: 14px;
}
.dashboard-week-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
}
.dashboard-week-total {
  color: var(--ink); font-size: 24px; font-weight: 700; letter-spacing: 0;
  font-variant-numeric: tabular-nums; margin-top: 4px;
}
.dashboard-week-spark {
  width: 136px; height: 40px; display: flex; align-items: flex-end; gap: 4px;
  padding: 6px; border: 1px solid var(--hairline); border-radius: var(--radius);
  background: var(--panel-2);
}
.dashboard-week-spark-bar {
  flex: 1; display: block; min-width: 0; height: 100%; border-radius: 999px 999px 0 0;
  overflow: hidden;
}
.dashboard-week-spark-fill {
  fill: var(--accent); opacity: .82;
}
.dashboard-week-bars {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px;
  align-items: end;
}
.dashboard-week-day {
  min-width: 0; display: grid; gap: 6px; align-items: end;
}
.dashboard-week-track {
  height: 48px; display: block; border-radius: 5px;
  background: var(--panel-2); border: 1px solid var(--hairline); overflow: hidden;
}
.dashboard-week-bar-chart {
  display: block; width: 100%; height: 100%;
}
.dashboard-week-bar-fill {
  fill: var(--accent); filter: drop-shadow(0 0 8px var(--accent-glow));
}
.dashboard-week-day:not(.has-time) .dashboard-week-bar-fill {
  fill: var(--panel-3); filter: none;
}
.dashboard-week-label {
  color: var(--muted); font-size: 10.5px; text-align: center; font-weight: 600;
}
.dashboard-week-day.is-today .dashboard-week-label { color: var(--accent); }
.dashboard-invoice-list {
  display: grid; gap: 0; list-style: none; padding: 0; margin: 0;
}
.dashboard-invoice-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px;
  align-items: center; padding: 9px 0; border-bottom: 1px solid var(--hairline);
}
.dashboard-invoice-row:last-child { border-bottom: 0; }
.dashboard-invoice-number { color: var(--ink); font-size: 13px; font-weight: 600; }
.dashboard-invoice-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.dashboard-invoice-amount {
  color: var(--ink); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dashboard-invoice-status {
  justify-self: end; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 2px 6px; font-size: 11px; font-weight: 600; color: var(--muted);
  background: var(--panel-2); white-space: nowrap;
}
.dashboard-invoice-status.status-overdue { color: var(--danger); border-color: var(--danger-border); background: var(--danger-soft); }
.dashboard-invoice-status.status-draft { color: var(--warning); border-color: var(--warning-border); background: var(--warning-soft); }
.dashboard-invoice-status.status-issued,
.dashboard-invoice-status.status-partially-paid { color: var(--info); border-color: var(--info-border); background: var(--info-soft); }
.dashboard-operations-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px;
}
.dashboard-operational-panel > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; cursor: pointer; list-style: none;
  border-bottom: 1px solid transparent;
}
.dashboard-operational-panel[open] > summary { border-bottom-color: var(--hairline); }
.dashboard-operational-panel > summary::-webkit-details-marker { display: none; }
.dashboard-operational-panel summary h2 { font-size: 13px; }
.dashboard-operational-actions {
  display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap;
  gap: 8px; margin-bottom: 10px;
}
.dashboard-panel-title-row {
  display: flex; align-items: center; gap: 8px;
}
.dashboard-invoice-open-link { justify-content: center; }
.dashboard-layout .projects,
.dashboard-layout .project-members,
.dashboard-layout .notifications {
  display: grid; gap: 10px; list-style: none; margin: 0; padding: 0;
}
.dashboard-layout .project,
.dashboard-layout .project-member,
.dashboard-layout .notification {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 12px;
}
.dashboard-layout .project,
.dashboard-layout .project-member {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.dashboard-layout .project > div:last-child {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end;
}
.dashboard-layout .notification { display: grid; gap: 10px; }
.dashboard-layout .project span,
.dashboard-layout .project-member span { color: var(--muted); font-size: 12.5px; }
.dashboard-layout .project-member-section {
  display: grid; gap: 10px; min-width: 0; margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--hairline);
}
.dashboard-layout .project-member-section-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; min-width: 0;
}
.dashboard-layout .project-member-section-header h3 {
  min-width: 0; color: var(--ink); font-size: 13px; font-weight: 700;
}
.dashboard-layout .project-member-list,
.dashboard-layout .project-invitation-list {
  display: grid; gap: 8px; list-style: none; margin: 0; padding: 0;
}
.dashboard-layout .project-member-card,
.dashboard-layout .project-invitation-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px; align-items: center; min-width: 0; padding: 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel-2);
}
.dashboard-layout .project-invitation-card {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto;
}
.dashboard-layout .project-member-main {
  display: grid; gap: 2px; min-width: 0;
}
.dashboard-layout .project-member-main strong {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink); font-size: 13px; font-weight: 700;
}
.dashboard-layout .project-member-main span {
  min-width: 0; overflow-wrap: anywhere;
}
.dashboard-layout .project-member-meta,
.dashboard-layout .project-member-actions,
.dashboard-layout .project-invitation-actions {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 7px; min-width: 0; flex-wrap: wrap;
}
.dashboard-layout .project-member-role,
.dashboard-layout .project-invitation-status {
  flex: none;
}
.dashboard-layout .project-invitation-expires {
  color: var(--muted); font-size: 12px;
}
.dashboard-layout .project-member-actions form,
.dashboard-layout .project-invitation-actions form {
  margin: 0;
}
.dashboard-layout .project-member-form,
.dashboard-layout .project-member-invitation-form {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; background: var(--panel-2);
}
.dashboard-layout .notification-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dashboard-first-run-checklist {
  display: grid; gap: 12px; min-width: 0; margin-bottom: 16px; padding: 14px;
  border: 1px solid var(--accent-border); border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--accent-softer), transparent 62%), var(--panel-2);
  box-shadow: var(--shadow-soft);
}
.dashboard-first-run-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; min-width: 0; padding-bottom: 12px; border-bottom: 1px solid var(--hairline);
}
.dashboard-first-run-head > div:first-child {
  display: grid; gap: 3px; min-width: 0;
}
.dashboard-first-run-kicker {
  color: var(--accent); font-size: 10.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
}
.dashboard-first-run-head h3 {
  min-width: 0; color: var(--ink); font-size: 15px; line-height: 1.25;
  overflow-wrap: anywhere;
}
.dashboard-first-run-head p {
  margin: 0; font-size: 12px; line-height: 1.35; overflow-wrap: anywhere;
}
.dashboard-first-run-progress {
  display: grid; gap: 6px; min-width: 122px; color: var(--ink-2);
  font-size: 11.5px; font-weight: 700; text-align: right; white-space: nowrap;
}
.dashboard-first-run-progress-track {
  display: block; height: 6px; overflow: hidden; border-radius: 999px;
  background: var(--panel-4);
}
.dashboard-first-run-progress-fill {
  display: block; width: 20%; height: 100%; border-radius: inherit;
  background: var(--accent); box-shadow: 0 0 10px var(--accent-glow);
}
.dashboard-first-run-progress-fill-0-of-7 { width: 0%; }
.dashboard-first-run-progress-fill-1-of-7 { width: 14.285%; }
.dashboard-first-run-progress-fill-2-of-7 { width: 28.57%; }
.dashboard-first-run-progress-fill-3-of-7 { width: 42.855%; }
.dashboard-first-run-progress-fill-4-of-7 { width: 57.14%; }
.dashboard-first-run-progress-fill-5-of-7 { width: 71.425%; }
.dashboard-first-run-progress-fill-6-of-7 { width: 85.71%; }
.dashboard-first-run-progress-fill-7-of-7 { width: 100%; }
.dashboard-first-run-steps {
  display: grid; gap: 8px; list-style: none; margin: 0; padding: 0;
}
.dashboard-first-run-step {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: start; gap: 10px; min-width: 0; padding: 10px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--panel);
}
.dashboard-first-run-step-next {
  border-color: var(--accent-border); background: var(--accent-softer);
}
.dashboard-first-run-step-skipped,
.dashboard-first-run-step-dismissed {
  border-style: dashed; background: color-mix(in srgb, var(--panel-2) 82%, transparent);
}
.dashboard-first-run-step-complete { opacity: .9; }
.dashboard-first-run-marker {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 999px; border: 1px solid var(--border-strong);
  color: var(--muted); background: var(--panel-3); font-size: 11px; font-weight: 700;
}
.dashboard-first-run-step-complete .dashboard-first-run-marker,
.dashboard-first-run-step-next .dashboard-first-run-marker {
  border-color: var(--accent-border); color: var(--accent); background: var(--accent-soft);
}
.dashboard-first-run-step-copy {
  display: grid; gap: 2px; min-width: 0;
}
.dashboard-first-run-step-copy strong {
  min-width: 0; color: var(--ink); font-size: 12.5px; line-height: 1.3;
  overflow-wrap: anywhere;
}
.dashboard-first-run-step-copy small {
  min-width: 0; color: var(--muted); font-size: 11.5px; line-height: 1.4;
  overflow-wrap: anywhere;
}
.dashboard-onboarding-workspace-checklist {
  margin-top: 0;
}
.dashboard-first-run-step-actions {
  grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 8px; min-width: 0;
}
.dashboard-first-run-step-actions form,
.dashboard-onboarding-tour-form,
.dashboard-onboarding-reopen form {
  margin: 0;
}
.dashboard-first-run-step-actions .btn,
.dashboard-onboarding-tour-form .btn,
.dashboard-onboarding-reopen .btn {
  justify-content: center;
}
.dashboard-onboarding-reopen {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-width: 0; margin-bottom: 14px; padding: 12px;
  border: 1px dashed var(--accent-border); border-radius: var(--radius);
  background: var(--accent-softer);
}
.dashboard-onboarding-reopen > div {
  display: grid; gap: 3px; min-width: 0;
}
.dashboard-onboarding-reopen strong {
  min-width: 0; color: var(--ink); font-size: 13px; line-height: 1.3;
  overflow-wrap: anywhere;
}
.dashboard-onboarding-reopen small {
  min-width: 0; font-size: 11.5px; line-height: 1.4; overflow-wrap: anywhere;
}
.dashboard-layout .drop-target { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 12px; }
.dashboard-layout .filters { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.dashboard-layout .filters label,
.dashboard-layout .setup-form label { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-2); }
.dashboard-work-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  position: relative;
}
.dashboard-filters,
.dashboard-create-work-item {
  margin: 0; position: relative;
}
.dashboard-filters > summary,
.dashboard-create-work-item > summary {
  display: inline-flex; align-items: center; min-height: 26px; padding: 0 9px;
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--panel-2); color: var(--ink); cursor: pointer; font-size: 11.5px;
  font-weight: 500; list-style: none;
}
.dashboard-filters > summary::-webkit-details-marker,
.dashboard-create-work-item > summary::-webkit-details-marker { display: none; }
.dashboard-filters form,
.dashboard-create-work-item .create-form {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 20;
  width: min(760px, calc(100vw - 320px)); padding: 12px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: 0 18px 48px rgba(0,0,0,.28);
}
.dashboard-layout .work-item-table th:first-child,
.dashboard-layout .work-item-table td:first-child { width: 34%; }
.dashboard-layout #work-items .work-item-table th:nth-child(3),
.dashboard-layout #work-items .work-item-table td:nth-child(3),
.dashboard-layout #work-items .work-item-table th:nth-child(6),
.dashboard-layout #work-items .work-item-table td:nth-child(6),
.dashboard-layout #work-items .work-item-table th:nth-child(8),
.dashboard-layout #work-items .work-item-table td:nth-child(8) {
  display: none;
}
.work-item-mobile-list { min-width: 0; }
.work-item-mobile-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  color: var(--ink);
}
.work-item-mobile-card-link {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.work-item-mobile-card-link:hover {
  color: inherit;
}
.work-item-mobile-timer-action {
  align-self: start;
}
.work-item-mobile-title {
  min-width: 0; overflow-wrap: anywhere; font-size: 13px; line-height: 1.3;
}
.work-item-mobile-project,
.work-item-mobile-meta {
  min-width: 0; overflow-wrap: anywhere; font-size: 12px; line-height: 1.35;
}
.work-item-mobile-badges {
  display: flex; flex-wrap: wrap; gap: 6px; min-width: 0;
}

@media (min-width: 901px) and (max-width: 1199px) {
  .dashboard-layout { grid-template-columns: 1fr; }
  .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-activity { position: static; }
  .dashboard-quick-start #current-timer form,
  .dashboard-quick-start .current-timer-form,
  .dashboard-quick-start .current-timer-running { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .dashboard-layout { grid-template-columns: 1fr; }
  .dashboard-metrics,
  .dashboard-secondary-grid,
  .dashboard-operations-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-activity { position: static; }
  .dashboard-layout .filters { grid-template-columns: 1fr; }
  .dashboard-layout .project,
  .dashboard-layout .project-member { align-items: flex-start; flex-wrap: wrap; }
  .dashboard-layout .project > div:last-child { justify-content: flex-start; }
  .dashboard-layout .project-member-card,
  .dashboard-layout .project-invitation-card {
    grid-template-columns: 1fr;
  }
  .dashboard-layout .project-member-meta,
  .dashboard-layout .project-member-actions {
    justify-content: flex-start;
  }
  .dashboard-layout .project-member-actions .btn {
    min-width: 0;
  }
  .dashboard-quick-start #current-timer form,
  .dashboard-quick-start .current-timer-form,
  .dashboard-quick-start .current-timer-running { grid-template-columns: 1fr; }
  .dashboard-filters form,
  .dashboard-create-work-item .create-form {
    width: min(520px, calc(100vw - 32px));
  }
  .dashboard-create-work-item .work-item-create-form { grid-template-columns: 1fr; }
  .dashboard-week-head { flex-direction: column; }
  .dashboard-week-spark { width: 100%; }
}

@media (max-width: 760px) {
  .page-body.dashboard-layout { padding-left: 12px; padding-right: 12px; }
  .dashboard-first-run-checklist { padding: 12px; }
  .dashboard-first-run-head {
    flex-direction: column; align-items: stretch; gap: 10px;
  }
  .dashboard-first-run-progress {
    width: 100%; min-width: 0; text-align: left; white-space: normal;
  }
  .dashboard-first-run-step {
    grid-template-columns: 24px minmax(0, 1fr); gap: 8px; padding: 9px;
  }
  .dashboard-first-run-step > .badge {
    grid-column: 2; justify-self: start;
  }
  .dashboard-first-run-step-actions {
    grid-column: 1 / -1;
  }
  .dashboard-first-run-step-actions .btn,
  .dashboard-onboarding-tour-form .btn,
  .dashboard-onboarding-reopen .btn {
    width: 100%;
  }
  .dashboard-onboarding-reopen {
    flex-direction: column; align-items: stretch;
  }
  .dashboard-first-run-marker {
    width: 20px; height: 20px;
  }
  .dashboard-filters form,
  .dashboard-create-work-item .create-form {
    position: fixed; left: 12px; right: 12px; top: 116px; width: auto;
    max-height: calc(100vh - 140px); overflow: auto; z-index: 120;
  }
  .dashboard-metrics,
  .dashboard-secondary-grid,
  .dashboard-operations-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 104px; }
  .dashboard-invoice-row { grid-template-columns: minmax(0, 1fr) auto; }
  .dashboard-invoice-status { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 900px) {
  .project-client-view { padding: 0; gap: 14px; }
  .project-client-view-card-header {
    flex-direction: row; align-items: flex-start; gap: 10px;
  }
  .project-client-view-metric-strip .time-metric:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@media (min-width: 901px) and (max-width: 1199px) {
  .project-client-view-page-header {
    align-items: flex-start; flex-direction: column;
  }
  .project-client-view-header-actions {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 280px);
  }
  .project-client-view-header-actions .btn {
    width: 100%; white-space: nowrap;
  }
}

@media (max-width: 760px) {
  .project-client-view-preview-banner {
    grid-template-columns: auto minmax(0, 1fr); align-items: start;
  }
  .project-client-view-preview-banner > .btn {
    grid-column: 1 / -1; width: 100%;
  }
  .project-client-view-identity {
    grid-template-columns: auto minmax(0, 1fr); padding: 15px 14px;
  }
  .project-client-view-identity > .badge {
    grid-column: 2; justify-self: start;
  }
  .project-client-view-metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .project-client-view-metric-strip .time-metric {
    border-right: 1px solid var(--hairline);
    border-bottom: 1px solid var(--hairline);
  }
  .project-client-view-card-grid { grid-template-columns: 1fr; }
  .project-client-view-card-grid > .project-client-view-card + .project-client-view-card {
    border-left: 0;
  }
  .project-client-view-file-list article,
  .project-client-view-invoice-list article {
    align-items: flex-start; flex-wrap: wrap;
  }
  .project-client-view-file-main { width: calc(100% - 84px); }
  .project-client-view-invoice-list article > span { margin-left: 0; }
  .project-client-view-invoice-list article > .btn { width: 100%; }
  .project-client-view-contact-bar {
    align-items: stretch; flex-direction: column;
  }
  .project-client-view-contact-bar .btn { width: 100%; }
}

/* ---------- Project overview and project-local navigation ---------- */
.project-overview-page { min-width: 0; }
.project-overview-header {
  display: grid; gap: 14px; min-width: 0; padding: 18px 24px 16px;
  border-bottom: 1px solid var(--hairline);
}
.project-overview-breadcrumb {
  display: flex; align-items: center; gap: 7px; min-width: 0;
  color: var(--muted); font-size: 11.5px;
}
.project-overview-breadcrumb a { color: var(--muted); }
.project-overview-breadcrumb span {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.project-overview-identity-row {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; min-width: 0;
}
.project-overview-identity {
  display: flex; align-items: center; gap: 12px; min-width: 0;
}
.project-overview-mark,
.project-overview-client-mark,
.project-overview-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  border: 1px solid var(--accent-border); background: var(--accent-soft); color: var(--accent-hover);
  font-weight: 700;
}
.project-overview-mark { width: 42px; height: 42px; border-radius: var(--radius-lg); font-size: 15px; }
.project-overview-title-block { display: grid; gap: 4px; min-width: 0; }
.project-overview-title-line {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px; min-width: 0;
}
.project-overview-title-line h1 {
  min-width: 0; overflow-wrap: anywhere; font-size: 21px; line-height: 1.2;
}
.project-overview-title-block > p {
  display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; margin: 0;
  color: var(--muted); font-size: 11.5px; overflow-wrap: anywhere;
}
.project-overview-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: none;
}
.project-overview-actions form { margin: 0; }
.project-overview-actions .btn svg {
  width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.project-overview-timer-form .btn svg { fill: currentColor; stroke: none; }
.project-overview-more-shell { position: relative; }
.project-overview-more-shell .project-row-more-menu { right: 0; left: auto; }
.project-overview-current-timer:empty { display: none; }

.project-local-nav-shell {
  min-width: 0; padding: 0 24px; border-bottom: 1px solid var(--border); background: var(--bg);
}
.project-local-nav {
  display: flex; gap: 3px; min-width: 0; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; overscroll-behavior-inline: contain;
}
.project-local-nav::-webkit-scrollbar { display: none; }
.project-local-nav a {
  position: relative; display: inline-flex; align-items: center; gap: 6px; flex: none;
  min-height: 42px; padding: 0 10px; color: var(--muted); font-size: 12px; font-weight: 500;
  white-space: nowrap;
}
.project-local-nav a:hover { color: var(--ink); }
.project-local-nav a[aria-current="page"] { color: var(--ink); }
.project-local-nav a[aria-current="page"]::after {
  content: ""; position: absolute; right: 8px; bottom: 0; left: 8px; height: 2px;
  border-radius: 2px 2px 0 0; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow);
}
.project-local-nav a span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 999px; background: var(--panel-3); color: var(--muted);
  font-size: 10px;
}

.project-overview-body {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 310px);
  align-items: start; gap: 22px; min-width: 0; padding: 20px 24px 48px;
}
.project-overview-main { display: grid; gap: 16px; min-width: 0; }
.project-overview-metrics {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; min-width: 0;
}
.project-overview-metric {
  display: grid; align-content: start; gap: 5px; min-width: 0; min-height: 112px; padding: 13px;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel);
  color: var(--ink); box-shadow: var(--shadow-soft);
}
.project-overview-metric:hover { border-color: var(--border-strong); color: var(--ink); background: var(--panel-2); }
.project-overview-metric > span {
  color: var(--muted); font-size: 10.5px; font-weight: 600; text-transform: uppercase;
}
.project-overview-metric strong {
  min-width: 0; overflow-wrap: anywhere; font-family: var(--font-display); font-size: 20px;
  line-height: 1.2;
}
.project-overview-metric small { color: var(--muted); font-size: 10.5px; line-height: 1.35; }
.project-overview-metric progress { width: 100%; height: 4px; margin-top: auto; accent-color: var(--accent); }
.project-overview-metric-warning strong { color: var(--warning); }
.project-overview-section {
  min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--panel); box-shadow: var(--shadow-soft);
}
.project-overview-section-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0;
  padding: 13px 15px; border-bottom: 1px solid var(--hairline);
}
.project-overview-section-heading > div { display: grid; gap: 2px; min-width: 0; }
.project-overview-section-heading h2 { min-width: 0; overflow-wrap: anywhere; }
.project-overview-section-heading > a { flex: none; font-size: 11.5px; }
.project-overview-kicker {
  margin: 0; color: var(--muted); font-size: 9.5px; font-weight: 700;
  text-transform: uppercase;
}
.project-overview-delivery-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 0;
}
.project-overview-delivery-grid > div { display: grid; gap: 2px; padding: 18px 15px; }
.project-overview-delivery-grid > div + div { border-left: 1px solid var(--hairline); }
.project-overview-delivery-grid strong { font-family: var(--font-display); font-size: 20px; }
.project-overview-delivery-grid span { color: var(--muted); font-size: 11.5px; }
.project-overview-client-summary {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: 11px; min-width: 0; padding: 15px;
}
.project-overview-client-mark { width: 34px; height: 34px; border-radius: var(--radius); font-size: 10px; }
.project-overview-client-summary > div { display: grid; gap: 2px; min-width: 0; }
.project-overview-client-summary strong,
.project-overview-client-summary p { min-width: 0; overflow-wrap: anywhere; }
.project-overview-client-summary p { margin: 0; color: var(--muted); font-size: 11.5px; }

.project-overview-rail {
  position: sticky; top: 68px; min-width: 0; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel);
  box-shadow: var(--shadow-soft);
}
.project-overview-rail-section { min-width: 0; padding: 15px; }
.project-overview-rail-section + .project-overview-rail-section { border-top: 1px solid var(--hairline); }
.project-overview-rail-section > h2,
.project-overview-rail-heading { margin-bottom: 12px; }
.project-overview-rail-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.project-overview-rail-heading span { color: var(--muted); font-size: 11px; }
.project-overview-details { display: grid; gap: 0; margin: 0; }
.project-overview-details > div {
  display: grid; grid-template-columns: minmax(76px, .7fr) minmax(0, 1.3fr); gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--hairline);
}
.project-overview-details > div:last-child { border-bottom: 0; }
.project-overview-details dt { color: var(--muted); font-size: 11.5px; }
.project-overview-details dd { min-width: 0; margin: 0; overflow-wrap: anywhere; text-align: right; font-size: 11.5px; }
.project-overview-team { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.project-overview-team li {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 9px; min-width: 0;
}
.project-overview-avatar {
  width: 30px; height: 30px; overflow: hidden; border-radius: 50%; font-size: 10px; white-space: nowrap;
}
.project-overview-team li > span:last-child { display: grid; gap: 1px; min-width: 0; }
.project-overview-team strong,
.project-overview-team small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-overview-team strong { font-size: 11.5px; }
.project-overview-team small { color: var(--muted); font-size: 10.5px; }

@media (max-width: 1199px) {
  .project-overview-identity-row { align-items: flex-start; flex-direction: column; }
  .project-overview-actions { justify-content: flex-start; width: 100%; }
  .project-overview-body { grid-template-columns: 1fr; gap: 16px; }
  .project-overview-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-overview-rail {
    position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .project-overview-rail-section + .project-overview-rail-section {
    border-top: 0; border-left: 1px solid var(--hairline);
  }
}

@media (max-width: 900px) {
  .project-overview-header { padding-inline: 16px; }
  .project-local-nav-shell { padding-inline: 8px; }
  .project-overview-body { grid-template-columns: 1fr; padding: 16px 16px 40px; }
}

@media (max-width: 760px) {
  .project-overview-header { gap: 12px; padding: 14px 12px 12px; }
  .project-overview-identity { align-items: flex-start; }
  .project-overview-mark { width: 38px; height: 38px; }
  .project-overview-title-line h1 { width: 100%; font-size: 19px; }
  .project-overview-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
  .project-overview-actions > .btn,
  .project-overview-actions form,
  .project-overview-actions form .btn,
  .project-overview-more-shell,
  .project-overview-more-trigger { width: 100%; justify-content: center; }
  .project-overview-more-shell { grid-column: 1 / -1; }
  .project-overview-actions .btn { min-height: 44px; }
  .project-row-more-menu-item { min-height: 44px; }
  .project-local-nav a { min-height: 44px; padding-inline: 9px; }
  .project-overview-body { gap: 12px; padding: 12px 12px 36px; }
  .project-overview-main { gap: 12px; }
  .project-overview-metrics { gap: 8px; }
  .project-overview-metric { min-height: 104px; padding: 11px; }
  .project-overview-metric strong { font-size: 17px; }
  .project-overview-section-heading { align-items: flex-start; padding: 12px; }
  .project-overview-delivery-grid > div { padding: 14px 12px; }
  .project-overview-client-summary {
    grid-template-columns: auto minmax(0, 1fr); align-items: start; padding: 12px;
  }
  .project-overview-client-summary > .badge { grid-column: 2; justify-self: start; }
  .project-overview-rail { display: block; }
  .project-overview-rail-section { padding: 13px; }
  .project-overview-rail-section + .project-overview-rail-section {
    border-top: 1px solid var(--hairline); border-left: 0;
  }
}

[data-theme="light"] .project-overview-section-heading > a {
  color: #047857;
}
[data-theme="light"] .project-overview-metric-warning strong {
  color: #b45309;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
