:root {
  --navy: #0d1821;
  --cream: #f2efe9;
  --copper: #cba88a;
  --blue: #064ca0;
  --blue-soft: #eef5ff;
  --ink: #1a1a1a;
  --muted: rgba(26, 26, 26, 0.62);
  --muted-light: rgba(255, 255, 255, 0.5);
  --line: rgba(13, 24, 33, 0.1);
  --dark-line: rgba(255, 255, 255, 0.1);
  --panel: #ffffff;
  --utility-soft: #eef2f4;
  --warning: #8a5a12;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--cream);
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family:
    Raleway, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-size: 14px;
}

body:has(.signed-in-shell.has-selected-client) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0) 340px),
    var(--cream);
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid var(--navy);
  background: var(--navy);
  color: #fff;
  border-radius: 6px;
  padding: 8px 13px;
  cursor: pointer;
}

button.secondary {
  background: #fff;
  color: var(--navy);
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
}

svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.hidden {
  display: none !important;
}

.loading-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--cream);
  color: var(--ink);
  padding: 16px;
}

.loading-mark {
  display: grid;
  justify-items: center;
  gap: 16px;
  text-align: center;
}

.loading-mark h1 {
  margin: 0;
  font-size: 31px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.1;
}

.loading-mark h1::after {
  content: "";
  display: block;
  width: 40px;
  height: 2px;
  margin: 13px auto 0;
  background: var(--copper);
}

.loading-mark h1 span {
  color: #8fa08b;
}

.loading-mark p {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.2px;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--navy);
  padding: 16px;
}

.login-card {
  position: relative;
  width: min(100%, 430px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.32);
  padding: 48px;
  backdrop-filter: blur(6px);
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--copper), #e2c6a8, #8fa08b);
}

.login-brand {
  display: grid;
  place-items: center;
  padding: 0;
}

.login-logo {
  width: 160px;
  height: auto;
  display: block;
}

.login-heading,
.login-form,
.login-message,
#login-signout {
  margin-right: 0;
  margin-left: 0;
}

.login-heading {
  position: relative;
  margin-bottom: 38px;
  padding-top: 15px;
  text-align: center;
}

.login-heading::after {
  content: "";
  display: block;
  width: 40px;
  height: 2px;
  margin: 13px auto 0;
  background: var(--copper);
}

.login-heading h1 {
  margin-bottom: 0;
  color: var(--copper);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.35px;
  line-height: 1.2;
}

.login-form {
  display: grid;
  gap: 8px;
  padding: 0;
}

.login-form label {
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
}

.login-form input {
  min-height: 45px;
  border-color: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  padding: 11px 14px;
}

.login-form input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.login-form input:focus-visible {
  outline: 0;
  border-color: var(--copper);
  background: rgba(255, 255, 255, 0.1);
}

.login-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.login-form button {
  min-height: 49px;
  border: 0;
  border-radius: 3px;
  background: var(--copper);
  color: #fff;
  font-size: 14px;
  font-weight: 650;
}

.login-form button:hover {
  background: #d9b99a;
}

.login-message {
  margin-top: 36px;
  padding: 0;
}

.login-message h2 {
  margin-bottom: 7px;
  color: #fff;
  font-size: 16px;
}

.login-message p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.45;
}

.login-message[data-tone="error"] h2 {
  color: #f0b7ad;
}

.login-message[data-tone="success"] h2 {
  color: #b5d7ba;
}

.login-message .auth-detail {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.68);
}

#login-signout {
  width: 100%;
  margin-top: 18px;
  border-color: rgba(255, 255, 255, 0.15);
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
}

@media (max-width: 520px) {
  .login-card {
    padding: 34px 22px 26px;
  }
}

.app-shell {
  min-height: 100vh;
  padding-left: 248px;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--navy);
  color: var(--muted-light);
}

.sidebar-menu {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.brand-block {
  padding: 30px 28px 22px;
  text-align: center;
  border-bottom: 1px solid var(--dark-line);
}

.logo-mark {
  width: 176px;
  height: auto;
  max-height: 54px;
  margin: 0 auto;
  display: block;
  object-fit: contain;
}

.product-label {
  position: relative;
  margin: 16px 0 0;
  color: var(--copper);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.35px;
}

.product-label::after {
  content: "";
  display: block;
  width: 28px;
  height: 2px;
  margin: 10px auto 0;
  background: var(--copper);
}

.mobile-menu-toggle {
  display: none;
}

.nav-group {
  padding: 14px 0 4px;
}

.nav-section,
.eyebrow,
label {
  display: block;
  margin: 0 0 7px;
  color: var(--muted);
  font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1.5;
  text-transform: uppercase;
}

.nav-section {
  padding: 12px 28px 6px;
  color: rgba(255, 255, 255, 0.3);
}

.nav-item {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 3px solid transparent;
  padding: 11px 28px 11px 25px;
  color: var(--muted-light);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--cream);
}

.nav-item.active {
  border-left-color: var(--copper);
}

.nav-group[aria-label="Main"] .nav-item.active {
  border-left-color: transparent;
  background: transparent;
  color: var(--muted-light);
}

.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 14px;
}

.user-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  gap: 11px;
  align-items: center;
  border-top: 1px solid var(--dark-line);
  padding: 18px 22px;
  flex: 0 0 auto;
}

.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--copper);
  color: var(--navy);
  font-size: 12px;
  font-weight: 800;
}

.user-card p {
  margin: 0 0 3px;
  color: var(--cream);
  font-size: 13px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-card span {
  display: block;
  color: rgba(255, 255, 255, 0.48);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-button {
  width: 38px;
  height: 38px;
  min-height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.62);
  padding: 0;
}

.logout-button:hover {
  border-color: var(--dark-line);
  background: rgba(255, 255, 255, 0.08);
  color: var(--cream);
}

.workspace {
  min-height: 100vh;
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(242, 239, 233, 0.94);
  padding: 18px clamp(22px, 4vw, 42px);
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar-title h1:has(#workspace-title:empty) {
  display: none;
}

.topbar-back {
  width: 30px;
  height: 38px;
  min-height: 38px;
  display: inline-grid;
  place-items: center;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--ink);
  font-size: 34px !important;
  font-weight: 500 !important;
  line-height: 1;
  padding: 0;
}

.topbar-back:hover,
.topbar-back:focus-visible {
  background: transparent;
  color: var(--accent);
}

.signed-in-shell.has-selected-client .topbar {
  background: rgba(248, 246, 241, 0.96);
}

.signed-in-shell.has-selected-client .topbar .search-control {
  display: none;
}

.topbar-timeline.hidden {
  display: none;
}

.topbar-timeline:not(.hidden) {
  display: none;
  align-items: center;
  justify-content: center;
}

.topbar-work-action {
  min-height: 36px;
  border-color: rgba(13, 24, 33, 0.16);
  background: #fff;
  color: var(--navy);
  font-size: 12px;
  font-weight: 800;
}

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

.topbar .search-control {
  width: min(320px, 32vw);
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
}

h2 {
  margin-bottom: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
}

h3 {
  margin-bottom: 8px;
  font-size: 16px;
  line-height: 1.25;
}

.toolbar {
  display: grid;
  grid-template-columns: 220px 190px minmax(300px, 420px);
  gap: 29px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding: 12px clamp(22px, 4vw, 42px);
}

.client-list-filter label,
.client-list-sort label {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 2.2px;
}

.app-shell:not(.signed-in-shell) .client-list-filter,
.signed-in-shell.has-selected-client .toolbar {
  display: none;
}

input,
select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
}

input::placeholder {
  color: rgba(26, 26, 26, 0.44);
}

.signed-in {
  display: none;
}

.split {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(680px, 1fr);
  gap: 16px;
  align-items: start;
  padding: 14px clamp(22px, 4vw, 42px) 28px;
}

.signed-in-shell.has-selected-client .split {
  grid-template-columns: minmax(0, 1fr);
  max-width: 1720px;
  margin: 0 auto;
  padding-top: 16px;
}

.signed-in-shell:not(.has-selected-client) .split {
  grid-template-columns: minmax(0, 1fr);
}

.signed-in-shell.has-selected-client .project-list {
  display: none;
}

.signed-in-shell:not(.has-selected-client) .detail {
  display: none;
}

.panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 3px rgba(13, 24, 33, 0.04);
}

.panel-heading {
  min-height: 58px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 16px 18px;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  background: #fff;
  color: var(--navy);
}

.icon-button:hover {
  border-color: rgba(13, 24, 33, 0.28);
  background: var(--utility-soft);
}

.rows {
  display: grid;
}

.client-list-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(92px, auto);
  gap: 14px;
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding: 14px 18px 12px;
}

.client-list-header-main {
  display: grid;
  grid-template-columns:
    minmax(150px, 0.95fr)
    minmax(170px, 1fr)
    minmax(105px, 0.62fr)
    minmax(135px, 0.78fr);
  column-gap: clamp(12px, 1.8vw, 28px);
  min-width: 0;
}

.client-list-header span {
  color: rgba(26, 26, 26, 0.56);
  font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.8px;
  line-height: 1.35;
  text-transform: uppercase;
}

.client-list-header-consultant {
  min-width: 180px;
  text-align: right;
}

.project-row {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(92px, auto);
  gap: 14px;
  align-items: start;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  padding: 15px 18px;
  text-align: left;
}

.row-main {
  display: grid;
  grid-template-columns:
    minmax(150px, 0.95fr)
    minmax(170px, 1fr)
    minmax(105px, 0.62fr)
    minmax(135px, 0.78fr);
  column-gap: clamp(12px, 1.8vw, 28px);
  row-gap: 4px;
  align-items: start;
  min-width: 0;
}

.project-row:hover,
.project-row.active {
  background: #f8f6f1;
}

.project-row.active {
  box-shadow: inset 3px 0 0 var(--copper);
}

.row-title {
  margin: 0 0 5px;
  font-weight: 750;
  line-height: 1.25;
}

.row-main .row-title {
  grid-column: 1;
  margin-bottom: 0;
}

.row-meta,
.detail-meta,
.empty {
  color: var(--muted);
  line-height: 1.45;
}

.row-contact {
  color: rgba(26, 26, 26, 0.74);
}

.row-email {
  grid-column: 2;
}

.row-phone {
  grid-column: 3;
}

.row-created {
  grid-column: 4;
  color: rgba(26, 26, 26, 0.74);
}

.row-context {
  grid-column: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 13px;
}

.client-count-cluster {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.client-count-metric {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: rgba(26, 26, 26, 0.58);
  font-size: 13px;
  line-height: 1;
}

.client-count-metric svg {
  width: 14px;
  height: 14px;
  color: rgba(151, 111, 76, 0.78);
  stroke-width: 1.9;
}

.list-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding: 12px 18px;
  color: var(--muted);
  font-size: 13px;
}

.pagination-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pagination-button {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0;
}

.pagination-button svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.pagination-button:hover:not(:disabled),
.pagination-button:focus-visible {
  border-color: var(--copper);
  color: var(--copper);
}

.pagination-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.empty {
  margin: 0;
}

.empty.compact {
  margin-bottom: 0;
  font-size: 13px;
}

.stage {
  max-width: 180px;
  border: 1px solid rgba(203, 168, 138, 0.45);
  border-radius: 999px;
  background: #fbf7f1;
  color: #76573c;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  padding: 5px 9px;
  text-align: right;
}

.row-side {
  display: grid;
  justify-items: end;
  gap: 7px;
  align-self: start;
  min-width: 180px;
}

.row-consultant {
  color: rgba(26, 26, 26, 0.74);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  text-align: right;
}

.row-consultant.current-user {
  color: var(--ink);
  font-weight: 800;
}

.detail {
  min-height: 640px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.detail-shell {
  display: grid;
  grid-template-columns: minmax(230px, 0.74fr) minmax(320px, 1.26fr);
  gap: 20px;
  align-items: start;
}

.relationship-map,
.selected-detail {
  min-width: 0;
}

.client-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(310px, 28vw, 430px);
  gap: 14px 20px;
  align-items: start;
}

.client-main,
.client-rail {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.client-main > *,
.client-rail > *,
.rail-content > * {
  min-width: 0;
}

.client-rail {
  align-self: start;
}

.rail-toggle {
  display: none;
}

.timeline-drawer-trigger,
.rail-backdrop {
  display: none;
}

.rail-content {
  display: grid;
  gap: 14px;
}

.client-header,
.work-panel,
.rail-section {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 3px rgba(13, 24, 33, 0.04);
}

.client-header {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 88px;
  padding: 18px 22px;
}

.back-button {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-self: start;
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.client-header h2 {
  font-size: 21px;
}

.client-header .detail-meta {
  margin: 8px 0 0;
}

.client-meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}

.client-meta-list > span {
  display: inline-flex;
  align-items: center;
}

.consultant-meta {
  color: var(--ink);
  font-weight: 500;
}

.client-avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: #e9e3d9;
  color: rgba(13, 24, 33, 0.62);
  font-weight: 800;
}

.work-panel {
  padding: 18px 22px 20px;
}

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

.panel-title,
.rail-heading-title {
  color: rgba(26, 26, 26, 0.56);
  font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 2.2px;
  line-height: 1.35;
  text-transform: uppercase;
}

.client-summary-panel .work-panel-heading {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 10px;
}

.panel-action {
  min-height: 34px;
  padding: 8px 12px;
  white-space: nowrap;
}

.panel-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.summary-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.45fr) minmax(260px, 0.8fr);
  gap: 0;
  border-top: 1px solid rgba(13, 24, 33, 0.09);
}

.summary-block {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 14px 20px 4px;
}

.summary-block:first-child {
  padding-left: 0;
}

.summary-block:last-child {
  padding-right: 0;
}

.summary-block + .summary-block {
  border-left: 1px solid rgba(13, 24, 33, 0.075);
}

.client-summary-panel .summary-grid {
  grid-template-columns: 1fr;
}

.client-summary-panel .summary-block {
  padding-right: 0;
  padding-left: 0;
}

.client-summary-panel .summary-block + .summary-block {
  border-left: 0;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.portal-access-panel {
  gap: 14px;
}

.portal-access-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.portal-access-summary > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfaf7;
  padding: 12px;
}

.portal-access-summary p {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.4;
}

.portal-check-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.portal-check-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  background: #fff;
}

.portal-check-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 24px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.portal-check-item.complete .portal-check-status {
  background: #e8f4ed;
  color: #2d6b44;
}

.portal-check-item.missing .portal-check-status {
  background: #f5e8df;
  color: #805231;
}

.portal-check-item strong,
.portal-check-item small {
  display: block;
  min-width: 0;
}

.portal-check-item strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.portal-check-item small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.portal-admin-step {
  margin: 0;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.client-info-group-title {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.3;
}

.editable-field-list {
  display: grid;
  gap: 0;
}

.contact-info-table {
  --contact-label-column: 82px;
  --contact-column-gap: 16px;
  display: grid;
  min-width: 0;
}

.contact-info-header,
.contact-info-row {
  display: grid;
  grid-template-columns: var(--contact-label-column) minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--contact-column-gap);
  align-items: center;
  min-width: 0;
}

.contact-info-header {
  margin-top: 8px;
  padding: 0 0 10px;
  position: relative;
}

.contact-info-header::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: calc(var(--contact-label-column) + var(--contact-column-gap));
  height: 1px;
  background: rgba(13, 24, 33, 0.09);
  pointer-events: none;
}

.contact-info-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.contact-info-row {
  padding: 8px 0;
}

.contact-info-header + .contact-info-row {
  padding-top: 11px;
}

.contact-info-row-full {
  border-bottom: 1px solid rgba(13, 24, 33, 0.09);
  margin-bottom: 10px;
  padding-bottom: 9px;
  padding-top: 0;
}

.contact-info-full {
  grid-column: 2 / 4;
  min-width: 0;
}

.contact-info-row > .field-label {
  margin-bottom: 0;
}

.editable-field {
  position: relative;
  display: grid;
  grid-template-columns: minmax(130px, 0.34fr) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  border-top: 1px solid rgba(13, 24, 33, 0.09);
  padding: 6px 0;
}

.editable-field:first-child {
  border-top: 0;
  padding-top: 0;
}

.editable-field.value-only {
  display: block;
  border-top: 0;
  padding: 0;
}

.editable-field .field-label {
  margin-bottom: 0;
}

.editable-field-body {
  min-width: 0;
}

.editable-field:not(.editing) .editable-field-body {
  padding-right: 34px;
}

.editable-field.value-only:not(.editing) .editable-field-body {
  min-height: 22px;
}

.editable-field.editing {
  align-items: start;
  padding: 9px 0;
}

.editable-field.value-only.editing {
  padding: 0;
}

.editable-field.editing .field-label {
  padding-top: 10px;
}

.editable-field.editing .editable-field-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.editable-field.editing .inline-edit-actions {
  padding-top: 0;
}

.editable-field.value-only.editing .inline-edit-actions {
  padding-top: 0;
}

.editable-field .field-value {
  min-width: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.editable-field .field-value.is-empty {
  color: rgba(26, 26, 26, 0.38);
}

.inline-edit-trigger {
  position: absolute;
  top: 50%;
  right: 0;
  width: 28px;
  height: 28px;
  min-height: 28px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0;
  opacity: 0;
  box-shadow: none;
  transition: opacity 120ms ease, color 120ms ease;
}

.editable-field:hover .inline-edit-trigger,
.editable-field:focus-within .inline-edit-trigger {
  opacity: 1;
}

.inline-edit-trigger:hover,
.inline-edit-trigger:focus-visible {
  background: transparent;
  box-shadow: none;
}

.inline-edit-trigger:focus-visible {
  outline: 2px solid rgba(6, 76, 160, 0.45);
  outline-offset: 2px;
}

.client-info-input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
  line-height: 1.35;
}

textarea.client-info-input {
  min-height: 82px;
  resize: vertical;
}

.inline-edit-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.inline-edit-action {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  box-shadow: none;
}

.inline-edit-save {
  background: #dcefe3;
  color: #2f6f46;
}

.inline-edit-save:hover {
  background: #d2e8db;
}

.inline-edit-cancel {
  background: #f3dfcf;
  color: #946235;
}

.inline-edit-cancel:hover {
  background: #ecd4c0;
}

.inline-edit-action:focus-visible {
  outline: 2px solid rgba(203, 168, 138, 0.7);
  outline-offset: 2px;
}

.small-action {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 12px;
}

.client-info-message {
  margin: 0 0 12px;
  border-radius: 5px;
  padding: 9px 10px;
  font-size: 13px;
  line-height: 1.45;
}

.client-info-message.success {
  background: #e8f4ed;
  color: #2d6b44;
}

.client-info-message.error {
  background: #fff1ee;
  color: #963b22;
}

@media (max-width: 720px) {
  .contact-info-header {
    display: none;
  }

  .contact-info-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px 18px;
    padding: 12px 0;
  }

  .contact-info-row > .field-label {
    grid-column: 1 / -1;
  }

  .contact-info-row-full {
    grid-template-columns: 1fr;
  }

  .contact-info-full {
    grid-column: 1 / -1;
  }

  .contact-info-row > div:nth-child(2)::before,
  .contact-info-row > div:nth-child(3)::before {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
  }

  .contact-info-row > div:nth-child(2)::before {
    content: "Primary";
  }

  .contact-info-row > div:nth-child(3)::before {
    content: "Secondary";
  }

  .contact-info-row-full > div:nth-child(2)::before {
    content: none;
  }

  .editable-field {
    grid-template-columns: 1fr;
    gap: 7px;
  }
}

.contact-block {
  border-bottom: 0;
  padding-bottom: 0;
}

.contact-block:last-child {
  margin-bottom: 0;
}

.contact-block h4 {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.25;
}

.contact-block p {
  margin: 0 0 5px;
  line-height: 1.45;
}

.inline-field {
  border-top: 0;
  padding-top: 0;
}

.soft-chip,
.inline-stage {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 5px;
  background: #e8f4ed;
  color: #2d6b44;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.soft-chip.is-opted-in {
  background: #e8f4ed;
  color: #2d6b44;
}

.soft-chip.is-not-opted-in {
  background: #f3dfcf;
  color: #946235;
}

.inline-stage {
  border-color: transparent;
  background: var(--blue-soft);
  color: var(--blue);
  min-width: max-content;
  text-align: left;
}

.scenario-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.scenario-header,
.scenario-row {
  min-width: 720px;
  display: grid;
  grid-template-columns: minmax(210px, 1.35fr) minmax(140px, 0.95fr) minmax(140px, 0.95fr) minmax(150px, 0.8fr);
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 10px 16px;
}

.scenario-header {
  background: #fbfaf7;
  color: rgba(26, 26, 26, 0.72);
  font-size: 12px;
  font-weight: 800;
}

.scenario-row {
  width: 100%;
  min-height: 52px;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.scenario-row:last-child {
  border-bottom: 0;
}

.scenario-row:hover,
.scenario-row.active {
  background: #f8f6f1;
}

.scenario-row strong {
  display: block;
  color: var(--ink);
}

.scenario-row small {
  display: inline-flex;
  margin-top: 4px;
  border-radius: 5px;
  background: var(--blue-soft);
  color: var(--blue);
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 700;
}

.table-empty {
  padding: 14px;
}

.selected-record .detail-grid {
  margin-top: 16px;
}

.client-rail .rail-section {
  padding: 18px;
}

.client-main > .rail-section {
  margin-top: 0;
  padding: 18px 22px 20px;
}

.next-step {
  background: linear-gradient(180deg, #f7fbff 0%, #eef5ff 100%);
  border-color: rgba(6, 76, 160, 0.16);
}

.client-main > .next-step {
  padding: 24px 24px 26px;
}

.placeholder-pill {
  border-radius: 5px;
  background: rgba(6, 76, 160, 0.08);
  color: var(--blue);
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 800;
}

.next-step-title {
  margin-bottom: 14px;
  font-size: 18px;
  line-height: 1.25;
}

.next-step p {
  max-width: 920px;
  margin-bottom: 22px;
  line-height: 1.55;
}

.next-step dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border-top: 1px solid rgba(6, 76, 160, 0.14);
}

.next-step dl > div {
  padding: 14px 18px 2px 0;
}

.next-step dl > div + div {
  border-left: 1px solid rgba(6, 76, 160, 0.14);
  padding-left: 18px;
}

.next-step dt {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.next-step dd {
  margin: 0;
  line-height: 1.45;
}

.client-summary,
.relationship-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.client-summary {
  margin-bottom: 18px;
  padding: 13px;
}

.relationship-row {
  min-height: 58px;
  padding: 12px 13px;
}

.client-summary:hover,
.client-summary.active,
.relationship-row:hover,
.relationship-row.active {
  border-color: rgba(203, 168, 138, 0.7);
  background: #fbf7f1;
}

.client-summary.active,
.relationship-row.active {
  box-shadow: inset 3px 0 0 var(--copper);
}

.client-summary strong,
.relationship-row strong {
  display: block;
  line-height: 1.25;
}

.client-summary small,
.relationship-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.35;
}

.relationship-section,
.rail-section {
  margin-top: 18px;
}

.client-rail .rail-section {
  margin-top: 0;
}

.client-main > .rail-section {
  margin-top: 0;
}

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

.section-heading .eyebrow,
.section-heading h3 {
  margin-bottom: 0;
}

.section-heading h3:not(.panel-title) {
  font-size: 16px;
}

.next-step-heading {
  margin-bottom: 16px;
}

.relationship-list {
  display: grid;
  gap: 8px;
}

.client-work-form {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(13, 24, 33, 0.1);
  border-radius: 8px;
  background: #fbfaf7;
}

.client-work-form.compact-form {
  margin-top: 18px;
}

.client-work-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.client-work-form label span,
.client-work-form .form-footer span {
  color: var(--muted);
  font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.client-work-form input,
.client-work-form select,
.client-work-form textarea {
  width: 100%;
  border: 1px solid rgba(13, 24, 33, 0.14);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  line-height: 1.35;
  padding: 9px 10px;
}

.client-work-form textarea {
  resize: vertical;
}

.client-work-readonly {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(13, 24, 33, 0.1);
  border-radius: 8px;
  background: #fbfaf7;
  padding: 14px;
}

.client-work-readonly div {
  display: grid;
  gap: 8px;
}

.client-work-readonly span {
  color: var(--muted);
  font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.client-work-readonly p {
  margin: 0;
  color: var(--ink);
  line-height: 1.55;
  white-space: pre-wrap;
}

.client-work-readonly footer {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.form-footer,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.form-footer {
  flex-wrap: wrap;
}

.form-actions {
  margin-left: auto;
}

.client-work-form .form-actions button[type="submit"] {
  border-color: var(--copper);
  background: var(--copper);
  color: var(--navy);
  font-weight: 800;
}

.client-work-form .form-actions button[type="submit"]:hover,
.client-work-form .form-actions button[type="submit"]:focus-visible {
  border-color: #b88d69;
  background: #d8b89a;
}

.due-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 150px);
  gap: 10px;
}

.task-status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef2f4;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.task-status.completed {
  background: #e7efe3;
}

.context-work-panel {
  display: grid;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(13, 24, 33, 0.1);
}

.context-work-panel h3 {
  margin: 0;
  font-size: 16px;
}

.context-work-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.context-work-actions button:not(.secondary) {
  border-color: var(--copper);
  background: var(--copper);
  color: var(--navy);
  font-weight: 800;
}

.context-work-actions button:not(.secondary):hover,
.context-work-actions button:not(.secondary):focus-visible {
  border-color: #b88d69;
  background: #d8b89a;
}

.timeline-controls {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.segmented-control {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid rgba(13, 24, 33, 0.1);
  border-radius: 6px;
  background: #fbfaf7;
}

.segmented-control button {
  min-height: 30px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(26, 26, 26, 0.68);
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 750;
}

.segmented-control button + button {
  border-left: 1px solid rgba(13, 24, 33, 0.08);
}

.segmented-control button:hover,
.segmented-control button.active {
  background: #f2efe9;
  color: var(--ink);
}

.timeline-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 10px;
  padding: 0 0 15px;
}

.timeline-item + .timeline-item {
  border-top: 1px solid rgba(13, 24, 33, 0.08);
  padding-top: 15px;
}

.timeline-marker {
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--copper);
  box-shadow: 0 0 0 1px rgba(203, 168, 138, 0.55);
  margin-top: 5px;
}

.timeline-item.activity .timeline-marker {
  background: var(--blue);
  box-shadow: 0 0 0 1px rgba(6, 76, 160, 0.26);
}

.timeline-item.emails .timeline-marker {
  background: var(--copper);
  box-shadow: 0 0 0 1px rgba(151, 111, 76, 0.38);
}

.timeline-item-heading {
  display: grid;
  gap: 4px;
}

.timeline-item-heading strong {
  line-height: 1.25;
}

.timeline-item-heading span,
.timeline-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.timeline-item p {
  margin: 6px 0 3px;
  line-height: 1.4;
}

.timeline-item.interactive {
  cursor: pointer;
}

.timeline-item.interactive:hover strong,
.timeline-item.interactive:focus-visible strong {
  color: var(--blue);
}

.timeline-item.interactive:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 4px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 20px;
}

.field {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.client-summary-panel .field {
  border-top: 0;
  padding-top: 0;
}

.field.full {
  grid-column: 1 / -1;
}

.field-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.field-value {
  margin: 0;
  line-height: 1.55;
}

.notice {
  margin-top: 18px;
  border: 1px solid #dfc58d;
  border-radius: 6px;
  background: #fff8e8;
  color: var(--warning);
  padding: 12px;
  line-height: 1.45;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(13, 24, 33, 0.42);
  padding: 20px;
}

.record-modal {
  width: min(100%, 440px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 48px rgba(13, 24, 33, 0.22);
  padding: 18px;
}

.record-modal {
  width: min(100%, 720px);
  max-height: min(760px, calc(100vh - 40px));
  overflow-y: auto;
}

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

.modal-heading h2 {
  font-size: 18px;
}

.record-modal p {
  margin-bottom: 14px;
  line-height: 1.45;
}

.record-modal #record-modal-body > .eyebrow,
.record-modal #record-modal-body > h2,
.record-modal #record-modal-body > .detail-meta {
  display: none;
}

.legacy-data-panel {
  display: grid;
  gap: 14px;
}

.legacy-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.legacy-summary span {
  border: 1px solid rgba(151, 111, 76, 0.22);
  border-radius: 999px;
  background: #fbf7f1;
  color: rgba(26, 26, 26, 0.72);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 750;
}

.legacy-record-list {
  display: grid;
  gap: 12px;
}

.legacy-record {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.email-detail-panel {
  display: grid;
  gap: 16px;
}

.email-meta {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  padding: 14px;
}

.email-meta div {
  display: grid;
  grid-template-columns: minmax(70px, 110px) minmax(0, 1fr);
  gap: 12px;
}

.email-meta dt {
  color: var(--muted);
  font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.email-meta dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.email-body {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.email-body-frame {
  display: block;
  width: 100%;
  min-height: 420px;
  border: 0;
  background: #fff;
}

.email-body-text {
  margin: 0;
  padding: 18px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.55;
}

.legacy-record summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  align-items: baseline;
  cursor: pointer;
  padding: 13px 14px;
}

.legacy-record summary span {
  color: rgba(151, 111, 76, 0.86);
  font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

.legacy-record summary strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.legacy-record summary small {
  grid-column: 1 / -1;
  color: rgba(26, 26, 26, 0.55);
}

.legacy-links {
  display: grid;
  gap: 6px;
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 12px 14px;
}

.legacy-links div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
}

.legacy-links dt {
  color: var(--muted);
  font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.legacy-links dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: rgba(26, 26, 26, 0.7);
}

.legacy-json-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 12px;
  border-top: 1px solid var(--line);
  padding: 12px 14px 14px;
}

.legacy-json-grid h4 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.legacy-json-grid pre {
  max-height: 280px;
  overflow: auto;
  border: 1px solid rgba(13, 24, 33, 0.1);
  border-radius: 6px;
  background: #fbfaf7;
  color: rgba(26, 26, 26, 0.78);
  padding: 10px;
  font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.auth-detail {
  overflow: auto;
  max-height: 170px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfaf7;
  color: rgba(26, 26, 26, 0.76);
  padding: 10px;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

@media (max-width: 1218px) {
  body.timeline-drawer-open {
    overflow: hidden;
  }

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

  .timeline-drawer-trigger {
    display: inline-flex;
    justify-self: end;
    align-items: center;
    border-color: var(--line);
    background: var(--panel);
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
  }

  .topbar-timeline:not(.hidden) {
    display: inline-flex;
  }

  .rail-backdrop {
    position: fixed;
    inset: 0;
    z-index: 38;
    border: 0;
    border-radius: 0;
    background: rgba(13, 24, 33, 0.34);
    padding: 0;
  }

  .timeline-open .rail-backdrop {
    display: block;
  }

  .client-rail {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 39;
    width: min(430px, calc(100vw - 24px));
    max-width: 100vw;
    height: 100dvh;
    align-content: start;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: var(--cream);
    box-shadow: -18px 0 46px rgba(13, 24, 33, 0.22);
    padding: 16px;
    transform: translateX(100%);
    transition: transform 180ms ease;
    visibility: hidden;
    pointer-events: none;
  }

  .client-rail.rail-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .rail-toggle {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    border-color: var(--line);
    background: var(--panel);
    color: var(--ink);
    padding: 13px 16px;
    text-align: left;
  }

  .rail-toggle span:first-child {
    color: rgba(26, 26, 26, 0.56);
    font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 2.2px;
    line-height: 1.35;
    text-transform: uppercase;
  }

  .rail-toggle span:last-child {
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
  }
}

@media (max-width: 1420px) and (min-width: 1001px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .summary-block {
    gap: 12px;
    padding: 14px 0 12px;
  }

  .summary-block + .summary-block {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 14px 0 12px;
  }

  .client-summary-panel .contact-block h4 {
    margin-bottom: 10px;
  }

  .client-summary-panel .contact-block p {
    margin-bottom: 5px;
    line-height: 1.45;
  }

  .client-summary-panel .field-label {
    margin-bottom: 0;
  }

  .client-summary-panel .field-value {
    line-height: 1.55;
  }

  .next-step-title {
    margin-bottom: 14px;
  }

  .next-step p {
    margin-bottom: 20px;
    line-height: 1.55;
  }

  .next-step dl {
    grid-template-columns: 1fr;
  }

  .next-step dl > div {
    padding: 18px 0 14px;
  }

  .next-step dl > div + div {
    border-left: 0;
    border-top: 1px solid rgba(6, 76, 160, 0.14);
    padding: 18px 0 14px;
  }

  .next-step dt {
    margin-bottom: 6px;
  }

  .next-step dd {
    line-height: 1.45;
  }
}

@media (max-width: 1040px) {
  .client-list-header {
    display: none;
  }

  .project-row {
    grid-template-columns: minmax(0, 1fr) minmax(96px, auto);
    gap: 16px;
  }

  .row-main {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 5px;
  }

  .row-main .row-title,
  .row-email,
  .row-phone,
  .row-created,
  .row-context {
    grid-column: 1;
  }

  .row-side {
    justify-items: end;
    min-width: 96px;
  }

  .row-consultant {
    text-align: right;
  }
}

@media (max-width: 900px) {
  .app-shell {
    padding-left: 0;
  }

  .portal-access-summary {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    width: auto;
    max-height: none;
    overflow: visible;
  }

  .brand-block {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 16px;
    align-items: center;
    padding: 18px 20px;
    text-align: left;
  }

  .brand-block .logo-mark {
    width: 182px;
    margin: 0;
    justify-self: start;
  }

  .product-label {
    display: none;
  }

  .mobile-menu-toggle {
    width: 42px;
    height: 42px;
    min-height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--dark-line);
    background: rgba(255, 255, 255, 0.06);
    color: var(--cream);
    padding: 0;
  }

  .mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.11);
  }

  .sidebar-menu {
    display: none;
    max-height: calc(100vh - 78px);
    overflow-y: auto;
    border-bottom: 1px solid var(--dark-line);
  }

  .mobile-menu-open .sidebar-menu {
    display: flex;
  }

  .sidebar-nav {
    flex: 0 0 auto;
    overflow: visible;
    padding-bottom: 8px;
  }

  .nav-group {
    display: block;
    padding-top: 8px;
  }

  .user-card {
    margin-top: 4px;
    padding: 14px 20px 16px;
  }

  .topbar,
  .toolbar {
    grid-template-columns: 1fr;
    padding-right: 18px;
    padding-left: 18px;
  }

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

  .topbar-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .signed-in-shell.has-selected-client .topbar {
    align-items: center;
    flex-direction: row;
    gap: 12px;
  }

  .signed-in-shell.has-selected-client .topbar-title {
    flex: 0 0 auto;
  }

  .signed-in-shell.has-selected-client .topbar-actions {
    flex: 1 1 auto;
    width: auto;
  }

  .topbar .search-control {
    width: min(100%, 360px);
  }

  .toolbar,
  .split,
  .detail-shell,
  .detail-grid,
  .legacy-json-grid,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .summary-block {
    padding: 18px 0 14px;
  }

  .summary-block + .summary-block {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 18px 0 14px;
  }

  .next-step dl {
    grid-template-columns: 1fr;
  }

  .next-step dl > div {
    padding: 18px 0 14px;
  }

  .next-step dl > div + div {
    border-left: 0;
    border-top: 1px solid rgba(6, 76, 160, 0.14);
    padding: 18px 0 14px;
  }

  .split {
    padding: 16px 18px 28px;
  }

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

@media (max-width: 700px) {
  .scenario-table {
    border: 0;
    border-radius: 0;
    overflow: visible;
  }

  .scenario-header {
    display: none;
  }

  .scenario-row {
    min-width: 0;
    grid-template-columns: 1fr;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    margin-bottom: 10px;
    padding: 12px;
  }

  .scenario-row > span {
    display: grid;
    gap: 3px;
  }

  .scenario-row > span::before {
    content: attr(data-label);
    color: var(--muted);
    font-family: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
  }
}

@media (max-width: 560px) {
  .row-main {
    grid-template-columns: 1fr;
    row-gap: 3px;
  }

  .row-main .row-title,
  .row-email,
  .row-phone,
  .row-context {
    grid-column: 1;
  }

  .row-side {
    justify-items: end;
    min-width: 0;
  }

  .row-consultant {
    text-align: right;
  }

  .client-header {
    grid-template-columns: 1fr;
  }

  .client-meta-list,
  .client-meta-list > span {
    align-items: flex-start;
    flex-direction: column;
  }

  .stage {
    max-width: none;
    justify-self: start;
    text-align: left;
  }
}
