:root {
  --evergreen: #174c42;
  --evergreen-dark: #0f3c34;
  --sage: #8fae9f;
  --stone: #f4f2ed;
  --white: #ffffff;
  --charcoal: #202624;
  --slate: #68716d;
  --gold: #b58a3b;
  --border: #deded8;
  --danger: #a34a3f;
  --danger-dark: #79372f;
  --information: #4d7894;
  --violet: #745b89;
  --radius: 15px;
  --shadow: 0 8px 24px rgba(20, 37, 32, 0.055);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  background: var(--stone);
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--charcoal);
  background: var(--stone);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(181, 138, 59, 0.42);
  outline-offset: 2px;
}

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

h1,
h2,
h3 {
  color: var(--evergreen-dark);
  font-family: Georgia, "Times New Roman", serif;
}

h1 {
  margin-bottom: 4px;
  font-size: clamp(2rem, 3vw, 2.85rem);
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 0;
  font-size: 1.16rem;
}

h3 {
  margin-bottom: 0;
  font-size: 1rem;
}

.app-shell {
  width: 100%;
  height: 100vh;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  overflow: hidden;
}

.sidebar {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 25px 17px 20px;
  color: var(--white);
  background: var(--evergreen);
}

.brand {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.85rem;
  letter-spacing: -0.045em;
}

.product-label {
  max-width: 168px;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.72rem;
  line-height: 1.4;
}

.case-context {
  margin-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  padding: 14px 0;
}

.case-context span,
.case-context strong,
.case-context small {
  display: block;
}

.case-context span {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case-context strong {
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-context small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.62);
}

.navigation {
  display: grid;
  gap: 4px;
  margin-top: 22px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: 9px;
  padding: 10px 11px;
  color: rgba(255, 255, 255, 0.8);
  background: transparent;
  text-align: left;
  font-size: 0.9rem;
}

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

.nav-count {
  min-width: 23px;
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--evergreen-dark);
  background: var(--gold);
  font-size: 0.7rem;
  text-align: center;
}

.sidebar-footer {
  margin-top: auto;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  padding-top: 16px;
}

.user-details {
  min-width: 0;
}

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

.user-card strong {
  overflow: hidden;
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-card span {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.61);
  font-size: 0.72rem;
}

.avatar {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--evergreen);
  background: var(--sage);
  font-size: 0.78rem;
  font-weight: 700;
}

.sign-out {
  margin-top: 12px;
  border: 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.67);
  background: transparent;
  font-size: 0.79rem;
}

.workspace {
  height: 100vh;
  min-width: 0;
  overflow-y: auto;
  padding: 26px 29px 40px;
  scrollbar-gutter: stable;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 19px;
}

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

.eyebrow,
.label {
  color: var(--slate);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.case-meta {
  margin-bottom: 0;
  color: var(--slate);
  font-size: 0.89rem;
}

.search input {
  width: 205px;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 11px;
  color: var(--charcoal);
  background: var(--white);
}

.primary-button,
.secondary-button,
.danger-button {
  border-radius: 9px;
  padding: 9px 13px;
  font-weight: 700;
}

.compact {
  padding: 8px 12px;
  font-size: 0.83rem;
}

.primary-button {
  border: 0;
  color: var(--white);
  background: var(--evergreen);
}

.primary-button:hover {
  background: var(--evergreen-dark);
}

.secondary-button {
  border: 1px solid var(--border);
  color: var(--charcoal);
  background: var(--white);
}

.danger-button {
  border: 0;
  color: var(--white);
  background: var(--danger);
}

.danger-button:hover {
  background: var(--danger-dark);
}

.text-button {
  border: 0;
  padding: 0;
  color: var(--evergreen);
  background: transparent;
  font-size: 0.8rem;
  font-weight: 700;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.summary-strip,
.workflow-card,
.panel,
.metric-card,
.document-card,
.contact-card,
.case-card,
.intake-section {
  border: 1px solid var(--border);
  background: var(--white);
  box-shadow: var(--shadow);
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-bottom: 15px;
  border-radius: var(--radius);
  padding: 16px 20px;
}

.summary-item strong {
  display: block;
  margin-top: 4px;
}

.verified {
  color: var(--evergreen);
}

.completion-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.progress-bar {
  width: 140px;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7e7e2;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--evergreen);
}

.workflow-card {
  margin-bottom: 15px;
  border-radius: var(--radius);
  padding: 18px 20px;
}

.section-heading,
.page-tools {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.page-tools {
  align-items: center;
  margin-bottom: 16px;
}

.workflow {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 20px;
}

.workflow::before {
  content: "";
  position: absolute;
  top: 12px;
  right: 7%;
  left: 7%;
  height: 2px;
  background: var(--border);
}

.workflow-step {
  position: relative;
  z-index: 1;
  text-align: center;
}

.step-dot {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  margin: 0 auto 8px;
  border: 2px solid var(--border);
  border-radius: 50%;
  color: var(--white);
  background: var(--white);
  font-size: 0.78rem;
}

.workflow-step.complete .step-dot {
  border-color: var(--evergreen);
  background: var(--evergreen);
}

.workflow-step.current .step-dot {
  border: 6px solid var(--sage);
  background: var(--evergreen);
}

.workflow-step strong,
.workflow-step small {
  display: block;
}

.workflow-step strong {
  font-size: 0.75rem;
}

.workflow-step small {
  margin-top: 3px;
  color: var(--slate);
  font-size: 0.67rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 13px;
  margin-bottom: 15px;
}

.metric-grid.three {
  grid-template-columns: repeat(3, 1fr);
}

.metric-card {
  min-width: 0;
  border-radius: 13px;
  padding: 16px;
}

.metric-card strong,
.metric-card small {
  display: block;
}

.metric-card strong {
  margin-top: 6px;
  color: var(--evergreen-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
}

.metric-card .person-name {
  font-size: 1.22rem;
  line-height: 1.1;
  white-space: nowrap;
}

.metric-card small {
  margin-top: 4px;
  color: var(--slate);
  font-size: 0.76rem;
}

.content-grid {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  gap: 15px;
}

.panel {
  border-radius: var(--radius);
  padding: 18px;
}

.next-action-panel {
  background: linear-gradient(135deg, #ffffff, #edf3ef);
}

.panel-description {
  max-width: 620px;
  margin: 15px 0;
  color: var(--slate);
  font-size: 0.88rem;
  line-height: 1.5;
}

.status-chip,
.deadline {
  border-radius: 999px;
  padding: 5px 8px;
  color: #72521f;
  background: #f3ead7;
  font-size: 0.7rem;
  font-weight: 700;
}

.button-row {
  display: flex;
  gap: 9px;
}

.list {
  display: grid;
  gap: 3px;
  margin-top: 10px;
}

.list-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid #ecece7;
  padding: 10px 0;
  color: var(--charcoal);
  background: transparent;
  text-align: left;
}

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

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

.list-row strong {
  font-size: 0.86rem;
}

.list-row small {
  margin-top: 2px;
  color: var(--slate);
  font-size: 0.73rem;
}

.grow {
  flex: 1;
}

.status-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.completed-dot {
  background: var(--evergreen);
}

.information-dot {
  background: var(--information);
}

.pending-dot {
  background: var(--gold);
}

.missing-text {
  color: var(--danger);
  font-size: 0.73rem;
  font-weight: 700;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-button {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--slate);
  background: var(--white);
}

.filter-button.active {
  border-color: var(--evergreen);
  color: var(--white);
  background: var(--evergreen);
}

.task-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 15px;
}

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

.task-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  border-bottom: 1px solid #ecece7;
  padding: 14px 0;
}

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

.task-row.completed .task-copy strong {
  color: var(--slate);
  text-decoration: line-through;
}

.task-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.task-check span {
  width: 20px;
  height: 20px;
  display: block;
  border: 2px solid var(--sage);
  border-radius: 6px;
  background: var(--white);
}

.task-check input:checked + span {
  border-color: var(--evergreen);
  background: var(--evergreen);
}

.task-check input:checked + span::after {
  content: "✓";
  display: grid;
  height: 100%;
  place-items: center;
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
}

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

.task-copy small {
  margin-top: 3px;
  color: var(--slate);
  font-size: 0.75rem;
}

.priority,
.table-status,
.case-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 0.69rem;
  font-weight: 700;
  white-space: nowrap;
}

.priority.high,
.missing-status {
  color: #8c3e35;
  background: #f5e4e1;
}

.priority.medium,
.pending-status {
  color: #72521f;
  background: #f3ead7;
}

.priority.normal,
.information-status {
  color: #365e75;
  background: #e2edf3;
}

.priority.done,
.verified-status,
.case-status.open {
  color: var(--evergreen);
  background: #e2eee8;
}

.review-status {
  color: #5f4a70;
  background: #ece6f0;
}

.case-status.closed {
  color: var(--slate);
  background: #e8e8e3;
}

.side-panel {
  align-self: start;
}

.side-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #ecece7;
  padding: 13px 0;
}

.side-stat strong {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--evergreen);
  font-size: 1.3rem;
}

.side-note {
  margin-top: 16px;
  border-radius: 11px;
  padding: 13px;
  color: var(--slate);
  background: var(--stone);
  font-size: 0.78rem;
  line-height: 1.45;
}

.muted {
  color: var(--slate);
  font-size: 0.78rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid #ecece7;
  padding: 13px 11px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--slate);
  font-size: 0.69rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

td {
  font-size: 0.82rem;
}

.document-grid,
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 13px;
}

.document-card,
.contact-card {
  display: grid;
  align-items: center;
  gap: 13px;
  border-radius: 13px;
  padding: 16px;
}

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

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

.document-card strong,
.document-card small,
.contact-card strong,
.contact-card small {
  display: block;
}

.document-card small,
.contact-card small {
  margin-top: 3px;
  color: var(--slate);
  font-size: 0.75rem;
}

.contact-card p {
  margin: 5px 0 0;
  color: var(--slate);
  font-size: 0.75rem;
}

.document-icon,
.contact-avatar {
  display: grid;
  place-items: center;
  color: var(--evergreen);
  background: #e2eee8;
  font-weight: 700;
}

.document-icon {
  width: 42px;
  height: 48px;
  border-radius: 8px;
  font-size: 0.67rem;
}

.contact-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 0.78rem;
}

.audit-list {
  display: grid;
}

.audit-row {
  display: grid;
  grid-template-columns: 150px 14px minmax(0, 1fr);
  gap: 14px;
  padding: 15px 0;
}

.audit-row + .audit-row {
  border-top: 1px solid #ecece7;
}

.audit-time {
  color: var(--slate);
  font-size: 0.73rem;
}

.audit-marker {
  position: relative;
  width: 10px;
  height: 10px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--evergreen);
}

.audit-marker::after {
  content: "";
  position: absolute;
  top: 13px;
  left: 4px;
  width: 2px;
  height: 52px;
  background: var(--border);
}

.audit-row:last-child .audit-marker::after {
  display: none;
}

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

.audit-row small {
  margin-top: 3px;
  color: var(--slate);
  font-size: 0.73rem;
}

.audit-row p {
  margin: 6px 0 0;
  color: var(--slate);
  font-size: 0.8rem;
  line-height: 1.45;
}

.case-list-grid {
  display: grid;
  gap: 13px;
}

.case-card {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) 1fr 1fr auto;
  align-items: center;
  gap: 20px;
  border-radius: var(--radius);
  padding: 18px;
}

.case-card:hover {
  border-color: var(--sage);
}

.case-primary strong,
.case-primary small {
  display: block;
}

.case-primary strong {
  color: var(--evergreen-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
}

.case-primary small {
  margin-top: 4px;
  color: var(--slate);
}

.case-data span,
.case-data strong {
  display: block;
}

.case-data span {
  color: var(--slate);
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.case-data strong {
  margin-top: 5px;
  font-size: 0.83rem;
}

.case-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.case-actions button {
  white-space: nowrap;
}

.case-progress {
  margin-top: 8px;
}

.case-progress .progress-bar {
  width: 100%;
}

.empty-state {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  color: var(--slate);
  background: rgba(255, 255, 255, 0.5);
  text-align: center;
}

.intake-shell {
  max-width: 1060px;
}

.intake-progress {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  margin-bottom: 18px;
}

.intake-progress button {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px;
  color: var(--slate);
  background: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
}

.intake-progress button.active {
  border-color: var(--evergreen);
  color: var(--white);
  background: var(--evergreen);
}

.intake-section {
  display: none;
  border-radius: var(--radius);
  padding: 22px;
}

.intake-section.active {
  display: block;
}

.intake-section-header {
  margin-bottom: 20px;
}

.intake-section-header p {
  margin: 6px 0 0;
  color: var(--slate);
  line-height: 1.5;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-grid.three {
  grid-template-columns: repeat(3, 1fr);
}

.field {
  display: grid;
  gap: 7px;
}

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

.field span {
  font-size: 0.79rem;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 11px;
  color: var(--charcoal);
  background: var(--white);
}

.field-help {
  color: var(--slate);
  font-size: 0.72rem;
  line-height: 1.4;
}

.intake-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 13px;
}

.review-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 15px;
  background: var(--stone);
}

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

.review-card span {
  margin-top: 5px;
  color: var(--slate);
  font-size: 0.8rem;
  line-height: 1.45;
}

dialog {
  width: min(540px, calc(100vw - 32px));
  border: 0;
  border-radius: 17px;
  padding: 22px;
  color: var(--charcoal);
  background: var(--white);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
}

dialog::backdrop {
  background: rgba(20, 30, 27, 0.48);
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.dialog-description {
  margin: 15px 0;
  color: var(--slate);
  line-height: 1.5;
}

.close-button {
  border: 0;
  padding: 0;
  color: var(--slate);
  background: transparent;
  font-size: 1.7rem;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 500;
  max-width: 330px;
  transform: translateY(18px);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--white);
  background: var(--evergreen-dark);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.visible {
  transform: translateY(0);
  opacity: 1;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.mobile-navigation {
  display: none;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 195px minmax(0, 1fr);
  }

  .workspace {
    padding: 23px;
  }

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

  .workflow {
    grid-template-columns: repeat(3, 1fr);
    row-gap: 21px;
  }

  .workflow::before {
    display: none;
  }

  .document-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .case-card {
    grid-template-columns: 1fr 1fr;
  }

  .case-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  body {
    overflow: auto;
    padding-bottom: 67px;
  }

  .app-shell {
    display: block;
    height: auto;
    overflow: visible;
  }

  .sidebar {
    display: none;
  }

  .workspace {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    padding: 17px;
  }

  .topbar {
    display: block;
  }

  .topbar-actions {
    margin-top: 15px;
    flex-wrap: wrap;
  }

  .search,
  .search input {
    width: 100%;
  }

  .summary-strip,
  .metric-grid,
  .metric-grid.three,
  .content-grid,
  .task-layout,
  .form-grid,
  .form-grid.three,
  .review-grid,
  .case-card {
    grid-template-columns: 1fr;
  }

  .workflow {
    grid-template-columns: 1fr;
    margin-top: 17px;
  }

  .workflow-step {
    display: grid;
    grid-template-columns: 32px 1fr;
    text-align: left;
  }

  .step-dot {
    grid-row: span 2;
    margin: 0;
  }

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

  .intake-progress {
    grid-template-columns: 1fr;
  }

  .document-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .document-card,
  .contact-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .audit-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .audit-marker {
    display: none;
  }

  .mobile-navigation {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--border);
    background: var(--white);
  }

  .mobile-navigation button {
    border: 0;
    padding: 13px 6px;
    color: var(--slate);
    background: transparent;
    font-size: 0.75rem;
  }

  .mobile-navigation button.active {
    color: var(--evergreen);
    font-weight: 700;
  }
}


/* Family Portal */

.family-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(290px, 0.7fr);
  gap: 15px;
}

.family-main-column,
.family-side-column {
  display: grid;
  align-content: start;
  gap: 15px;
}

.family-preview-panel {
  background: linear-gradient(135deg, #ffffff, #edf3ef);
}

.family-progress-card {
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 16px;
  background: var(--white);
}

.family-progress-card .progress-bar {
  width: 100%;
  max-width: 340px;
}

.family-stage-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.family-stage-grid span,
.family-stage-grid strong {
  display: block;
}

.family-stage-grid span {
  color: var(--slate);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.family-stage-grid strong {
  margin-top: 5px;
  font-size: 0.82rem;
}

.family-message-list {
  display: grid;
  gap: 10px;
  margin-top: 15px;
}

.family-message {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: var(--stone);
}

.family-message-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.family-message-heading strong,
.family-message-heading small {
  display: block;
}

.family-message-heading small {
  margin-top: 3px;
  color: var(--slate);
  font-size: 0.72rem;
}

.family-message-heading time {
  color: var(--slate);
  font-size: 0.7rem;
  white-space: nowrap;
}

.family-message p {
  margin: 12px 0 10px;
  font-size: 0.83rem;
  line-height: 1.5;
}

.message-audience {
  color: var(--slate);
  font-size: 0.7rem;
  font-weight: 700;
}

.family-access-list,
.beneficiary-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.family-access-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #ecece7;
  padding: 10px 0;
}

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

.family-access-copy strong,
.family-access-copy small {
  display: block;
}

.family-access-copy small {
  margin-top: 3px;
  color: var(--slate);
  font-size: 0.7rem;
}

.family-access-copy p {
  margin: 4px 0 0;
  color: var(--slate);
  font-size: 0.7rem;
}

.family-access-row button,
.list-row button {
  border: 0;
  cursor: pointer;
}

.beneficiary-row {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 13px;
  background: var(--stone);
}

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

.beneficiary-row small {
  margin-top: 3px;
  color: var(--slate);
  font-size: 0.72rem;
}

.beneficiary-row p {
  margin: 8px 0;
  color: var(--slate);
  font-size: 0.76rem;
  line-height: 1.4;
}

.family-report-panel {
  background: linear-gradient(145deg, #ffffff, #f4eee1);
}

@media (max-width: 1080px) {
  .family-layout {
    grid-template-columns: 1fr;
  }

  .family-side-column {
    grid-template-columns: repeat(2, 1fr);
  }

  .family-report-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .family-stage-grid,
  .family-side-column {
    grid-template-columns: 1fr;
  }

  .family-report-panel {
    grid-column: auto;
  }

  .family-access-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .family-access-row button {
    grid-column: 2;
    justify-self: start;
  }

  .family-message-heading {
    display: block;
  }

  .family-message-heading time {
    display: block;
    margin-top: 5px;
  }
}


/* Phase 4 and Phase 5 */

.table-subtext {
  display: block;
  margin-top: 3px;
  color: var(--slate);
  font-size: 0.7rem;
}

.notification-grid,
.dispute-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.notification-card,
.dispute-grid .panel {
  align-self: start;
}

.record-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.record-details div {
  min-width: 0;
}

.record-details dt {
  color: var(--slate);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.record-details dd {
  margin: 5px 0 0;
  font-size: 0.8rem;
  line-height: 1.45;
}

.full-record-detail {
  grid-column: 1 / -1;
}

.closure-summary {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 15px;
  margin-bottom: 15px;
}

.closure-score-panel {
  background: linear-gradient(135deg, #ffffff, #edf3ef);
}

.closure-score {
  margin: 12px 0;
  color: var(--evergreen-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 3rem;
  letter-spacing: -0.05em;
}

.closure-score-panel .progress-bar {
  width: 100%;
}

.closure-checklist {
  display: grid;
}

.closure-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  border-bottom: 1px solid #ecece7;
  padding: 13px 0;
}

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

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

.closure-row small {
  margin-top: 3px;
  color: var(--slate);
  font-size: 0.72rem;
}

@media (max-width: 1080px) {
  .notification-grid,
  .dispute-grid,
  .closure-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .record-details {
    grid-template-columns: 1fr;
  }

  .full-record-detail {
    grid-column: auto;
  }

  .closure-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .closure-row .table-status {
    grid-column: 2;
    justify-self: start;
  }
}


/* Resolve navigation and mobile access fix */

.sidebar {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color:
    rgba(255, 255, 255, 0.32)
    transparent;
}

.sidebar::-webkit-scrollbar {
  width: 7px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.navigation {
  flex: 0 0 auto;
  padding-bottom: 18px;
}

.sidebar-footer {
  flex: 0 0 auto;
  margin-top: auto;
  padding-top: 10px;
  padding-bottom: 4px;
  background: var(--evergreen);
}

.user-card-button {
  width: 100%;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.user-card-button:hover {
  opacity: 0.9;
}

.user-card-arrow {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.58);
  font-size: 1.25rem;
}

.mobile-menu-button,
.mobile-menu-backdrop,
.mobile-menu-close {
  display: none;
}

@media (max-width: 760px) {
  body {
    padding-top: 62px;
  }

  .mobile-menu-button {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 1002;
    width: 44px;
    height: 44px;
    display: grid;
    align-content: center;
    justify-content: center;
    gap: 5px;
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 0;
    background: var(--white);
    box-shadow: var(--shadow);
  }

  .mobile-menu-button span {
    width: 20px;
    height: 2px;
    display: block;
    border-radius: 999px;
    background: var(--evergreen);
  }

  .mobile-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(15, 35, 30, 0.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity 170ms ease;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1001;
    width: min(84vw, 320px);
    height: 100dvh;
    display: flex;
    transform: translateX(-105%);
    padding-top: 24px;
    padding-bottom: 28px;
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.22);
    transition: transform 190ms ease;
  }

  .mobile-menu-open {
    overflow: hidden;
  }

  .mobile-menu-open .sidebar {
    transform: translateX(0);
  }

  .mobile-menu-open .mobile-menu-backdrop {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu-close {
    position: absolute;
    top: 13px;
    right: 14px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 9px;
    color: var(--white);
    background: rgba(255, 255, 255, 0.12);
    font-size: 1.55rem;
  }

  .sidebar .brand {
    padding-right: 48px;
  }

  .navigation {
    margin-top: 20px;
  }

  .nav-item {
    min-height: 45px;
    font-size: 0.94rem;
  }

  .sidebar-footer {
    position: relative;
    bottom: auto;
    margin-top: 18px;
    padding-bottom: 18px;
  }

  .workspace {
    padding-top: 12px;
  }

  .topbar {
    padding-left: 52px;
  }

  .mobile-navigation {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}


/* Mass completion update */

.profile-dialog { width: min(650px, calc(100vw - 28px)); }
.profile-dialog-body { display: grid; gap: 20px; margin-top: 18px; }
.profile-dialog-identity { display: flex; align-items: center; gap: 16px; }
.profile-dialog-identity strong,
.profile-dialog-identity small { display: block; }
.profile-dialog-identity small { margin: 4px 0 9px; color: var(--slate); }
.profile-avatar-large {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--evergreen);
  background: var(--sage);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 700;
}
.profile-dialog-grid,
.case-health-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.profile-dialog-grid div,
.case-health-grid div {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 12px;
  background: var(--stone);
}
.profile-dialog-grid span,
.profile-dialog-grid strong,
.case-health-grid span,
.case-health-grid strong { display: block; }
.profile-dialog-grid span,
.case-health-grid span {
  color: var(--slate);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.profile-dialog-grid strong,
.case-health-grid strong {
  margin-top: 5px;
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}
.case-health-panel { margin-bottom: 15px; }
.case-health-grid {
  margin-top: 15px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.case-health-grid strong {
  color: var(--evergreen-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
}
@media (max-width: 760px) {
  .profile-dialog-grid,
  .case-health-grid { grid-template-columns: 1fr 1fr; }
}

/* Resolve mobile polish pass */

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

  .workspace {
    width: 100%;
    padding: 16px;
    overflow-x: hidden;
  }

  .topbar {
    padding-left: 0;
    margin-bottom: 20px;
  }

  .topbar > div:first-child {
    paddin-right: 4px;
  }

  .topbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
  }

  .topbar-actions .search {
    grid-column: 1 / -1;
  }

  .topbar-actions .search input {
    width: 100%;
    min-height: 46px;
  }

  .mobile-menu-button {
    top: 12px;
    left: 12px;
    z-index: 1002;
  }

  .mobile-menu-open .mobile-menu-button {
    opacity: 0;
    pointer-events: none;
    transform: scale(.8);
  }

  .sidebar {
    width: min(88vw, 340px);
    paddin: 76px 18px 28px;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .mobile-menu-close {
    top: 14px;
    right: 14px;
  }

  .sidebar .brand {
    padding-right: 0;
    font-size: 1.8rem;
    line-height: 1.1;
  }

  .product-label {
    max-width: 220px;
    margin-top: 6px;
    line-height: 1.35;
  }

  .case-context {
    margin-top: 24px;
    padding: 16px 0;
  }

  .case-context strong {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
    font-size: 1.05rem;
  }

  .navigation {
    gap: 6px;
    padding-bottom: 10px;
  }

  .nav-item {
    min-height: 46px;
    padding: 11px 12px;
    font-size: .92rem;
  }

  .sidebar-footer {
    margin-top: 12px;
    padding-top: 16px;
  }

  .page-tools {
    width: 100%;
    gap: 12px;
  }

  .document-grid,
  .contact-grid {
    gap: 12px;
  }

  .document-card {
    grid-template-columns: 50px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 14px;
  }

  .document-card .table-status {
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: 2px;
  }

  .document-card strong,
  .document-card small {
    overflow-wrap: anywher;
  }

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

  .family-layout,
  .profile-layout,
  .closure-summary {
    grid-template-columns: 1fr;
  }

  .list-row {
    align-items: flex-start;
  }

  .table-wrap {
    margin:-inline: -2px;
    padding-bottom: 4px;
  }

  .mobile-navigation {
    height: 60px;
    box-shadow: 0 -8px 24px rgba(20, 37, 32, .08);
  }

  .mobile-navigation button {
    min-width: 0;
    padding: 10px 4px;
    font-size: .7rrem;
  }

  .content-grid {
    gap: 12px;
  }
}
/* Resolve mobile alignment cleanup */
@media (max-width: 760px) {
  .closure-summary .side-stat {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 5px;
    padding: 14px 0;
  }
  .closure-summary .side-stat strong {
    max-width: 100%;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.2;
    font-size: 1.05rem;
  }
  .closure-checklist .closure-row {
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    padding: 18px 0;
  }
  .closure-checklist .closure-row > .table-status {
    grid-column: 2;
    justify-self: start;
    margin-top: 8px;
  }
  .closure-checklist .closure-row strong {
    line-height: 1.22;
    overflow-wrap: anywhere;
  }
  .closure-checklist .closure-row small {
    margin-top: 5px;
  }
  .table-status,
  .status-chip,
  .case-status {
    width: fit-content;
    max-width: 100%;
    white-space: normal;
    line-height: 1.15;
    text-align: left;
  }
  .document-card .table-status {
    margin-top: 4px;
  }
  .mobile-menu-button {
    box-shadow: 0 8px 24px rgba(20, 37, 32, 0.14);
  }
}
