@font-face {
  font-family: "Oswald";
  src: url("assets/fonts/Oswald-VariableFont_wght.ttf") format("truetype-variations");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #212122;
  --muted: #625d57;
  --line: #e5e2dc;
  --line-strong: #d2cec6;
  --panel: #ffffff;
  --panel-muted: #f2f0ec;
  --page: #e6e6e6;
  --accent: #e11b22;
  --accent-dark: #c8171d;
  --accent-darker: #a61218;
  --accent-tint: #fde7e8;
  --primary-bg: #e11b22;
  --primary-fg: #ffffff;
  --gold: #c8861a;
  --green: #2e7d52;
  --blue: #1e99d6;
  --orange: #f1633d;
  --fuchsia: #bf2e91;
  --purple: #4e2a7a;
  --radius: 6px;
  --font-display: "Oswald", "Arial Narrow", sans-serif;
  --font-body: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --shadow: 0 1px 2px rgba(26, 23, 24, 0.08);
  --shadow-lift: 0 4px 12px rgba(26, 23, 24, 0.10);
  --shadow-drag: 0 18px 34px rgba(26, 23, 24, 0.18);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f7f4ef;
  --muted: #c7c0b8;
  --line: #3a3434;
  --line-strong: #574f4e;
  --panel: #212122;
  --panel-muted: #2e2d2e;
  --page: #1a1718;
  --accent: #f04a4f;
  --accent-dark: #ff7478;
  --accent-darker: #ffabad;
  --accent-tint: rgba(237, 28, 37, 0.16);
  --primary-bg: #e11b22;
  --primary-fg: #ffffff;
  --gold: #e0a542;
  --green: #5db17f;
  --blue: #58b7e8;
  --orange: #f48668;
  --fuchsia: #d76bb0;
  --purple: #9a78c8;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.34);
  --shadow-lift: 0 6px 18px rgba(0, 0, 0, 0.38);
  --shadow-drag: 0 20px 42px rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1420px, calc(100% - 308px));
  margin: 0 24px 0 284px;
  padding: 24px 0 36px;
}

.app-rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: none;
  grid-template-rows: auto 1fr auto;
  width: 76px;
  border-right: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 18px 10px;
}

.rail-brand {
  display: grid;
  place-items: center;
  min-height: 48px;
}

.rail-brand img {
  width: 54px;
  height: auto;
}

.rail-brand-dark {
  display: none;
}

:root[data-theme="dark"] .rail-brand-light {
  display: none;
}

:root[data-theme="dark"] .rail-brand-dark {
  display: block;
}

.rail-nav {
  display: grid;
  align-content: start;
  gap: 8px;
  margin-top: 28px;
}

.rail-link,
.rail-add {
  display: grid;
  place-items: center;
  width: 54px;
  min-height: 52px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 120ms cubic-bezier(0.22, 1, 0.36, 1), border-color 120ms cubic-bezier(0.22, 1, 0.36, 1), color 120ms cubic-bezier(0.22, 1, 0.36, 1);
}

.rail-link:hover,
.rail-add:hover,
.rail-link.active {
  border-color: var(--line);
  background: var(--panel-muted);
  color: var(--ink);
}

.rail-link.active {
  box-shadow: inset 2px 0 0 var(--accent);
}

.rail-link span {
  margin-top: 3px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.rail-link .button-icon {
  width: 20px;
  height: 20px;
}

.rail-add {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
}

.app-section-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 35;
  width: 260px;
  border-right: 1px solid var(--line);
  background: var(--panel);
  padding: 24px 12px;
  overflow-y: auto;
}

.section-sidebar-brand {
  display: flex;
  align-items: center;
  min-height: 78px;
  margin-bottom: 16px;
}

.section-sidebar-brand img {
  width: 156px;
  height: auto;
}

.section-brand-dark {
  display: none;
}

:root[data-theme="dark"] .section-brand-light {
  display: none;
}

:root[data-theme="dark"] .section-brand-dark {
  display: block;
}

.section-search span,
.section-nav-label {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-quick-add {
  display: block;
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.03em;
  margin-bottom: 16px;
  text-align: center;
  text-transform: uppercase;
}

.section-quick-add:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.section-search {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.section-nav {
  display: grid;
  gap: 5px;
}

.section-nav-label {
  margin: 14px 8px 3px;
}

.section-link {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 8px 10px;
  text-align: left;
}

.section-link:hover,
.section-link.active {
  border-color: var(--line);
  background: var(--panel-muted);
}

.section-link.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.section-link .button-icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.section-link span {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.brand-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.app-version {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 6px;
  white-space: nowrap;
}

.brand-mark {
  display: block;
  width: 132px;
  height: auto;
}

.brand-mark-dark {
  display: none;
}

@media (display-mode: window-controls-overlay) {
  .app-section-sidebar,
  .app-rail {
    padding-top: calc(env(titlebar-area-height, 0px) + 18px);
  }

  .app-shell {
    padding-top: calc(env(titlebar-area-height, 0px) + 18px);
  }
}

:root[data-theme="dark"] .brand-mark-light {
  display: none;
}

:root[data-theme="dark"] .brand-mark-dark {
  display: block;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(32px, 5vw, 58px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
}

h1,
h2,
.tab-button,
.text-button,
.icon-button,
label span,
.identity-card span,
.stats-grid span,
.stats-grid strong,
.time-summary-grid span,
.time-summary-grid strong,
.inline-action,
.week-picker span,
.week-picker strong,
.sheet-head,
.sheet-foot,
.admin-tab-button {
  font-family: var(--font-display);
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-menu-wrap {
  position: relative;
}

.account-menu-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.account-menu-button:hover,
.account-menu-button[aria-expanded="true"] {
  border-color: var(--accent);
  background: var(--accent-tint);
}

.account-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 45;
  display: grid;
  gap: 10px;
  width: 320px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-lift);
  padding: 12px;
}

.account-menu-status {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-muted);
  padding: 8px 10px;
}

.account-menu-status span,
.account-menu-status strong {
  display: block;
}

.account-menu-status span {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account-menu-status strong {
  font-size: 13px;
}

.account-menu-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.account-menu .google-sign-in {
  min-height: 40px;
}

.account-menu .theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.account-menu .theme-toggle .theme-icon {
  width: 16px;
  height: 16px;
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.google-sign-in {
  min-height: 40px;
}

.identity-card {
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 8px 10px;
}

.identity-card span,
.identity-card strong {
  display: block;
}

.identity-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.identity-card strong {
  font-size: 13px;
}

.sync-status {
  min-width: 170px;
  color: var(--muted);
  font-size: 14px;
  text-align: right;
}

.icon-button,
.text-button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  transition: background 120ms cubic-bezier(0.22, 1, 0.36, 1), border-color 120ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 120ms cubic-bezier(0.22, 1, 0.36, 1), color 120ms cubic-bezier(0.22, 1, 0.36, 1), transform 120ms cubic-bezier(0.22, 1, 0.36, 1);
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 0;
  display: grid;
  place-items: center;
  font-size: 22px;
}

.theme-toggle {
  color: var(--ink);
}

.theme-icon {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 2;
}

.theme-icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-icon-moon {
  display: block;
}

.text-button {
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.text-button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.icon-button:hover,
.text-button:hover {
  border-color: var(--line-strong);
  background: var(--panel-muted);
  box-shadow: var(--shadow-lift);
}

.text-button.primary:hover {
  border-color: var(--ink);
  background: var(--ink);
}

.icon-button:active,
.text-button:active {
  transform: translateY(1px);
}

.icon-button:disabled,
.text-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.button-spinner {
  display: none;
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  animation: spin 0.7s linear infinite;
}

.text-button.is-saving .button-spinner {
  display: inline-block;
}

.text-button.is-saving {
  pointer-events: none;
}

.app-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.primary-tabs,
.quick-add-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.primary-tabs {
  display: none;
}

.quick-add-nav {
  position: relative;
  margin-left: auto;
  padding-bottom: 6px;
}

.quick-add-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  display: grid;
  width: 220px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-lift);
  padding: 6px;
}

.quick-add-menu button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 42px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 8px 10px;
  text-align: left;
}

.quick-add-menu button:hover,
.quick-add-menu button:focus-visible {
  background: var(--panel-muted);
  outline: 0;
}

.quick-add-menu kbd {
  min-width: 26px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel-muted);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 6px 8px;
  text-align: center;
}

.tab-button {
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.tab-button.active {
  border-bottom-color: var(--accent);
  color: var(--ink);
}

.view-section[hidden] {
  display: none;
}

.work-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.work-overview-grid article {
  min-height: 84px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.work-overview-grid span,
.work-overview-grid strong {
  display: block;
  font-family: var(--font-display);
  text-transform: uppercase;
}

.work-overview-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.work-overview-grid strong {
  margin-top: 6px;
  font-size: 30px;
  line-height: 1;
}

.work-board-panel {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.work-categories,
.work-projects-panel,
.clients-page-panel,
.weekly-status-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.work-categories {
  position: sticky;
  top: 14px;
  overflow: auto;
  max-height: calc(100vh - 28px);
}

.work-category-list {
  display: grid;
  padding: 8px;
}

.work-category-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 38px;
  border: 0;
  border-left: 3px solid transparent;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 8px 10px;
  text-align: left;
}

.work-category-row:hover {
  border-left-color: var(--accent);
  background: var(--panel-muted);
}

.work-category-row strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-category-row span {
  min-width: 30px;
  border-radius: 999px;
  background: var(--panel-muted);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 2px 8px;
  text-align: center;
}

.work-project-heading {
  gap: 16px;
}

.work-project-tools {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px;
  gap: 8px;
  min-width: min(520px, 50%);
}

.clients-heading .work-project-tools {
  grid-template-columns: minmax(220px, 1fr) 150px auto;
  min-width: min(680px, 62%);
}

.work-table-wrap {
  overflow: auto;
  border-top: 1px solid var(--line);
}

.work-project-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.work-project-table th,
.work-project-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 14px;
  text-align: left;
  vertical-align: middle;
}

.work-project-table th {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.work-project-table tbody tr:hover {
  background: var(--panel-muted);
}

.work-project-name-row,
.client-detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.work-edit-project {
  flex: 0 0 auto;
}

.work-edit-project:hover,
.work-edit-project:focus-visible {
  text-decoration: none;
}

.work-project-table td:first-child strong,
.work-project-link {
  color: var(--ink);
  font-weight: 800;
}

.work-project-table td:first-child span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.work-project-link,
.work-client-link {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-align: left;
}

.client-page-link {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: 0;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.inline-client-link,
.retainer-client-link,
.timeline-client-link {
  font-weight: 800;
}

.client-page-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.client-page-fallback {
  color: inherit;
}

.work-project-link:hover {
  color: var(--accent);
}

.work-client-link {
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
}

.work-client-link:hover,
.client-pill.client-page-link:hover {
  filter: brightness(0.94);
}

.client-table-link {
  margin-bottom: 4px;
}

.clients-heading {
  gap: 16px;
}

.work-status-pill {
  display: inline-flex;
  border: 1px solid var(--line);
  background: var(--panel-muted);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  padding: 3px 8px;
}

.work-budget-cell {
  display: grid;
  gap: 4px;
  min-width: 180px;
}

.work-budget-cell strong {
  font-size: 14px;
}

.work-budget-cell span {
  color: var(--muted);
  font-size: 12px;
}

.work-budget-cell i {
  display: block;
  height: 5px;
  background: linear-gradient(90deg, var(--green) var(--budget-percent), var(--line) 0);
}

.work-project-table tr.over-budget .work-budget-cell i {
  background: linear-gradient(90deg, var(--accent) var(--budget-percent), var(--line) 0);
}

.weekly-status-heading {
  gap: 16px;
}

.status-meeting-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.status-meeting-toolbar label {
  display: grid;
  gap: 5px;
}

.status-meeting-toolbar label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.status-meeting-toolbar select {
  width: 100%;
}

.weekly-status-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.weekly-status-actions strong {
  min-width: 126px;
  color: var(--ink);
  font-weight: 900;
  text-align: center;
}

.weekly-status-table-wrap {
  overflow: auto;
  border-top: 1px solid var(--line);
}

.weekly-status-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
}

.weekly-status-table th,
.weekly-status-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.weekly-status-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel);
  color: var(--muted);
}

.weekly-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0;
  text-transform: uppercase;
}

.weekly-sort-button::after {
  content: "";
  color: var(--accent);
  font-size: 10px;
  line-height: 1;
}

.weekly-sort-button:hover,
.weekly-sort-button.active {
  color: var(--ink);
}

.weekly-sort-button.active[data-direction="asc"]::after {
  content: "▲";
}

.weekly-sort-button.active[data-direction="desc"]::after {
  content: "▼";
}

.weekly-status-table tbody tr:nth-child(odd) {
  background: color-mix(in srgb, var(--panel-muted) 45%, transparent);
}

.weekly-status-table tbody tr:hover {
  background: var(--accent-tint);
}

.weekly-status-table tr.is-project-start td {
  border-top: 2px solid var(--ink);
}

.weekly-status-table tr.is-overdue td {
  background: var(--accent-tint);
}

.weekly-status-table td strong,
.weekly-status-table td span:not(.client-pill) {
  display: block;
}

.weekly-status-table td span:not(.client-pill) {
  color: var(--muted);
  font-size: 12px;
}

.weekly-status-task {
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0;
  text-align: left;
}

.weekly-status-task:hover {
  color: var(--accent);
}

.weekly-status-task-line,
.calendar-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.card-edit-button {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  flex: 0 0 30px;
  place-items: center;
  padding: 0;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.card-edit-button:hover {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent-dark);
}

.card-edit-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.card-edit-button .button-icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 2;
}

.budget-circle-cell {
  display: grid;
  grid-template-columns: 58px minmax(120px, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 210px;
}

.budget-circle {
  --budget-used: 0%;
  display: grid;
  place-items: center;
  align-content: center;
  width: 58px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--panel) 0 60%, transparent 61%),
    conic-gradient(var(--accent) var(--budget-used), var(--line) 0);
}

.budget-circle strong,
.budget-circle span,
.budget-circle-copy strong,
.budget-circle-copy span {
  display: block;
}

.budget-circle strong {
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1;
}

.budget-circle span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.budget-circle-copy strong {
  font-size: 13px;
}

.budget-circle-copy span {
  color: var(--muted);
  font-size: 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.stats-grid article {
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 16px;
}

.stats-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.stats-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
  line-height: 1;
}

.toolbar {
  display: grid;
  grid-template-columns: 1.6fr repeat(4, minmax(130px, 1fr));
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 12px;
  margin-bottom: 12px;
}

.toolbar label span {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

label span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

input,
select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  padding: 6px 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="color"] {
  min-height: 36px;
  padding: 3px;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-strong);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(237, 28, 37, 0.16);
  outline: none;
}

.content-grid {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.sidebar,
.task-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.sidebar {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  overflow: auto;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
}

.section-heading p,
.section-heading span {
  color: var(--muted);
  font-size: 13px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.task-view-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  background: var(--panel);
}

.view-mode-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 9px 12px;
  text-transform: uppercase;
  transition: background 120ms cubic-bezier(0.22, 1, 0.36, 1), color 120ms cubic-bezier(0.22, 1, 0.36, 1), transform 120ms cubic-bezier(0.22, 1, 0.36, 1);
}

.view-mode-button .button-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 2;
}

.view-mode-button:last-child {
  border-right: 0;
}

.view-mode-button:hover {
  background: var(--panel-muted);
  color: var(--ink);
}

.view-mode-button:active {
  transform: translateY(1px);
}

.view-mode-button.active {
  background: var(--ink);
  color: var(--panel);
}

.task-heading {
  align-items: flex-start;
}

.client-groups {
  padding: 8px;
}

.client-group {
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px;
  text-align: left;
}

.client-group:hover,
.client-group.active {
  background: var(--panel-muted);
}

.client-group strong {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-group i,
.client-color-row i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.client-group span {
  color: var(--muted);
  font-size: 13px;
}

.task-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 12px;
}

.task-list.calendar-view {
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.task-loading-state {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 20px 12px 14px;
  color: var(--muted);
}

.task-loading-state[hidden] {
  display: none;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.task-loading-state strong,
.task-loading-state span {
  display: block;
}

.task-loading-state strong {
  color: var(--ink);
  font-size: 15px;
  margin-bottom: 4px;
}

.task-loading-state span {
  font-size: 13px;
}

.task-skeleton-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.task-skeleton-list i {
  display: block;
  height: 76px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, #f2f0ec 25%, #faf9f7 38%, #f2f0ec 63%) 0 0 / 240% 100%,
    var(--panel);
  animation: skeleton-shimmer 1.15s ease-in-out infinite;
}

.task-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) minmax(218px, auto);
  align-items: stretch;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--panel);
  cursor: default;
  transform-origin: center;
  transition: box-shadow 180ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms cubic-bezier(0.22, 1, 0.36, 1), transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, box-shadow;
}

.task-card:hover {
  box-shadow: inset 0 2px 0 var(--blue), var(--shadow-lift);
  transform: translateY(-2px);
}

.task-card:active {
  cursor: default;
}

.task-card.pressing {
  box-shadow: var(--shadow-drag);
  transform: translateY(-4px) scale(1.006);
}

.task-card.dragging {
  opacity: 0.2;
  outline: 2px dashed rgba(237, 28, 37, 0.62);
  outline-offset: -2px;
  pointer-events: none;
  box-shadow: none;
  transform: scale(0.985);
}

.task-card.drag-preview {
  position: fixed;
  z-index: 1000;
  opacity: 0.98;
  pointer-events: none;
  box-shadow: var(--shadow-drag);
  transform-origin: top left;
}

.task-list.drag-active .task-card:not(.dragging) {
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.task-list.drag-active {
  cursor: move;
  user-select: none;
}

.task-card button,
.task-card input {
  cursor: auto;
}

.task-drag-handle {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  background: var(--panel-muted);
  color: var(--muted);
  cursor: move;
  display: grid;
  place-items: center;
  padding: 0;
  touch-action: none;
}

.task-drag-handle:hover,
.task-card.pressing .task-drag-handle,
.task-card.dragging .task-drag-handle {
  border-color: var(--accent);
  color: var(--ink);
  background: var(--accent-tint);
}

.task-drag-handle svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 2;
}

.task-copy-button,
.task-edit-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  background: var(--panel-muted);
  color: var(--ink);
  display: grid;
  place-items: center;
  padding: 0;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease;
}

.task-copy-button:hover,
.task-copy-button.copied,
.task-edit-button:hover {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent-dark);
}

.task-copy-button:focus-visible,
.task-edit-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.task-copy-button .button-icon,
.task-edit-button .button-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 2;
}

.task-card-side {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "date date"
    "complete actions";
  align-items: end;
  align-content: space-between;
  gap: 12px 14px;
  min-width: 218px;
}

.task-card-side .task-date {
  grid-area: date;
  justify-self: end;
}

.task-card-side .check-wrap {
  grid-area: complete;
  justify-self: end;
  padding-top: 0;
}

.task-card-actions {
  grid-area: actions;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

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

.task-card.soon {
  box-shadow: inset 0 2px 0 var(--gold);
}

.task-card.done {
  opacity: 0.62;
}

.check-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  padding-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.check-wrap input {
  width: 24px;
  height: 24px;
  min-height: 24px;
  accent-color: var(--green);
}

.check-wrap span {
  white-space: nowrap;
  text-transform: none;
}

.task-main {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.task-title,
.task-title-button {
  font-size: 17px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.task-title-button {
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: block;
  padding: 0;
  text-align: left;
}

.task-title-button:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.task-card.done .task-title {
  text-decoration: line-through;
}

.task-meta,
.task-notes {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.task-notes {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-month {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-muted);
  overflow: hidden;
}

.calendar-month-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  padding: 12px 14px;
}

.calendar-month-heading h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1;
  text-transform: uppercase;
}

.calendar-month-heading span {
  color: var(--muted);
  font-size: 13px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-weekday {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  padding: 8px;
  text-align: center;
  text-transform: uppercase;
}

.calendar-weekday:nth-child(7) {
  border-right: 0;
}

.calendar-day {
  min-height: 116px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  padding: 8px;
}

.calendar-day:nth-child(7n) {
  border-right: 0;
}

.calendar-day.empty {
  background: var(--panel-muted);
}

.calendar-day.today {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.calendar-day-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}

.calendar-day-heading strong {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1;
}

.calendar-day-heading span {
  color: var(--muted);
  font-size: 12px;
}

.calendar-day-stack,
.calendar-loose-grid {
  display: grid;
  gap: 8px;
}

.calendar-loose-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 12px;
}

.calendar-loose-section.overdue {
  border-color: rgba(237, 28, 37, 0.42);
}

.calendar-task-card {
  display: grid;
  gap: 6px;
  min-height: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-muted);
}

.calendar-task-card.overdue {
  border-color: rgba(237, 28, 37, 0.45);
}

.calendar-project-name,
.calendar-client-name {
  width: fit-content;
  max-width: 100%;
  border: 0;
  padding: 0;
  text-align: left;
}

.calendar-project-name {
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.calendar-project-name {
  min-width: 0;
}

.calendar-edit-button {
  width: 26px;
  min-width: 26px;
  height: 26px;
  min-height: 26px;
  flex-basis: 26px;
}

.calendar-project-name:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.calendar-client-name {
  width: 100%;
  min-height: 20px;
  border-radius: 999px;
  padding: 2px 7px;
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
  white-space: normal;
}

.calendar-client-name:hover {
  filter: brightness(0.94);
}

.calendar-project-name:focus-visible,
.calendar-client-name:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--panel-muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.client-pill {
  border-color: transparent;
  white-space: nowrap;
}

button.client-pill {
  cursor: pointer;
}

button.client-pill:hover {
  filter: brightness(0.94);
  transform: translateY(-1px);
}

.inline-action {
  min-height: 26px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  padding: 3px 9px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.task-date {
  min-width: 132px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-align: right;
  text-transform: none;
}

.task-date.overdue-text {
  color: var(--accent-dark);
}

.empty-state {
  padding: 48px 18px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong,
.empty-state span {
  display: block;
}

.empty-state strong {
  color: var(--ink);
  margin-bottom: 5px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes skeleton-shimmer {
  to {
    background-position: -240% 0;
  }
}

.time-toolbar {
  display: grid;
  grid-template-columns: auto 160px 160px 150px minmax(320px, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 12px;
  margin-bottom: 12px;
}

.button-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 2;
}

.icon-text-button,
.icon-inline-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.inline-action .button-icon {
  width: 14px;
  height: 14px;
}

.timer-launch-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
}

.client-page-panel,
.client-page-section,
.project-page-panel,
.project-page-section,
.timer-focus-card,
.timer-edit-card,
.timer-confirm-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.client-page-hero,
.project-page-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 18px;
}

.client-page-hero h2,
.project-page-hero h2 {
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1;
}

.client-page-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.client-logo-frame {
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-muted);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
}

.client-logo-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  padding: 7px;
  background: #fff;
}

.client-logo-frame img[hidden],
.client-logo-frame span[hidden] {
  display: none;
}

.client-table-identity {
  display: flex;
  align-items: center;
  gap: 9px;
}

.client-table-identity .client-row-edit {
  margin-left: auto;
}

.client-table-identity > span:last-child,
.client-table-identity small {
  display: block;
}

.client-table-logo {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid !important;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-muted);
  color: var(--muted) !important;
  font-family: var(--font-display);
  font-size: 11px !important;
  font-weight: 800;
}

.client-table-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 3px;
  background: #fff;
}

.clients-table {
  table-layout: fixed;
}

.clients-table th:nth-child(1) { width: 24%; }
.clients-table th:nth-child(2) { width: 14%; }
.clients-table th:nth-child(3) { width: 27%; }
.clients-table th:nth-child(4) { width: 10%; }
.clients-table th:nth-child(5) { width: 20%; }
.clients-table th:nth-child(6) { width: 5%; }

.clients-table td {
  vertical-align: middle;
}

.clients-table td:nth-child(2) > .work-status-pill {
  display: inline-flex;
  width: auto;
}

.clients-table td small,
.client-table-status {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.client-progress-copy {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.client-progress-copy strong {
  font-variant-numeric: tabular-nums;
}

.client-progress-copy span,
.client-progress small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-progress-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.client-progress-foot small:last-child {
  text-align: right;
}

.client-progress-track {
  height: 6px;
  margin: 6px 0 3px;
  overflow: hidden;
  background: var(--panel-muted);
}

.client-progress-track i {
  display: block;
  height: 100%;
  background: var(--accent);
}

.client-contact-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.client-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
}

.client-stats-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-muted);
  padding: 16px;
}

.client-stats-grid span,
.client-stats-grid strong {
  display: block;
  font-family: var(--font-display);
  text-transform: uppercase;
}

.client-stats-grid span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.client-stats-grid strong {
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
}

.client-page-grid,
.client-summary-grid,
.project-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
}

.client-summary-grid {
  padding-top: 0;
}

.client-budget-visual {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 12px;
}

.client-budget-ring {
  --budget-used: 0%;
  display: grid;
  place-items: center;
  align-content: center;
  width: 156px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--panel) 0 58%, transparent 59%),
    conic-gradient(var(--accent) var(--budget-used), #e5e9ee 0);
}

.client-budget-ring strong,
.client-budget-ring span,
.client-budget-copy strong,
.client-budget-copy span {
  display: block;
}

.client-budget-ring strong {
  font-size: 30px;
  line-height: 1;
}

.client-budget-ring span,
.client-budget-copy span {
  color: var(--muted);
  font-size: 13px;
}

.client-budget-copy strong {
  font-size: 24px;
  line-height: 1.1;
}

.client-profile-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 12px;
}

.client-profile-list div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}

.client-profile-list dt {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.client-profile-list dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.project-detail-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px;
}

.project-detail-list div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.project-detail-list dt {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.project-detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.project-notes {
  margin: 0;
  padding: 12px;
  color: var(--muted);
  line-height: 1.55;
}

.client-detail-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.client-detail-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.client-detail-row strong,
.client-detail-row span {
  display: block;
}

.client-detail-row span {
  color: var(--muted);
  font-size: 13px;
}

.timer-window {
  min-height: 100vh;
}

.timer-shell {
  width: min(560px, calc(100% - 32px));
  margin: 0 auto;
  padding: 8px 0;
}

.timer-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.timer-topbar .brand-mark {
  width: 116px;
}

.timer-focus-card,
.timer-edit-card,
.timer-confirm-card {
  padding: 12px 16px;
  margin-bottom: 8px;
}

.timer-readout-large {
  display: block;
  margin: 6px 0 10px;
  font-family: var(--font-mono);
  font-size: clamp(2.45rem, 10vw, 3.9rem);
  line-height: 1;
  letter-spacing: 0;
}

.timer-controls,
.timer-duration-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.timer-duration-row label {
  flex: 1;
}

.timer-edit-card {
  display: grid;
  gap: 7px;
}

.timer-window .dialog-heading {
  gap: 8px;
}

.timer-window .dialog-heading h1 {
  font-size: 30px;
}

.timer-window label span {
  margin-bottom: 3px;
}

.timer-window input,
.timer-window select {
  min-height: 34px;
  padding: 6px 10px;
}

.timer-window textarea {
  min-height: 84px;
  padding: 10px 12px;
  font-size: 16px;
}

.timer-window .dialog-actions {
  margin-top: 6px;
}

.timer-window .dialog-actions .text-button {
  min-height: 40px;
  font-size: 17px;
}

.timer-window .timer-controls .text-button {
  min-height: 40px;
  padding: 7px 12px;
}

.timer-window .eyebrow {
  margin-bottom: 0;
}

.timer-confirm-card[hidden] {
  display: none;
}

.timer-confirm-card {
  display: grid;
  gap: 10px;
}

.timer-confirm-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.timer-confirm-grid article,
.timer-confirm-summary > div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-muted);
  padding: 10px;
}

.timer-confirm-grid span,
.timer-confirm-grid strong,
.timer-confirm-summary span,
.timer-confirm-summary strong {
  display: block;
  font-family: var(--font-display);
  text-transform: uppercase;
}

.timer-confirm-grid span,
.timer-confirm-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.timer-confirm-grid strong,
.timer-confirm-summary strong {
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.1;
}

.timer-confirm-summary {
  display: grid;
  gap: 8px;
}

.timer-confirm-summary p {
  margin-top: 5px;
  color: var(--ink);
}

.danger-icon-button {
  color: var(--accent);
}

.danger-icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 2;
}

.week-picker,
.time-actions {
  display: flex;
  align-items: end;
  gap: 8px;
}

.week-picker > div {
  min-width: 190px;
  padding: 4px 0;
}

.week-picker span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.week-picker strong {
  display: block;
  font-size: 16px;
}

.time-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.time-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.time-summary-grid article,
.retainer-panel,
.timesheet-panel,
.archive-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.time-summary-grid article {
  min-height: 86px;
  padding: 16px;
}

.time-summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.time-summary-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
}

.retainer-panel {
  margin-bottom: 12px;
}

.retainer-list {
  display: block;
  padding: 12px;
}

.time-budget-group + .time-budget-group {
  margin-top: 18px;
}

.time-budget-group-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.time-budget-group-heading h3 {
  margin: 0;
  font-family: "Oswald", sans-serif;
  font-size: 18px;
  text-transform: uppercase;
}

.time-budget-group-heading span {
  color: var(--muted);
  font-size: 13px;
}

.time-budget-group-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.retainer-row {
  display: grid;
  grid-template-columns: minmax(210px, 1.05fr) minmax(0, 1fr) minmax(150px, 0.6fr);
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.retainer-row strong,
.retainer-row span {
  display: block;
}

.retainer-row span,
.retainer-hours span {
  color: var(--muted);
  font-size: 13px;
}

.retainer-hours {
  text-align: right;
}

.meter {
  height: 7px;
  border-radius: 999px;
  background: #e5e9ee;
  margin-top: 8px;
  overflow: hidden;
}

.meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.timesheet-panel {
  overflow: hidden;
  margin-bottom: 12px;
}

.timesheet-grid {
  display: block;
  overflow-x: auto;
}

.sheet-head,
.sheet-cell,
.sheet-total,
.sheet-foot,
.sheet-project {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  min-height: 62px;
  padding: 10px;
}

.sheet-head,
.sheet-foot {
  background: var(--panel-muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.sheet-project strong,
.sheet-project span {
  display: block;
}

.sheet-project span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.time-entry {
  min-height: 40px;
  border-color: var(--line-strong);
}

.time-entry.invalid {
  border-color: var(--accent);
}

.sheet-total,
.sheet-foot {
  align-content: center;
  font-weight: 700;
}

.sheet-empty {
  grid-column: 1 / -1;
  padding: 34px;
  color: var(--muted);
  text-align: center;
}

.weekly-timesheet {
  min-width: 760px;
  padding: 14px;
}

.timesheet-day {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--panel);
}

.timesheet-day.is-expanded {
  padding-bottom: 16px;
}

.timesheet-day-toggle {
  width: 32px;
  height: 32px;
  align-self: start;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  position: relative;
}

.timesheet-day-toggle::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 10px;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 13px solid currentColor;
}

.timesheet-day-toggle[aria-expanded="true"]::before {
  border-top: 0;
  border-bottom: 13px solid currentColor;
}

.timesheet-day-toggle span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.timesheet-day-body {
  min-width: 0;
}

.timesheet-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.timesheet-day-head h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0;
}

.timesheet-day-title {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.timesheet-day-log {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
}

.timesheet-day-log:hover {
  background: var(--panel-muted);
  color: var(--accent);
}

.timesheet-day-log:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.timesheet-day-log svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.timesheet-day-head strong {
  white-space: nowrap;
  font-size: 18px;
}

.timesheet-timeline {
  position: relative;
  padding-top: 4px;
}

.timesheet-timeline.show-scale {
  padding-top: 34px;
}

.timesheet-scale,
.timesheet-ticks {
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
}

.timesheet-scale {
  top: 0;
  height: 18px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
}

.timesheet-scale span {
  position: absolute;
  transform: translateX(-50%);
}

.timesheet-ticks {
  top: 20px;
  height: 14px;
}

.timesheet-ticks i {
  position: absolute;
  bottom: 0;
  width: 1px;
  background: var(--line-strong);
  transform: translateX(-50%);
}

.timesheet-ticks .hour {
  height: 14px;
}

.timesheet-ticks .half {
  height: 10px;
}

.timesheet-ticks .quarter {
  height: 7px;
}

.timesheet-track {
  position: relative;
  height: 18px;
  border-radius: 999px;
  background: #eef0f2;
  overflow: visible;
}

.timesheet-day.is-expanded .timesheet-track {
  height: 34px;
  margin-bottom: 10px;
}

.timeline-add-entry {
  position: absolute;
  top: 50%;
  z-index: 10;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0;
  border: 2px solid var(--panel);
  border-radius: 50%;
  background: var(--ink);
  color: var(--panel);
  box-shadow: 0 4px 12px rgba(24, 23, 22, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.82);
  transition: opacity 100ms ease, transform 100ms ease, background-color 100ms ease;
}

.timeline-add-entry.is-visible,
.timeline-add-entry:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.timeline-add-entry:hover {
  background: var(--accent);
}

.timeline-add-entry:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.timeline-add-entry svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.timeline-empty-bar {
  display: block;
  height: 100%;
}

.timeline-segment {
  position: absolute;
  top: 50%;
  height: 100%;
  min-width: 14px;
  border-radius: 999px;
  background: var(--segment-color);
  color: var(--segment-text);
  transform: translateY(-50%);
  transition: box-shadow 120ms ease, filter 120ms ease, opacity 120ms ease;
}

.timesheet-day.is-expanded .timeline-segment {
  height: 28px;
  border-radius: 4px;
}

.timeline-segment.is-draggable {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.timeline-segment.is-draggable:hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 12px rgba(24, 23, 22, 0.2);
  z-index: 5;
}

.timeline-segment.is-draggable:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  z-index: 6;
}

.timeline-segment.is-dragging {
  cursor: grabbing;
  box-shadow: 0 6px 16px rgba(24, 23, 22, 0.28);
  filter: brightness(1.08);
  z-index: 8;
}

.timeline-segment.is-saving {
  cursor: wait;
  opacity: 0.68;
}

.timeline-segment-copy {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0 8px;
  overflow: hidden;
  color: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 28px;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.segment-handle {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 34px;
  border: 2px solid var(--segment-color);
  border-radius: 999px;
  background: var(--panel);
  cursor: ew-resize;
  touch-action: none;
  transform: translateY(-50%);
}

.segment-handle:hover,
.segment-handle.is-active,
.timeline-segment.is-resizing .segment-handle {
  background: var(--segment-color);
}

.timeline-segment.is-resizing {
  z-index: 8;
}

.segment-handle.start {
  left: -7px;
}

.segment-handle.end {
  right: -7px;
}

.segment-handle::after {
  content: "";
  position: absolute;
  inset: -8px -6px;
}

.timeline-break {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 22px;
  border-radius: 999px;
  background: #ee5a28;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.timeline-break-toggle {
  position: absolute;
  top: -18px;
  z-index: 9;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--break-color);
  color: #fff;
  box-shadow: none;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: opacity 100ms ease, transform 100ms ease;
}

.timeline-break-toggle::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  width: 36px;
  height: 12px;
  transform: translateX(-50%);
}

.timeline-break-toggle::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  width: 1px;
  height: 6px;
  background: var(--break-color);
  transform: translateX(-50%);
}

.timeline-break-toggle.is-active {
  background: var(--break-color);
  opacity: 1;
  pointer-events: auto;
}

.timeline-break-toggle.is-empty {
  background: var(--break-color);
  opacity: 0;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(0.82);
}

.timeline-segment:hover + .timeline-break-toggle.is-empty,
.timeline-segment:focus-visible + .timeline-break-toggle.is-empty,
.timeline-break-toggle.is-empty:hover,
.timeline-break-toggle.is-empty:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.timeline-break-toggle:hover {
  transform: translate(-50%, -50%) scale(1.08);
}

.timeline-break-toggle:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.timeline-break-toggle.is-saving {
  cursor: wait;
  opacity: 0.6;
}

.timeline-break-toggle > i {
  width: 16px;
  height: 16px;
  background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 2v2M14 2v2M6 2v2M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H5a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 2v2M14 2v2M6 2v2M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H5a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1'/%3E%3C/svg%3E") center / contain no-repeat;
}

.timeline-break-toggle > span {
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  place-items: center;
  min-width: 12px;
  height: 12px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}

@media (hover: none) {
  .timeline-break-toggle.is-empty {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
  }
}

.timesheet-day-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}

.timesheet-day-actions button {
  min-height: 30px;
  border: 1px dashed var(--accent);
  border-radius: 4px;
  background: var(--panel);
  color: var(--accent);
  font-weight: 700;
}

.timesheet-day-actions span {
  color: var(--muted);
  font-size: 12px;
}

.timeline-task-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 28px;
  margin-top: 6px;
}

.timeline-task-chips span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 800;
}

.timeline-task-chips .timeline-task-chip {
  display: block;
  max-width: min(360px, 100%);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-task-chips .muted {
  color: var(--muted);
  background: transparent;
  border: 0;
  padding-left: 0;
}

.timeline-entry-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.timeline-entry-editor {
  margin-top: 10px;
}

.timeline-entry-editor summary {
  width: max-content;
  max-width: 100%;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.timeline-entry-list p {
  margin: 0;
  color: var(--muted);
}

.timeline-entry-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 92px 92px 82px auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px;
}

.timeline-edit-log {
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 7px;
}

.timeline-entry-row span,
.timeline-entry-row strong,
.timeline-entry-row small {
  display: block;
  min-width: 0;
}

.timeline-entry-row small {
  color: var(--muted);
}

.timeline-entry-input {
  min-height: 34px;
  border-color: var(--line-strong);
}

.timeline-entry-input.duration {
  font-weight: 800;
}

.timeline-entry-input.invalid {
  border-color: var(--accent);
}

.week-total-bar {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 16px 0 4px;
}

.week-total-bar > span {
  font-size: 22px;
  color: var(--ink);
}

.week-total-days {
  display: flex;
  justify-content: center;
  gap: clamp(16px, 4vw, 42px);
}

.week-total-day {
  text-align: center;
}

.week-total-day span {
  display: block;
  font-size: 14px;
  color: var(--ink);
}

.week-total-day strong,
.week-total-bar > strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  color: var(--ink);
}

.archive-toolbar {
  display: grid;
  grid-template-columns: 150px 150px repeat(3, minmax(160px, 1fr));
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.archive-summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.archive-summary strong {
  font-size: 24px;
}

.archive-summary span {
  color: var(--muted);
  font-size: 14px;
}

.archive-list {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  padding: 12px;
}

.archive-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.archive-row strong,
.archive-row span {
  display: block;
}

.archive-row span {
  color: var(--muted);
  font-size: 13px;
}

.archive-row > div:last-child {
  text-align: right;
}

.activity-list {
  margin-top: 14px;
}

.activity-row > div:first-child {
  min-width: 0;
}

.activity-row > div:first-child span {
  overflow-wrap: anywhere;
}

.global-search-button kbd,
.global-search-dialog kbd {
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--panel-muted);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 5px;
}

.global-search-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 48px));
  border: 0;
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 24px 70px rgba(20, 18, 18, 0.32);
  padding: 0;
}

.global-search-dialog::backdrop {
  background: rgba(20, 18, 18, 0.58);
}

.global-search-shell {
  display: grid;
  grid-template-rows: auto minmax(180px, 1fr) auto;
  max-height: min(720px, calc(100vh - 48px));
}

.global-search-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 14px;
}

.global-search-head input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 17px;
}

.global-search-results {
  overflow: auto;
  padding: 8px;
}

.global-search-result {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  padding: 10px;
  cursor: pointer;
}

.global-search-result:hover,
.global-search-result:focus-visible {
  border-color: var(--line-strong);
  background: var(--panel-muted);
  outline: 0;
}

.global-search-result strong,
.global-search-result small {
  display: block;
}

.global-search-result small {
  margin-top: 2px;
  color: var(--muted);
}

.global-search-type {
  color: var(--accent-dark);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.global-search-shell footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  padding: 10px 14px;
}

.project-workspace {
  display: grid;
  gap: 12px;
}

.project-workspace-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 20px;
}

.project-workspace-header h2 {
  margin: 2px 0 10px;
  font-size: 34px;
  line-height: 1.1;
}

.project-workspace-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.project-state-badge,
.project-health-badge,
.project-code {
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--panel-muted);
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  padding: 4px 7px;
}

.project-state-badge[data-status="waiting_on_client"],
.project-health-badge[data-health="at_risk"] {
  border-color: #d59c2c;
  background: #fff2c7;
  color: #76500a;
}

.project-state-badge[data-status="blocked"],
.project-health-badge[data-health="behind"] {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent-darker);
}

.project-health-badge[data-health="on_track"] {
  border-color: #73a78a;
  background: #e2f2e8;
  color: #205c3a;
}

.project-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.project-metric-grid article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 15px;
}

.project-metric-grid span,
.project-metric-grid strong,
.project-metric-grid small {
  display: block;
}

.project-metric-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.project-metric-grid strong {
  margin: 7px 0 3px;
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1;
}

.project-metric-grid small {
  color: var(--muted);
}

.project-metric-grid .over-budget {
  border-color: var(--accent);
}

.project-risk-alert {
  border: 1px solid #d59c2c;
  border-radius: var(--radius);
  background: #fff2c7;
  color: #694708;
  font-weight: 650;
  padding: 11px 14px;
}

:root[data-theme="dark"] .project-risk-alert,
:root[data-theme="dark"] .project-state-badge[data-status="waiting_on_client"],
:root[data-theme="dark"] .project-health-badge[data-health="at_risk"] {
  background: #40351d;
  color: #f2cf79;
}

:root[data-theme="dark"] .project-health-badge[data-health="on_track"] {
  background: #1e392a;
  color: #8bd1a8;
}

.project-workspace-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.project-summary-section,
.project-task-section {
  grid-column: 1 / -1;
}

.project-detail-list.compact {
  margin-top: 18px;
}

.project-task-list {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.project-task-group {
  min-width: 0;
}

.project-task-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 6px 2px 8px;
  text-align: left;
  cursor: pointer;
}

.project-task-group-toggle:hover {
  color: var(--accent-dark);
}

.project-task-group-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.project-task-group-title svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 140ms ease;
}

.project-task-group-toggle[aria-expanded="false"] .project-task-group-title svg {
  transform: rotate(-90deg);
}

.project-task-group-title strong {
  font-family: var(--font-body);
  font-size: 15px;
  letter-spacing: 0;
}

.project-task-group-count {
  min-width: 28px;
  border-radius: 999px;
  background: var(--panel-muted);
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
}

.project-task-group-content {
  display: grid;
  gap: 6px;
  padding-top: 8px;
}

.project-task-group-content[hidden] {
  display: none;
}

.project-task-group-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 8px 2px 2px;
}

.project-task-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  padding: 10px;
  cursor: pointer;
}

.project-task-row:hover,
.project-task-row:focus-visible {
  border-color: var(--line-strong);
  background: var(--panel-muted);
  outline: 0;
}

.project-task-row small,
.project-task-row strong {
  display: block;
}

.project-task-row small,
.project-task-status {
  color: var(--muted);
  font-size: 12px;
}

.project-task-check {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.project-task-row.is-complete strong {
  color: var(--muted);
  text-decoration: line-through;
}

.project-task-row.is-complete .project-task-check {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.client-project-link {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  text-align: left;
  padding: 0;
  cursor: pointer;
}

.client-project-link:hover,
.client-project-link:focus-visible {
  color: var(--accent-dark);
  text-decoration: underline;
  outline: 0;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin-bottom: 12px;
}

.admin-header h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.admin-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-save-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-save-status {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  padding: 4px 8px;
}

.admin-save-status:empty {
  display: none;
}

.admin-save-status[data-status="saving"] {
  border-color: var(--line);
  background: var(--panel-muted);
}

.admin-save-status[data-status="saved"] {
  border-color: rgba(103, 130, 54, 0.34);
  background: rgba(103, 130, 54, 0.12);
  color: var(--green);
}

.admin-save-status[data-status="error"] {
  border-color: rgba(237, 28, 37, 0.34);
  background: rgba(237, 28, 37, 0.1);
  color: var(--accent);
}

.admin-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
  overflow-x: auto;
}

.admin-tab-button {
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 11px 10px;
  cursor: pointer;
  white-space: nowrap;
}

.admin-tab-button.active {
  border-bottom-color: var(--accent);
  color: var(--ink);
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.admin-tab-panel[hidden] {
  display: none;
}

.admin-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.work-accordion {
  overflow: hidden;
}

.work-accordion summary {
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.work-accordion summary::-webkit-details-marker {
  display: none;
}

.work-accordion .section-heading {
  margin: 0;
}

.accordion-indicator {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-muted);
  color: var(--muted);
  flex: 0 0 auto;
}

.accordion-indicator::before {
  content: "+";
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1;
}

.work-accordion[open] .accordion-indicator::before {
  content: "-";
}

.work-accordion:not([open]) .section-heading {
  border-bottom: 0;
}

.settings-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  padding: 12px;
}

.settings-form .wide {
  grid-column: 1 / -1;
}

.admin-create-form {
  align-items: end;
}

.admin-create-form textarea {
  min-height: 78px;
}

.admin-create-form button[type="submit"] {
  justify-self: start;
}

.template-help {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-muted);
  padding: 12px;
}

.template-help strong {
  font-size: 13px;
}

.template-help span {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.template-help code {
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 10px;
  font-size: 12px;
}

.client-color-list {
  display: grid;
  gap: 8px;
  max-height: 680px;
  overflow: auto;
  padding: 12px;
}

.client-color-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 10px;
}

.client-color-row span {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  min-width: 0;
}

.client-color-row input {
  width: 46px;
  min-height: 34px;
  padding: 2px;
}

.client-color-inputs {
  justify-content: flex-end;
}

.client-color-inputs small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.client-access-panel {
  gap: 16px;
}

.client-account-create-form {
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(220px, 1.3fr) auto;
  align-items: end;
  border-bottom: 1px solid var(--line);
}

.client-account-create-form .text-button {
  min-height: 44px;
}

.client-credential-result {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  margin: 12px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 7%, var(--panel));
  padding: 12px;
}

.client-credential-result[hidden] {
  display: none;
}

.client-credential-result div {
  display: grid;
  gap: 3px;
}

.client-credential-result span {
  color: var(--muted);
  font-size: 12px;
}

.client-credential-result code {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 10px 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  user-select: all;
}

.client-access-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 260px);
  gap: 10px;
  padding: 12px 12px 0;
}

.client-access-toolbar label,
.client-account-row label,
.client-registration-row label {
  display: grid;
  gap: 5px;
}

.client-access-toolbar label > span,
.client-account-row label > span,
.client-registration-row label > span,
.client-account-login > span,
.client-registration-date > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.client-account-list,
.client-registration-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.client-account-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(160px, 1fr) minmax(150px, 1fr) minmax(210px, 1.25fr) minmax(130px, 0.75fr);
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px;
  background: var(--panel);
}

.client-account-row.is-inactive {
  background: var(--panel-muted);
}

.client-account-identity,
.client-account-login,
.client-registration-contact,
.client-registration-date,
.client-registration-resolution {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.client-account-identity strong,
.client-account-login strong,
.client-registration-contact strong,
.client-registration-date strong,
.client-registration-resolution strong {
  overflow-wrap: anywhere;
}

.client-account-identity span,
.client-registration-contact span,
.client-registration-contact a,
.client-registration-resolution span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.client-account-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 2px;
}

.client-account-notifications {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.client-account-notifications summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}

.client-account-notifications summary::-webkit-details-marker {
  display: none;
}

.client-account-notifications summary::before {
  content: "+";
  width: 20px;
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1;
}

.client-account-notifications[open] summary::before {
  content: "-";
}

.client-account-notifications summary span {
  margin-right: auto;
}

.client-account-notifications summary strong {
  color: var(--muted);
  font-size: 12px;
}

.client-notification-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 8px;
  padding: 8px 0 2px 32px;
}

.client-notification-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.client-notification-options input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.client-account-notifications[data-muted] .client-notification-options label:not(.client-notification-master) {
  opacity: 0.52;
}

.text-button.danger {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  color: var(--accent);
}

.client-registration-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(150px, 0.75fr) minmax(190px, 1fr) auto;
  gap: 12px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px;
}

.client-registration-row:not(.status-pending) {
  background: var(--panel-muted);
}

.client-registration-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.client-registration-resolution {
  align-self: center;
  text-align: right;
}

.archived-task-list {
  display: grid;
  gap: 8px;
  max-height: 680px;
  overflow: auto;
  padding: 12px;
}

.archived-task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.archived-task-row strong,
.archived-task-row span {
  display: block;
}

.archived-task-row span {
  color: var(--muted);
  font-size: 13px;
}

.archived-task-row > div:last-child {
  text-align: right;
}

.archive-empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.quick-add-dialog,
.log-dialog {
  width: min(980px, calc(100% - 24px));
  border: 0;
  border-radius: 0;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
  padding: 0;
}

.log-dialog {
  width: min(1120px, calc(100% - 24px));
}

.quick-add-dialog {
  width: min(760px, calc(100% - 24px));
}

.client-edit-dialog {
  width: min(860px, calc(100% - 24px));
}

.quick-add-dialog::backdrop,
.log-dialog::backdrop {
  background: rgba(20, 24, 30, 0.42);
}

.quick-add-dialog form,
.log-dialog form {
  padding: 28px 42px 28px;
}

.quick-add-heading,
.dialog-heading,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.quick-add-heading,
.dialog-heading {
  margin-bottom: 22px;
}

.quick-add-heading h2 {
  font-size: 28px;
  line-height: 1;
}

.quick-add-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}

.quick-add-steps button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.quick-add-steps button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.quick-add-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-muted);
}

.quick-add-panel .settings-form {
  padding: 14px;
}

.quick-add-dialog input[type="color"] {
  min-height: 36px;
  padding: 3px;
}

.log-title-row {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.log-title-stack {
  display: grid;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.log-title-row h2 {
  font-size: 24px;
}

.log-task-pill {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  max-width: min(420px, 58vw);
  border-radius: 999px;
  background: var(--log-color, #b84fa2);
  color: var(--log-text-color, #fff);
  font-size: 21px;
  font-weight: 700;
  padding: 9px 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.log-project-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.8fr) minmax(180px, 1fr) minmax(240px, 1.5fr) 170px;
  gap: 12px;
  align-items: end;
  max-width: none;
}

.time-readout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-muted);
  color: var(--ink);
  padding: 7px 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
}

.time-readout::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-sizing: border-box;
}

.time-readout i {
  width: 14px;
  height: 1px;
  background: var(--muted);
}

.time-readout span {
  display: inline;
  margin: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

.timeline-card {
  margin: 6px 0 28px;
}

.timeline-scale {
  position: relative;
  width: calc(100% - 24px);
  height: 18px;
  margin: 0 auto 2px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
}

.timeline-scale span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  min-width: 18px;
  text-align: center;
}

.timeline-ticks {
  position: relative;
  width: calc(100% - 24px);
  height: 26px;
  margin: 0 auto 4px;
}

.timeline-ticks i {
  display: block;
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  width: 1px;
  background: var(--line-strong);
}

.timeline-ticks i.hour {
  height: 22px;
}

.timeline-ticks i.half {
  height: 16px;
}

.timeline-ticks i.quarter {
  height: 11px;
}

.timeline-track {
  position: relative;
  height: 48px;
  margin: 0 auto;
  width: calc(100% - 24px);
}

.timeline-track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 19px;
  height: 12px;
  border-radius: 999px;
  background: var(--line);
}

.timeline-fill {
  --start: 0%;
  --end: 8%;
  position: absolute;
  left: var(--start);
  right: calc(100% - var(--end));
  top: 19px;
  height: 12px;
  border-radius: 999px;
  background: var(--log-color, #b84fa2);
  pointer-events: none;
}

.timeline-track:hover::before {
  background: var(--line-strong);
}

.timeline-track:hover .timeline-fill {
  filter: saturate(1.08);
}

.break-markers {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.break-marker {
  --break-left: 50%;
  position: absolute;
  left: var(--break-left);
  top: 14px;
  transform: translateX(-50%);
  pointer-events: none;
  text-align: center;
}

.break-marker i {
  display: block;
  width: 18px;
  height: 24px;
  border-radius: 999px;
  background: var(--orange);
  margin: 0 auto 6px;
}

.break-marker span {
  display: block;
  min-width: 64px;
  color: var(--accent-darker);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.timeline-range {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
  appearance: none;
}

.timeline-range.start {
  z-index: 2;
}

.timeline-range.end {
  z-index: 3;
}

.timeline-range::-webkit-slider-runnable-track {
  height: 48px;
  background: transparent;
}

.timeline-range::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 44px;
  border: 3px solid var(--log-color, #b84fa2);
  border-radius: 999px;
  background: var(--panel);
  cursor: ew-resize;
  pointer-events: auto;
  margin-top: 2px;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.timeline-range::-webkit-slider-thumb:hover {
  background: var(--accent-tint);
  box-shadow: 0 0 0 5px rgba(237, 28, 37, 0.14);
  transform: scale(1.05);
}

.timeline-range::-moz-range-track {
  height: 48px;
  background: transparent;
}

.timeline-range::-moz-range-thumb {
  width: 18px;
  height: 44px;
  border: 3px solid var(--log-color, #b84fa2);
  border-radius: 999px;
  background: var(--panel);
  cursor: ew-resize;
  pointer-events: auto;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.timeline-range::-moz-range-thumb:hover {
  background: var(--accent-tint);
  box-shadow: 0 0 0 5px rgba(237, 28, 37, 0.14);
  transform: scale(1.05);
}

.timeline-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 0 8px;
}

.dialog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.dialog-grid .wide {
  grid-column: 1 / -1;
}

textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  color: var(--ink);
  padding: 10px 12px;
  resize: vertical;
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
}

.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-label.compact {
  gap: 5px;
}

.check-label input {
  width: 18px;
  min-height: 18px;
}

.check-label span {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.log-description-head {
  display: grid;
  grid-template-columns: auto auto 36px minmax(80px, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.inline-label span {
  color: var(--ink);
  font-size: 18px;
  font-weight: 500;
  margin: 0;
}

.icon-button.small {
  width: 28px;
  height: 28px;
  min-height: 28px;
  border-radius: 0;
  font-weight: 700;
}

.break-summary {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.day-total {
  font-family: var(--font-mono);
  font-size: 28px;
  line-height: 1;
  text-align: right;
}

.dialog-options {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-top: 20px;
}

.dialog-actions {
  justify-content: flex-end;
  margin-top: 24px;
}

.dialog-actions .text-button {
  min-width: 150px;
  min-height: 56px;
  border-radius: 0;
  font-size: 22px;
}

.dialog-actions .text-button.primary {
  background: var(--accent);
  border-color: var(--accent);
}

.save-log-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.save-log-button::before {
  content: "";
  display: none;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.log-dialog.is-saving .save-log-button::before {
  display: inline-block;
}

.log-dialog.is-saving textarea,
.log-dialog.is-saving select,
.log-dialog.is-saving input,
.log-dialog.is-saving .icon-button {
  pointer-events: none;
}

:root[data-theme="dark"] .identity-card,
:root[data-theme="dark"] .account-menu,
:root[data-theme="dark"] .account-menu-button,
:root[data-theme="dark"] .account-menu-status,
:root[data-theme="dark"] .stats-grid article,
:root[data-theme="dark"] .toolbar,
:root[data-theme="dark"] .sidebar,
:root[data-theme="dark"] .task-panel,
:root[data-theme="dark"] .time-toolbar,
:root[data-theme="dark"] .time-summary-grid article,
:root[data-theme="dark"] .retainer-panel,
:root[data-theme="dark"] .timesheet-panel,
:root[data-theme="dark"] .archive-panel,
:root[data-theme="dark"] .admin-header,
:root[data-theme="dark"] .admin-panel,
:root[data-theme="dark"] .work-categories,
:root[data-theme="dark"] .work-projects-panel,
:root[data-theme="dark"] .work-overview-grid article,
:root[data-theme="dark"] .clients-page-panel,
:root[data-theme="dark"] .weekly-status-panel,
:root[data-theme="dark"] .client-page-panel,
:root[data-theme="dark"] .client-page-section,
:root[data-theme="dark"] .timer-focus-card,
:root[data-theme="dark"] .timer-edit-card,
:root[data-theme="dark"] .timer-confirm-card,
:root[data-theme="dark"] .quick-add-menu,
:root[data-theme="dark"] .quick-add-dialog,
:root[data-theme="dark"] .log-dialog {
  background: var(--panel);
  border-color: var(--line);
}

:root[data-theme="dark"] .task-card,
:root[data-theme="dark"] .retainer-row,
:root[data-theme="dark"] .timesheet-day,
:root[data-theme="dark"] .timeline-entry-row,
:root[data-theme="dark"] .archive-row,
:root[data-theme="dark"] .client-detail-row,
:root[data-theme="dark"] .client-color-row,
:root[data-theme="dark"] .archived-task-row,
:root[data-theme="dark"] .work-project-table tbody tr {
  background: #262121;
}

:root[data-theme="dark"] .weekly-status-table th {
  background: var(--panel);
}

:root[data-theme="dark"] .weekly-status-table tbody tr:nth-child(odd) {
  background: #262121;
}

:root[data-theme="dark"] .timesheet-track {
  background: #353130;
}

:root[data-theme="dark"] .segment-handle,
:root[data-theme="dark"] .timesheet-day-actions button {
  background: var(--panel);
}

:root[data-theme="dark"] .task-skeleton-list i {
  background:
    linear-gradient(90deg, #262121 25%, #2e2d2e 38%, #262121 63%) 0 0 / 240% 100%,
    var(--panel);
}

:root[data-theme="dark"] .client-group:hover,
:root[data-theme="dark"] .client-group.active,
:root[data-theme="dark"] .sheet-head,
:root[data-theme="dark"] .sheet-foot,
:root[data-theme="dark"] .template-help,
:root[data-theme="dark"] .time-readout,
:root[data-theme="dark"] .quick-add-panel,
:root[data-theme="dark"] .quick-add-menu button:hover,
:root[data-theme="dark"] .quick-add-menu button:focus-visible,
:root[data-theme="dark"] .task-view-toggle {
  background: var(--panel-muted);
}

:root[data-theme="dark"] .view-mode-button.active {
  background: #f7f4ef;
  color: #1a1718;
}

:root[data-theme="dark"] .quick-add-dialog::backdrop,
:root[data-theme="dark"] .log-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

:root[data-theme="dark"] .text-button.primary:hover,
:root[data-theme="dark"] .dialog-actions .text-button.primary:hover {
  border-color: #f7f4ef;
  background: #f7f4ef;
  color: #1a1718;
}

:root[data-theme="dark"] ::placeholder {
  color: #8f8780;
}

@media (max-width: 1100px) {
  .app-section-sidebar {
    display: none;
  }

  .app-rail {
    display: grid;
  }

  .app-shell {
    width: calc(100% - 104px);
    margin-left: 88px;
    margin-right: 16px;
  }

  .primary-tabs {
    display: flex;
  }

  .toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .log-project-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status-meeting-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-board-panel {
    grid-template-columns: 1fr;
  }

  .work-categories {
    position: static;
    max-height: none;
  }

  .work-category-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .time-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .archive-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .time-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .calendar-loose-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar {
    position: static;
    max-height: 280px;
  }

  .week-total-bar {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .week-total-days {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  body {
    padding-bottom: 74px;
  }

  .log-project-row {
    grid-template-columns: 1fr;
  }

  .content-grid .task-panel {
    order: 1;
  }

  .content-grid .sidebar {
    order: 2;
  }

  .task-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .task-heading .section-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .task-heading .task-view-toggle,
  .task-heading #clearDoneButton {
    grid-column: 1 / -1;
  }

  .task-heading .view-mode-button {
    flex: 1;
  }

  button.pill,
  .inline-action,
  .view-mode-button {
    min-height: 44px;
  }

  .client-page-hero {
    flex-direction: column;
  }

  .client-page-hero .section-actions {
    width: 100%;
  }

  .client-logo-frame {
    width: 60px;
    height: 60px;
    flex-basis: 60px;
  }

  .global-search-button span,
  .global-search-button kbd {
    display: none;
  }

  .project-workspace-header {
    flex-direction: column;
  }

  .project-workspace-header .section-actions {
    width: 100%;
  }

  .project-workspace-grid {
    grid-template-columns: 1fr;
  }

  .project-summary-section,
  .project-task-section {
    grid-column: auto;
  }

  .app-rail {
    inset: auto 0 0 0;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: none;
    width: auto;
    height: 66px;
    border-top: 1px solid var(--line);
    border-right: 0;
    padding: 6px 10px;
  }

  .rail-brand {
    display: none;
  }

  .rail-nav {
    grid-column: 1 / 6;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    margin: 0;
  }

  .rail-link,
  .rail-add {
    width: 100%;
    min-height: 52px;
  }

  .rail-add {
    grid-column: 6;
  }

  .app-shell {
    width: min(100% - 20px, 1480px);
    margin: 0 auto;
    padding-top: 14px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    flex-wrap: wrap;
    max-width: 100%;
  }

  .sync-status {
    min-width: 0;
    text-align: left;
  }

  .stats-grid,
  .work-overview-grid,
  .toolbar,
  .status-meeting-toolbar,
  .time-toolbar,
  .time-summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .time-budget-group-grid {
    grid-template-columns: 1fr 1fr;
  }

  .client-stats-grid,
  .work-category-list,
  .client-summary-grid,
  .client-page-grid,
  .project-page-grid,
  .timer-confirm-grid {
    grid-template-columns: 1fr 1fr;
  }

  .toolbar label:first-child {
    grid-column: 1 / -1;
  }

  .work-project-tools {
    grid-template-columns: 1fr;
    min-width: 100%;
  }

  .task-card {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .task-card .task-card-side {
    grid-column: 2;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "date date"
      "complete actions";
    min-width: 0;
  }

  .calendar-month {
    overflow-x: auto;
  }

  .calendar-grid {
    min-width: 760px;
  }

  .calendar-loose-grid {
    grid-template-columns: 1fr;
  }

  .calendar-task-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .task-date {
    text-align: left;
  }

  .retainer-row,
  .archive-row,
  .timeline-entry-row,
  .admin-grid,
  .dialog-grid {
    grid-template-columns: 1fr;
  }

  .weekly-timesheet {
    min-width: 620px;
  }

  .timesheet-day {
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 10px;
  }

  .timesheet-day-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .timesheet-day-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .log-dialog form {
    padding: 22px;
  }

  .quick-add-dialog form {
    padding: 22px;
  }

  .quick-add-heading {
    align-items: flex-start;
  }

  .log-title-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .log-description-head {
    grid-template-columns: 1fr auto auto;
  }

  .break-summary,
  .day-total {
    grid-column: 1 / -1;
    text-align: left;
  }

  .retainer-hours,
  .archive-row > div:last-child {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .stats-grid,
  .toolbar,
  .time-toolbar,
  .time-summary-grid,
  .client-stats-grid,
  .client-summary-grid,
  .client-page-grid,
  .timer-confirm-grid,
  .archive-toolbar,
    .settings-form {
    grid-template-columns: 1fr;
  }

  .time-budget-group-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .time-budget-group-grid {
    grid-template-columns: 1fr;
  }

  .project-metric-grid {
    grid-template-columns: 1fr;
  }

  .project-task-row {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .project-task-status {
    grid-column: 2;
  }

  .global-search-result {
    grid-template-columns: 1fr;
  }

  .client-budget-visual,
  .client-profile-list {
    grid-template-columns: 1fr;
  }

  .time-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .dialog-actions,
  .dialog-options {
    align-items: stretch;
    flex-direction: column;
  }

  .quick-add-nav {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }

  .quick-add-menu {
    right: auto;
    left: 0;
    width: min(100vw - 40px, 260px);
  }

  .account-menu {
    right: 0;
    width: min(100vw - 28px, 320px);
  }

  .quick-add-steps {
    grid-template-columns: 1fr;
  }

  .quick-add-heading {
    flex-direction: column;
  }

  .dialog-actions .text-button {
    width: 100%;
  }
}

/* Signed-out gateway and client workspace */
.auth-gateway {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-height: 100dvh;
  overflow: hidden;
  background: #161616;
  color: #fff;
}

.auth-gateway-brand {
  position: absolute;
  inset: 28px 32px auto;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  pointer-events: none;
}

.auth-gateway-brand img {
  width: min(210px, 28vw);
  filter: brightness(0) invert(1);
}

.auth-gateway-brand span {
  max-width: 360px;
  font-size: 14px;
  font-weight: 650;
  text-align: right;
}

.auth-gateway-panel {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-width: 0;
  min-height: 100dvh;
  background-position: center;
  background-size: cover;
  isolation: isolate;
  transition: flex-grow 260ms ease, filter 260ms ease;
}

.auth-gateway-panel::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(12, 12, 12, 0.12) 18%, rgba(12, 12, 12, 0.88) 100%);
  content: "";
  transition: background-color 260ms ease;
}

.auth-gateway-panel:hover::before,
.auth-gateway-panel:focus-within::before {
  background-color: rgba(225, 27, 34, 0.2);
}

.auth-gateway-employee {
  background-image: url("assets/landing/employee-planning-wall.webp");
}

.auth-gateway-client {
  border-left: 1px solid rgba(255, 255, 255, 0.3);
  background-image: url("assets/landing/client-review-table.webp");
}

.auth-gateway-copy {
  width: min(620px, 100%);
  padding: 44px 6vw 54px;
}

.auth-gateway-copy h1 {
  margin: 0 0 12px;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(42px, 5vw, 78px);
  font-weight: 650;
  letter-spacing: 0;
  line-height: 0.98;
  text-transform: uppercase;
}

.auth-gateway-copy p {
  max-width: 480px;
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 17px;
}

.gateway-button {
  min-height: 48px;
  border: 1px solid #fff;
  border-radius: var(--radius);
  background: #fff;
  color: #181818;
  padding: 10px 18px;
  cursor: pointer;
  font-weight: 750;
}

.gateway-button:hover,
.gateway-button:focus-visible {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.gateway-link {
  display: block;
  border: 0;
  background: transparent;
  color: #fff;
  margin-top: 14px;
  padding: 4px 0;
  cursor: pointer;
  font-weight: 650;
}

.gateway-link:hover,
.gateway-link:focus-visible {
  color: #fff;
  text-decoration: underline;
}

.portal-dialog {
  width: min(620px, calc(100vw - 28px));
  border: 0;
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  padding: 0;
}

.portal-dialog::backdrop {
  background: rgba(18, 18, 18, 0.66);
}

.portal-dialog form {
  display: grid;
  gap: 18px;
  padding: 28px;
}

.portal-dialog label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.portal-dialog input,
.portal-dialog select,
.portal-dialog textarea {
  width: 100%;
}

.auth-dialog {
  width: min(460px, calc(100vw - 28px));
}

.portal-google-sign-in {
  min-height: 44px;
}

.portal-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-error {
  border: 1px solid var(--accent);
  background: var(--accent-tint);
  color: var(--accent-darker);
  margin: 0;
  padding: 10px 12px;
}

.form-status {
  border: 1px solid var(--green);
  background: color-mix(in srgb, var(--green) 12%, var(--panel));
  margin: 0;
  padding: 10px 12px;
}

.review-options {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.review-options label {
  display: flex;
  align-items: center;
}

.review-options input {
  width: auto;
}

.client-portal {
  min-height: 100vh;
  background: var(--page);
}

.client-portal-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  min-height: 78px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  padding: 14px max(24px, calc((100vw - 1320px) / 2));
  backdrop-filter: blur(14px);
}

.client-portal-header img {
  width: 150px;
}

.portal-brand-dark {
  display: none;
}

:root[data-theme="dark"] .portal-brand-light {
  display: none;
}

:root[data-theme="dark"] .portal-brand-dark {
  display: block;
}

.client-portal-identity {
  display: grid;
}

.client-portal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.client-portal-actions .theme-toggle {
  flex: 0 0 42px;
}

.client-portal-header span {
  color: var(--muted);
  font-size: 13px;
}

.client-portal-main {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  padding: 42px 0 64px;
}

.client-portal-welcome {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.client-portal-welcome h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(38px, 5vw, 64px);
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
}

.client-portal-welcome p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.client-portal-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.client-portal-stats article,
.client-portal-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.client-portal-stats article {
  display: grid;
  gap: 4px;
  min-height: 116px;
  padding: 18px;
}

.client-portal-stats .portal-retainer-stat {
  grid-template-columns: 80px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.portal-retainer-stat .budget-circle,
.portal-project-card .portal-project-progress {
  width: 80px;
}

.portal-retainer-stat .budget-circle strong,
.portal-project-card .portal-project-progress strong {
  font-size: 22px;
}

.portal-retainer-stat .budget-circle span,
.portal-project-card .portal-project-progress span {
  font-size: 11px;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

.portal-retainer-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.portal-retainer-copy strong {
  font-size: 18px;
}

.client-portal-stats span,
.client-portal-stats small {
  color: var(--muted);
  font-size: 13px;
}

.client-portal-stats strong {
  font-size: 28px;
}

.client-portal-section {
  overflow: hidden;
  margin-bottom: 18px;
}

.client-portal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
}

.portal-project-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-project-card {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 16px;
  min-height: 156px;
  border-top: 1px solid var(--line);
  padding: 20px;
}

.portal-project-card:nth-child(even) {
  border-left: 1px solid var(--line);
}

.portal-project-copy {
  min-width: 0;
}

.portal-project-copy h3,
.portal-list-item h3 {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  letter-spacing: 0;
}

.portal-project-copy p,
.portal-list-item p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.portal-project-meta,
.portal-list-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 12px;
}

.portal-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 18px 20px;
}

.portal-list-actions {
  justify-content: flex-end;
  margin-top: 0;
}

.portal-empty {
  color: var(--muted);
  padding: 30px 20px;
  text-align: center;
}

@media (hover: hover) and (min-width: 781px) {
  .auth-gateway {
    display: flex;
  }

  .auth-gateway-panel {
    flex: 1 1 50%;
  }

  .auth-gateway-panel:hover,
  .auth-gateway-panel:focus-within {
    flex-grow: 1.08;
  }
}

@media (max-width: 780px) {
  .auth-gateway {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    overflow-y: auto;
  }

  .auth-gateway-brand {
    inset: 20px 20px auto;
  }

  .auth-gateway-brand span {
    display: none;
  }

  .auth-gateway-panel {
    min-height: clamp(520px, 70svh, 620px);
  }

  .auth-gateway-client {
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-left: 0;
  }

  .auth-gateway-copy {
    padding: 90px 24px 34px;
  }

  .client-portal-header {
    gap: 12px;
    padding: 12px 16px;
  }

  .client-portal-header img {
    width: 112px;
  }

  .client-portal-identity {
    display: none;
  }

  .client-portal-header {
    grid-template-columns: 1fr auto;
  }

  .client-portal-main {
    width: min(100% - 24px, 1320px);
    padding-top: 24px;
  }

  .client-portal-welcome,
  .client-portal-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .client-portal-stats,
  .portal-project-list,
  .portal-form-grid {
    grid-template-columns: 1fr;
  }

  .portal-project-card:nth-child(even) {
    border-left: 0;
  }
}

/* Impeccable refinement: operational hierarchy, access, and responsive controls. */
::selection {
  background: var(--accent);
  color: #ffffff;
}

html {
  scrollbar-color: var(--line-strong) var(--panel-muted);
  scrollbar-width: thin;
}

* {
  caret-color: var(--accent);
}

:where(button, a, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  box-shadow: none;
}

.section-link:focus-visible,
.rail-link:focus-visible,
.rail-add:focus-visible,
.quick-add-menu button:focus-visible,
.global-search-result:focus-visible,
.project-task-row:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.page-subtitle {
  max-width: 70ch;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.project-client-context {
  min-height: 32px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}

.project-client-context:hover {
  color: var(--ink);
  text-decoration-color: currentColor;
}

.topbar {
  min-height: 58px;
  margin-bottom: 14px;
}

.brand-heading h1 {
  font-size: 34px;
  line-height: 1;
}

.build-status strong {
  font-family: var(--font-mono);
  font-size: 12px;
}

.section-search[hidden] {
  display: none;
}

.section-search span,
.section-nav-label,
.rail-link span {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0;
}

.section-link span,
.text-button,
.view-mode-button,
.admin-tab-button,
label span,
.stats-grid span,
.time-summary-grid span,
.inline-action,
.week-picker span,
.week-picker strong {
  font-family: var(--font-body);
  letter-spacing: 0;
  text-transform: none;
}

.section-quick-add,
.rail-add,
.text-button.primary,
.dialog-actions .text-button.primary {
  border-color: var(--primary-bg);
  background: var(--primary-bg);
  color: var(--primary-fg);
}

.section-quick-add:hover,
.rail-add:hover,
.text-button.primary:hover,
.dialog-actions .text-button.primary:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--panel);
}

.stats-grid {
  gap: 8px;
}

.stats-grid article {
  min-height: 72px;
  box-shadow: none;
  padding: 12px 14px;
}

.stats-grid strong {
  margin-top: 4px;
  font-size: 27px;
}

.stats-grid span,
.time-summary-grid span {
  font-size: 12px;
  font-weight: 700;
}

.view-mode-button span,
.section-heading .view-mode-button span {
  color: inherit;
}

.toolbar,
.time-toolbar,
.admin-header,
.work-overview-grid article,
.time-summary-grid article {
  box-shadow: none;
}

.task-card {
  will-change: auto;
}

.task-card.pressing,
.task-card.dragging,
.task-card.drag-preview {
  will-change: transform, box-shadow;
}

.task-drag-handle,
.task-copy-button,
.task-edit-button,
.icon-button.small {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
}

.timesheet-day-actions button {
  width: auto;
  min-width: max-content;
  min-height: 44px;
  padding: 8px 12px;
  white-space: nowrap;
}

.action-menu {
  position: relative;
}

.action-menu summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  list-style: none;
  cursor: pointer;
}

.action-menu summary::-webkit-details-marker {
  display: none;
}

.action-menu summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.action-menu[open] summary::after {
  transform: translateY(2px) rotate(225deg);
}

.action-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  display: grid;
  width: 180px;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-lift);
  padding: 6px;
}

.action-menu-panel .text-button {
  width: 100%;
  justify-content: flex-start;
}

.admin-section-select {
  display: none;
  margin-bottom: 12px;
}

.admin-save-status[data-status="dirty"] {
  border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 12%, transparent);
  color: var(--ink);
}

.weekly-status-table th {
  top: 0;
  box-shadow: 0 1px 0 var(--line);
}

.weekly-status-table td:nth-child(5) {
  white-space: nowrap;
}

.weekly-status-table td:nth-child(7) {
  width: 34%;
  min-width: 280px;
}

.notes-disclosure summary {
  color: var(--ink);
  cursor: pointer;
  font-weight: 650;
}

.notes-disclosure p {
  max-width: 70ch;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.dialog-close {
  flex: 0 0 44px;
}

.dialog-close .button-icon {
  width: 18px;
  height: 18px;
}

.app-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--panel);
  box-shadow: var(--shadow-lift);
  padding: 12px 14px;
}

.app-toast .text-button {
  min-height: 36px;
  border-color: currentColor;
  color: inherit;
}

.app-toast[hidden] {
  display: none;
}

@media (max-width: 1100px) {
  .rail-nav {
    gap: 6px;
  }

  .rail-link,
  .rail-add {
    width: 56px;
    min-height: 56px;
  }
}

@media (max-width: 720px) {
  body {
    padding-bottom: 82px;
  }

  .app-rail {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    height: 74px;
  }

  .rail-nav {
    grid-column: 1 / 7;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .rail-add {
    grid-column: 7;
  }

  .rail-link,
  .rail-add {
    min-width: 44px;
    min-height: 58px;
  }

  .brand-heading h1 {
    font-size: 30px;
  }

  .topbar {
    flex-direction: row;
    align-items: center;
  }

  .topbar-actions {
    flex-wrap: nowrap;
  }

  .task-stats-grid {
    grid-template-columns: repeat(4, minmax(92px, 1fr));
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .task-stats-grid article {
    min-height: 66px;
  }

  .task-card {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .task-card .task-card-side {
    grid-column: 2;
    min-width: 0;
  }

  .admin-tabs {
    display: none;
  }

  .admin-section-select {
    display: grid;
    gap: 5px;
  }

  .action-menu-panel {
    right: auto;
    left: 0;
  }

  .app-toast {
    right: 16px;
    bottom: 90px;
  }
}

@media (max-width: 480px) {
  .topbar-actions .timer-launch-button span {
    display: none;
  }

  .page-subtitle {
    display: none;
  }

  .stats-grid.task-stats-grid {
    grid-template-columns: repeat(4, minmax(86px, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  html:focus-within {
    scroll-behavior: auto !important;
  }

  .loading-spinner,
  .task-skeleton-list i,
  .save-spinner,
  .timer-running-dot {
    animation: none !important;
    border-color: var(--line-strong);
    border-top-color: var(--accent);
  }

  .task-card,
  button,
  input,
  select,
  textarea,
  .account-menu,
  .app-toast {
    transition: none !important;
  }
}

input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]),
select,
.text-button,
.icon-button {
  min-height: 44px;
}

/* Operational typography: Oswald is reserved for primary section headings. */
body * {
  font-family: var(--font-body) !important;
  letter-spacing: 0;
}

body h1,
body h1 *,
body h2,
body h2 * {
  font-family: var(--font-display) !important;
}

body code,
body kbd,
body pre,
body .build-status strong,
body .project-code {
  font-family: var(--font-mono) !important;
}

/* Dense project register: one primary line and one compact status line. */
.work-project-table {
  min-width: 1120px;
  table-layout: fixed;
}

.work-project-table th,
.work-project-table td {
  padding: 8px 12px;
}

.work-project-table th:nth-child(1),
.work-project-table td:nth-child(1) {
  width: 15%;
}

.work-project-table th:nth-child(2),
.work-project-table td:nth-child(2) {
  width: 30%;
}

.work-project-table th:nth-child(3),
.work-project-table td:nth-child(3),
.work-project-table th:nth-child(4),
.work-project-table td:nth-child(4) {
  width: 8%;
  white-space: nowrap;
}

.work-project-table th:nth-child(5),
.work-project-table td:nth-child(5) {
  width: 11%;
  white-space: nowrap;
}

.work-project-table th:nth-child(6),
.work-project-table td:nth-child(6) {
  width: 10%;
  white-space: nowrap;
}

.work-project-table th:nth-child(7),
.work-project-table td:nth-child(7) {
  width: 18%;
}

.work-project-name-row {
  min-width: 0;
}

.work-project-link {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-edit-project {
  flex: 0 0 auto;
}

.work-project-table td:nth-child(2) > span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-client-link,
.work-status-pill {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.budget-circle-cell {
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}

.budget-circle {
  width: 64px;
}

.budget-circle strong {
  font-size: 18px;
}

.budget-circle-copy {
  min-width: 0;
}

.budget-circle-copy strong,
.budget-circle-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.retainer-row .budget-circle-cell {
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 12px;
}

.retainer-row .budget-circle {
  width: 80px;
}

.retainer-row .budget-circle strong {
  font-size: 22px;
}

.retainer-row .budget-circle span {
  font-size: 10px;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

/* Coming Soon roadmap */
.roadmap-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.roadmap-heading {
  margin: 0;
  padding: 18px 20px;
}

.roadmap-heading > div {
  min-width: 0;
}

.roadmap-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 2fr) repeat(3, minmax(140px, 1fr));
  gap: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--panel-muted);
  padding: 14px 20px;
}

.roadmap-toolbar label,
.roadmap-form-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.roadmap-toolbar label > span,
.roadmap-form-grid label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.roadmap-toolbar input,
.roadmap-toolbar select {
  width: 100%;
  min-width: 0;
}

.roadmap-groups {
  display: grid;
}

.roadmap-group + .roadmap-group {
  border-top: 2px solid var(--line-strong);
}

.roadmap-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-muted);
  padding: 11px 20px;
}

.roadmap-group-heading h3 {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 750;
  letter-spacing: 0;
}

.roadmap-group-heading span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.roadmap-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  min-height: 104px;
  border-bottom: 1px solid var(--line);
  padding: 16px 20px;
}

.roadmap-item:last-child {
  border-bottom: 0;
}

.roadmap-item[data-status="completed"] .roadmap-item-copy > strong,
.roadmap-item[data-status="completed"] .roadmap-item-copy > p {
  color: var(--muted);
  text-decoration: line-through;
}

.roadmap-check {
  display: grid;
  place-items: center;
  min-width: 26px;
  min-height: 34px;
}

.roadmap-check input {
  width: 21px;
  height: 21px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.roadmap-check input:disabled {
  cursor: default;
}

.roadmap-item-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.roadmap-item-copy > strong {
  font-size: 16px;
  line-height: 1.35;
}

.roadmap-item-copy > p {
  max-width: 820px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.roadmap-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 12px;
  color: var(--muted);
  font-size: 12px;
}

.roadmap-priority,
.roadmap-status {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--panel-muted);
  color: var(--ink);
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.2;
}

.roadmap-priority[data-priority="now"] {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent-darker);
}

.roadmap-priority[data-priority="later"] {
  color: var(--muted);
}

.roadmap-status[data-status="blocked"] {
  border-color: var(--accent);
  color: var(--accent-darker);
}

.roadmap-status[data-status="completed"] {
  border-color: var(--green);
  color: var(--green);
}

.roadmap-item-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 190px;
}

.roadmap-status-select {
  width: 150px;
  min-height: 40px;
}

.roadmap-edit-button {
  flex: 0 0 auto;
}

.roadmap-dialog {
  width: min(720px, calc(100vw - 32px));
}

.roadmap-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.roadmap-form-grid .wide-field {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .client-account-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-account-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-account-identity,
  .client-account-actions {
    grid-column: 1 / -1;
  }

  .client-notification-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-registration-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-registration-actions,
  .client-registration-resolution {
    justify-content: flex-start;
    text-align: left;
  }

  .roadmap-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .roadmap-item {
    grid-template-columns: 26px minmax(0, 1fr);
  }

  .roadmap-item-controls {
    grid-column: 2;
    justify-content: flex-start;
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .client-account-create-form,
  .client-access-toolbar,
  .client-account-row,
  .client-registration-row,
  .client-credential-result {
    grid-template-columns: 1fr;
  }

  .client-account-identity,
  .client-account-actions {
    grid-column: auto;
  }

  .client-account-actions,
  .client-registration-actions {
    justify-content: stretch;
  }

  .client-account-actions .text-button,
  .client-registration-actions .text-button {
    flex: 1 1 150px;
  }

  .client-notification-options {
    grid-template-columns: 1fr;
    padding-left: 0;
  }

  .app-rail {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .rail-nav {
    grid-column: 1 / 8;
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .rail-add {
    grid-column: 8;
  }

  .roadmap-toolbar,
  .roadmap-form-grid {
    grid-template-columns: 1fr;
  }

  .roadmap-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .roadmap-form-grid .wide-field {
    grid-column: auto;
  }

  .roadmap-heading,
  .roadmap-toolbar,
  .roadmap-group-heading,
  .roadmap-item {
    padding-right: 14px;
    padding-left: 14px;
  }
}

@media (max-width: 480px) {
  .roadmap-heading {
    align-items: flex-start;
  }

  .roadmap-heading .text-button span,
  .rail-link span {
    display: none;
  }

  .roadmap-item {
    gap: 10px;
  }

  .roadmap-item-controls {
    flex-wrap: wrap;
  }

  .roadmap-status-select {
    width: min(100%, 190px);
  }
}
