:root {
  --ink: #17201b;
  --graphite: #2e3633;
  --paper: #f7f8f3;
  --mist: #ecefe8;
  --line: #d8ded4;
  --harbor: #0b5f59;
  --harbor-hover: #0e756c;
  --copper: #a45a2a;
  --blue: #356fb3;
  --red: #b33a3a;
  --gold: #b98520;
  --shadow-soft: 0 18px 36px rgb(23 32 27 / 0.14);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #fbfcf8;
  color: var(--ink);
}

.auth-screen {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(360px, 440px);
  gap: 48px;
  align-items: center;
  width: min(1040px, calc(100vw - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 56px 0;
}

.auth-screen-minimal {
  grid-template-columns: minmax(320px, 440px);
  justify-content: center;
}

.auth-copy {
  min-width: 0;
}

.auth-copy h1 {
  max-width: 560px;
  margin-top: 26px;
  margin-bottom: 12px;
  font-size: 42px;
  line-height: 50px;
}

.auth-copy p:not(.eyebrow) {
  max-width: 540px;
  color: var(--graphite);
  font-size: 16px;
  line-height: 24px;
}

.auth-panel {
  display: grid;
  gap: 18px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 22px;
  box-shadow: 0 16px 40px rgb(23 32 27 / 0.08);
}

.auth-panel-header {
  display: grid;
  gap: 4px;
}

.auth-panel-header h2 {
  font-size: 22px;
  line-height: 30px;
}

.auth-panel-header p:not(.eyebrow) {
  margin: 0;
  color: var(--graphite);
  font-size: 14px;
  line-height: 20px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.auth-tab {
  border-color: transparent;
  background: transparent;
  color: var(--graphite);
  font-weight: 700;
}

.auth-tab:hover,
.auth-tab.active {
  border-color: var(--harbor);
  background: var(--harbor);
  color: white;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-verification {
  display: grid;
  gap: 18px;
  padding: 4px 0;
}

.auth-verification h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 26px;
}

.auth-verification p {
  margin: 0;
  color: var(--graphite);
  font-size: 14px;
  line-height: 21px;
}

.auth-verification p + p {
  margin-top: 6px;
}

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

.text-button {
  min-height: auto;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--harbor);
  font-weight: 700;
}

.text-button:hover {
  background: transparent;
  color: var(--harbor-hover);
  text-decoration: underline;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--graphite);
  font-size: 13px;
  font-weight: 700;
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field-note {
  margin: -6px 0 0;
  color: var(--graphite);
  font-size: 12px;
  line-height: 16px;
}

.auth-message {
  min-height: 0;
  border-radius: 6px;
  color: var(--graphite);
  font-size: 13px;
  line-height: 18px;
}

.auth-message:not(:empty) {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 10px 12px;
}

.auth-message.error-text {
  border-color: #efc9c9;
  background: #fff6f6;
  color: var(--red);
}

.brand-lockup {
  display: inline-grid;
  grid-template-columns: 44px auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.brand-symbol {
  width: 44px;
  height: 44px;
}

.brand-lockup strong,
.brand-lockup span {
  display: block;
  overflow-wrap: anywhere;
}

.brand-lockup strong {
  font-size: 18px;
  line-height: 24px;
}

.brand-lockup span {
  color: var(--graphite);
  font-size: 13px;
  line-height: 18px;
}

.auth-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.auth-proof span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--graphite);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
}

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

button {
  min-height: 36px;
  border: 1px solid var(--harbor);
  border-radius: 6px;
  background: var(--harbor);
  color: white;
  padding: 0 12px;
  cursor: pointer;
}

button:hover {
  background: var(--harbor-hover);
}

.secondary-button,
.button-link {
  border-color: var(--line);
  background: white;
  color: var(--ink);
}

.secondary-button:hover,
.button-link:hover {
  border-color: var(--harbor);
  background: #eef7f4;
  color: var(--harbor);
}

.button-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  text-decoration: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid rgb(53 111 179 / 0.28);
  outline-offset: 2px;
}

button:disabled {
  border-color: var(--line);
  background: var(--mist);
  color: var(--graphite);
  cursor: not-allowed;
}

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

.danger-button:hover {
  background: #8f2d2d;
}

button:disabled.danger-button {
  border-color: var(--line);
  background: var(--mist);
  color: var(--graphite);
}

.shell-nav {
  position: fixed;
  inset: 0 auto 0 0;
  width: 256px;
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: white;
}

.nav-lockup {
  grid-template-columns: 38px minmax(0, 1fr);
  margin-bottom: 18px;
}

.nav-lockup .brand-symbol {
  width: 38px;
  height: 38px;
}

.nav-lockup strong {
  font-size: 15px;
  line-height: 20px;
}

.nav-lockup span {
  font-size: 12px;
  line-height: 16px;
}

.primary-nav {
  display: grid;
  gap: 6px;
}

.nav-add-menu {
  width: 100%;
  margin-bottom: 14px;
}

.nav-add-menu > button {
  width: 100%;
  justify-content: flex-start;
  min-height: 38px;
  font-weight: 800;
}

.nav-add-menu .menu-popover {
  left: 0;
  right: auto;
  width: 100%;
}

.nav-item {
  width: 100%;
  justify-content: flex-start;
  border-radius: 6px;
  padding: 10px 12px;
  border-color: transparent;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 700;
}

.nav-item:hover,
.nav-item.active {
  border-color: #d7e8e3;
  background: #eef7f4;
  color: var(--harbor);
}

.nav-footer {
  display: grid;
  gap: 4px;
  margin-top: auto;
  padding: 14px 12px;
  border-top: 1px solid var(--line);
  color: var(--graphite);
  font-size: 12px;
  line-height: 17px;
}

.nav-footer strong,
.nav-footer span {
  overflow-wrap: anywhere;
}

.shell-main {
  margin-left: 256px;
  padding: 28px 32px 48px;
}

.topbar,
.panel-header,
.actions,
.inline-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.topbar,
.panel-header {
  justify-content: space-between;
}

#packet-actions {
  min-width: 0;
  max-width: 100%;
  justify-content: flex-end;
  gap: 6px;
}

.topbar {
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.topbar-leading {
  min-width: 0;
}

.page-subtitle {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--graphite);
  font-size: 15px;
  line-height: 22px;
}

.panel-subtitle {
  margin: 4px 0 0;
  color: var(--graphite);
  font-size: 13px;
  line-height: 18px;
}

.session-label {
  max-width: min(320px, 32vw);
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: anywhere;
}

.firm-menu {
  position: relative;
}

.firm-menu-trigger {
  display: inline-flex;
  min-height: 34px;
  max-width: 100%;
  align-items: center;
  gap: 8px;
  border-color: transparent;
  background: transparent;
  color: var(--ink);
  padding: 6px 4px 6px 8px;
}

.firm-menu-trigger:hover,
.firm-menu-trigger[aria-expanded="true"] {
  border-color: var(--line);
  background: white;
}

.firm-menu-trigger::after {
  width: 0;
  height: 0;
  margin-right: 4px;
  border-top: 5px solid var(--graphite);
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  content: "";
}

.firm-menu-popover {
  min-width: 164px;
}

.firm-menu-popover .firm-menu-logout {
  color: var(--red);
}

.firm-menu-popover .firm-menu-logout:hover {
  background: #fff5f4;
  color: var(--red);
}

.add-menu {
  position: relative;
}

.menu-popover {
  position: absolute;
  z-index: 5;
  right: 0;
  top: calc(100% + 8px);
  display: grid;
  min-width: 190px;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 6px;
  box-shadow: 0 18px 36px rgb(23 32 27 / 0.14);
}

.menu-popover button {
  justify-content: flex-start;
  border-color: transparent;
  background: white;
  color: var(--ink);
  text-align: left;
}

.menu-popover button:hover {
  background: #eef7f4;
  color: var(--harbor);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--harbor);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 34px;
  line-height: 42px;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  line-height: 24px;
}

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

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

.global-notice:empty {
  display: none;
}

.global-notice {
  margin: 16px 0 0;
  padding: 10px 12px;
  border: 1px solid #d7e8e3;
  border-radius: 6px;
  background: #f4faf8;
}

.metric,
.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.panel {
  box-shadow: 0 1px 0 rgb(23 32 27 / 0.03);
}

.metric {
  padding: 14px 16px;
}

.metric span {
  display: block;
  margin-bottom: 4px;
  font-size: 28px;
  font-weight: 700;
}

.metric label {
  color: var(--graphite);
  font-size: 13px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 16px;
  margin-top: 22px;
  margin-bottom: 16px;
}

.workspace.one-column,
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-top: 22px;
}

.home-command-center {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.home-category-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.home-category {
  display: flex;
  min-width: 0;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: white;
  color: var(--ink);
  padding: 14px 16px;
  text-align: left;
}

.home-category:last-child {
  border-right: 0;
}

.home-category:hover,
.home-category:focus-visible {
  background: #eef7f4;
  color: var(--harbor);
}

.home-category span:first-child {
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 18px;
}

.home-category-count {
  flex: 0 0 auto;
  font-size: 22px;
  font-weight: 400;
  line-height: 28px;
}

.home-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.85fr);
  gap: 16px;
}

.home-content-grid:has(.home-focus-panel[hidden]) {
  grid-template-columns: minmax(0, 1fr);
}

.home-activity-list,
.home-focus-list,
.home-focus-rows {
  display: grid;
}

.home-activity-list {
  margin-top: 12px;
}

.home-activity-row,
.home-focus-row {
  width: 100%;
  min-width: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  padding: 10px 0;
  text-align: left;
}

.home-activity-row:hover,
.home-focus-row:hover {
  background: transparent;
  color: var(--harbor);
}

.home-activity-row:last-child,
.home-focus-row:last-child {
  border-bottom: 0;
}

.home-activity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(154px, 0.7fr) auto;
  gap: 12px;
  align-items: center;
}

.home-activity-context,
.home-activity-description,
.home-activity-date,
.home-focus-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.home-activity-context,
.home-focus-row {
  display: grid;
  gap: 2px;
}

.home-activity-client,
.home-focus-row span:first-child {
  font-size: 13px;
  line-height: 18px;
}

.home-activity-context span:last-child,
.home-activity-description,
.home-activity-date,
.home-focus-row span:last-child,
.home-empty-state {
  color: var(--graphite);
  font-size: 12px;
  line-height: 17px;
}

.home-activity-date {
  text-align: right;
  white-space: nowrap;
}

.home-empty-state {
  margin: 12px 0 0;
}

.home-focus-list {
  gap: 18px;
}

.home-focus-section {
  display: grid;
  gap: 8px;
}

.home-focus-section .mini-section-heading h2 {
  margin: 0;
  font-size: 14px;
  line-height: 18px;
}

.packet-summary-context {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--graphite);
  font-size: 12px;
  line-height: 18px;
}

.packet-summary-context .table-link {
  color: var(--harbor);
  font-size: 12px;
}

.section-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.section-tab {
  min-height: 30px;
  border-color: var(--line);
  background: white;
  color: var(--graphite);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.section-tab:hover,
.section-tab.active {
  border-color: var(--harbor);
  background: #eef7f4;
  color: var(--harbor);
}

.section-tabs {
  margin-top: 14px;
}

.operations-panel {
  margin-bottom: 16px;
}

.operations-grid {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
  margin-top: 14px;
}

.operations-grid label {
  display: grid;
  gap: 6px;
  color: var(--graphite);
  font-size: 13px;
}

.summary-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 40px;
  color: var(--graphite);
}

.lifecycle-actions {
  grid-column: 1 / -1;
}

.system-field {
  display: none !important;
}

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

.secondary-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
  padding: 10px 12px;
}

.secondary-details summary {
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

.secondary-details label,
.secondary-details .inline-actions {
  margin-top: 12px;
}

.admin-details {
  margin-top: 12px;
}

.panel {
  min-height: 96px;
  padding: 14px;
}

.form-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.form-panel label,
.checkbox-label {
  display: grid;
  gap: 6px;
  color: var(--graphite);
  font-size: 13px;
  font-weight: 700;
}

.source-preview {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--graphite);
  font-size: 13px;
}

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

.generated-request-list {
  display: grid;
  gap: 6px;
}

.preview-request-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 28px;
  margin: 0;
  color: var(--ink);
  font-weight: 600;
}

.preview-request-row input {
  width: 16px;
  min-height: 16px;
}

.preview-request-row span {
  overflow-wrap: anywhere;
}

.preview-request-row em {
  color: var(--graphite);
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
}

.source-preview-summary strong,
.source-preview-summary span {
  overflow-wrap: anywhere;
}

.source-preview-summary strong {
  color: var(--ink);
}

.checklist-builder {
  display: grid;
  gap: 10px;
}

.checklist-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(170px, 0.8fr) minmax(110px, auto) auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

.checkbox-label {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.row {
  display: grid;
  min-width: 0;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}

.packet-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

.packet-card.selected {
  border-color: var(--harbor);
  box-shadow: inset 3px 0 0 var(--harbor);
}

.packet-card-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  text-align: left;
}

.packet-card-button:hover {
  background: transparent;
  color: var(--ink);
}

.packet-card-button strong,
.packet-card-button small {
  display: block;
  overflow-wrap: anywhere;
}

.packet-card-button small,
.packet-card-meta {
  color: var(--graphite);
  font-size: 12px;
}

.packet-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.row button {
  justify-self: start;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: auto;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: var(--graphite);
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
}

.compact-button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.compact-actions {
  gap: 6px;
}

.table-link {
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--harbor);
  padding: 0;
  text-align: left;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.table-link:hover {
  background: transparent;
  color: var(--harbor-hover);
}

.row > *,
.item-row > *,
.document-card > *,
.request-review-row > *,
.unmatched-upload-row > *,
.packet-card > * {
  min-width: 0;
}

.row strong,
.row span,
.item-row span,
.document-card strong,
.document-card span,
.audit-row span {
  overflow-wrap: anywhere;
}

.status-badge.ready_for_bookkeeping,
.status-badge.sent,
.status-badge.approved,
.status-badge.accepted,
.status-badge.complete,
.status-badge.exported,
.status-badge.not_applicable {
  color: var(--harbor);
}

.status-badge.needs_firm_review,
.status-badge.awaiting_client,
.status-badge.draft,
.status-badge.expired,
.status-badge.needs_replacement {
  color: var(--copper);
}

.status-badge.rejected_replacement_needed,
.status-badge.failed,
.status-badge.missing,
.status-badge.quarantined,
.status-badge.revoked,
.status-badge.blocked {
  color: var(--red);
}

.muted,
.detail-empty {
  color: var(--graphite);
}

.item-grid {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.item-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 120px minmax(210px, auto);
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.comment-thread {
  display: grid;
  gap: 4px;
  margin-top: 6px;
}

.comment-line {
  display: grid;
  grid-template-columns: minmax(70px, max-content) minmax(0, 1fr);
  gap: 6px;
  color: var(--graphite);
  font-size: 12px;
  line-height: 17px;
}

.comment-line strong {
  color: var(--ink);
  font-size: 12px;
}

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

.detail-header,
.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.packet-work-area-entity {
  margin: 4px 0 0;
  color: var(--graphite);
  font-size: 13px;
  line-height: 18px;
}

.packet-context-row {
  display: flex;
  justify-content: flex-end;
  min-height: 18px;
}

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

.subsection h3 {
  margin-bottom: 10px;
  font-size: 15px;
  line-height: 20px;
}

.empty-state {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.data-table-wrap {
  width: 100%;
  margin-top: 14px;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  color: var(--graphite);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.data-table td strong,
.data-table td span {
  display: block;
  overflow-wrap: anywhere;
}

.data-table td span {
  color: var(--graphite);
  font-size: 12px;
  line-height: 17px;
}

.compact-data-table {
  min-width: 640px;
}

.workflow-table {
  min-width: 980px;
}

.completed-table {
  min-width: 760px;
}

.table-primary-cell,
.stacked-cell,
.table-action-cell {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.table-primary-cell strong,
.table-primary-cell span,
.stacked-cell span,
.action-reason {
  overflow-wrap: anywhere;
}

.table-primary-cell strong {
  font-size: 13px;
  line-height: 18px;
}

.table-value {
  color: var(--ink) !important;
  font-size: 13px !important;
  font-weight: 400;
  line-height: 18px !important;
}

.stacked-cell span,
.action-reason {
  color: var(--graphite);
  font-size: 12px;
  line-height: 16px;
}

.table-action-cell {
  justify-items: start;
}

.detail-page {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.detail-page-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

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

.client-summary-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.client-summary-band div {
  min-width: 0;
}

.client-summary-band strong,
.client-summary-band span {
  display: block;
  overflow-wrap: anywhere;
}

.client-summary-band strong {
  font-size: 16px;
  line-height: 22px;
}

.source-list {
  margin-top: 12px;
}

.packet-mini-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.packet-section-stack {
  display: grid;
  gap: 18px;
  margin-top: 12px;
}

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

.mini-section-heading h3 {
  margin: 0;
  font-size: 14px;
  line-height: 18px;
}

.mini-section-heading span {
  color: var(--graphite);
  font-size: 12px;
  font-weight: 800;
}

.secondary-packet-section {
  opacity: 0.92;
}

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

.packet-mini-row strong,
.packet-mini-row span {
  display: block;
  overflow-wrap: anywhere;
}

.packet-mini-row span {
  color: var(--graphite);
  font-size: 12px;
}

.document-card {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(170px, auto) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.request-review-list,
.unmatched-upload-list {
  display: grid;
  gap: 6px;
}

.request-review-row,
.unmatched-upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 0.8fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 10px 0 10px 10px;
  border-bottom: 1px solid var(--line);
  box-shadow: inset 3px 0 0 transparent;
}

.request-review-row.needs-review {
  box-shadow: inset 3px 0 0 var(--copper);
}

.request-review-row.needs-client {
  box-shadow: inset 3px 0 0 var(--blue);
}

.request-review-row.resolved {
  box-shadow: inset 3px 0 0 var(--harbor);
}

.request-review-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.request-review-main strong,
.request-review-main span {
  overflow-wrap: anywhere;
}

.request-review-main strong {
  font-size: 13px;
  line-height: 17px;
}

.request-review-main span {
  color: var(--graphite);
  font-size: 12px;
  line-height: 16px;
}

.request-review-statuses {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.unmatched-upload-row .request-review-statuses {
  grid-template-columns: repeat(2, minmax(80px, 1fr));
}

.request-review-actions {
  grid-column: 1 / -1;
  min-width: 0;
  justify-content: flex-start;
  gap: 6px;
}

.request-review-actions .more-actions-menu {
  right: auto;
  left: 0;
}

.document-request {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.document-request strong,
.document-request span,
.document-status-pair strong,
.document-status-pair small {
  overflow-wrap: anywhere;
}

.document-request strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 17px;
}

.document-request span {
  color: var(--graphite);
  font-size: 12px;
  line-height: 16px;
}

.document-statuses {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 170px;
}

.document-status-pair {
  display: grid;
  gap: 2px;
}

.document-status-pair small {
  color: var(--graphite);
  font-size: 10px;
  font-weight: 800;
  line-height: 12px;
}

.document-status-pair strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 16px;
}

.document-actions {
  justify-content: flex-end;
  gap: 6px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
}

.download-button {
  position: relative;
}

.download-button::before {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.download-button::after {
  content: "";
  position: absolute;
  bottom: 8px;
  width: 14px;
  height: 2px;
  background: currentColor;
}

.more-actions {
  position: relative;
}

.more-actions summary {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

.more-actions summary::-webkit-details-marker {
  display: none;
}

.more-actions-menu {
  position: absolute;
  right: 0;
  z-index: 20;
  display: grid;
  gap: 6px;
  min-width: 240px;
  margin-top: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow-soft);
}

.reassign-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.reassign-control select {
  min-width: 0;
}

.audit-list {
  display: grid;
  gap: 6px;
}

.audit-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(120px, 0.8fr) minmax(130px, auto);
  gap: 10px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.flag-list,
.blocker-list,
.compact-list {
  margin: 0;
  padding-left: 18px;
}

.flag-list {
  grid-column: 1 / -1;
  color: var(--copper);
}

.blocker-list {
  color: var(--copper);
}

.link-callout {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #d7e8e3;
  border-radius: 8px;
  background: #f4faf8;
}

.link-callout a {
  font-size: 13px;
}

.compact-callout {
  margin-top: 10px;
  padding: 10px;
}

.compact-link-button {
  min-height: 30px;
  padding: 0 9px;
  font-size: 12px;
}

.stepper {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding: 0;
}

.compact-stepper {
  margin-top: 0;
}

.stepper-item {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.stepper-item:last-child {
  border-bottom: 0;
}

.stepper-item strong,
.stepper-item span {
  display: block;
  overflow-wrap: anywhere;
}

.stepper-item span {
  color: var(--graphite);
  font-size: 12px;
}

.step-dot {
  width: 10px;
  height: 10px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: white;
}

.stepper-item.complete .step-dot {
  border-color: var(--harbor);
  background: var(--harbor);
}

a {
  color: var(--harbor);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100vw - 40px));
  border-radius: 8px;
  background: var(--harbor);
  color: white;
  padding: 12px 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.toast.visible {
  opacity: 1;
}

.toast.error {
  background: var(--red);
}

dialog {
  width: min(760px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  padding: 18px;
  box-shadow: 0 24px 70px rgb(23 32 27 / 0.22);
}

dialog.settings-modal {
  width: min(940px, calc(100vw - 72px));
  max-height: min(820px, calc(100dvh - 72px));
  overflow: auto;
  padding: 0;
}

.settings-modal-content.portal-appearance {
  display: grid;
  gap: 24px;
  padding: 36px;
}

.settings-modal-content > .panel-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.settings-modal-content .portal-branding-form {
  gap: 20px;
}

.settings-modal-content .portal-branding-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.settings-modal-content .portal-branding-status {
  min-height: 0;
  margin: -8px 0 0;
}

.modal-summary {
  display: grid;
  gap: 10px;
  color: var(--graphite);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.summary-row strong {
  color: var(--ink);
}

.reminder-list {
  max-height: 160px;
  overflow: auto;
}

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

.character-count {
  margin-top: -6px;
  color: var(--graphite);
  font-size: 12px;
  text-align: right;
}

dialog::backdrop {
  background: rgb(23 32 27 / 0.4);
}

.dialog-close-form {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.entry-modal-header {
  margin-bottom: 14px;
}

.entry-form {
  display: grid;
  gap: 12px;
}

.entry-form label {
  display: grid;
  gap: 6px;
  color: var(--graphite);
  font-size: 13px;
  font-weight: 700;
}

.client-body {
  min-height: 100dvh;
  background: var(--paper);
}

.client-body.client-portal-loading {
  background: #f1f5f2;
}

.client-shell {
  width: min(820px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.client-portal:not(.client-portal-ready) {
  visibility: hidden;
}

.client-header {
  margin-bottom: 16px;
}

.client-brand-lockup {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  max-width: 100%;
  margin: 0 0 18px;
  color: var(--ink);
}

.client-brand-logo {
  display: block;
  width: 40px;
  height: 40px;
  max-width: 40px;
  max-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  object-fit: contain;
  object-position: center;
}

.client-brand-name {
  min-width: 0;
  overflow-wrap: anywhere;
  color: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 18px;
}

.client-brand-subtitle {
  margin: 1px 0 0;
  margin-top: 1px;
  color: var(--graphite);
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
}

.portal-theme-classic {
  background: transparent;
}

.client-body.portal-theme-classic {
  background: #f1f5f2;
}

.portal-theme-classic .client-shell {
  width: min(860px, calc(100vw - 40px));
}

.portal-theme-classic .client-brand-lockup {
  margin-bottom: 24px;
  padding: 0 2px 16px;
  border-bottom: 1px solid var(--line);
}

.portal-theme-classic .client-header {
  margin-bottom: 24px;
}

.portal-theme-classic .client-workflow {
  gap: 18px;
}

.portal-theme-classic .client-workflow > .panel {
  border-color: #dbe5df;
  background: #fff;
  box-shadow: 0 14px 34px rgb(23 32 27 / 0.07);
}

.portal-theme-classic .client-item-row {
  border-color: #dbe5df;
  background: #fbfdfc;
}

.portal-theme-classic .upload-form input,
.portal-theme-classic .upload-form select,
.portal-theme-classic .upload-form textarea {
  border-color: #dbe5df;
}

.portal-theme-signature {
  background: transparent;
}

.client-body.portal-theme-signature {
  background: #202c28;
}

.portal-theme-signature .client-shell {
  width: min(900px, calc(100vw - 40px));
  padding: 40px 0 64px;
}

.portal-theme-signature .client-brand-lockup {
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 22px;
  border: 1px solid var(--graphite);
  border-radius: 8px;
  background: var(--graphite);
  color: white;
  padding: 14px 16px;
}

.portal-theme-signature .client-brand-logo {
  width: 44px;
  height: 44px;
  max-width: 44px;
  max-height: 44px;
  border-color: rgb(255 255 255 / 0.34);
}

.portal-theme-signature .client-brand-subtitle {
  color: rgb(255 255 255 / 0.76);
}

.portal-theme-signature .client-header {
  width: min(760px, 100%);
  margin: 0 auto 28px;
  text-align: center;
}

.portal-theme-signature .client-header h1 {
  color: white;
}

.portal-theme-signature .client-header .muted {
  color: rgb(235 244 240 / 0.8);
}

.portal-theme-signature .client-header a {
  color: #9ed6c5;
}

.portal-theme-signature .client-workflow {
  width: min(820px, 100%);
  margin: 0 auto;
  gap: 18px;
}

.portal-theme-signature .client-workflow > .panel {
  border-color: rgb(255 255 255 / 0.15);
  background: #fff;
  box-shadow: 0 18px 42px rgb(0 0 0 / 0.24);
}

.portal-theme-signature .client-items {
  gap: 10px;
}

.portal-theme-signature .client-item-row {
  border-color: #dfe8e3;
  background: #f8fbf9;
}

.portal-theme-signature .upload-form input,
.portal-theme-signature .upload-form select,
.portal-theme-signature .upload-form textarea {
  border-color: #d7e3dc;
  background: #fbfdfc;
}

.portal-theme-signature .upload-form input:focus,
.portal-theme-signature .upload-form select:focus,
.portal-theme-signature .upload-form textarea:focus {
  border-color: #397a69;
  box-shadow: 0 0 0 3px rgb(57 122 105 / 0.14);
}

.portal-theme-signature .client-item-actions button:not(.secondary-button) {
  background: #285e51;
}

.portal-theme-focused {
  background: transparent;
}

.client-body.portal-theme-focused {
  background: white;
}

.portal-theme-focused .client-shell {
  width: min(760px, calc(100vw - 32px));
  padding-top: 40px;
}

.portal-theme-focused .client-brand-lockup {
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.portal-theme-focused .client-brand-logo {
  width: 32px;
  height: 32px;
  max-width: 32px;
  max-height: 32px;
  border-radius: 4px;
}

.portal-theme-focused .client-brand-name {
  font-size: 12px;
  line-height: 16px;
}

.portal-theme-focused .client-brand-subtitle {
  display: none;
}

.portal-theme-focused .client-header {
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.portal-theme-focused .client-header .eyebrow {
  margin-bottom: 6px;
}

.portal-theme-focused .client-header h1 {
  font-size: 27px;
  line-height: 34px;
}

.portal-theme-focused .client-workflow {
  gap: 12px;
}

.portal-theme-focused .client-workflow > .panel {
  border-width: 0 0 1px;
  border-radius: 0;
  box-shadow: none;
  padding: 0 0 16px;
}

.portal-theme-focused .client-workflow > .panel:last-child {
  border-bottom: 0;
}

.portal-theme-focused .client-item-row {
  border-width: 0 0 1px;
  border-radius: 0;
  background: transparent;
  padding: 12px 0;
}

.portal-theme-focused .client-items {
  gap: 0;
}

.portal-theme-focused .upload-form {
  gap: 12px;
}

.portal-theme-focused .upload-form input,
.portal-theme-focused .upload-form select,
.portal-theme-focused .upload-form textarea {
  border-width: 0 0 1px;
  border-radius: 0;
  padding-right: 0;
  padding-left: 0;
}

.portal-appearance {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 2px 0;
}

.portal-appearance > header,
.portal-appearance > .panel-header {
  align-items: flex-start;
}

.portal-appearance h3 {
  margin-bottom: 4px;
  font-size: 15px;
  line-height: 20px;
}

.portal-appearance p {
  margin-bottom: 0;
  color: var(--graphite);
  font-size: 13px;
  line-height: 19px;
}

.portal-theme-fieldset {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.portal-theme-fieldset legend {
  padding: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.portal-branding-identity {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.8fr);
  gap: 18px;
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.portal-branding-current-logo,
.portal-branding-preview-identity {
  min-width: 0;
}

.portal-branding-identity-lockup,
.portal-branding-preview-lockup {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.portal-branding-logo,
.portal-branding-name-fallback {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--harbor);
  font-size: 13px;
  font-weight: 800;
  object-fit: contain;
}

.portal-branding-logo-controls {
  display: grid;
  gap: 6px;
}

.portal-branding-preview {
  display: grid;
  gap: 10px;
}

.portal-branding-preview-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.portal-branding-preview-canvas {
  display: grid;
  gap: 8px;
  min-height: 126px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  padding: 16px;
}

.portal-branding-preview-canvas[data-portal-theme="signature"] {
  background: var(--graphite);
  color: white;
}

.portal-branding-preview-canvas[data-portal-theme="signature"] .portal-branding-logo,
.portal-branding-preview-canvas[data-portal-theme="signature"] .portal-branding-name-fallback {
  border-color: rgb(255 255 255 / 0.34);
}

.portal-branding-preview-canvas[data-portal-theme="focused"] {
  border-width: 0 0 1px;
  border-radius: 0;
  background: white;
}

.portal-logo-preview {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 78px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: var(--paper);
  padding: 10px;
}

.portal-logo-preview img,
.portal-logo-preview .client-brand-logo {
  width: 56px;
  height: 56px;
  max-width: 56px;
  max-height: 56px;
  margin: 0;
}

.portal-logo-preview strong,
.portal-logo-preview span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.portal-logo-preview strong {
  font-size: 13px;
  line-height: 18px;
}

.portal-logo-preview span {
  margin-top: 2px;
  color: var(--graphite);
  font-size: 12px;
  line-height: 17px;
}

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

.portal-style-option {
  position: relative;
  display: grid;
  grid-template-rows: 84px auto minmax(32px, auto);
  min-width: 0;
  min-height: 174px;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 10px;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

button.portal-style-option {
  width: 100%;
  min-height: 174px;
}

.portal-style-option:hover {
  border-color: var(--harbor);
  background: #fbfdfc;
  color: var(--ink);
}

.portal-style-option.selected,
.portal-style-option.active,
.portal-style-option[aria-checked="true"],
.portal-style-option[aria-selected="true"] {
  border-color: var(--harbor);
  box-shadow: inset 0 0 0 1px var(--harbor);
}

.portal-style-option:focus-visible,
.portal-style-option:has(input:focus-visible) {
  outline: 3px solid rgb(53 111 179 / 0.28);
  outline-offset: 2px;
}

.portal-style-option input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
  white-space: nowrap;
}

.portal-style-option:has(input:checked) {
  border-color: var(--harbor);
  box-shadow: inset 0 0 0 1px var(--harbor);
}

.portal-style-option::before {
  content: "";
  display: block;
  height: 84px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background-color: var(--paper);
}

.portal-style-option::after {
  content: "";
  position: absolute;
  right: 22px;
  left: 22px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: white;
}

.portal-style-option > strong,
.portal-style-option > span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.portal-style-option > strong {
  font-size: 13px;
  line-height: 18px;
}

.portal-style-option > span {
  color: var(--graphite);
  font-size: 12px;
  line-height: 16px;
}

.portal-style-option.portal-theme-classic::before,
.portal-style-option.classic::before,
.portal-style-option[data-portal-style="classic"]::before {
  border-color: #dbe5df;
  background: #edf4ef;
  box-shadow: inset 0 -44px 0 white;
}

.portal-style-option.portal-theme-classic::after,
.portal-style-option.classic::after,
.portal-style-option[data-portal-style="classic"]::after {
  top: 55px;
  border-color: #dbe5df;
}

.portal-style-option.portal-theme-signature::before,
.portal-style-option.signature::before,
.portal-style-option[data-portal-style="signature"]::before {
  border-color: var(--graphite);
  background: var(--graphite);
  box-shadow: inset 0 0 0 8px #202c28;
}

.portal-style-option.portal-theme-signature::after,
.portal-style-option.signature::after,
.portal-style-option[data-portal-style="signature"]::after {
  top: 54px;
  border-color: transparent;
  box-shadow: 0 7px 0 -5px #b8d7cc;
}

.portal-style-option.portal-theme-focused::before,
.portal-style-option.focused::before,
.portal-style-option[data-portal-style="focused"]::before {
  background: white;
  border-width: 0 0 1px;
  border-radius: 0;
}

.portal-style-option.portal-theme-focused::after,
.portal-style-option.focused::after,
.portal-style-option[data-portal-style="focused"]::after {
  top: 53px;
  height: 1px;
  border: 0;
  border-radius: 0;
  background: var(--graphite);
  box-shadow: 0 -13px 0 -1px var(--line), 0 13px 0 -1px var(--line);
}

.client-header h1 {
  font-size: 30px;
  line-height: 38px;
}

.client-items {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.client-workflow {
  display: grid;
  gap: 16px;
}

.client-recovery {
  margin-bottom: 16px;
}

.client-item-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
}

.client-item-main {
  display: grid;
  gap: 4px;
}

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

.client-portal-feedback {
  margin: 0;
}

.client-complete-state {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid #d7e8e3;
  border-radius: 6px;
  background: #f4faf8;
}

.client-complete-state strong {
  color: var(--harbor);
  font-size: 13px;
  line-height: 18px;
}

.client-complete-state span {
  color: var(--graphite);
  font-size: 12px;
  line-height: 16px;
}

.item-comment-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

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

.client-note-disclosure summary {
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.client-note-disclosure[open] summary {
  margin-bottom: 8px;
}

.client-note-disclosure .item-comment-form {
  border: 0;
  padding-top: 0;
}

.item-comment-form label {
  display: grid;
  gap: 5px;
  color: var(--graphite);
  font-size: 13px;
}

.item-comment-actions {
  display: grid;
  gap: 5px;
  justify-items: end;
  color: var(--graphite);
  font-size: 12px;
}

.upload-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.upload-form label {
  display: grid;
  gap: 6px;
  color: var(--graphite);
  font-size: 14px;
}

dialog.client-upload-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: min(700px, calc(100dvh - 32px));
  overflow: auto;
  padding: 0;
}

.client-upload-form {
  gap: 16px;
  margin: 0;
  padding: 28px;
}

.client-upload-dialog-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.client-upload-dialog-header h2 {
  margin-bottom: 4px;
  font-size: 20px;
  line-height: 26px;
}

.client-upload-dialog-header .muted {
  margin: 0;
  font-size: 13px;
  line-height: 18px;
}

.upload-note-label textarea {
  min-height: 92px;
}

.file-dropzone {
  display: grid;
  min-height: 128px;
  place-items: center;
  gap: 6px;
  border: 1px dashed #9eb8ae;
  border-radius: 8px;
  background: #f7fbf9;
  color: var(--ink);
  padding: 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.file-dropzone:hover,
.file-dropzone:focus-visible,
.file-dropzone.is-dragging {
  border-color: var(--harbor);
  background: #eef7f4;
  box-shadow: inset 0 0 0 1px var(--harbor);
  outline: none;
}

.file-dropzone strong {
  font-size: 14px;
  line-height: 20px;
}

.file-dropzone span {
  color: var(--graphite);
  font-size: 12px;
  line-height: 17px;
  overflow-wrap: anywhere;
}

.client-upload-dialog-actions {
  justify-content: flex-end;
  padding-top: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
  white-space: nowrap;
}

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

input::placeholder,
textarea::placeholder {
  color: #7d8782;
}

.notice {
  margin-top: 12px;
  color: var(--harbor);
  font-weight: 700;
}

.receipt-panel {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--mist);
}

.error-text {
  color: var(--red);
}

@media (max-width: 900px) {
  .auth-screen,
  .two-column {
    grid-template-columns: 1fr;
  }

  .auth-screen {
    align-items: start;
    padding: 24px 0 40px;
  }

  .shell-nav {
    position: static;
    width: auto;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    overflow-x: auto;
  }

  .nav-lockup {
    margin-bottom: 0;
  }

  .primary-nav {
    display: flex;
    min-width: max-content;
  }

  .nav-add-menu {
    width: auto;
    min-width: 140px;
    margin-bottom: 0;
  }

  .nav-add-menu .menu-popover {
    width: 190px;
  }

  .nav-footer {
    display: none;
  }

  .shell-main {
    margin-left: 0;
    padding: 20px 16px 40px;
  }

  .metric-grid,
  .workspace,
  .dashboard-grid,
  .home-content-grid,
  .operations-grid,
  .form-grid,
  .checklist-row,
  .topbar-leading,
  .client-summary-band {
    grid-template-columns: 1fr;
  }

  .item-row,
  .document-card,
  .request-review-row,
  .unmatched-upload-row,
  .client-item-row,
  .audit-row,
  .detail-header,
  .split-section,
  .stepper-item,
  .packet-mini-row {
    grid-template-columns: 1fr;
  }

  .document-statuses,
  .request-review-statuses,
  .item-comment-form {
    display: grid;
    grid-template-columns: 1fr;
  }

  .document-actions,
  .request-review-actions,
  .client-item-actions {
    justify-content: flex-start;
  }

  .portal-theme-signature .client-header {
    text-align: left;
  }

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

  .portal-style-option,
  button.portal-style-option {
    min-height: 154px;
  }

  .more-actions-menu {
    position: static;
  }

  dialog.settings-modal {
    width: min(760px, calc(100vw - 40px));
  }

  .portal-branding-identity {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .topbar {
    align-items: flex-start;
  }

  .firm-menu-trigger {
    max-width: calc(100vw - 48px);
  }

  .session-label {
    max-width: calc(100vw - 100px);
  }

  dialog.settings-modal {
    width: calc(100vw - 28px);
    max-height: calc(100dvh - 28px);
  }

  .settings-modal-content {
    gap: 16px;
    padding: 22px;
  }

  .settings-modal-content.portal-appearance {
    padding: 22px;
  }

  .settings-modal-content > .panel-header {
    padding-bottom: 14px;
  }

  dialog.client-upload-dialog {
    width: calc(100vw - 28px);
    max-height: calc(100dvh - 28px);
  }

  .client-upload-form {
    padding: 22px;
  }

  .file-dropzone {
    min-height: 116px;
    padding: 14px;
  }

  .portal-style-grid {
    gap: 8px;
  }

  .portal-style-option,
  button.portal-style-option {
    grid-template-columns: 88px minmax(0, 1fr);
    grid-template-rows: auto auto;
    min-height: 78px;
    gap: 2px 12px;
    padding: 8px;
  }

  .portal-style-option::before {
    grid-column: 1;
    grid-row: 1 / span 2;
    height: 60px;
  }

  .portal-style-option::after {
    top: 31px;
    right: auto;
    left: 22px;
    width: 60px;
    height: 17px;
  }

  .portal-style-option > strong,
  .portal-style-option > span {
    grid-column: 2;
  }

  .portal-style-option > strong {
    align-self: end;
  }

  .portal-style-option > span {
    align-self: start;
  }

  .portal-style-option.portal-theme-classic::after,
  .portal-style-option.classic::after,
  .portal-style-option[data-portal-style="classic"]::after {
    top: 32px;
  }

  .portal-style-option.portal-theme-signature::after,
  .portal-style-option.signature::after,
  .portal-style-option[data-portal-style="signature"]::after {
    top: 31px;
  }

  .portal-style-option.portal-theme-focused::after,
  .portal-style-option.focused::after,
  .portal-style-option[data-portal-style="focused"]::after {
    top: 38px;
  }

  .settings-modal-content .portal-branding-actions {
    position: sticky;
    z-index: 1;
    bottom: -22px;
    margin: 0 -22px -22px;
    background: white;
    box-shadow: 0 -10px 18px rgb(23 32 27 / 0.08);
    padding: 14px 22px;
  }
}

@media (max-width: 420px) {
  .client-shell,
  .portal-theme-classic .client-shell,
  .portal-theme-signature .client-shell,
  .portal-theme-focused .client-shell {
    width: calc(100% - 24px);
    max-width: 820px;
    padding-top: 18px;
  }

  .client-brand-lockup,
  .portal-theme-signature .client-brand-lockup {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 9px;
    padding: 10px 0 12px;
  }

  .portal-theme-signature .client-brand-lockup {
    padding: 12px;
  }

  .client-brand-logo,
  .portal-theme-signature .client-brand-logo {
    width: 36px;
    height: 36px;
    max-width: 36px;
    max-height: 36px;
  }

  .client-header h1,
  .portal-theme-focused .client-header h1 {
    font-size: 25px;
    line-height: 32px;
  }

  .portal-logo-preview {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
  }

  .portal-logo-preview img,
  .portal-logo-preview .client-brand-logo {
    width: 44px;
    height: 44px;
    max-width: 44px;
    max-height: 44px;
  }

  .portal-style-option::after {
    right: 20px;
    left: 20px;
  }
}

/* Mobile is intentionally a focused staff work surface, not a compressed desktop dashboard. */
.mobile-app-bar,
.mobile-nav-scrim,
.mobile-nav-firm-actions {
  display: none;
}

@media (min-width: 768px) and (max-width: 900px) {
  .staff-data-table,
  .staff-data-table.compact-data-table,
  .staff-data-table.workflow-table,
  .staff-data-table.completed-table {
    min-width: 0;
  }

  .staff-data-table thead {
    display: none;
  }

  .staff-data-table tbody {
    display: grid;
    gap: 10px;
  }

  .staff-data-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 18px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: white;
    padding: 12px;
  }

  .staff-data-table td {
    display: grid;
    grid-template-columns: minmax(82px, 0.55fr) minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    border: 0;
    padding: 0;
  }

  .staff-data-table td::before {
    color: var(--graphite);
    content: attr(data-label);
    font-size: 11px;
    font-weight: 800;
    line-height: 17px;
    text-transform: uppercase;
  }

  .staff-data-table td:first-child,
  .packet-workflow-table td:last-child {
    grid-column: 1 / -1;
  }

  .staff-data-table td:first-child {
    grid-template-columns: minmax(0, 1fr);
    border-bottom: 1px solid var(--line);
    padding-bottom: 9px;
  }

  .staff-data-table td:first-child::before,
  .packet-workflow-table td:last-child::before {
    display: none;
  }

  .packet-workflow-table td:last-child {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 2px;
  }

  .packet-workflow-table .table-action-cell,
  .packet-workflow-table .table-action-cell button {
    width: 100%;
  }

  .account-sources-table td:last-child {
    grid-column: 1 / -1;
  }

  .account-sources-table td:last-child::before {
    display: none;
  }

  .data-table-wrap {
    overflow: visible;
  }
}

@media (max-width: 767px) {
  body.mobile-nav-open {
    overflow: hidden;
  }

  .auth-screen {
    width: min(100% - 32px, 440px);
    gap: 28px;
    padding: 24px 0 32px;
  }

  .auth-copy h1 {
    margin-top: 18px;
    font-size: 34px;
    line-height: 40px;
  }

  .auth-proof {
    margin-top: 18px;
  }

  .shell-nav {
    position: fixed;
    z-index: 30;
    inset: 0 auto 0 0;
    width: min(320px, calc(100vw - 52px));
    min-height: 100dvh;
    align-items: stretch;
    gap: 0;
    overflow-y: auto;
    border-right: 1px solid var(--line);
    box-shadow: var(--shadow-soft);
    padding: 20px 16px;
    transform: translateX(-104%);
    transition: transform 180ms ease;
  }

  body.mobile-nav-open .shell-nav {
    transform: translateX(0);
  }

  .nav-lockup {
    margin-bottom: 18px;
  }

  .nav-add-menu {
    width: 100%;
    min-width: 0;
    margin-bottom: 14px;
  }

  .nav-add-menu .menu-popover {
    width: 100%;
  }

  .primary-nav {
    display: grid;
    width: 100%;
    min-width: 0;
  }

  .mobile-nav-firm-actions {
    display: grid;
    gap: 8px;
    margin-top: auto;
    border-top: 1px solid var(--line);
    padding: 16px 0 0;
  }

  .mobile-nav-firm-actions strong {
    overflow-wrap: anywhere;
    font-size: 13px;
  }

  .mobile-nav-firm-actions .secondary-button {
    justify-content: flex-start;
  }

  .mobile-app-bar {
    position: sticky;
    z-index: 20;
    top: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 58px;
    border-bottom: 1px solid var(--line);
    background: rgb(251 252 248 / 0.97);
    padding: 10px 12px;
    backdrop-filter: blur(10px);
  }

  .mobile-menu-button {
    min-height: 34px;
    border-color: var(--line);
    background: white;
    color: var(--ink);
    padding: 0 9px;
    font-size: 12px;
    font-weight: 800;
  }

  .mobile-menu-button:hover {
    border-color: var(--harbor);
    background: #eef7f4;
    color: var(--harbor);
  }

  .mobile-view-title {
    overflow: hidden;
    font-size: 15px;
    line-height: 20px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-add-menu {
    position: relative;
  }

  .mobile-add-options {
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    width: 190px;
  }

  .mobile-nav-scrim {
    position: fixed;
    z-index: 25;
    inset: 0;
    width: 100%;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
    background: rgb(23 32 27 / 0.35);
    padding: 0;
  }

  .shell-main {
    margin-left: 0;
    padding: 14px 12px 36px;
  }

  .topbar {
    display: none;
  }

  .dashboard-grid,
  .home-command-center,
  .home-content-grid,
  .workspace,
  .detail-page {
    gap: 12px;
    margin-top: 12px;
  }

  .panel {
    min-height: 0;
    padding: 12px;
  }

  .panel-header {
    gap: 10px;
  }

  .panel-header h2 {
    font-size: 17px;
    line-height: 22px;
  }

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

  .home-category {
    min-height: 62px;
    padding: 11px 12px;
  }

  .home-category:nth-child(2) {
    border-right: 0;
  }

  .home-category:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .home-category-count {
    font-size: 20px;
    line-height: 24px;
  }

  .home-activity-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 10px;
    align-items: start;
  }

  .home-activity-description {
    grid-column: 1 / -1;
  }

  .home-activity-date {
    padding-top: 1px;
  }

  .section-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .section-tab {
    flex: 0 0 auto;
  }

  .data-table-wrap {
    overflow: visible;
  }

  .staff-data-table,
  .staff-data-table.compact-data-table,
  .staff-data-table.workflow-table,
  .staff-data-table.completed-table {
    min-width: 0;
  }

  .staff-data-table thead {
    display: none;
  }

  .staff-data-table tbody {
    display: grid;
    gap: 10px;
  }

  .staff-data-table tr {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: white;
    padding: 12px;
  }

  .staff-data-table td {
    display: grid;
    grid-template-columns: minmax(88px, 0.65fr) minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    border: 0;
    padding: 0;
  }

  .staff-data-table td::before {
    color: var(--graphite);
    content: attr(data-label);
    font-size: 11px;
    font-weight: 800;
    line-height: 17px;
    text-transform: uppercase;
  }

  .staff-data-table td:first-child {
    grid-template-columns: minmax(0, 1fr);
    border-bottom: 1px solid var(--line);
    padding-bottom: 9px;
  }

  .staff-data-table td:first-child::before,
  .packet-workflow-table td:last-child::before {
    display: none;
  }

  .packet-workflow-table td:last-child {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 2px;
  }

  .packet-workflow-table .table-action-cell,
  .packet-workflow-table .table-action-cell button {
    width: 100%;
  }

  .packet-workflow-table .table-action-cell {
    gap: 6px;
  }

  .account-sources-table td:last-child {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 2px;
  }

  .account-sources-table td:last-child::before {
    display: none;
  }

  .account-sources-table .inline-actions {
    width: 100%;
  }

  .account-sources-table .inline-actions button {
    flex: 1 1 120px;
  }

  .template-table td:last-child {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 2px;
  }

  .template-table td:last-child::before {
    display: none;
  }

  .template-table .inline-actions {
    width: 100%;
  }

  .template-table .inline-actions button {
    flex: 1 1 120px;
  }

  .detail-page-header {
    align-items: stretch;
  }

  .detail-page-header > .inline-actions,
  .detail-page-header > .inline-actions button {
    width: 100%;
  }

  .client-summary-band {
    gap: 14px;
    padding: 12px;
  }

  .client-summary-band div:nth-child(n + 3) {
    display: none;
  }

  .packet-mini-row {
    gap: 6px;
    padding: 10px 0;
  }

  .packet-mini-row > span {
    display: none;
  }

  .workspace > .panel:first-child {
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
  }

  .workspace > .panel:first-child .panel-header {
    padding: 0 2px;
  }

  .packet-card {
    padding: 12px;
  }

  .packet-card-button {
    align-items: start;
  }

  .request-review-list,
  .unmatched-upload-list {
    gap: 10px;
  }

  .packet-context-row {
    display: none;
  }

  .request-review-row,
  .unmatched-upload-row {
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 12px;
    box-shadow: inset 3px 0 0 transparent;
  }

  .request-review-statuses {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    border-top: 1px solid var(--line);
    padding-top: 10px;
  }

  .request-review-row .request-review-statuses .document-status-pair:last-child {
    grid-column: 1 / -1;
  }

  .request-review-actions {
    border-top: 1px solid var(--line);
    padding-top: 10px;
  }

  .request-review-actions > button:first-child:not(.icon-button) {
    flex: 1 1 150px;
  }

  .reassign-control {
    width: 100%;
  }

  .client-shell,
  .portal-theme-classic .client-shell,
  .portal-theme-signature .client-shell,
  .portal-theme-focused .client-shell {
    width: min(100% - 24px, 640px);
    padding-top: 16px;
    padding-bottom: 32px;
  }

  .client-request-header {
    margin-bottom: 12px;
  }

  .client-request-heading h1,
  .portal-theme-focused .client-request-heading h1 {
    font-size: 24px;
    line-height: 30px;
  }

  .client-request-panel {
    padding: 12px;
  }

  .client-request-panel > .panel-header {
    align-items: center;
  }

  .client-progress {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .client-items {
    gap: 10px;
  }

  .client-item-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "main status"
      "actions actions"
      "notes notes";
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: white;
    padding: 12px;
  }

  .client-item-main {
    grid-area: main;
  }

  .client-item-status {
    grid-area: status;
    align-self: start;
    text-align: right;
  }

  .client-item-actions {
    grid-area: actions;
  }

  .client-item-actions .client-upload-action {
    width: 100%;
    min-height: 36px;
  }

  .client-item-row .client-note-disclosure {
    grid-area: notes;
    padding-top: 10px;
  }

  .client-upload-dialog-actions {
    position: sticky;
    bottom: -22px;
    margin: 0 -22px -22px;
    background: white;
    box-shadow: 0 -10px 18px rgb(23 32 27 / 0.08);
    padding: 12px 22px;
  }

  .client-upload-dialog-actions button {
    flex: 1 1 140px;
  }
}

.client-portal .client-brand-lockup:has(.client-brand-logo[hidden]) {
  grid-template-columns: minmax(0, 1fr);
}
