.nav.grouped { gap: 16px; margin-top: 25px; min-height: 0; overflow-y: auto; }
.nav-group { display: grid; gap: 3px; }
.nav-group .nav-label { margin-bottom: 4px; }
.nav.grouped button { height: 38px; flex-shrink: 0; }

.portfolio-hero { display: grid; gap: 13px; min-width: 0; }
.portfolio-hero .metrics { margin-top: 0; }
.summary:has(.flow-steps > :nth-child(7)) {
  grid-template-columns: minmax(172px, .64fr) minmax(0, 1.36fr);
  gap: clamp(13px, 2vw, 25px);
}
.summary:has(.flow-steps > :nth-child(7)) .summary-flow { min-width: 0; padding-left: clamp(12px, 2vw, 23px); }
.summary .flow-steps:has(> :nth-child(7)) { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.summary .flow-steps:has(> :nth-child(7))::before { left: 7%; right: 7%; top: 20px; }
.summary .flow-steps:has(> :nth-child(7)) button > span { width: 42px; height: 42px; }
.summary .flow-steps:has(> :nth-child(7)) b { white-space: normal; font-size: 12px; line-height: 1.35; }
.summary .flow-steps:has(> :nth-child(7)) button:nth-child(3) > span { color: #bfe6d0; background: #204e3f; border-color: #6fa58b7c; }
.summary .flow-steps:has(> :nth-child(7)) button:nth-child(5) > span { color: #142f24; background: #a3e7bd; border-color: #b4edc9; }
.metric.static { cursor: default; }
.metric.static:hover { border-color: var(--border); background: var(--surface); }
.metric.static .metric-detail { min-width: 0; white-space: normal; }
.metric.static .metric-detail strong { overflow-wrap: anywhere; }

.platform-casebar,
.platform-panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.platform-casebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 13px 18px;
  margin-bottom: 12px;
}
.case-ident { display: flex; align-items: center; gap: 10px; min-width: 0; }
.case-ident b, .case-ident strong { display: block; font-size: 15px; overflow-wrap: anywhere; }
.case-ident small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.case-ident > div, .case-ident > span { min-width: 0; }
.case-ident .company-avatar { flex: 0 0 auto; }
.case-select { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); font-size: 13px; }
.case-select > span { flex: none; }
.case-select select, select.case-select {
  max-width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fafbf8;
  color: var(--ink);
}

.lifecycle {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  margin: 0 0 16px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #f9faf7;
}
.lifecycle-step {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
  min-width: 0;
  padding: 9px 3px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--neutral);
  text-align: center;
  font-size: 13px;
  line-height: 1.45;
}
.lifecycle-step:hover { background: #edf3ee; }
.lifecycle-step > .icon, .lifecycle-step > span:first-child:has(svg) {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: #edf1ed;
  color: var(--muted);
}
.lifecycle-step > span:first-child .icon { width: 16px; height: 16px; }
.lifecycle-step small { color: var(--muted); font-size: 11px; line-height: 1.25; }
.lifecycle-step.passed > .icon, .lifecycle-step.passed > span:first-child:has(svg) { background: var(--green-wash); color: var(--green-deep); }
.lifecycle-step.current, .lifecycle-step[aria-current="step"] { border-color: #bdd8c7; background: #e5f2e9; color: var(--green-deep); font-weight: 700; }
.lifecycle-step.current > .icon, .lifecycle-step.current > span:first-child:has(svg) { background: #d2eadb; color: var(--green-deep); }

.platform-grid, .cash-item { display: grid; gap: 14px; grid-template-columns: minmax(0, 1.18fr) minmax(0, .82fr); align-items: start; }
.platform-grid > *, .cash-item > * { min-width: 0; }
.platform-panel { padding: clamp(14px, 2vw, 21px); }
.platform-panel h3 { font-size: 17px; line-height: 1.42; }
.module-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 9px 14px; margin-bottom: 15px; }
.module-head h2 { font-size: 20px; line-height: 1.35; overflow-wrap: anywhere; }
.module-head p, .module-head small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.55; }

.facts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; margin: 0; }
.facts-grid > div { min-width: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts-grid dt { color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.facts-grid dd { margin: 0; color: var(--ink); font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }

.contract-list, .checklist { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.contract-list > li, .checklist > li { display: flex; align-items: center; gap: 9px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.contract-list > li:last-child, .checklist > li:last-child { border-bottom: 0; }
.contract-list > li > div, .checklist > li > div { flex: 1; min-width: 0; }
.contract-list > li > span:last-child, .checklist > li > span:last-child { margin-left: auto; }
.contract-list small, .checklist small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.checklist > li > .icon, .checklist > li > span:first-child:has(svg) { color: var(--green); flex: none; }

.side-stat { display: grid; gap: 6px; padding: 14px; color: var(--green-deep); border: 1px solid #d4e8db; border-radius: 8px; background: var(--green-wash); }
.side-stat strong, strong.side-stat { font-size: clamp(20px, 3vw, 30px); font-weight: 730; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.side-stat small, .side-stat > span { font-size: 13px; font-weight: 650; }
.module-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.panel-note { margin-top: 12px; padding: 9px 11px; border-radius: 7px; background: #f4f7f3; color: var(--neutral); font-size: 13px; line-height: 1.55; }
.panel-note + .panel-note { margin-top: 6px; }

.module-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 0 0 15px; }
.module-tile { min-width: 0; display: grid; gap: 5px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; background: #f8faf7; font-size: 13px; }
.module-tile > span, .module-tile small { color: var(--muted); }
.module-tile strong { font-size: clamp(16px, 2.1vw, 24px); letter-spacing: -.015em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.sub-table:not(table) { max-width: 100%; overflow-x: auto; }
table.sub-table, .sub-table table { font-size: 13px; white-space: normal; }
.sub-table th, .sub-table td { padding: 9px 7px; }
.sub-table th:first-child, .sub-table td:first-child { padding-left: 7px; }
.sub-table th:last-child, .sub-table td:last-child { padding-right: 7px; }
.sub-table .numeric, .sub-table time { white-space: nowrap; }
.active-marker { display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 50%; background: #3d8f69; }

@media (max-width: 920px) {
  .nav.grouped { gap: 7px; margin-top: 0; overflow: auto hidden; }
  .nav.grouped button { height: 36px; }
  .nav-group { display: flex; flex: none; align-items: center; gap: 3px; }
}

@media (max-width: 760px) {
  .summary:has(.flow-steps > :nth-child(7)) { grid-template-columns: minmax(0, 1fr); min-height: auto; }
  .summary:has(.flow-steps > :nth-child(7)) .summary-progress { max-width: none; }
  .summary:has(.flow-steps > :nth-child(7)) .summary-flow { border-left: 0; border-top: 1px solid #9cceb140; padding: 12px 0 0; }
  .platform-grid, .cash-item { grid-template-columns: minmax(0, 1fr); }
  .lifecycle { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .platform-casebar { align-items: stretch; flex-direction: column; gap: 11px; padding: 11px; }
  .case-select select, select.case-select { width: 100%; }
  .summary .flow-steps:has(> :nth-child(7)) { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 12px; }
  .summary .flow-steps:has(> :nth-child(7))::before { display: none; }
  .summary .flow-steps:has(> :nth-child(7)) button { gap: 5px; }
  .summary .flow-steps:has(> :nth-child(7)) button > span { width: 36px; height: 36px; }
  .summary .flow-steps:has(> :nth-child(7)) .icon { width: 18px; height: 18px; }
  .module-tiles { gap: 5px; }
  .module-tile { padding: 8px; }
  .lifecycle-step { font-size: 12px; }
  .lifecycle-step small { font-size: 10px; }
}

.portfolio-hero .flow-steps > button {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: 0;
  color: #d5ece0;
  text-align: center;
}
.portfolio-hero .flow-steps > button > span {
  display: grid;
  place-items: center;
  color: #bfe6d0;
  border: 1px solid #6fa58b7c;
  border-radius: 9px;
  background: #204e3f;
}
.portfolio-hero .flow-steps > button:hover > span,
.portfolio-hero .flow-steps > button:focus-visible > span {
  outline: 2px solid #a3e7bd;
  outline-offset: 2px;
}
.case-select select {
  width: min(28vw, 280px);
  min-height: 38px;
  padding: 0 26px 0 10px;
  border: 0;
  border-radius: 6px;
  text-overflow: ellipsis;
}
.platform-panel.cash-item { display: block; }
.platform-panel + .event-panel, .platform-grid + .event-panel,
.main > .platform-panel + .platform-panel,
.main > .module-tiles + .platform-panel + .platform-panel { margin-top: 14px; }
.side-stat { display: flex; align-items: baseline; font-size: clamp(22px, 3vw, 33px); font-weight: 730; }
.module-toolbar > p, .checklist li p { flex: 1 1 155px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.module-tile > b { font-size: clamp(16px, 2.1vw, 24px); overflow-wrap: anywhere; }
.checklist + .module-tiles, .account-balances, .finance-layout + .event-panel { margin-top: 16px; }
.platform-panel .robot-compact-steps { padding: 12px 0 0; }
@media (max-width: 640px) {
  .case-select select { width: 100%; }
  .portfolio-hero .flow-steps > button > span { width: 29px !important; height: 29px !important; }
  .portfolio-hero .flow-steps > button > span .icon { width: 16px; height: 16px; }
  .portfolio-hero .flow-steps > button > b { font-size: 11px; }
}
.finance-workspace + .event-panel { margin-top: 14px; }
.client-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.client-form label { display: grid; gap: 5px; color: var(--neutral); font-size: 13px; font-weight: 650; }
.client-form input { width: 100%; min-height: 39px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 7px; color: var(--ink); background: #f9fbf8; font-size: 14px; }
.client-form .full-field { grid-column: 1 / -1; }
.client-form .modal-actions { margin-top: 4px; }
