.portal {
  padding: 48px;
  max-width: 1360px;
}
.portal h1 {
  font-size: clamp(32px, 4vw, 52px);
}
.portal h2 {
  font-size: 24px;
}
.portal .panel {
  margin: 24px 0;
  padding: 28px;
}
.wallet,
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.wallet h2 {
  font-size: 42px;
  margin: 0;
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}
input,
select {
  font: inherit;
  padding: 11px 12px;
  min-width: 0;
  width: 100%;
  background: #0c0e13;
  color: #f7f6f3;
  border: 1px solid #555d6e;
  border-radius: 6px;
}
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #ff7646;
  flex-shrink: 0;
}
.consent {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 10px;
  margin: 20px 0;
  max-width: 700px;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}
th,
td {
  text-align: left;
  padding: 16px 12px;
  border-bottom: 1px solid #2a2f3a;
  vertical-align: top;
}
td .details {
  display: block;
  font-size: 12px;
  margin: 3px 0;
  overflow-wrap: anywhere;
}
td a {
  color: #ff9875;
}
.actions {
  margin: 18px 0;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.portal #status {
  position: sticky;
  top: 0;
  background: #151923;
  padding: 12px;
  border-radius: 6px;
  z-index: 3;
}
.portal #status:empty {
  display: none;
}
.portal #sign-in {
  margin: 24px auto;
  max-width: 420px;
}
.download-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 0;
  border-bottom: 1px solid #2a2f3a;
}
.fine a,
.legal a {
  color: #ff9875;
  text-decoration: underline;
}
.legal {
  max-width: 850px;
  padding: 48px;
}
.legal h1 {
  font-size: 42px;
}
.legal h2 {
  font-size: 24px;
  margin-top: 32px;
}
.legal p {
  color: #c0c4ce;
}
.button {
  font: inherit;
}
input:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 3px solid #ff7646;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 900px) {
  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .portal,
  .legal {
    padding: 26px 18px;
  }
  .portal .panel {
    padding: 18px;
  }
  .filter-grid {
    grid-template-columns: 1fr;
  }
  .wallet .button {
    margin: 6px 0;
    width: 100%;
  }
  header {
    padding: 20px 18px;
  }
  footer {
    padding: 24px 18px;
  }
  .portal #status {
    font-size: 14px;
  }
  th,
  td {
    padding: 12px 8px;
  }
  .table-wrap {
    max-width: 100%;
  }
}
.portal .panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
button.secondary {
  background: transparent;
}
button.primary {
  border: 1px solid transparent;
}
.portal #status {
  position: static;
}
.portal .details {
  color: #c0c4ce;
}
/* Clerk's sign-in card is full-width; its mounted user button must stay compact. */
#user-button {
  width: 32px;
  min-width: 32px;
  flex: none;
}
header {
  flex-wrap: wrap;
  gap: 16px;
}
header nav {
  gap: 16px;
}

.lead-views {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 24px 0;
}
.lead-views [aria-current="page"] {
  background: var(--accent);
  color: #141414;
  border-color: var(--accent);
}
.lead-filters summary {
  cursor: pointer;
  font-weight: 600;
  padding: 8px 0;
}
.lead-filters summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
.lead-filters[open] summary {
  margin-bottom: 20px;
}
.niche-filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.niche-filter .fine {
  margin: 0;
}
.result-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.result-summary strong {
  display: block;
  font-size: clamp(24px, 3vw, 36px);
  overflow-wrap: anywhere;
}
.result-summary .details {
  display: block;
  font-size: 14px;
}
.lead-workspace td {
  overflow-wrap: anywhere;
}
.lead-workspace td .button {
  padding: 10px 12px;
  font-size: 13px;
  min-height: 44px;
  white-space: nowrap;
}
.pipeline-stage {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}
.empty-leads {
  padding: 24px 0;
}
#lead-action-status:empty {
  display: none;
}
#lead-action-status {
  padding: 12px;
  border-left: 3px solid var(--accent);
  background: #1a202b;
}
@media (max-width: 700px) {
  .result-summary {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .result-summary > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
  }
  .result-summary strong {
    font-size: 25px;
  }
  .result-summary .details {
    max-width: 55%;
  }
  .lead-workspace .table-wrap {
    overflow: visible;
  }
  .lead-workspace table,
  .lead-workspace tbody {
    display: block;
  }
  .lead-workspace thead {
    display: block;
  }
  .lead-workspace thead tr {
    display: block;
    border: 0;
    margin: 0;
    padding: 0;
  }
  .lead-workspace thead th:not(:first-child) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .lead-workspace thead th:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
  }
  .lead-workspace thead th:first-child::after {
    content: "Select all leads on this page";
    font-weight: 400;
  }
  .lead-workspace tbody tr {
    display: grid;
    grid-template-columns: 1fr;
    border: 1px solid var(--line);
    border-radius: 8px;
    margin: 14px 0;
    padding: 10px;
  }
  .lead-workspace td {
    display: block;
    padding: 9px;
    border: 0;
    min-width: 0;
  }
  .lead-workspace td::before {
    content: attr(data-label);
    display: block;
    font-size: 12px;
    color: #a8aeba;
    margin-bottom: 5px;
  }
  .lead-workspace td:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .lead-workspace td:first-child::before {
    margin: 0;
    order: 1;
  }
  .lead-workspace td:nth-child(2) {
    font-size: 18px;
    font-weight: 600;
  }
  .lead-workspace td:nth-child(2)::before {
    display: none;
  }
  .lead-workspace td .button {
    width: 100%;
  }
  .lead-workspace .actions .button {
    min-height: 44px;
  }
}
