:root {
  --bg: #f5f6f1;
  --surface: #ffffff;
  --surface-2: #f8f9f5;
  --surface-3: #edf1e9;
  --ink: #111915;
  --ink-2: #2f3933;
  --muted: #657068;
  --muted-2: #768078;
  --line: #d9dfd3;
  --line-2: #c7d0c1;
  --accent: #174d35;
  --accent-soft: #e5eee7;
  --accent-ink: #174d35;
  --warn: #b57c33;
  --warn-ink: #6f3f10;
  --warn-soft: #f5ead8;
  --danger: #8d3329;
  --danger-soft: #f1ddd7;
  --info: #2b5378;
  --info-soft: #dce5ee;
  --radius: 6px;
  --shadow-sm: 0 1px 0 rgba(20, 20, 15, 0.04), 0 1px 2px rgba(20, 20, 15, 0.04);
  --shadow-md: 0 1px 0 rgba(20, 20, 15, 0.04), 0 4px 14px rgba(20, 20, 15, 0.06);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

.audit-log {
  margin-top: 14px;
}

.audit-summary {
  padding: 24px 24px 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.activity-metric {
  min-width: 0;
}

.activity-metric span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.activity-metric strong {
  display: block;
  margin-top: 8px;
  font-size: 1.55rem;
  line-height: 1;
}

.activity-metric small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.35;
  word-break: break-word;
}

.audit-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.audit-filter {
  display: grid;
  gap: 2px;
  font-size: 0.78rem;
}

.audit-filter span {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.audit-filter select {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.audit-list {
  display: grid;
  gap: 6px;
  max-height: 360px;
  overflow: auto;
}

.audit-entry {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  align-items: center;
}

.audit-entry strong {
  font-family: "SFMono-Regular", ui-monospace, monospace;
  font-size: 0.78rem;
}

.audit-entry small {
  display: block;
  margin-top: 1px;
  font-size: 0.7rem;
  word-break: break-word;
}

.audit-actor span {
  font-weight: 600;
}

.audit-when code {
  font-size: 0.74rem;
}

.audit-more {
  margin: 8px 0 0;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.42;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

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

h1,
h2,
h3,
.brand-name {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: 2rem;
  line-height: 1.08;
  font-weight: 650;
}

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

p {
  color: var(--muted);
}

code,
kbd,
.mono,
.num,
.eyebrow,
.tiny {
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.loading-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.loading-shell.rich {
  align-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
}

.loading-shell.rich strong,
.loading-shell.rich h1 {
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
}

.loading-shell.rich p {
  max-width: 460px;
  margin-bottom: 0;
}

.auth-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-shell {
  width: min(100%, 720px);
  margin: 0 auto;
}

.auth-workspace-grid {
  width: min(100%, 640px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.auth-workspace {
  min-width: 0;
  min-height: 128px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.auth-workspace:hover,
.auth-workspace:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.auth-workspace-icon {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--accent);
}

.auth-workspace strong,
.auth-workspace small {
  display: block;
}

.auth-workspace strong {
  margin-bottom: 4px;
}

.auth-workspace small {
  color: var(--muted);
  line-height: 1.35;
}

@media (max-width: 720px) {
  .auth-workspace-grid {
    grid-template-columns: 1fr;
  }

  .auth-workspace {
    min-height: 0;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }
}

.skeleton-lines {
  width: min(280px, 74vw);
  display: grid;
  gap: 7px;
}

.skeleton-lines i {
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--surface-3), var(--line), var(--surface-3));
  background-size: 180% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.skeleton-lines i:nth-child(2) {
  width: 82%;
  margin-left: auto;
}

.skeleton-lines i:nth-child(3) {
  width: 58%;
  margin: 0 auto;
}

@keyframes shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 180% 50%; }
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  grid-template-rows: 52px minmax(0, 1fr);
}

.skip-link {
  position: fixed;
  left: 12px;
  top: 12px;
  z-index: 60;
  transform: translateY(-140%);
  border-radius: 4px;
  background: var(--ink);
  color: var(--bg);
  padding: 8px 10px;
  font-weight: 750;
  text-decoration: none;
  transition: transform 120ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.sidebar {
  grid-row: 1 / 3;
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--bg);
  display: grid;
  place-items: center;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  position: relative;
}

.brand-mark::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.brand-name {
  font-weight: 650;
  font-size: 15px;
}

.brand small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 0.66rem;
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.workspace-switcher {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.workspace-switcher strong,
.workspace-switcher span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-switcher span {
  color: var(--muted);
  font-size: 0.75rem;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-label,
.eyebrow,
.upper {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.68rem;
  color: var(--muted);
}

.nav-item {
  min-height: 32px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  text-align: left;
  color: var(--ink-2);
}

.nav-item:hover {
  background: rgba(20, 20, 15, 0.04);
}

.nav-item[aria-current="page"] {
  background: var(--ink);
  color: var(--bg);
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.nav-item[aria-current="page"] .nav-icon {
  color: var(--bg);
}

.nav-count {
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.72rem;
}

.nav-dot,
.live-pulse,
.live-dot,
.avail-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

.workspace-environment {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 6px 8px 8px;
  display: grid;
  gap: 6px;
}

.workspace-pill {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
}

.workspace-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.workspace-buttons button,
.mobile-nav button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.workspace-buttons button.is-active,
.mobile-nav button.is-active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.attention-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px;
  display: grid;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

.attention-card button {
  min-height: 36px;
  border: 0;
  border-radius: 4px;
  background: var(--surface-2);
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  color: var(--ink-2);
  text-align: left;
}

.attention-card button:hover {
  background: var(--surface-3);
}

.attention-card strong {
  color: var(--accent-ink);
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.98rem;
}

.attention-card span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attention-empty {
  margin: 0;
  min-height: 42px;
  border-radius: 4px;
  background: var(--surface-2);
  display: grid;
  gap: 2px;
  align-content: center;
  padding: 8px;
}

.attention-empty strong {
  font-family: inherit;
  color: var(--ink);
  font-size: 0.82rem;
}

.attention-empty span {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
  white-space: normal;
}

.sidebar-foot {
  margin-top: auto;
  padding: 10px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
}

.live-pulse {
  box-shadow: 0 0 0 0 rgba(47, 93, 63, 0.45);
  animation: pulse 2s infinite;
}

.live-off {
  background: var(--muted-2);
  box-shadow: none;
  animation: none;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(47, 93, 63, 0.45); }
  70% { box-shadow: 0 0 0 6px rgba(47, 93, 63, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 93, 63, 0); }
}

.topbar {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px auto;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: var(--bg);
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}

.crumbs strong {
  color: var(--ink);
  font-weight: 600;
}

.crumb-sep {
  color: var(--muted-2);
}

.search {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 10px;
  color: var(--muted);
  text-align: left;
}

.search kbd {
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--surface-2);
  padding: 1px 5px;
  color: var(--muted);
}

.top-actions,
.actions,
.chip-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.live-status,
.btn {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 650;
  text-decoration: none;
}

.btn-sm {
  min-height: 28px;
  padding: 0 8px;
  font-size: 0.82rem;
}

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn-ghost {
  background: transparent;
}

.top-bell {
  position: relative;
}

.bell-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  display: grid;
  place-items: center;
}

.page {
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.page-stack {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

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

.page-head p {
  margin-bottom: 0;
}

.page-action-form {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page-action-form label {
  display: grid;
  gap: 4px;
  min-width: 210px;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.page-action-form select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  padding: 8px;
  text-transform: none;
  letter-spacing: 0;
}

.disc-root {
  min-height: 100%;
  display: grid;
  grid-template-columns: 236px 408px minmax(0, 1fr);
}

.disc-filters,
.disc-list,
.detail-panel {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.disc-filters {
  border-right: 1px solid var(--line);
  padding: 16px;
  background: var(--surface-2);
}

.campaign-card,
.match-assist,
.panel,
.dr-card,
.compare-col,
.command,
.drawer,
.case-card,
.mini-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.campaign-card {
  padding: 14px;
  margin-bottom: 14px;
}

.campaign-card h2 {
  margin: 4px 0 6px;
}

.filter-group {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.scope-note {
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent-ink);
  padding: 10px;
  display: grid;
  gap: 4px;
}

.scope-note strong,
.scope-note span {
  display: block;
}

.scope-note span {
  color: var(--accent-ink);
  font-size: 0.78rem;
}

.filter-title {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
}

.filter-row,
.saved-search {
  width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 6px;
  text-align: left;
}

.filter-row[data-on="true"],
.filter-row:hover {
  background: var(--surface);
}

.filter-checkbox {
  width: 12px;
  height: 12px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: var(--surface);
}

.filter-row[data-on="true"] .filter-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.slider-row input {
  min-width: 0;
  flex: 1;
}

.disc-list {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.match-assist {
  margin: 16px;
  padding: 12px;
}

.match-assist-head,
.match-suggestion,
.compare-head,
.dr-card-head,
.panel-head,
.mini-card,
.case-card,
.audit-row,
.progress-row > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.match-assist-head {
  justify-content: flex-start;
  margin-bottom: 8px;
}

.match-glyph {
  width: 24px;
  height: 24px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.match-assist p,
.match-suggestion small,
.comm-main small,
.comm-side small,
.compare-head small,
.dr-card small,
.mini-card small,
.case-card small {
  display: block;
  margin: 0;
  color: var(--muted);
}

.match-suggestion {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  padding: 8px 0;
  text-align: left;
}

.match-rank {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  font-weight: 700;
}

.disc-list-head {
  padding: 0 16px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  padding: 2px;
}

.seg.wide {
  display: flex;
  width: 100%;
  margin-top: 8px;
}

.seg button {
  min-height: 26px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  padding: 0 9px;
  color: var(--muted);
}

.seg button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
}

.list-scroll {
  overflow: auto;
}

.community-card-grid {
  padding: 0 16px 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  overflow: auto;
}

.comm-row {
  width: 100%;
  min-height: 86px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  text-align: left;
}

.comm-row:hover,
.comm-row.is-active {
  background: var(--surface);
}

.comm-main {
  min-width: 0;
}

.comm-main strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.04rem;
}

.comm-side {
  display: grid;
  justify-items: end;
  gap: 3px;
}

.community-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--ink);
  padding: 12px;
  display: grid;
  gap: 10px;
  text-align: left;
  min-height: 230px;
}

.community-card:hover,
.community-card.is-active {
  background: var(--surface);
  border-color: var(--accent);
}

.community-card-head {
  display: flex;
  gap: 10px;
  align-items: center;
}

.community-card-head strong,
.community-card-package strong {
  display: block;
}

.community-card-head small,
.community-card-package small,
.community-card-metrics small {
  color: var(--muted);
  font-size: 0.72rem;
}

.community-card-copy {
  color: var(--muted);
  line-height: 1.4;
  min-height: 38px;
}

.community-card-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.community-card-metrics span,
.community-card-package {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  padding: 8px;
}

.community-card-package span {
  display: block;
  color: var(--muted);
  margin-top: 2px;
  font-size: 0.75rem;
}

.avail-dot.is-pulse {
  animation: pulse 2s infinite;
}

.detail-panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-hero {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.metric-grid,
.terms-grid,
.kpi-row,
.admin-grid,
.settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

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

.kpi {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 10px;
}

.kpi span,
.kpi-card span,
.terms-grid span {
  color: var(--muted);
  font-size: 0.75rem;
}

.kpi strong,
.kpi-card strong,
.terms-grid strong {
  display: block;
  margin-top: 2px;
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 1.08rem;
}

.panel {
  padding: 14px;
}

.panel.compact {
  padding: 12px;
}

.panel-head {
  margin-bottom: 10px;
}

.span-2 {
  grid-column: span 2;
}

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

.slot-row span {
  height: 8px;
  border-radius: 4px;
  background: var(--surface-3);
}

.slot-row .is-open {
  background: var(--accent);
}

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

.trust-list span,
.dr-items span,
.evidence-item {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px;
  background: var(--surface-2);
}

.trust-list .trust-item.is-verified {
  border-left: 3px solid var(--accent);
  background: var(--surface);
}

.trust-list small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
  font-size: 0.7rem;
  line-height: 1.35;
}

.fit {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  line-height: 1;
  flex: 0 0 auto;
}

.fit.large {
  width: 56px;
  height: 56px;
}

.fit strong,
.fit small {
  grid-column: 1;
  grid-row: 1;
}

.fit small {
  transform: translateY(12px);
  color: var(--muted);
  font-size: 0.62rem;
}

.fit {
  position: relative;
  cursor: help;
}

.fit-tooltip {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 0.74rem;
  line-height: 1.45;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
  z-index: 20;
  box-shadow: var(--shadow-md);
  pointer-events: none;
}

.fit:hover .fit-tooltip,
.fit:focus-within .fit-tooltip,
.fit:focus .fit-tooltip {
  opacity: 1;
  visibility: visible;
}

.fit-tooltip strong {
  display: block;
  margin-bottom: 6px;
  transform: none;
  position: static;
  color: var(--bg);
  font-size: 0.72rem;
}

.fit-tooltip ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 3px;
}

.fit-tooltip li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.fit-tooltip li span {
  color: var(--muted-2);
}

.fit-tooltip li b {
  color: var(--bg);
  font-weight: 600;
}

.chip {
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  padding: 2px 8px;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-size: 0.72rem;
  font-weight: 750;
}

.chip-accent {
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-color: transparent;
}

.chip-warn {
  background: var(--warn-soft);
  color: var(--warn-ink);
  border-color: transparent;
}

.chip-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}

.chip-ghost {
  background: var(--surface);
}

.compare-grid {
  padding: 24px;
  display: grid;
  grid-template-columns: 170px repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  overflow: auto;
}

.compare-side {
  padding-top: 76px;
}

.compare-side div,
.compare-col > div {
  min-height: 48px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
}

.compare-col {
  padding: 12px;
}

.compare-col .btn {
  width: 100%;
  margin-top: 12px;
}

.compare-actions {
  display: grid;
  gap: 8px;
  border-bottom: 0;
}

.offers-root {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) 430px;
}

.offers-list {
  min-width: 0;
  border-right: 1px solid var(--line);
}

.offers-head {
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.pipeline-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 8px;
}

.pipeline-lane {
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 10px;
  text-align: left;
}

.pipeline-lane:hover,
.pipeline-lane:focus-visible,
.pipeline-lane.is-active {
  border-color: var(--ink);
  background: var(--surface-2);
}

.pipeline-lane span {
  color: var(--muted);
  font-size: 0.76rem;
}

.pipeline-lane strong {
  font-size: 1.05rem;
}

.pipeline-lane small {
  color: var(--muted);
  line-height: 1.3;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
}

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

.tbl th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
}

.tbl tr.is-active,
.tbl tr:hover {
  background: var(--surface-2);
}

.mark {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--bg);
  display: inline-grid;
  place-items: center;
  margin-right: 8px;
}

.offers-panel {
  min-width: 0;
  overflow: auto;
  background: var(--surface);
}

.offer-detail,
.builder {
  padding: 16px;
}

.next-action {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 14px 0;
  padding: 12px;
  background: var(--surface-2);
  display: grid;
  gap: 4px;
}

.next-action span,
.next-action small {
  color: var(--muted);
}

.next-action.is-ready {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

.quarantine-form {
  flex: 1 0 100%;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.finance-action-form {
  flex: 1 1 280px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.quarantine-form label,
.finance-action-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.quarantine-form textarea,
.finance-action-form input,
.finance-action-form textarea {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  padding: 8px;
  text-transform: none;
  letter-spacing: 0;
}

.quarantine-form textarea,
.finance-action-form textarea {
  resize: vertical;
}

.offer-tabs,
.builder-stepper {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.offer-tabs button {
  min-height: 34px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
}

.offer-tabs .is-active {
  color: var(--ink);
  border-bottom: 2px solid var(--ink);
}

.builder-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.builder-stepper {
  border: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.builder-stepper span {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  color: var(--muted);
}

.builder-stepper b {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  margin-right: 6px;
}

.builder-stepper .is-active {
  border-color: var(--ink);
  color: var(--ink);
}

.state-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 14px;
}

.state-rail span {
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
}

.state-rail .is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.terms-grid {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 14px;
}

.terms-grid > div {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}

.policy-ok { color: var(--accent-ink); }
.policy-warn { color: var(--warn-ink); }
.policy-bad { color: var(--danger); }

.policy-line {
  margin: 4px 0 10px;
}

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

.thread-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}

.thread-item p {
  margin-bottom: 0;
}

.thread-item.is-system {
  background: var(--surface-2);
}

.thread-item.is-risk {
  border-color: var(--danger-soft);
  background: var(--danger-soft);
}

.thread-item.is-risk strong,
.thread-item.is-risk p {
  color: var(--danger);
}

.thread-item.is-good {
  border-color: var(--accent-soft);
  background: var(--accent-soft);
}

.thread-item.is-good strong,
.thread-item.is-good p {
  color: var(--accent-ink);
}

.form-grid {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.form-grid label {
  display: grid;
  gap: 4px;
  color: var(--muted);
}

.form-grid input {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  padding: 0 10px;
  color: var(--ink);
}

.settings-form {
  display: grid;
  gap: 10px;
}

.settings-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
}

.settings-form input {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 10px;
}

.settings-form input:disabled {
  background: var(--surface-2);
  color: var(--muted);
}

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

.settings-row:first-of-type {
  border-top: 0;
}

.settings-row span {
  color: var(--muted);
}

.settings-row strong {
  text-align: right;
  word-break: break-word;
}

.dr-grid,
.report-grid,
.settings-grid {
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.team-layout {
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: start;
}

.team-side {
  display: grid;
  gap: 14px;
}

.team-overview {
  padding: 14px 24px 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.team-metric {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px 12px;
}

.team-metric span,
.team-metric small,
.role-cell small,
.role-guide-row small,
.role-help span {
  display: block;
  color: var(--muted);
}

.team-metric span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
}

.team-metric strong {
  display: block;
  margin: 2px 0;
  font-size: 1.05rem;
}

.team-invite {
  display: grid;
  gap: 10px;
}

.team-invite label,
.onboarding-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
}

.team-invite input,
.team-invite select,
.team-table select,
.onboarding-form input {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 10px;
}

.team-table select {
  width: 100%;
  max-width: 190px;
}

.role-cell {
  display: grid;
  gap: 4px;
  min-width: 190px;
}

.role-cell small,
.role-guide-row small,
.role-help span {
  font-size: 0.76rem;
  line-height: 1.35;
}

.role-help {
  margin: -2px 0 0;
  border-left: 3px solid var(--accent);
  padding: 8px 10px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.role-help strong,
.role-help span {
  color: var(--accent-ink);
}

.role-guide {
  display: grid;
  gap: 0;
}

.role-guide-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.role-guide-row:first-of-type {
  border-top: 0;
}

.onboarding-shell {
  gap: 12px;
}

.onboarding-form {
  width: min(100%, 460px);
  display: grid;
  gap: 10px;
}

.onboarding-role-grid {
  display: grid;
  gap: 10px;
  text-align: left;
}

.onboarding-role-option {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.onboarding-role-option input {
  min-height: 0;
  margin-top: 3px;
}

.onboarding-role-option strong {
  display: block;
  color: var(--ink);
}

.onboarding-role-option small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  line-height: 1.35;
}

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

.readiness-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.readiness-head p {
  margin: 4px 0 0;
}

.readiness-score {
  min-width: 112px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 10px;
  text-align: right;
}

.readiness-score strong {
  display: block;
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 1.6rem;
  line-height: 1;
  margin-bottom: 6px;
}

.readiness-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: start;
}

.readiness-layout h3 {
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.readiness-checks,
.readiness-side,
.readiness-facts {
  display: grid;
  gap: 8px;
}

.readiness-check {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
}

.readiness-check small,
.readiness-action small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.readiness-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted-2);
}

.readiness-dot.status-complete {
  background: var(--accent);
}

.readiness-dot.status-warning {
  background: var(--warn);
}

.readiness-dot.status-action {
  background: var(--danger);
}

.readiness-action {
  border-left: 3px solid var(--warn);
  background: var(--warn-soft);
  color: var(--warn-ink);
  padding: 9px 10px;
  border-radius: 4px;
}

.readiness-action strong,
.readiness-action small {
  color: var(--warn-ink);
}

.onboarding-error {
  width: min(100%, 420px);
  margin: 0;
  border: 1px solid var(--danger);
  border-radius: 4px;
  background: var(--danger-soft);
  color: var(--danger);
  padding: 8px 10px;
  font-size: 0.85rem;
}

.dr-card {
  padding: 14px;
}

.dr-vault {
  min-height: 120px;
  border-radius: var(--radius);
  border: 1px dashed var(--line-2);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  text-align: center;
  margin: 12px 0;
  color: var(--muted);
}

.dr-vault.is-open {
  border-style: solid;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.dr-vault.is-open small {
  color: var(--accent-ink);
}

.dr-items {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.evidence-list {
  grid-template-columns: 1fr;
}

.evidence-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.evidence-item strong,
.evidence-item small {
  display: block;
  overflow-wrap: anywhere;
}

.evidence-empty {
  color: var(--muted);
}

.file-btn {
  cursor: pointer;
}

.data-room-revoke-form {
  flex: 1 0 100%;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding-top: 8px;
}

.data-room-revoke-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-room-revoke-form textarea {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  padding: 8px;
  text-transform: none;
  letter-spacing: 0;
  resize: vertical;
}

.sf-selector {
  display: flex;
  gap: 6px;
  padding: 0 24px;
  flex-wrap: wrap;
}

.sf-selector button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 600;
}

.sf-selector button[aria-current="true"] {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.storefront-root {
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
}

.sf-browser {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.sf-browser-bar {
  min-height: 34px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  background: var(--surface-2);
}

.sf-browser-bar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted-2);
}

.sf-browser-bar code {
  margin-left: 8px;
  color: var(--muted);
}

.sf-site {
  padding: 28px;
  display: grid;
  gap: 22px;
}

.sf-site header,
.sf-package {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.sf-site h1 {
  max-width: 520px;
}

.sf-package {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}

.sf-package .sf-package-action {
  min-height: 30px;
  border: 0;
  border-radius: 4px;
  background: var(--ink);
  color: var(--bg);
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.storefront-controls {
  display: grid;
  gap: 14px;
  align-content: start;
}

.code-block {
  max-height: 320px;
  overflow: auto;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bg);
  padding: 12px;
  font-size: 0.78rem;
  line-height: 1.5;
}

.kpi-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 24px 24px 0;
}

.kpi-card {
  min-height: 128px;
}

.kpi-card strong {
  font-size: 1.8rem;
}

.kpi-card small {
  color: var(--accent-ink);
}

.spark {
  width: 100%;
  height: 38px;
  color: var(--accent);
  margin-top: 8px;
}

.funnel,
.waterfall {
  display: grid;
  gap: 12px;
}

.funnel div,
.waterfall div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 86px;
  gap: 12px;
  align-items: center;
}

.funnel i,
.waterfall i,
.progress-row i {
  height: 12px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
  display: block;
}

.funnel i {
  background: var(--accent);
}

.waterfall i {
  background: var(--warn);
}

.progress-row {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.progress-row b {
  display: block;
  height: 100%;
  background: var(--accent);
}

.admin-head {
  background: var(--surface);
}

.admin-tabs {
  min-height: 42px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 24px;
  overflow: auto;
}

.admin-tabs button {
  min-height: 34px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  white-space: nowrap;
}

.admin-tabs .is-active {
  color: var(--ink);
  border-bottom: 2px solid var(--ink);
}

.admin-tabs span {
  margin-left: 6px;
  color: var(--accent-ink);
}

.kpi-inline {
  text-align: right;
  border-left: 1px solid var(--line);
  padding-left: 16px;
}

.kpi-inline span,
.kpi-inline strong {
  display: block;
}

.inbound-split {
  padding: 24px;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 14px;
}

.inbound-list {
  display: grid;
  gap: 8px;
  align-content: start;
}

.inbound-card {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  text-align: left;
}

.inbound-card.is-active {
  background: var(--surface-2);
  border-color: var(--accent);
  border-left: 3px solid var(--accent);
  padding-left: 8px;
}

.inbound-detail {
  min-width: 0;
}

.counter-offer-panel {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 150px) minmax(160px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.counter-offer-panel label,
.counter-offer-panel label span {
  display: block;
}

.counter-offer-panel label span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.75rem;
}

.counter-offer-panel input {
  width: 100%;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 9px;
}

.package-management {
  padding: 24px;
  display: grid;
  gap: 14px;
}

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

.package-form-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr repeat(3, minmax(100px, 0.8fr)) 1.2fr;
  gap: 10px;
}

.package-form-grid label,
.package-form-grid label span {
  display: block;
}

.package-form-grid label span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.75rem;
}

.package-form-grid input,
.package-form-grid select {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 9px;
}

.case-card,
.mini-card {
  padding: 12px;
  align-items: flex-start;
}

.mini-card {
  flex-wrap: wrap;
}

.mini-card > div {
  min-width: 0;
}

.mini-card strong,
.mini-card .tiny {
  display: block;
}

.mini-card .tiny {
  margin-bottom: 3px;
}

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

.case-card .actions,
.mini-card .actions {
  grid-column: 1 / -1;
}

.case-note-form,
.appeal-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(150px, 0.32fr) auto;
  gap: 10px;
  align-items: end;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.case-note-form label,
.appeal-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.case-note-form textarea,
.case-note-form select,
.appeal-form textarea,
.appeal-form select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  padding: 8px;
  text-transform: none;
  letter-spacing: 0;
}

.case-note-form textarea,
.appeal-form textarea {
  resize: vertical;
}

.appeal-form .actions {
  align-self: end;
}

.mini-card .actions {
  flex: 1 0 100%;
}

.audit-row {
  min-height: 38px;
  border-bottom: 1px solid var(--line);
  padding: 6px 0;
}

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

.payout-create-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.payout-create-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.payout-create-row small {
  color: var(--muted);
  margin-top: 2px;
}

.summary-line {
  min-height: 36px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px minmax(86px, auto) auto;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}

.summary-line span,
.summary-line code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-line strong {
  text-align: right;
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
}

.audit-row code {
  color: var(--muted);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 24px;
  color: var(--muted);
}

.empty-glyph {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

.empty strong {
  display: block;
  color: var(--ink);
  margin-bottom: 4px;
}

.empty p {
  margin-bottom: 0;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
  padding: 42px;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(20, 20, 15, 0.18);
  display: grid;
  place-items: start center;
  padding-top: 86px;
}

.command {
  width: min(580px, calc(100vw - 32px));
  padding: 8px;
  box-shadow: var(--shadow-md);
}

.command-search {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 0 10px;
  color: var(--ink);
  font: inherit;
  outline: none;
}

.command-search::placeholder {
  color: var(--muted);
}

.command-results {
  display: grid;
  gap: 2px;
  padding-top: 6px;
}

.command button {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
  text-align: left;
}

.command button:hover {
  background: var(--surface-2);
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 31;
  width: min(420px, 100vw);
  padding: 16px;
  box-shadow: var(--shadow-md);
  overflow: auto;
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.stack {
  display: grid;
  gap: 10px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  max-width: 360px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bg);
  padding: 12px 14px;
  box-shadow: var(--shadow-md);
  font-weight: 700;
}

.mobile-nav,
.mobile-workspace {
  display: none;
}

.muted {
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 980px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    padding-bottom: 104px;
  }

  .sidebar {
    display: none;
  }

  .topbar,
  .page {
    grid-column: 1;
  }

  .topbar {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 12px 14px;
  }

  .disc-root,
  .offers-root,
  .storefront-root,
  .inbound-split {
    grid-template-columns: 1fr;
  }

  .disc-filters,
  .disc-list,
  .offers-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .detail-panel,
  .page-head,
  .audit-summary,
  .dr-grid,
  .report-grid,
  .settings-grid,
  .team-layout,
  .kpi-row,
  .inbound-split,
  .storefront-root,
  .compare-grid {
    padding: 14px;
  }

  .page-head,
  .detail-hero,
  .readiness-head,
  .sf-site header,
  .sf-package {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-grid,
  .terms-grid,
  .kpi-row,
  .admin-grid,
    .settings-grid,
    .team-layout,
    .readiness-layout,
    .team-overview,
    .audit-summary,
    .dr-grid,
  .report-grid,
  .dr-items,
  .trust-list {
    grid-template-columns: 1fr;
  }

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

  .counter-offer-panel {
    grid-template-columns: 1fr;
  }

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

  .case-note-form,
  .appeal-form,
  .page-action-form {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .page-action-form {
    display: grid;
    justify-content: stretch;
  }

  .page-action-form label {
    min-width: 0;
  }

  .package-management {
    padding: 14px;
  }

  .package-form-grid {
    grid-template-columns: 1fr;
  }

  .counter-offer-panel .btn {
    width: 100%;
  }

  .compare-side {
    display: none;
  }

  .tbl {
    min-width: 680px;
  }

  .team-layout .panel {
    min-width: 0;
    overflow: hidden;
  }

  .team-table {
    min-width: 0;
  }

  .team-table thead {
    display: none;
  }

  .team-table,
  .team-table tbody,
  .team-table tr,
  .team-table td {
    display: block;
    width: 100%;
  }

  .team-table tr {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
  }

  .team-table td {
    padding: 2px 0;
    border-bottom: 0;
    word-break: break-word;
  }

  .team-table td.num {
    text-align: left;
  }

  .team-table select,
  .role-cell {
    max-width: 100%;
    min-width: 0;
  }

  .offers-list,
  .list-scroll {
    overflow: auto;
  }

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

  .payout-create-row {
    align-items: stretch;
    flex-direction: column;
  }

  .payout-create-row .btn {
    width: 100%;
  }

  .actions .btn,
  .actions .live-status {
    width: 100%;
  }

  .finance-action-form {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .top-actions {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 6px;
    align-items: center;
  }

  .top-actions .btn-primary {
    grid-column: 1 / -1;
  }

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

  .admin-tabs {
    padding: 6px 12px;
    gap: 2px;
    flex-wrap: wrap;
    overflow: visible;
    min-height: auto;
  }

  .admin-tabs button {
    padding: 4px 8px;
    font-size: 0.72rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    flex: 0 0 auto;
  }

  .admin-tabs span {
    display: none;
  }

  .span-2 {
    grid-column: auto;
  }

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

  .terms-grid > div {
    word-break: break-word;
  }

  .audit-entry {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .audit-when {
    display: flex;
    justify-content: space-between;
    gap: 8px;
  }

  .inbound-detail-panel,
  .inbound-detail {
    min-width: 0;
  }

  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    display: flex;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    border-top: 1px solid var(--line);
    background: var(--surface);
    padding: 4px;
    gap: 4px;
  }

  .mobile-nav button {
    min-width: max(88px, 24vw);
    flex: 0 0 auto;
  }

  .mobile-workspace {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 48px;
    z-index: 25;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--line);
    background: var(--surface-2);
    padding: 4px;
    gap: 4px;
  }

  .mobile-workspace button {
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--surface);
    color: var(--muted);
    font-weight: 700;
  }

  .mobile-workspace button.is-active {
    background: var(--ink);
    color: var(--bg);
    border-color: var(--ink);
  }
}

.app-command-shell {
  --command-green: #174d35;
  --command-green-2: #246441;
  --command-gold: #b57c33;
  --command-red: #8d3329;
  --command-blue: #2b5378;
  grid-template-columns: 88px minmax(0, 1fr);
  background: var(--bg);
}

.app-command-shell .sidebar {
  padding: 12px 8px;
  gap: 10px;
  border-right: 0;
  background: #17231c;
  color: #dce5dc;
  box-shadow: inset -1px 0 rgba(255, 255, 255, 0.08);
}

.app-command-shell .brand {
  justify-content: center;
  padding: 4px 0 12px;
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.app-command-shell .brand > span:not(.brand-mark),
.app-command-shell .nav-label,
.app-command-shell .workspace-switcher span,
.app-command-shell .workspace-switcher strong,
.app-command-shell .nav-item > span:not(.nav-icon):not(.nav-count),
.app-command-shell .attention-card {
  display: none;
}

.app-command-shell .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #ffffff;
  color: var(--command-green);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.app-command-shell .brand-mark::after {
  background: var(--command-gold);
}

.app-command-shell .workspace-switcher {
  min-height: 36px;
  padding: 0;
  border-color: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
}

.app-command-shell .workspace-switcher::before {
  content: "WS";
  color: #eef4ed;
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 900;
}

.app-command-shell .nav-section {
  gap: 6px;
}

.app-command-shell .nav-item {
  min-height: 44px;
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 0;
  border-radius: 12px;
  color: rgba(236, 244, 235, 0.72);
  position: relative;
}

.app-command-shell .nav-item:hover {
  background: rgba(255, 255, 255, 0.09);
}

.app-command-shell .nav-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: rgba(236, 244, 235, 0.74);
}

.app-command-shell .nav-item[aria-current="page"] {
  background: var(--command-green-2);
  color: #ffffff;
}

.app-command-shell .nav-item[aria-current="page"] .nav-icon {
  color: #ffffff;
}

.app-command-shell .nav-count {
  position: absolute;
  right: 5px;
  top: 4px;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: #f2d49b;
  color: #17231c;
  font-size: 0.64rem;
}

.app-command-shell .workspace-environment {
  padding: 6px;
  border-color: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.app-command-shell .workspace-pill {
  display: none;
}

.app-command-shell .workspace-buttons {
  grid-template-columns: 1fr;
}

.app-command-shell .workspace-buttons button {
  min-height: 28px;
  border-color: rgba(255, 255, 255, 0.16);
  background: transparent;
  color: #dce5dc;
  padding: 0 4px;
  font-size: 0.66rem;
}

.app-command-shell .workspace-buttons button.is-active {
  background: #ffffff;
  color: #17231c;
  border-color: #ffffff;
}

.app-command-shell .sidebar-foot {
  border-top-color: rgba(255, 255, 255, 0.12);
  font-size: 0;
  justify-content: center;
}

.app-command-shell .sidebar :focus-visible {
  outline-color: #f2d49b;
}

.app-command-shell .topbar {
  grid-template-columns: minmax(130px, 0.55fr) minmax(260px, 1fr) auto;
  background: #ffffff;
}

.app-command-shell .search {
  min-height: 38px;
  border-radius: 999px;
  background: #f8faf6;
  box-shadow: inset 0 0 0 1px rgba(23, 77, 53, 0.04);
}

.today-root {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.today-hero {
  min-height: 218px;
  border-radius: 14px;
  padding: 24px;
  background: var(--command-green);
  color: #ffffff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 22px;
  align-items: end;
  overflow: hidden;
  box-shadow: 0 18px 42px rgba(23, 77, 53, 0.18);
}

.today-hero .eyebrow,
.today-hero p,
.today-hero small,
.today-hero span {
  color: rgba(255, 255, 255, 0.78);
}

.today-hero h1 {
  max-width: 720px;
  margin: 8px 0 10px;
  color: #ffffff;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 2.35rem;
  line-height: 1.05;
  font-weight: 780;
}

.today-hero p {
  max-width: 680px;
  margin-bottom: 0;
  font-size: 1rem;
}

.today-hero-stat {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
}

.today-hero-stat span,
.today-hero-stat small {
  display: block;
}

.today-hero-stat strong {
  display: block;
  margin: 7px 0;
  font-size: 2rem;
  line-height: 1;
}

.today-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px) minmax(260px, 330px);
  gap: 14px;
  align-items: start;
  min-width: 0;
}

.today-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.today-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  padding: 15px;
  box-shadow: var(--shadow-sm);
}

.today-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.today-panel-head h2 {
  margin: 2px 0 0;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 1.05rem;
  line-height: 1.18;
}

.today-panel-head p {
  margin: 4px 0 0;
  font-size: 0.82rem;
}

.today-queue {
  display: grid;
  gap: 9px;
}

.today-queue-row {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #fbfcf8;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  color: var(--ink);
  text-align: left;
}

.today-queue-row:hover {
  border-color: rgba(23, 77, 53, 0.34);
  background: #ffffff;
}

.today-queue-row.is-selected {
  border-color: rgba(181, 124, 51, 0.58);
  background: #fff9ed;
}

.today-rank {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--command-green);
  font-weight: 900;
}

.today-queue-copy {
  min-width: 0;
}

.today-queue-copy strong,
.today-queue-copy small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.today-queue-copy strong {
  font-size: 0.96rem;
}

.today-queue-copy small {
  margin-top: 3px;
  color: var(--muted);
}

.today-action-chip {
  border-radius: 999px;
  padding: 7px 9px;
  background: var(--accent-soft);
  color: var(--command-green);
  font-size: 0.74rem;
  font-weight: 900;
  white-space: nowrap;
}

.today-inspector,
.today-activity {
  position: sticky;
  top: 66px;
}

.today-detail {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcf8;
  padding: 12px;
  margin-bottom: 12px;
}

.today-detail strong,
.today-detail p {
  overflow-wrap: anywhere;
}

.today-detail p {
  margin: 5px 0 0;
}

.today-direct-actions {
  display: grid;
  gap: 9px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcf8;
}

.today-direct-actions > .btn,
.today-direct-actions > label.btn,
.today-direct-actions > .actions {
  justify-self: start;
}

.today-direct-actions .counter-offer-panel,
.today-direct-actions .finance-action-form,
.today-direct-actions .data-room-revoke-form {
  margin: 0;
}

.today-activity-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 12px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcf8;
}

.today-activity-toggle button {
  min-height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.today-activity-toggle button.is-active {
  background: var(--command-green);
  color: #ffffff;
}

.today-activity-list {
  display: grid;
  gap: 10px;
}

.today-activity-list article {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcf8;
  padding: 11px;
}

.today-activity-list strong,
.today-activity-list span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.today-activity-list span {
  color: var(--muted);
  margin-top: 4px;
}

.today-pipeline-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
  gap: 9px;
}

.today-pipeline-list span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcf8;
  padding: 10px;
  color: var(--muted);
  font-size: 0.8rem;
}

.today-pipeline-list strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 1.05rem;
}

@media (max-width: 1180px) {
  .today-layout,
  .today-hero {
    grid-template-columns: 1fr;
  }

  .today-inspector,
  .today-activity {
    position: static;
  }
}

@media (max-width: 980px) {
  .app-command-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .app-command-shell .topbar,
  .app-command-shell .page {
    grid-column: 1;
  }

  .app-command-shell .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 10px 14px;
  }

  .app-command-shell .crumbs {
    min-width: 0;
  }

  .app-command-shell .search {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }

  .app-command-shell .search kbd {
    display: none;
  }

  .app-command-shell .top-actions {
    display: flex;
    flex-wrap: nowrap;
    justify-content: end;
  }

  .app-command-shell .top-actions .btn-ghost:not(.top-bell):not([data-action="dev-sign-out"]):not([data-action="clerk-sign-out"]) {
    display: none;
  }

  .app-command-shell .toast {
    position: static;
    grid-column: 1;
    margin: 0 12px 12px;
    max-width: none;
  }
}

@media (max-width: 720px) {
  .today-hero {
    min-height: 0;
    padding: 18px;
  }

  .today-hero h1 {
    font-size: 1.7rem;
  }

  .today-panel {
    padding: 13px;
  }

  .today-queue-row {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
  }

  .today-rank {
    width: 34px;
    height: 34px;
  }

  .today-action-chip {
    grid-column: 2;
    justify-self: start;
    white-space: normal;
  }
}
