:root {
  color-scheme: light;
  --bg: #f4f5f1;
  --surface: #fafbf8;
  --surface-strong: #ffffff;
  --surface-muted: #ebeee8;
  --line: #d9ddd5;
  --line-strong: #bcc3b8;
  --text: #172019;
  --text-soft: #687069;
  --text-faint: #8a918a;
  --accent: #315c48;
  --accent-strong: #234535;
  --accent-soft: #dce9e1;
  --danger: #9d3d38;
  --warning: #765e28;
  --radius: 14px;
  --radius-small: 10px;
  --shadow: 0 24px 80px rgba(48, 59, 51, 0.1);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  font-family: "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
  font-synthesis: none;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111512;
  --surface: #171c18;
  --surface-strong: #1c221d;
  --surface-muted: #242b25;
  --line: #343c35;
  --line-strong: #505c52;
  --text: #edf1eb;
  --text-soft: #adb6ad;
  --text-faint: #838d84;
  --accent: #8db49c;
  --accent-strong: #b9d3c2;
  --accent-soft: #293b30;
  --danger: #e08b85;
  --warning: #d2b468;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-small);
  background: var(--text);
  color: var(--bg);
  transform: translateY(-160%);
}

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

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}

.wordmark strong {
  font-size: 1.55rem;
  font-weight: 750;
  letter-spacing: -0.08em;
  line-height: 1;
}

.wordmark span {
  color: var(--text-soft);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.quiet-button,
.back-button,
.drawer-close,
.mobile-menu-button {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: transparent;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 650;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms var(--ease);
}

.quiet-button:hover,
.back-button:hover,
.drawer-close:hover,
.mobile-menu-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-muted);
}

button:active {
  transform: translateY(1px) scale(0.99);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 34%, transparent);
  outline-offset: 2px;
}

.auth-shell {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 16% 6%, color-mix(in srgb, var(--accent-soft) 48%, transparent), transparent 28rem),
    var(--bg);
}

.auth-header {
  display: flex;
  width: min(100% - 40px, 1240px);
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
}

.auth-main {
  display: grid;
  width: min(100% - 40px, 1120px);
  min-height: calc(100dvh - 72px);
  align-items: center;
  margin: 0 auto;
  padding: 48px 0 88px;
  gap: clamp(56px, 10vw, 140px);
  grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
}

.auth-intro {
  max-width: 610px;
}

.section-label {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 0.73rem;
  font-weight: 720;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-intro h1,
.view-heading h1 {
  margin: 0;
  font-size: clamp(3rem, 7vw, 6.5rem);
  font-weight: 520;
  letter-spacing: -0.068em;
  line-height: 0.94;
  text-wrap: balance;
}

.auth-intro > p:not(.section-label) {
  max-width: 42ch;
  margin: 30px 0 0;
  color: var(--text-soft);
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.65;
}

.auth-proof {
  display: grid;
  max-width: 560px;
  margin: 76px 0 0;
  padding: 22px 0 0;
  gap: 28px;
  border-top: 1px solid var(--line);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-proof div {
  display: grid;
  gap: 3px;
}

.auth-proof dt {
  font-weight: 700;
}

.auth-proof dd {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.83rem;
}

.auth-card {
  padding: clamp(26px, 4vw, 42px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
  box-shadow: var(--shadow);
}

.auth-mode {
  display: grid;
  padding: 4px;
  margin-bottom: 40px;
  border-radius: var(--radius-small);
  background: var(--surface-muted);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-mode button {
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 680;
}

.auth-mode button[aria-selected="true"] {
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: 0 1px 5px rgba(42, 52, 44, 0.08);
}

.panel-heading {
  margin-bottom: 28px;
}

.panel-heading h2,
.dialog-heading h2,
.drawer-content h2 {
  margin: 0;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 570;
  letter-spacing: -0.045em;
  line-height: 1.04;
}

.panel-heading p {
  margin: 12px 0 0;
  color: var(--text-soft);
  line-height: 1.6;
}

.auth-form,
.quick-form {
  display: grid;
  gap: 16px;
}

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

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

.field label {
  font-size: 0.78rem;
  font-weight: 680;
}

.field input,
.global-search input,
.filter-input,
.filter-select {
  width: 100%;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  outline: 0;
  background: var(--surface-strong);
  color: var(--text);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.field input::placeholder,
.global-search input::placeholder,
.filter-input::placeholder {
  color: var(--text-faint);
  opacity: 1;
}

.field input:focus,
.global-search input:focus,
.filter-input:focus,
.filter-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.primary-button {
  min-height: 50px;
  padding: 0 18px;
  border: 1px solid var(--accent-strong);
  border-radius: var(--radius-small);
  background: var(--accent-strong);
  color: var(--surface-strong);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 720;
  white-space: nowrap;
  transition: background 180ms ease, transform 180ms var(--ease);
}

:root[data-theme="dark"] .primary-button {
  color: var(--bg);
}

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

.primary-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.form-message {
  min-height: 1.2em;
  margin: 0;
  color: var(--danger);
  font-size: 0.79rem;
}

.form-message.is-success {
  color: var(--accent);
}

.consent-row {
  display: grid;
  align-items: start;
  gap: 9px;
  color: var(--text-soft);
  font-size: 0.73rem;
  grid-template-columns: auto minmax(0, 1fr);
  line-height: 1.5;
}

.consent-row input {
  width: 17px;
  height: 17px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.consent-row a,
.auth-note a {
  color: var(--accent);
}

.auth-note {
  margin: 26px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--text-faint);
  font-size: 0.73rem;
  line-height: 1.5;
}

.back-button {
  margin-bottom: 24px;
}

.app-shell {
  display: grid;
  min-height: 100dvh;
  grid-template-areas:
    "nav top"
    "nav main";
  grid-template-columns: 212px minmax(0, 1fr);
  grid-template-rows: 64px minmax(0, 1fr);
}

.side-nav {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  display: flex;
  width: 212px;
  padding: 18px 14px 14px;
  border-right: 1px solid var(--line);
  background: var(--surface);
  flex-direction: column;
}

.app-wordmark {
  min-height: 38px;
  padding: 0 9px;
}

.nav-list {
  display: grid;
  overflow-y: auto;
  margin: 16px -4px 10px;
  padding: 0 6px 12px;
  gap: 2px;
}

.nav-item {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  padding: 0 11px;
  border: 0;
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 630;
  text-align: left;
  transition: background 180ms ease, color 180ms ease, transform 180ms var(--ease);
}

.nav-group-label {
  margin: 10px 10px 2px;
  color: var(--text-faint);
  font-size: 0.61rem;
  font-weight: 720;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-group-label:first-child {
  margin-top: 0;
}

.nav-item b {
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-soft);
  font-size: 0.62rem;
  font-weight: 720;
  text-align: center;
}

.nav-item:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.nav-item.is-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.nav-item kbd,
.global-search kbd {
  color: var(--text-faint);
  font: 600 0.68rem/1 "Avenir Next", sans-serif;
}

.side-footer {
  position: relative;
  display: grid;
  margin-top: auto;
  gap: 9px;
}

.demo-label,
.status-label {
  width: fit-content;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text-soft);
  font-size: 0.65rem;
  font-weight: 690;
  letter-spacing: 0.03em;
}

.account-button {
  display: grid;
  width: 100%;
  min-height: 54px;
  align-items: center;
  padding: 7px;
  gap: 10px;
  border: 0;
  border-radius: var(--radius-small);
  background: transparent;
  cursor: pointer;
  grid-template-columns: 36px minmax(0, 1fr);
  text-align: left;
}

.account-button:hover {
  background: var(--surface-muted);
}

.account-button > span:last-child {
  display: grid;
  min-width: 0;
}

.account-button strong,
.account-button small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-button strong {
  font-size: 0.76rem;
}

.account-button small {
  color: var(--text-soft);
  font-size: 0.65rem;
}

.account-initials,
.top-account span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.7rem;
  font-weight: 740;
}

.account-menu {
  position: absolute;
  right: 0;
  bottom: 62px;
  left: 0;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.account-menu button {
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.account-menu button:hover {
  background: var(--surface-muted);
}

.top-bar {
  position: sticky;
  z-index: 15;
  top: 0;
  grid-area: top;
  display: grid;
  min-width: 0;
  height: 64px;
  align-items: center;
  padding: 0 clamp(16px, 2.4vw, 32px);
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(18px);
  grid-template-columns: minmax(200px, 460px) auto;
  justify-content: space-between;
}

.search-shell,
.global-search {
  position: relative;
  display: block;
}

.global-search input {
  min-height: 40px;
  padding-right: 42px;
  background: var(--surface);
  font-size: 0.8rem;
}

.global-search kbd {
  position: absolute;
  top: 50%;
  right: 13px;
  transform: translateY(-50%);
}

.global-results {
  position: absolute;
  z-index: 50;
  top: calc(100% + 9px);
  right: 0;
  left: 0;
  overflow: hidden;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-strong) 97%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.global-results button {
  display: grid;
  width: 100%;
  min-height: 64px;
  padding: 9px 11px;
  gap: 2px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  grid-template-columns: 70px minmax(0, 1fr);
  text-align: left;
}

.global-results button:hover {
  background: var(--surface-muted);
}

.global-results span {
  color: var(--accent);
  font-size: 0.64rem;
  font-weight: 720;
  grid-row: 1 / span 2;
}

.global-results strong {
  overflow: hidden;
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-results small,
.global-results p {
  color: var(--text-soft);
  font-size: 0.66rem;
}

.global-results p {
  margin: 0;
  padding: 18px;
}

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

.top-account {
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}

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

.workspace {
  grid-area: main;
  min-width: 0;
  padding: clamp(22px, 2.5vw, 36px) clamp(18px, 3vw, 42px) 64px;
}

.view {
  width: min(100%, 1480px);
  margin: 0 auto;
}

.view-heading {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(20px, 2.4vw, 32px);
  padding-bottom: 16px;
  gap: 22px;
  border-bottom: 1px solid var(--line);
}

.view-heading h1 {
  font-size: clamp(1.55rem, 2.2vw, 2.15rem);
  font-weight: 590;
  letter-spacing: -0.045em;
  line-height: 1;
}

.view-heading p {
  max-width: 58ch;
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 0.75rem;
}

.date-copy {
  color: var(--text-soft);
  font-size: 0.77rem;
  white-space: nowrap;
}

.metrics {
  display: grid;
  margin: 0 0 32px;
  padding: 0;
  gap: 1px;
  background: var(--line);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.metric small {
  display: block;
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 0.68rem;
}

.metric {
  min-width: 0;
  padding: 16px clamp(14px, 1.6vw, 22px);
  background: var(--bg);
}

.metric dt {
  color: var(--text-soft);
  font-size: 0.71rem;
  font-weight: 650;
}

.metric dd {
  margin: 7px 0 0;
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  font-variant-numeric: tabular-nums;
  font-weight: 540;
  letter-spacing: -0.045em;
}

.dashboard-grid {
  display: grid;
  align-items: start;
  gap: clamp(24px, 3vw, 42px);
  grid-template-columns: minmax(0, 1.4fr) minmax(290px, 0.65fr);
}

.section-block {
  min-width: 0;
}

.section-heading,
.list-toolbar,
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.section-heading {
  margin-bottom: 12px;
}

.matched-section-heading {
  margin-top: 28px;
}

.mini-listings {
  display: grid;
  gap: 6px;
}

.mini-listings button {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  gap: 12px;
  border: 0;
  border-radius: var(--radius-small);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
}

.mini-listings button:hover {
  background: var(--surface-muted);
}

.mini-listings span {
  display: grid;
  min-width: 0;
}

.mini-listings strong,
.mini-listings small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-listings strong,
.mini-listings b {
  font-size: 0.74rem;
}

.mini-listings small {
  color: var(--text-soft);
  font-size: 0.64rem;
}

.section-heading h2,
.list-toolbar h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.text-button {
  min-height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 700;
}

.data-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.data-row {
  display: grid;
  min-width: 0;
  min-height: 58px;
  align-items: center;
  padding: 8px 2px;
  gap: 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  grid-template-columns: minmax(0, 1.4fr) minmax(90px, 0.7fr) minmax(90px, 0.6fr);
  text-align: left;
}

button.data-row {
  cursor: pointer;
  transition: padding 180ms var(--ease), background 180ms ease;
}

button.data-row:hover {
  padding-right: 10px;
  padding-left: 10px;
  background: var(--surface);
}

.data-row strong,
.data-row span,
.data-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-row strong {
  font-size: 0.82rem;
}

.data-row span,
.data-row small {
  color: var(--text-soft);
  font-size: 0.73rem;
}

.data-row > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

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

.task-item {
  display: grid;
  min-height: 52px;
  align-items: center;
  padding: 9px 10px;
  gap: 10px;
  border-radius: var(--radius-small);
  background: var(--surface);
  grid-template-columns: auto minmax(0, 1fr);
}

.task-toggle {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
}

.task-toggle[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
}

.task-toggle[aria-pressed="true"]::after {
  content: "✓";
  color: var(--surface-strong);
  font-size: 0.72rem;
  font-weight: 800;
}

.task-copy {
  display: grid;
  min-width: 0;
}

.task-copy strong {
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-copy small {
  color: var(--text-soft);
  font-size: 0.69rem;
}

.task-item.is-done .task-copy {
  opacity: 0.55;
  text-decoration: line-through;
}

.list-toolbar {
  min-height: 42px;
  align-items: center;
  margin-bottom: 14px;
}

.filter-group {
  display: flex;
  width: min(100%, 560px);
  gap: 8px;
}

.filter-input,
.filter-select {
  min-height: 38px;
  font-size: 0.78rem;
}

.filter-select {
  width: 160px;
}

.client-list .data-row {
  grid-template-columns: minmax(180px, 1.2fr) minmax(140px, 1fr) minmax(100px, 0.6fr) minmax(100px, 0.55fr);
}

.client-list .table-head {
  min-height: 38px;
  color: var(--text-faint);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.listing-grid {
  display: grid;
  gap: clamp(14px, 1.8vw, 22px);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.listing-card {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: transform 220ms var(--ease), box-shadow 220ms ease;
}

.listing-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.listing-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--surface-muted);
}

.listing-body {
  padding: 14px;
}

.listing-body h2 {
  margin: 0;
  font-size: 0.9rem;
  letter-spacing: -0.025em;
}

.listing-body p {
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 0.76rem;
}

.listing-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  gap: 12px;
}

.listing-meta strong {
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.content-queue {
  display: grid;
  gap: 12px;
}

.content-item {
  display: grid;
  align-items: center;
  padding: 15px 16px;
  gap: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  grid-template-columns: minmax(0, 1fr) auto;
}

.content-item > div:first-child {
  display: grid;
  gap: 6px;
}

.content-item h2 {
  margin: 0;
  font-size: 0.92rem;
}

.content-item p {
  max-width: 70ch;
  margin: 0;
  color: var(--text-soft);
  font-size: 0.76rem;
}

.content-actions {
  display: flex;
  gap: 6px;
}

.content-actions button {
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: transparent;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 680;
}

.content-actions button:first-child {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--surface-strong);
}

.toolbar-button,
.signal-card button,
.sold-card button,
.news-row button,
.service-card button,
.secondary-button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: transparent;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 680;
}

.toolbar-button:hover,
.signal-card button:hover,
.sold-card button:hover,
.news-row button:hover,
.service-card button:hover,
.secondary-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-muted);
}

.overview-alerts {
  margin-top: 34px;
}

.compact-grid,
.signal-grid,
.sold-grid,
.service-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.signal-card,
.sold-card,
.service-card {
  display: grid;
  min-width: 0;
  padding: 15px;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.signal-card > div:first-child,
.service-card > div:first-child,
.card-actions,
.drawer-button-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.signal-card h2,
.sold-card h2,
.service-card h2,
.timeline-row h2,
.news-row h2 {
  margin: 0;
  font-size: 0.94rem;
  letter-spacing: -0.02em;
}

.signal-card p,
.sold-card p,
.service-card p,
.timeline-row p,
.news-row p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.75rem;
}

.signal-card small {
  color: var(--text-faint);
  font-size: 0.68rem;
}

.signal-card.is-cleared {
  opacity: 0.52;
}

.signal-card .card-actions button:first-child,
.sold-card button,
.service-card button {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.timeline,
.news-list {
  display: grid;
}

.timeline-row {
  display: grid;
  min-height: 94px;
  align-items: center;
  padding: 16px 4px;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  grid-template-columns: 10px minmax(0, 1fr) auto;
}

.timeline-row time {
  color: var(--text-soft);
  font-size: 0.7rem;
}

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.sold-card dl,
.service-card dl {
  display: grid;
  margin: 4px 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sold-card dt,
.service-card dt {
  color: var(--text-faint);
  font-size: 0.66rem;
}

.sold-card dd,
.service-card dd {
  margin: 2px 0 0;
  font-size: 0.78rem;
  font-weight: 680;
}

.verified-label {
  color: var(--accent);
  font-size: 0.67rem;
  font-weight: 720;
}

.news-row {
  display: grid;
  align-items: start;
  padding: 24px 0;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  grid-template-columns: 130px minmax(0, 1fr) auto;
}

.news-source {
  display: grid;
  color: var(--text-soft);
  font-size: 0.72rem;
}

.news-source small {
  margin-top: 4px;
  color: var(--text-faint);
}

.vertical-actions {
  display: grid;
  gap: 6px;
}

.email-workspace {
  display: grid;
  min-height: 420px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.2fr);
}

.email-list {
  border-right: 1px solid var(--line);
}

.email-row {
  display: grid;
  width: 100%;
  min-height: 88px;
  padding: 14px;
  gap: 5px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.email-row:hover {
  background: var(--surface-muted);
}

.email-row strong {
  font-size: 0.84rem;
}

.email-row small {
  color: var(--text-soft);
  font-size: 0.69rem;
}

.email-empty {
  display: grid;
  place-content: center;
  padding: 50px;
  text-align: center;
}

.email-empty h2 {
  margin: 0;
  font-size: 1.4rem;
}

.email-empty p:not(.section-label) {
  max-width: 34ch;
  color: var(--text-soft);
}

.email-preview-copy {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.8rem;
}

.more-menu {
  display: none;
}

.empty-state {
  padding: 70px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.empty-state h2 {
  margin: 0;
  font-size: 1.2rem;
}

.empty-state p {
  margin: 8px 0 0;
  color: var(--text-soft);
}

.drawer-backdrop,
.dialog-backdrop {
  position: fixed;
  z-index: 40;
  inset: 0;
  background: rgba(17, 24, 19, 0.28);
  opacity: 0;
  transition: opacity 220ms ease;
}

.drawer-backdrop.is-visible,
.dialog-backdrop.is-visible {
  opacity: 1;
}

.detail-drawer {
  position: fixed;
  z-index: 45;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(100%, 440px);
  overflow-y: auto;
  padding: 18px clamp(22px, 4vw, 42px) 42px;
  border-left: 1px solid var(--line);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  transform: translateX(102%);
  transition: transform 300ms var(--ease);
}

.detail-drawer.is-open {
  transform: translateX(0);
}

.drawer-close {
  margin: 0 0 46px auto;
}

.drawer-content {
  display: grid;
  gap: 32px;
}

.drawer-content dl {
  display: grid;
  margin: 0;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.drawer-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.drawer-content dl div {
  display: grid;
  gap: 2px;
}

.drawer-content dt {
  color: var(--text-soft);
  font-size: 0.68rem;
}

.drawer-content dd {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 650;
}

.drawer-note {
  padding: 18px;
  border-radius: var(--radius-small);
  background: var(--surface-muted);
  color: var(--text-soft);
  font-size: 0.78rem;
}

.dialog-backdrop {
  display: grid;
  padding: 20px;
  place-items: center;
}

.quick-dialog {
  width: min(100%, 520px);
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  transform: translateY(14px) scale(0.985);
  transition: transform 240ms var(--ease);
}

.dialog-backdrop.is-visible .quick-dialog {
  transform: translateY(0) scale(1);
}

.dialog-heading {
  align-items: start;
  margin-bottom: 28px;
}

@media (prefers-reduced-motion: no-preference) {
  .auth-intro,
  .auth-card {
    animation: enter 600ms var(--ease) both;
  }

  .auth-card {
    animation-delay: 80ms;
  }

  .view.is-entering > * {
    animation: enter 420ms var(--ease) both;
  }

  .view.is-entering > *:nth-child(2) {
    animation-delay: 45ms;
  }

  .view.is-entering > *:nth-child(3) {
    animation-delay: 85ms;
  }
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1050px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .compact-grid,
  .sold-grid,
  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-list .data-row {
    grid-template-columns: minmax(160px, 1.2fr) minmax(130px, 1fr) minmax(90px, 0.6fr);
  }

  .client-list .data-row > :nth-child(4) {
    display: none;
  }
}

@media (max-width: 860px) {
  .auth-main {
    width: min(100% - 32px, 540px);
    padding: 30px 0 68px;
    grid-template-columns: 1fr;
  }

  .auth-intro {
    padding-top: 36px;
  }

  .auth-intro h1 {
    font-size: clamp(3.2rem, 14vw, 5.2rem);
  }

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

  .app-shell {
    display: block;
    padding-bottom: 66px;
  }

  .side-nav {
    display: none;
  }

  .top-bar {
    grid-template-columns: auto minmax(140px, 1fr) auto;
    height: 64px;
    padding: 0 14px;
  }

  .mobile-menu-button {
    display: block;
  }

  .top-actions .quiet-button {
    display: none;
  }

  .workspace {
    padding: 28px 16px 86px;
  }

  .mobile-nav {
    position: fixed;
    z-index: 30;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 8px;
    display: grid;
    overflow: hidden;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--surface-strong) 94%, transparent);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .mobile-nav button {
    min-width: 0;
    min-height: 43px;
    padding: 0 4px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    font-size: 0.61rem;
    font-weight: 680;
  }

  .mobile-nav button.is-active {
    background: var(--accent-soft);
    color: var(--accent-strong);
  }

  .more-menu {
    position: fixed;
    z-index: 40;
    right: 8px;
    bottom: calc(max(8px, env(safe-area-inset-bottom)) + 62px);
    left: 8px;
    display: block;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--surface-strong) 97%, transparent);
    box-shadow: var(--shadow);
    opacity: 0;
    backdrop-filter: blur(18px);
    transform: translateY(12px);
    transition: opacity 180ms ease, transform 180ms var(--ease);
  }

  .more-menu.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  .more-menu-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
  }

  .more-menu-heading button,
  .more-menu-grid button {
    min-height: 40px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    cursor: pointer;
    font-size: 0.75rem;
  }

  .more-menu-heading button {
    padding: 0 10px;
    color: var(--text-soft);
  }

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

  .more-menu-grid button {
    background: var(--surface-muted);
    font-weight: 680;
  }

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

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

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

  .email-empty {
    display: none;
  }

  .email-list {
    border-right: 0;
  }
}

@media (max-width: 620px) {
  .auth-header {
    width: calc(100% - 32px);
  }

  .auth-main {
    gap: 42px;
  }

  .auth-proof {
    grid-template-columns: 1fr;
  }

  .auth-card {
    padding: 24px 20px;
  }

  .field-grid,
  .listing-grid,
  .compact-grid,
  .signal-grid,
  .sold-grid,
  .service-grid {
    grid-template-columns: 1fr;
  }

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

  .view-heading {
    margin-bottom: 38px;
  }

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

  .filter-group {
    flex-direction: column;
  }

  .filter-select {
    width: 100%;
  }

  .client-list .table-head {
    display: none;
  }

  .client-list .data-row,
  .data-row {
    min-height: 78px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .client-list .data-row > :nth-child(2) {
    display: none;
  }

  .client-list .data-row > :nth-child(3) {
    display: block;
  }

  .content-item {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .content-actions {
    width: 100%;
  }

  .content-actions button {
    flex: 1;
  }

  .news-row {
    gap: 12px;
    grid-template-columns: 1fr;
  }

  .news-source {
    display: flex;
    justify-content: space-between;
  }

  .vertical-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timeline-row {
    grid-template-columns: 10px minmax(0, 1fr);
  }

  .timeline-row time {
    display: none;
  }

  .top-bar {
    gap: 8px;
  }

  .global-search kbd {
    display: none;
  }

  .global-search input {
    padding-right: 10px;
  }
}

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