:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef2f5;
  --border: #d8dee6;
  --text: #17202a;
  --muted: #657384;
  --accent: #1f6f68;
  --accent-hover: #185a54;
  --accent-2: #b45f35;
  --danger: #b42318;
  --shadow: 0 12px 32px rgba(23, 32, 42, 0.08);
  --shadow-sm: 0 2px 8px rgba(23, 32, 42, 0.06);
  --radius: 10px;
  font-family: "DM Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  color: var(--text);
  background: var(--bg);
}

.hidden {
  display: none !important;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
  outline: none;
}

/* App header */
.app-header {
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.app-header-bar {
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.app-header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

.app-header-bar .app-header-inner {
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  font-size: 1.02rem;
  text-decoration: none;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.brand:hover {
  color: var(--accent);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, #1f6f68, #2d8a80);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 12px rgba(31, 111, 104, 0.28);
}

.brand-text {
  line-height: 1;
}

.app-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 auto;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.app-nav-link,
.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted);
  font-weight: 650;
  font-size: 0.9rem;
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.app-nav-link:hover,
.nav-link:hover {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.75);
}

.app-nav-link.active,
.nav-link.active {
  color: var(--accent);
  background: #fff;
  border-color: rgba(31, 111, 104, 0.18);
  box-shadow: 0 1px 4px rgba(23, 32, 42, 0.08);
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.user-avatar {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(31, 111, 104, 0.14);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
}

.user-email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--muted);
}

.page-banner {
  background:
    radial-gradient(ellipse 80% 120% at 100% 0%, rgba(31, 111, 104, 0.1), transparent 55%),
    radial-gradient(ellipse 60% 80% at 0% 100%, rgba(180, 95, 53, 0.07), transparent 50%),
    linear-gradient(180deg, #f8fafb 0%, var(--bg) 100%);
}

.page-banner .app-header-inner {
  padding-top: 22px;
  padding-bottom: 22px;
}

.page-banner-compact .app-header-inner {
  padding-top: 18px;
  padding-bottom: 18px;
}

.page-banner-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
}

.page-banner-copy h1 {
  margin: 0 0 8px;
  font-size: clamp(1.65rem, 3.2vw, 2.35rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.page-banner-compact .page-banner-copy h1 {
  font-size: clamp(1.45rem, 2.8vw, 2rem);
  margin-bottom: 4px;
}

.page-banner-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  min-width: 200px;
}

.header-feature-list {
  display: grid;
  gap: 10px;
  width: 100%;
}

.header-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.82);
}

.header-feature-icon {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(31, 111, 104, 0.1);
  color: var(--accent);
  font-size: 0.95rem;
  flex-shrink: 0;
}

.header-feature strong {
  display: block;
  font-size: 0.88rem;
  line-height: 1.2;
}

.header-feature small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 2px;
}

.page-banner-cta {
  white-space: nowrap;
}

.banner-br {
  display: none;
}

.page {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 20px 44px;
}

.hero {
  margin-bottom: 24px;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: 0;
  margin: 0 0 10px;
}

.subtitle {
  color: var(--muted);
  max-width: 640px;
  margin: 0;
  line-height: 1.55;
  font-size: 0.96rem;
}

.navline {
  margin: 12px 0 0;
}

.link-btn {
  background: none;
  border: 0;
  padding: 8px 14px;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.login-page-body {
  min-height: 100%;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse 70% 60% at 80% 10%, rgba(31, 111, 104, 0.14), transparent 55%),
    radial-gradient(ellipse 50% 50% at 10% 90%, rgba(180, 95, 53, 0.1), transparent 50%),
    linear-gradient(165deg, #f0f4f6 0%, var(--bg) 45%, #e8eef2 100%);
}

.login-page {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  padding: 24px;
  gap: 22px;
  box-sizing: border-box;
}

.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
}

.login-panel {
  width: min(420px, 100%);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(23, 32, 42, 0.1);
}

.login-panel h1 {
  margin: 0 0 6px;
  font-size: 1.65rem;
  letter-spacing: -0.02em;
}

.login-panel form {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.muted {
  color: var(--muted);
  margin: 4px 0 0;
}

/* Search page: tighter banner so workspace gets more height */
.search-page .page-banner .app-header-inner {
  padding-top: 14px;
  padding-bottom: 14px;
}

.search-page .page-banner-copy h1 {
  font-size: clamp(1.35rem, 2.5vw, 1.85rem);
  margin-bottom: 4px;
}

.search-page .page-banner .subtitle {
  font-size: 0.88rem;
  max-width: 520px;
}

.search-page .header-feature-list {
  display: none;
}

.search-page .page-banner-aside {
  min-width: 0;
}

.how-it-works {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.84rem;
  color: var(--muted);
}

.how-it-works li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border);
}

.how-step-num {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(31, 111, 104, 0.12);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}

.search-page .page {
  padding-top: 10px;
}

@media (min-width: 1100px) {
  .search-page .header-feature-list {
    display: grid;
  }
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.layout.layout-resizable {
  --sidebar-width: 380px;
  grid-template-columns: var(--sidebar-width) 10px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
}

.lists-layout.layout-resizable {
  --sidebar-width: 260px;
}

.layout-resizable > .panel,
.layout-resizable > aside.panel {
  min-width: 0;
}

.layout-resizer {
  position: relative;
  z-index: 2;
  width: 10px;
  margin: 0 -2px;
  cursor: col-resize;
  touch-action: none;
  flex-shrink: 0;
  align-self: stretch;
}

.layout-resizer::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 50%;
  width: 4px;
  margin-left: -2px;
  border-radius: 999px;
  background: var(--border);
  transition: background 0.15s ease, width 0.15s ease, margin 0.15s ease;
}

.layout-resizer:hover::before,
.layout-resizer:focus-visible::before,
body.layout-resizing .layout-resizer::before {
  background: rgba(31, 111, 104, 0.55);
  width: 6px;
  margin-left: -3px;
}

.layout-resizer:focus-visible {
  outline: none;
}

body.layout-resizing {
  cursor: col-resize !important;
  user-select: none;
}

body.layout-resizing * {
  cursor: col-resize !important;
}

/* Viewport-contained workspace: panels scroll internally, not the whole page */
body.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

body.app-shell .app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  flex-shrink: 0;
}

body.app-shell .app-header-inner {
  max-width: none;
}

body.app-shell .page {
  flex: 1;
  width: 100%;
  min-height: 0;
  max-width: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: 14px;
  padding-bottom: 16px;
}

body.app-shell .layout {
  flex: 1;
  min-height: 0;
  align-items: stretch;
}

body.app-shell .panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.app-shell .form-panel {
  overflow-y: auto;
  overscroll-behavior: contain;
}

body.app-shell .results-panel {
  overflow: hidden;
}

body.app-shell .results-header {
  flex-shrink: 0;
}

body.app-shell .results-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body.app-shell .results-panel .results-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

body.app-shell .results-panel .table-wrap {
  flex: none;
  min-height: 0;
  overflow: visible;
}

body.app-shell .list-workspace {
  min-height: 0;
}

body.app-shell .list-empty-state {
  flex: 1;
  min-height: 0;
}

body.app-shell .list-detail:not(.hidden) {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.app-shell .list-detail-header,
body.app-shell .list-status,
body.app-shell .list-tabs {
  flex-shrink: 0;
}

body.app-shell .list-detail-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.app-shell .list-tab-panels {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.app-shell .list-tab-panel:not(.hidden) {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.app-shell .list-tab-panel:not(.hidden) .leads-toolbar,
body.app-shell .list-tab-panel:not(.hidden) .action-card {
  flex-shrink: 0;
}

body.app-shell .list-tab-panel:not(.hidden) .leads-table-wrap {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  overscroll-behavior: contain;
}

body.app-shell .list-tab-panel:not(.hidden)[data-list-tab-panel="grow"],
body.app-shell .list-tab-panel:not(.hidden)[data-list-tab-panel="outreach"],
body.app-shell .list-tab-panel:not(.hidden)[data-list-tab-panel="research"] {
  overflow-y: auto;
  overscroll-behavior: contain;
}

body.app-shell .draft-panel:not(.hidden) {
  flex-shrink: 0;
  max-height: min(38vh, 360px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

body.app-shell .list-sidebar {
  position: static;
  max-height: none;
  height: 100%;
}

body.app-shell .saved-list-items {
  overscroll-behavior: contain;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}

.form-section {
  margin-bottom: 4px;
}

.form-section-title {
  margin: 0 0 14px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.filter-details {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.filter-details summary {
  padding: 10px 12px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

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

.filter-details summary::before {
  content: "▸ ";
  display: inline-block;
  color: var(--accent);
  transition: transform 0.15s ease;
}

.filter-details[open] summary::before {
  transform: rotate(90deg);
}

.filter-details[open] summary {
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.filter-details-body {
  padding: 12px;
}

.filter-details-body .row {
  margin-top: 0;
}

.filter-details-body .checks {
  margin-top: 10px;
}

.row-balanced {
  grid-template-columns: 1fr 1fr;
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 650;
  margin-bottom: 7px;
}

.hint {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.8rem;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 6px;
  padding: 11px 12px;
  font: inherit;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 111, 104, 0.14);
  outline: none;
}

textarea {
  resize: vertical;
  min-height: 118px;
}

.row {
  display: grid;
  grid-template-columns: 1fr 132px;
  gap: 12px;
  margin-top: 14px;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.checks label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.check-pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.check-pill:has(input:checked) {
  border-color: rgba(31, 111, 104, 0.35);
  background: rgba(31, 111, 104, 0.06);
  color: var(--accent);
}

.checks input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.actions-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

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

.actions-secondary .btn {
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 10px;
  min-height: 38px;
  font-size: 0.84rem;
}

.btn-find {
  width: 100%;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.save-box {
  border-top: 1px solid var(--border);
  margin-top: 16px;
  padding-top: 16px;
}

.save-box.hidden,
.bulk-results.hidden,
.bulk-drafts.hidden,
.draft-panel.hidden,
.research-panel.hidden,
.list-status.hidden {
  display: none;
}

.save-box h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.bulk-results {
  margin-top: 14px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.5;
  max-height: 220px;
  overflow: auto;
}

.bulk-results .fail {
  color: var(--danger);
}

.bulk-results .ok {
  color: var(--accent);
}

.bulk-drafts,
.email-drafts-stack {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.bulk-drafts {
  max-height: min(60vh, 640px);
  overflow: auto;
  padding-right: 4px;
}

.bulk-draft-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 4px;
}

.bulk-draft-card input.bulk-draft-subject {
  width: 100%;
  margin-bottom: 4px;
}

.bulk-draft-card textarea.bulk-draft-body {
  min-height: 140px;
  width: 100%;
}

.field-hint {
  margin: -4px 0 10px;
  font-size: 0.85rem;
}

.email-drafts-stack.hidden {
  display: none;
}

.btn {
  border: 0;
  border-radius: 6px;
  padding: 11px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  min-height: 42px;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--accent);
  color: white;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 8px rgba(31, 111, 104, 0.25);
}

.btn.primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 4px 14px rgba(31, 111, 104, 0.32);
}

.btn.primary:active:not(:disabled) {
  transform: translateY(1px);
}

.btn.secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn.secondary:hover:not(:disabled) {
  background: #fff;
  border-color: rgba(31, 111, 104, 0.28);
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--accent);
  border-color: rgba(31, 111, 104, 0.28);
  background: rgba(31, 111, 104, 0.05);
}

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

.btn-danger:hover:not(:disabled) {
  background: #fef2f2;
}

.btn-sm {
  min-height: 34px;
  padding: 6px 12px;
  font-size: 0.84rem;
  font-weight: 650;
}

.list-detail-stats .btn-danger {
  margin-top: 0;
}

.list-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 8px;
}

.status {
  min-height: 1.4rem;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.status.error {
  color: var(--danger);
}

.search-progress {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(31, 111, 104, 0.35);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(31, 111, 104, 0.08), rgba(31, 111, 104, 0.03));
  box-shadow: 0 4px 16px rgba(31, 111, 104, 0.1);
}

.search-progress-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.search-progress-copy {
  flex: 1;
  min-width: 0;
}

.search-progress-title {
  display: block;
  font-size: 0.98rem;
  color: var(--text);
}

.search-step {
  margin: 4px 0 0;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
}

.search-spinner {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border: 3px solid rgba(31, 111, 104, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.search-progress-bar {
  margin-top: 12px;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(31, 111, 104, 0.15);
}

.search-progress-bar span {
  display: block;
  width: 35%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #3aa89d);
  animation: search-progress-slide 1.6s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes search-progress-slide {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

@keyframes skeleton-shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.btn.is-loading {
  position: relative;
  padding-left: 34px;
}

.btn.is-loading::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.badge.badge-searching {
  background: rgba(180, 95, 53, 0.12);
  color: var(--accent-2);
  border-color: rgba(180, 95, 53, 0.35);
  animation: badge-pulse 1.4s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.65;
  }
}

@media (max-width: 1100px) {
  .quality {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

.results-panel.is-searching .table-wrap,
.results-panel.is-searching .results-table-wrap {
  border-color: rgba(31, 111, 104, 0.35);
  background: linear-gradient(180deg, rgba(31, 111, 104, 0.04), transparent 120px);
}

.skeleton-row td {
  padding-top: 14px;
  padding-bottom: 14px;
}

.skeleton {
  display: block;
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, #e8edf1 0%, #f5f8fa 45%, #e8edf1 90%);
  background-size: 200px 100%;
  animation: skeleton-shimmer 1.2s ease-in-out infinite;
}

.skeleton-sm {
  width: 48px;
  margin: 0 auto;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.results-header h2 {
  margin: 0;
  font-size: 1.18rem;
}

.badge {
  background: rgba(31, 111, 104, 0.1);
  color: var(--accent);
  border: 1px solid rgba(31, 111, 104, 0.28);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 0.84rem;
  font-weight: 700;
}

.badge-neutral {
  background: var(--surface-2);
  color: var(--muted);
  border-color: var(--border);
}

.strategy {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0 2px 4px;
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
}

.strategy-details {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  flex-shrink: 0;
}

.strategy-details.hidden {
  display: none;
}

.strategy-details summary {
  padding: 10px 12px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
}

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

.strategy-details summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.15s ease;
}

.strategy-details[open] summary::before {
  transform: rotate(90deg);
}

.strategy-details .strategy {
  padding: 0 12px 12px;
  border-top: 1px solid var(--border);
}

.strategy-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 10px;
  font-size: 0.84rem;
}

.strategy-meta span {
  color: var(--muted);
}

.strategy-meta strong {
  color: var(--text);
}

.strategy-queries-label {
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.strategy-queries {
  margin: 0;
  padding-left: 18px;
  font-size: 0.84rem;
}

.strategy-queries li {
  margin-bottom: 4px;
}

.strategy.hidden,
.quality.hidden {
  display: none;
}

.strategy strong {
  color: var(--text);
}

.quality {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 0;
  flex-shrink: 0;
}

.quality-compact div {
  padding: 8px 10px;
  text-align: center;
}

.quality-compact span {
  font-size: 1.05rem;
}

.quality-compact small {
  font-size: 0.72rem;
}

.quality div {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
}

.quality span {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
}

.quality small {
  color: var(--muted);
  font-weight: 650;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 940px;
}

th,
td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: #e7edf1;
  font-size: 0.82rem;
  color: #415166;
  position: sticky;
  top: 0;
}

tbody tr:hover {
  background: #f8fafb;
}

.score {
  display: inline-grid;
  place-items: center;
  width: 48px;
  min-height: 48px;
  border-radius: 8px;
  background: var(--surface-2);
  font-weight: 800;
  line-height: 1;
}

.score small {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
}

.grade-A {
  background: #d8f3dc;
  color: #14532d;
}

.grade-B {
  background: #e0f2fe;
  color: #075985;
}

.grade-C {
  background: #fef3c7;
  color: #92400e;
}

.grade-D {
  background: #fee2e2;
  color: #991b1b;
}

.empty-row td {
  color: var(--muted);
  text-align: center;
  padding: 28px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px 16px;
  max-width: 320px;
  margin: 0 auto;
}

.empty-state-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 4px;
  border-radius: 14px;
  background: rgba(31, 111, 104, 0.1);
  color: var(--accent);
  font-size: 1.5rem;
  line-height: 1;
}

.empty-state-icon-search::before {
  content: "";
  width: 22px;
  height: 22px;
  border: 3px solid currentColor;
  border-radius: 50%;
  box-shadow: 8px 8px 0 -5px currentColor;
}

.empty-state-icon-list::before {
  content: "";
  width: 20px;
  height: 24px;
  border: 2.5px solid currentColor;
  border-radius: 3px;
  box-shadow: inset 0 -8px 0 -2px currentColor;
}

.empty-state-icon-empty::before {
  content: "—";
  font-size: 1.6rem;
  font-weight: 300;
  line-height: 1;
}

.empty-state-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.empty-state-desc {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
}

.empty-steps {
  margin: 4px 0 16px;
  padding-left: 20px;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--muted);
  text-align: left;
  max-width: 340px;
}

.empty-steps strong {
  color: var(--text);
}

a {
  color: var(--accent);
  font-weight: 700;
}

.lists-page .hero-compact {
  margin-bottom: 16px;
}

.hero-compact {
  margin-bottom: 14px;
}

.hero-compact h1,
.lists-page .hero-compact h1 {
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  margin-bottom: 4px;
}

.hero-compact .subtitle {
  margin-top: 6px;
  font-size: 0.94rem;
}

.lists-layout {
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
  align-items: start;
}

.list-workspace {
  min-height: 0;
}

.list-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 320px;
  padding: 32px 24px;
  text-align: center;
}

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

.list-empty-state .muted {
  max-width: 380px;
  line-height: 1.55;
}

.list-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff 0%, #f8fafb 100%);
  box-shadow: 0 2px 10px rgba(23, 32, 42, 0.04);
}

.list-detail-eyebrow {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.list-detail-intro h2,
.list-detail-title h2 {
  margin: 0 0 8px;
  font-size: 1.45rem;
  line-height: 1.2;
}

.list-detail-toolbar {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.list-detail-metrics {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.list-detail-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.list-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge-lg {
  font-size: 0.88rem;
  padding: 6px 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.list-status-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.stat-pill {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--border);
}

.stat-pill.stat-follow_up,
.stat-pill.stat-drafted {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.stat-pill.stat-contacted,
.stat-pill.stat-won {
  background: rgba(31, 111, 104, 0.12);
  color: var(--accent);
  border-color: rgba(31, 111, 104, 0.25);
}

.stat-pill.stat-lost {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.list-status {
  margin: 0 0 12px;
  min-height: 1.25rem;
}

.list-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 4px;
  background: var(--surface-2);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.list-tab {
  border: none;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 650;
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.list-tab:hover {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.7);
}

.list-tab.active {
  color: var(--accent);
  background: #fff;
  box-shadow: 0 1px 3px rgba(23, 32, 42, 0.08);
}

.list-tab-panels {
  min-height: 200px;
}

.action-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  background: #fff;
  margin-bottom: 14px;
}

.action-card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.action-card > .muted {
  margin: 0 0 14px;
}

.action-card label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--muted);
}

.action-card textarea,
.action-card input,
.action-card select {
  width: 100%;
}

.action-card textarea {
  min-height: 88px;
  resize: vertical;
  margin-bottom: 12px;
}

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

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

.field .field,
.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--muted);
}

.leads-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.lead-click-hint {
  margin: 0;
  font-size: 0.84rem;
  flex: 1 1 100%;
}

@media (min-width: 621px) {
  .lead-click-hint {
    flex: 1 1 auto;
    margin-left: 4px;
  }
}

.leads-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.selected-count {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
}

.draft-hint {
  margin: 0 0 12px;
  font-size: 0.88rem;
}

.select-all-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.column-details {
  font-size: 0.9rem;
}

.column-details summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 650;
  list-style: none;
}

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

.column-form {
  margin-top: 10px;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr 140px auto;
  gap: 8px;
  align-items: end;
}

.column-form {
  grid-template-columns: 1fr 120px auto;
}

.leads-table-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: auto;
  min-height: 0;
}

.leads-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.leads-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.leads-table tbody td {
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.leads-table tbody tr:hover td {
  background: rgba(31, 111, 104, 0.03);
}

.leads-table .col-check {
  width: 42px;
}

.leads-table .col-lead {
  min-width: 180px;
  max-width: 220px;
}

.leads-table .col-email {
  min-width: 160px;
}

.leads-table .col-status {
  min-width: 120px;
}

.leads-table .col-followup {
  min-width: 130px;
}

.leads-table .col-notes {
  min-width: 140px;
  max-width: 200px;
}

.lead-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lead-name-row .score {
  flex-shrink: 0;
  font-size: 0.82rem;
  padding: 3px 7px;
}

.lead-sub {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 4px;
}

.lead-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 0.8rem;
  font-weight: 650;
}

.status-select {
  width: 100%;
  font-weight: 600;
}

.status-select.status-follow_up,
.status-select.status-drafted {
  border-color: #fcd34d;
  background: #fffbeb;
}

.status-select.status-contacted,
.status-select.status-won {
  border-color: rgba(31, 111, 104, 0.35);
  background: rgba(31, 111, 104, 0.06);
}

.status-select.status-lost {
  border-color: #fecaca;
  background: #fef2f2;
}

#leadsTable input,
#leadsTable select,
#leadsTable textarea {
  width: 100%;
  padding: 7px 9px;
  font-size: 0.88rem;
}

#leadsTable textarea {
  min-height: 52px;
  resize: vertical;
}

.research-summary {
  margin-bottom: 12px;
  line-height: 1.5;
}

.research-prospect-name {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.research-findings {
  margin: 10px 0;
  padding-left: 18px;
}

.research-hint {
  margin: 8px 0 0;
  font-size: 0.9rem;
}

.research-save {
  margin-bottom: 12px;
}

.list-sidebar {
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.list-sidebar .results-header {
  flex-shrink: 0;
}

.saved-list-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
  margin-top: 4px;
  flex: 1;
  min-height: 120px;
}

.list-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 8px;
  padding: 11px 12px;
  cursor: pointer;
  font: inherit;
}

.list-item:hover {
  border-color: var(--accent);
}

.list-item.active {
  border-color: var(--accent);
  background: rgba(31, 111, 104, 0.08);
  box-shadow: inset 3px 0 0 var(--accent);
}

.list-item strong,
.list-item span {
  display: block;
}

.list-item span,
.score-line {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 4px;
}

.list-item-meta {
  font-size: 0.78rem !important;
  line-height: 1.35;
}

.sidebar-foot {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  flex-shrink: 0;
}

.draft-panel {
  margin-top: 16px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.draft-panel .results-header h3 {
  margin: 0;
}

#drafts {
  display: grid;
  gap: 12px;
}

.draft-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.draft-card label {
  margin-top: 10px;
}

.draft-card textarea {
  min-height: 170px;
}

/* Lead detail drawer */
.lead-drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  justify-content: flex-end;
}

.lead-drawer.hidden {
  display: none !important;
}

.lead-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 32, 42, 0.45);
}

.lead-drawer-panel {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  max-width: 100%;
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -12px 0 40px rgba(23, 32, 42, 0.14);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lead-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.lead-drawer-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.lead-drawer-title-row h2 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.25;
}

.lead-drawer-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.lead-drawer-close:hover {
  color: var(--text);
  border-color: var(--accent);
}

.lead-drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px 24px;
  overscroll-behavior: contain;
}

.lead-drawer-section {
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.lead-drawer-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.lead-drawer-section h3 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.lead-detail-grid {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
}

.lead-detail-grid div {
  display: grid;
  gap: 2px;
}

.lead-detail-grid dt {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.lead-detail-grid dd {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
  word-break: break-word;
}

.lead-drawer-fields {
  margin-bottom: 12px;
}

.lead-drawer-email-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.lead-drawer-email-form.hidden {
  display: none;
}

.lead-drawer-email-status {
  margin-top: 10px;
}

.lead-drawer-email-status.hidden {
  display: none;
}

.leads-table tbody tr[data-lead-id] {
  cursor: pointer;
}

.leads-table tbody tr[data-lead-id]:hover td {
  background: rgba(31, 111, 104, 0.05);
}

.leads-table tbody tr.lead-row-active td {
  background: rgba(31, 111, 104, 0.1);
}

.lead-name-row strong {
  color: var(--accent);
}

body.lead-drawer-open {
  overflow: hidden;
}

.lead-drawer-email .field {
  margin-bottom: 12px;
}

.lead-drawer-email .field:last-of-type {
  margin-bottom: 0;
}

/* Collapsible lists sidebar (mobile) */
.sidebar-toggle {
  display: none;
  width: 100%;
  margin-bottom: 10px;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.sidebar-toggle-icon {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.list-sidebar.sidebar-open .sidebar-toggle-icon {
  transform: rotate(180deg);
}

@media (min-width: 721px) {
  .banner-br {
    display: inline;
  }
}

@media (min-width: 961px) {
  .app-header-bar .app-header-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
  }

  .app-nav {
    justify-self: center;
    margin: 0;
  }

  .app-header-actions {
    margin-left: 0;
  }
}

/* Tablet / narrow desktop */
@media (max-width: 1100px) {
  .layout:not(.layout-resizable) {
    grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
    gap: 14px;
  }

  .lists-layout:not(.layout-resizable) {
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  }

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

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

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

  .panel {
    padding: 16px;
  }
}

@media (max-width: 960px) {
  .search-page .page-banner .app-header-inner,
  .lists-page .page-banner-compact .app-header-inner {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .search-page .page-banner-copy h1,
  .lists-page .page-banner-compact .page-banner-copy h1 {
    font-size: clamp(1.2rem, 4.5vw, 1.55rem);
  }

  .search-page .page-banner .subtitle,
  .lists-page .page-banner-compact .subtitle {
    font-size: 0.84rem;
    line-height: 1.4;
  }

  body.app-shell .layout,
  body.app-shell .lists-layout {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: 14px;
  }

  body.app-shell .form-panel {
    flex: 0 1 auto;
    max-height: min(44vh, 420px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  body.app-shell .list-sidebar {
    flex: 0 0 auto;
    height: auto;
  }

  body.app-shell .list-sidebar:not(.sidebar-open) {
    flex: 0 0 auto;
  }

  body.app-shell .results-panel,
  body.app-shell .list-workspace {
    flex: 1;
    min-height: 0;
  }

  body.app-shell .results-panel .results-table-wrap,
  body.app-shell .leads-table-wrap {
    flex: 1;
    min-height: 0;
    max-height: none;
  }

  body.app-shell .draft-panel:not(.hidden) {
    max-height: min(34vh, 300px);
  }

  .layout,
  .lists-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .layout-resizer {
    display: none;
  }

  body.app-shell .layout.layout-resizable,
  body.app-shell .lists-layout.layout-resizable {
    display: flex;
    grid-template-columns: unset;
  }

  .layout.layout-resizable,
  .lists-layout.layout-resizable {
    grid-template-columns: 1fr !important;
  }

  .list-workspace {
    min-height: auto;
  }

  .list-sidebar {
    position: static;
    max-height: none;
    height: auto;
  }

  .sidebar-toggle {
    display: flex;
  }

  .list-sidebar:not(.sidebar-open) .results-header,
  .list-sidebar:not(.sidebar-open) .saved-list-items,
  .list-sidebar:not(.sidebar-open) .sidebar-foot {
    display: none;
  }

  .list-sidebar.sidebar-open .saved-list-items {
    max-height: min(42vh, 320px);
  }

  .list-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
  }

  .list-tab {
    flex-shrink: 0;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .table-wrap::after,
  .leads-table-wrap::after {
    content: "Swipe sideways for more columns";
    display: block;
    padding: 7px 10px;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--muted);
    text-align: center;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
  }

  .leads-table-wrap::after {
    content: "Swipe sideways for more columns";
    display: block;
    padding: 7px 10px;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--muted);
    text-align: center;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
  }

  .results-table-wrap::after {
    content: "Swipe sideways for more columns";
    display: block;
    padding: 7px 10px;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--muted);
    text-align: center;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
  }

  .list-detail-header {
    flex-direction: column;
  }

  .list-detail-toolbar,
  .list-detail-metrics,
  .list-detail-stats {
    align-items: flex-start;
    width: 100%;
  }

  .page-banner-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: start;
  }

  .page-banner-aside {
    align-items: stretch;
    min-width: 0;
  }

  .header-feature-list {
    display: none;
  }

  .page-banner-cta {
    width: 100%;
    justify-content: center;
  }

  .app-nav {
    order: 3;
    width: 100%;
    justify-content: center;
    margin: 0;
  }

  .app-header-bar .app-header-inner {
    flex-wrap: wrap;
    padding-top: 10px;
    padding-bottom: 10px;
    min-height: auto;
  }

  .app-header-actions {
    margin-left: 0;
  }

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

  .field-grid .field-wide {
    grid-column: auto;
  }

  .leads-toolbar-actions {
    margin-left: 0;
  }

  .list-detail-actions {
    width: 100%;
    justify-content: stretch;
  }

  .list-detail-actions .btn {
    flex: 1 1 auto;
  }
}

@media (max-width: 620px) {
  .page {
    padding: 14px 12px 24px;
  }

  body.app-shell .page {
    padding-bottom: 12px;
    padding-top: 12px;
  }

  .page-banner .app-header-inner {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .page-banner-copy h1 {
    font-size: clamp(1.3rem, 5vw, 1.7rem);
  }

  .banner-br {
    display: none;
  }

  .subtitle {
    font-size: 0.9rem;
    line-height: 1.45;
  }

  .app-header-inner {
    padding-left: 12px;
    padding-right: 12px;
  }

  .app-nav-link,
  .nav-link {
    padding: 8px 12px;
    font-size: 0.84rem;
    min-height: 38px;
  }

  .user-chip {
    max-width: 140px;
  }

  .user-email {
    font-size: 0.76rem;
  }

  .panel {
    padding: 14px;
    border-radius: 10px;
  }

  .row,
  .quality {
    grid-template-columns: 1fr;
  }

  .row-balanced {
    grid-template-columns: 1fr;
  }

  .actions-secondary {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .how-it-works {
    display: none;
  }

  .save-box .actions,
  #bulkSendBox .actions {
    display: flex;
    flex-direction: column;
  }

  .save-box .actions .btn,
  #bulkSendBox .actions .btn {
    width: 100%;
    flex: none;
  }

  .leads-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .leads-toolbar-actions {
    width: 100%;
    justify-content: space-between;
  }

  .leads-toolbar .column-details {
    width: 100%;
  }

  .list-detail-title h2 {
    font-size: 1.2rem;
  }

  .list-detail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .list-detail-actions .btn-danger {
    grid-column: 1 / -1;
  }

  .list-status-stats {
    justify-content: flex-start;
  }

  .inline-form,
  .column-form {
    grid-template-columns: 1fr;
  }

  .results-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .results-header h2,
  .results-header h3 {
    font-size: 1.05rem;
  }

  .search-progress {
    padding: 12px;
  }

  .search-progress-title {
    font-size: 0.92rem;
  }

  .search-step {
    font-size: 0.84rem;
  }

  th,
  td {
    padding: 9px 10px;
    font-size: 0.88rem;
  }

  .empty-row td {
    padding: 20px 12px;
    font-size: 0.88rem;
  }

  .draft-card textarea {
    min-height: 140px;
  }

  .login-page {
    padding: 16px;
  }
}

@media (max-width: 400px) {
  .app-header-bar .app-header-inner {
    gap: 8px;
  }

  .brand {
    flex: 1;
    min-width: 0;
  }

  .user-chip {
    display: none !important;
  }

  .app-nav-link,
  .nav-link {
    padding: 7px 10px;
    font-size: 0.8rem;
  }

  .actions-secondary {
    grid-template-columns: 1fr;
  }

  .list-tab {
    padding: 8px 11px;
    font-size: 0.84rem;
  }
}

.analytics-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.analytics-card {
  background: var(--surface-elevated, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 12px 14px;
}

.analytics-card strong {
  display: block;
  font-size: 1.4rem;
  margin-top: 4px;
}

.analytics-label {
  color: var(--muted, #64748b);
  font-size: 0.85rem;
}

.analytics-status-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.analytics-events-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.analytics-events-table th,
.analytics-events-table td {
  border-bottom: 1px solid var(--border, #e2e8f0);
  padding: 8px 6px;
  text-align: left;
}

.sequence-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
}

.sequence-queue {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #e2e8f0);
}

.sequence-queue-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.sequence-queue-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.lead-research-summary ul {
  margin: 8px 0 0 18px;
}

.lead-drawer-research-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.stat-replied {
  background: #ecfdf5;
  color: #047857;
}

/* Developer credit */
.dev-credit {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 36px);
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(31, 111, 104, 0.18);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 28px rgba(23, 32, 42, 0.1);
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.dev-credit:hover {
  transform: translateY(-2px);
  border-color: rgba(31, 111, 104, 0.35);
  box-shadow: 0 14px 34px rgba(31, 111, 104, 0.14);
}

.dev-credit-pulse {
  position: relative;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent), #2d8a80);
  box-shadow: 0 0 0 0 rgba(31, 111, 104, 0.45);
  animation: dev-credit-pulse 2.4s ease-out infinite;
}

@keyframes dev-credit-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(31, 111, 104, 0.45);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(31, 111, 104, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(31, 111, 104, 0);
  }
}

.dev-credit-copy {
  white-space: nowrap;
}

.dev-credit-link {
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
  background: linear-gradient(120deg, var(--accent) 0%, #2d8a80 45%, var(--accent-2) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: background-position 0.35s ease;
}

.dev-credit-link:hover {
  background-position: right center;
}

.dev-credit-sep {
  opacity: 0.45;
}

.dev-credit-phone {
  color: var(--muted);
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.dev-credit-phone:hover {
  color: var(--accent);
}

@media (max-width: 520px) {
  .dev-credit {
    right: 12px;
    bottom: 12px;
    gap: 8px;
    padding: 8px 12px;
    font-size: 0.72rem;
  }

  .dev-credit-copy {
    white-space: normal;
  }
}
