:root {
    --brand-orange: #ff8a00;
    --brand-purple: #43204f;
    --brand-red: #e42a2e;
    --brand-ink: #25233a;
    --brand-muted: #5f6470;
    --surface: #ffffff;
    --surface-soft: #f6f6f8;
    --border: #e4e4ea;
}

.search-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.25rem;
}

.search-hero {
    display: grid;
    gap: 0.35rem;
    padding: 0.15rem 0.1rem;
    position: relative;
    padding-right: 3.1rem;
}

.search-tutorial-help {
    position: absolute;
    top: 0;
    right: 0;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 999px;
    border: 1px solid #ffb364;
    background: #fff4e8;
    color: #8f4a00;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
    line-height: 1;
    transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
}

.search-tutorial-help:hover,
.search-tutorial-help:focus-visible {
    background: #ffe8cf;
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(143, 74, 0, 0.16);
}

.search-tutorial-help:focus-visible {
    outline: 2px solid #ffd8a8;
    outline-offset: 2px;
}

.search-hero-title {
    margin: 0;
    color: var(--brand-ink);
    font-size: clamp(1.55rem, 2.2vw, 2rem);
    line-height: 1.1;
    letter-spacing: 0.01em;
}

.search-hero-subtitle {
    margin: 0;
    color: var(--brand-muted);
    font-size: clamp(1rem, 1.4vw, 1.08rem);
    max-width: 66ch;
}

.trial-exhausted-copy {
    display: block;
}

.trial-exhausted-actions {
    margin-top: 0.5rem;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.trial-exhausted-btn {
    text-decoration: none;
    min-height: 1.9rem;
    padding: 0.28rem 0.68rem;
}

.feature-locked {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.my-search-empty .feature-locked {
    margin-right: 0.35rem;
    margin-top: 0.35rem;
}

.feature-locked .btn[disabled],
.feature-locked .my-search-text-btn[disabled] {
    pointer-events: none;
}

.feature-locked .btn-locked,
.feature-locked .my-search-text-btn--locked {
    opacity: 0.58;
    cursor: not-allowed;
}

.feature-locked[data-tooltip]:hover::after,
.feature-locked[data-tooltip]:focus-within::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    background: #2b2f3c;
    color: #ffffff;
    padding: 0.34rem 0.55rem;
    border-radius: 8px;
    font-size: 0.74rem;
    line-height: 1.25;
    white-space: nowrap;
    box-shadow: 0 10px 18px rgba(20, 22, 31, 0.22);
    z-index: 25;
}

.feature-locked[data-tooltip]:hover::before,
.feature-locked[data-tooltip]:focus-within::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 100%;
    transform: translateX(-50%);
    border-width: 6px 6px 0;
    border-style: solid;
    border-color: #2b2f3c transparent transparent;
    z-index: 25;
}

.search-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.1rem;
    box-shadow: 0 10px 24px rgba(37, 35, 58, 0.06);
}

.search-title-row {
.leads-table tbody tr[data-map-row-index] {
    cursor: pointer;
}
.leads-table tbody tr.is-map-selected td {
    background: #fff7ec;
}
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.search-title {
    color: var(--brand-ink);
    font-size: 1.5rem;
    line-height: 1.2;
}

.search-subtitle {
    color: var(--brand-muted);
    font-size: 0.95rem;
}

.search-form-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.9rem;
}

.search-form-grid .form-group {
    min-width: 0;
}

.search-form-grid .form-group input,
.search-form-grid .form-group select {
    width: 100%;
}

.field-area {
    grid-column: span 4;
}

.field-industry {
    grid-column: span 3;
}

.field-radius {
    grid-column: span 2;
}

.field-results {
    grid-column: span 2;
}

.search-plan-cap {
    display: block;
    width: 100%;
    margin-top: 0;
    padding: 0.12rem 0.46rem;
    border-radius: 14px;
    border: 1px solid #ddd6e7;
    background: #f4f1f8;
    color: #4f3a60;
    font-size: 0.72rem;
    line-height: 1.3;
    font-weight: 700;
}

.search-plan-cap-row {
    grid-column: 10 / 13;
    align-self: start;
    margin-top: -0.4rem;
}

.search-plan-cap--warn {
    border-color: #ffd4a3;
    background: #fff3e6;
    color: #8f4a00;
}

.field-submit {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding-top: 0;
    min-width: 0;
}

.field-submit-label {
    display: block;
    visibility: hidden;
    font-size: 0.83rem;
    font-weight: 600;
    line-height: 1.2;
    min-height: 1em;
    margin-bottom: 0.3rem;
}

.field-submit .btn {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.15;
}

.search-panel-footer {
    margin-top: 0.85rem;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
}

.search-clear-btn {
    min-width: 106px;
    text-align: center;
}

.search-tutorial-btn {
    min-width: 120px;
    text-align: center;
}

#search-submit-btn.is-loading {
    opacity: 0.9;
    cursor: not-allowed;
}

#search-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-top: 4px;
}

#search-submit-btn[disabled] {
    pointer-events: none;
}

.search-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(37, 35, 58, 0.38);
    backdrop-filter: blur(2px);
    display: none;
    pointer-events: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
}

.search-loading-overlay.is-active {
    display: flex;
    pointer-events: auto;
}

.search-loading-dialog {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem 1.2rem;
    min-width: 280px;
    max-width: 92vw;
    box-shadow: 0 16px 34px rgba(37, 35, 58, 0.18);
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.search-loading-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(67, 32, 79, 0.25);
    border-top-color: var(--brand-purple);
    border-radius: 50%;
    animation: search-spin 0.8s linear infinite;
    flex: 0 0 auto;
}

.search-loading-message {
    margin: 0;
    color: var(--brand-ink);
    font-size: 0.95rem;
    line-height: 1.25;
}

.search-how-it-works {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfbfd 100%);
    padding: 1rem 1.1rem;
}

.how-it-works-header {
    margin-bottom: 0.85rem;
}

.how-it-works-header h2 {
    color: var(--brand-ink);
    font-size: 1.15rem;
    line-height: 1.2;
    margin-bottom: 0.2rem;
}

.how-it-works-header p {
    color: var(--brand-muted);
    font-size: 0.92rem;
}

.how-it-works-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.how-step {
    border: 1px solid #ececf2;
    border-radius: 12px;
    padding: 0.8rem;
    background: #ffffff;
}

.how-step-icon {
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 999px;
    border: 1px solid var(--brand-orange);
    background: var(--brand-orange);
    color: var(--brand-purple);
    font-size: 0.74rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.45rem;
}

.how-step h3 {
    color: var(--brand-ink);
    font-size: 1rem;
    line-height: 1.25;
    margin-bottom: 0.25rem;
}

.how-step p {
    color: var(--brand-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

.my-searches-launch {
    display: flex;
    justify-content: flex-end;
}

.my-searches-launch-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.my-searches-launch-meta {
    display: inline-flex;
    font-size: 0.76rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.88);
}

#my-saved-leads-counter {
    border-radius: 999px;
    transition: background-color 220ms ease, color 220ms ease;
}

#my-saved-leads-counter.is-updated {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    animation: saved-leads-counter-pulse 560ms ease;
}

@keyframes saved-leads-counter-pulse {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.08);
    }

    100% {
        transform: scale(1);
    }
}

.my-searches-launch-btn--active {
    background: linear-gradient(135deg, #136f63 0%, #0f766e 100%);
    border-color: #0f6a64;
    color: #ffffff;
    animation: my-search-pulse 1.85s ease-in-out infinite;
}

.my-searches-launch-btn--active:hover {
    background: linear-gradient(135deg, #0f6458 0%, #0d6b64 100%);
}

@keyframes my-search-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(15, 118, 110, 0.42);
    }

    70% {
        box-shadow: 0 0 0 14px rgba(15, 118, 110, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(15, 118, 110, 0);
    }
}

.my-searches-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 15, 20, 0.4);
    opacity: 0;
    transition: opacity 0.22s ease;
    pointer-events: none;
    z-index: 1590;
}

.my-searches-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}

.my-searches-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(560px, 96vw);
    background: #ffffff;
    border-left: 1px solid #e7e8ef;
    box-shadow: -20px 0 46px rgba(32, 27, 52, 0.2);
    transform: translateX(104%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 1600;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
}

.my-searches-drawer.is-open {
    transform: translateX(0);
}

.my-searches-header {
    padding: 1.1rem 1.1rem 0.9rem;
    border-bottom: 1px solid #ececf2;
    display: flex;
    gap: 0.85rem;
    justify-content: space-between;
    align-items: flex-start;
}

.my-searches-heading h2 {
    margin: 0;
    color: var(--brand-ink);
    font-size: 1.15rem;
}

.my-searches-heading p {
    margin: 0.2rem 0 0;
    color: var(--brand-muted);
    font-size: 0.86rem;
    line-height: 1.35;
}

.my-searches-close {
    appearance: none;
    border: 1px solid #e2e4eb;
    background: #fbfbfd;
    color: #3f4454;
    border-radius: 999px;
    width: 1.9rem;
    height: 1.9rem;
    line-height: 1;
    font-size: 1.1rem;
    cursor: pointer;
}

.my-searches-close:hover {
    background: #f1f3f8;
}

.my-searches-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    padding: 0.75rem 1.1rem;
    border-bottom: 1px solid #ececf2;
}

.my-searches-tab {
    appearance: none;
    border: 1px solid #e4e6ef;
    border-radius: 10px;
    background: #f8f9fc;
    color: #51566a;
    font-size: 0.86rem;
    font-weight: 400;
    padding: 0.5rem 0.6rem;
    cursor: pointer;
}

.my-searches-tab.is-active {
    background: #2f3244;
    border-color: #2f3244;
    color: #ffffff;
}

.my-searches-tab--attention {
    border-color: #ffcb95;
    background: #fff4e6;
    color: #8f4a00;
    animation: my-search-tab-pulse 1.9s ease-in-out infinite;
}

.my-searches-tab--attention.is-active {
    background: #ff8a00;
    border-color: #ff8a00;
    color: #ffffff;
}

@keyframes my-search-tab-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 138, 0, 0.38);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 138, 0, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 138, 0, 0);
    }
}

.my-searches-content {
    min-height: 0;
    overflow: hidden;
}

.my-searches-panel {
    height: 100%;
    overflow-y: auto;
    padding: 0.9rem 1.1rem calc(1.2rem + 64px);
    scroll-padding-bottom: 72px;
}

.my-searches-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.65rem;
}

.my-searches-stats span {
    display: inline-flex;
    gap: 0.25rem;
    align-items: center;
    border: 1px solid #e7e8ee;
    border-radius: 999px;
    background: #fbfbfd;
    color: #4a4f5e;
    padding: 0.2rem 0.5rem;
    font-size: 0.78rem;
}

.my-searches-stats strong {
    color: #212437;
}

.my-searches-top-terms {
    margin: 0 0 0.75rem;
    color: #5c6170;
    font-size: 0.82rem;
}

.my-searches-list {
    display: grid;
    gap: 0.72rem;
}

.my-search-card {
    border: 1px solid #e9e9f0;
    border-radius: 12px;
    padding: 0.78rem;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(42, 38, 58, 0.05);
}

.my-search-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.6rem;
}

.my-search-card-head h3 {
    margin: 0;
    color: #24283a;
    font-size: 0.96rem;
    line-height: 1.25;
}

.my-search-card-badges {
    display: inline-flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.my-search-badge {
    border: 1px solid #d8deea;
    border-radius: 999px;
    background: #f5f8ff;
    color: #3e4b65;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.12rem 0.44rem;
}

/* Active alerts — high contrast so it reads on white saved-search cards */
.my-search-badge[data-alert-badge] {
    border: 1px solid #ff8a00;
    background: linear-gradient(180deg, #fff6ed 0%, #ffecd9 100%);
    color: #7a3d00;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 0.22rem 0.62rem;
    letter-spacing: 0.03em;
    box-shadow: 0 1px 3px rgba(255, 138, 0, 0.28);
}

.my-search-badge--hot {
    border-color: #ffcc94;
    background: #fff4e8;
    color: #8d4a00;
}

.my-search-alert-help-btn {
    appearance: none;
    border: 1px solid #d8deea;
    background: #f4f7fd;
    color: #3f4c67;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.my-search-alert-help-btn:hover {
    background: #e9eef9;
    color: #2e3c59;
}

.saved-search-alert-help {
    position: fixed;
    inset: 0;
    /* Must sit above My Searches drawer (1600) and its overlay (1590). */
    z-index: 1700;
    display: grid;
    place-items: center;
    padding: 1rem;
}

.saved-search-alert-help[hidden] {
    display: none;
}

.saved-search-alert-help__overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: rgba(15, 15, 20, 0.46);
    backdrop-filter: blur(2px);
}

.saved-search-alert-help__dialog {
    position: relative;
    z-index: 1;
    width: min(460px, 92vw);
    border-radius: 14px;
    border: 1px solid #e5e8f1;
    background: #ffffff;
    box-shadow: 0 20px 40px rgba(24, 22, 39, 0.22);
    padding: 1rem 1.1rem;
    display: grid;
    gap: 0.55rem;
}

.saved-search-alert-help__dialog h2 {
    margin: 0;
    color: var(--brand-ink);
    font-size: 1.06rem;
}

.saved-search-alert-help__dialog p {
    margin: 0;
    color: #4f5667;
    font-size: 0.9rem;
    line-height: 1.45;
}

.saved-search-alert-help__list {
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.28rem;
    color: #41495e;
    font-size: 0.86rem;
}

.saved-search-alert-help__tip {
    border-top: 1px solid #e9ecf3;
    padding-top: 0.5rem;
    color: #4a5164;
    font-size: 0.84rem;
}

.saved-search-alert-help__upgrade-link {
    justify-self: start;
    margin-top: 0.15rem;
    text-decoration: none;
}

.saved-search-alert-help__manage-link {
    justify-self: start;
    margin-top: 0.15rem;
    text-decoration: none;
}

.saved-search-alert-help__close {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    appearance: none;
    border: 1px solid #dde2ee;
    background: #f8f9fd;
    color: #3f4559;
    border-radius: 999px;
    width: 1.8rem;
    height: 1.8rem;
    line-height: 1;
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
}

.saved-search-alert-help__close:hover {
    background: #eef2fa;
}

.my-search-badge--priority {
    border-style: solid;
}

.my-search-badge--priority-low {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
}

.my-search-badge--priority-medium {
    background: #fff7ec;
    border-color: #ffd4a3;
    color: #8f4a00;
}

.my-search-badge--priority-high {
    background: #fff1f1;
    border-color: #efcaca;
    color: #8d2b2b;
}

.my-search-card--overdue {
    border-color: #efcaca;
    box-shadow: 0 0 0 1px #fff1f1, 0 10px 24px rgba(141, 43, 43, 0.08);
}

.my-search-card--updated {
    animation: lead-card-pulse 0.6s ease;
}

@keyframes lead-card-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 138, 0, 0.36);
    }
    100% {
        box-shadow: 0 0 0 10px rgba(255, 138, 0, 0);
    }
}

.lead-next-action-due {
    font-weight: 700;
    color: #30384d;
}

.lead-next-action-due--overdue {
    color: #8d2b2b;
}

.my-search-card-meta {
    margin: 0.45rem 0 0.2rem;
    color: #2f3447;
    font-size: 0.84rem;
}

.my-search-card-submeta {
    margin: 0;
    color: #707687;
    font-size: 0.76rem;
}

.my-search-card-timeline {
    margin-top: 0.52rem;
    border-top: 1px dashed #e4e8f1;
    padding-top: 0.45rem;
}

.my-search-card-timeline > strong {
    display: block;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #5f677e;
    margin-bottom: 0.2rem;
}

.lead-activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.18rem;
}

.lead-activity-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.55rem;
    font-size: 0.74rem;
    color: #444d66;
}

.lead-activity-summary {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lead-activity-when {
    color: #7a8399;
    white-space: nowrap;
}

.lead-activity-empty {
    color: #8f97ab;
}

.my-search-card-actions {
    margin-top: 0.68rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.my-search-card-actions form {
    margin: 0;
}

.lead-workspace-actions {
    margin-top: 0.8rem;
    display: grid;
    gap: 0.65rem;
}

.lead-action-group {
    border: 1px solid #e7eaf2;
    border-radius: 10px;
    background: #f8faff;
    padding: 0.55rem;
    display: grid;
    gap: 0.45rem;
}

.lead-action-group-title {
    margin: 0;
    color: #3f4962;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.lead-action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.lead-action-row--compact {
    gap: 0.55rem;
}

.lead-action-form {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
}

.lead-action-form--wide {
    display: grid;
    grid-template-columns: 96px minmax(140px, 1fr) auto auto;
    align-items: center;
    gap: 0.38rem;
}

.lead-action-label {
    color: #5f677e;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.my-search-inline-form {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
}

.my-search-inline-form input[type="text"] {
    width: 140px;
    max-width: 34vw;
    border: 1px solid #d8dce8;
    border-radius: 8px;
    padding: 0.36rem 0.45rem;
    font-size: 0.8rem;
}

.my-search-inline-form input[type="datetime-local"] {
    border: 1px solid #d8dce8;
    border-radius: 8px;
    padding: 0.34rem 0.45rem;
    font-size: 0.8rem;
    background: #ffffff;
    color: #30384d;
}

.my-search-inline-form select {
    border: 1px solid #d8dce8;
    border-radius: 8px;
    padding: 0.33rem 0.45rem;
    font-size: 0.8rem;
    background: #ffffff;
    color: #30384d;
}

.my-search-inline-form textarea {
    width: 210px;
    max-width: 46vw;
    border: 1px solid #d8dce8;
    border-radius: 8px;
    padding: 0.38rem 0.45rem;
    font-size: 0.8rem;
    line-height: 1.35;
    resize: vertical;
    min-height: 2.15rem;
}

.js-lead-complete-form input[name="completion_note"] {
    width: 180px;
    max-width: 42vw;
}

.lead-action-form input[type="text"],
.lead-action-form input[type="datetime-local"],
.lead-action-form select,
.lead-action-form textarea {
    max-width: 100%;
}

.lead-action-form--wide textarea {
    min-height: 2.1rem;
}

.lead-action-form--wide button {
    justify-self: start;
}

.my-search-text-btn {
    appearance: none;
    border: 1px solid #d6dcea;
    background: #f6f8fc;
    color: #30384d;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    line-height: 1;
    font-weight: 400;
    min-height: 1.85rem;
    padding: 0.28rem 0.62rem;
    cursor: pointer;
    text-decoration: none;
}

.lead-grid-wrapper {
    overflow-x: auto;
}

.lead-grid {
    width: 100%;
    border-collapse: collapse;
}

.lead-grid th,
.lead-grid td {
    border-bottom: 1px solid #e6eaf3;
    padding: 0.7rem 0.55rem;
    vertical-align: top;
    text-align: left;
    font-size: 0.84rem;
    color: #2c344a;
}

.lead-grid th {
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #5f6980;
}

.lead-source-meta {
    display: block;
    margin-top: 0.28rem;
    color: #5f6678;
    font-size: 0.74rem;
    line-height: 1.35;
}

.lead-source-meta strong {
    color: #2f3446;
}

/* Manual lead form grid */
.lead-form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem 1.2rem;
}

@media (max-width: 700px) {
    .lead-form-grid {
        grid-template-columns: 1fr;
    }
}

.lead-form-grid .form-group {
    min-width: 0;
}

.lead-form-grid .form-group input,
.lead-form-grid .form-group select,
.lead-form-grid .form-group textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d8dce8;
    border-radius: 8px;
    padding: 0.45rem 0.6rem;
    font-size: 0.9rem;
    font-family: inherit;
    color: #2a2a3a;
    background: #fff;
    transition: border-color 0.15s;
}

.lead-form-grid .form-group input:focus,
.lead-form-grid .form-group select:focus,
.lead-form-grid .form-group textarea:focus {
    outline: none;
    border-color: #7c4daa;
    box-shadow: 0 0 0 3px rgba(124, 77, 170, 0.12);
}

.lead-form-grid .form-group--full {
    grid-column: 1 / -1;
}

.form-fieldset {
    border: 1px solid #e2e4ed;
    border-radius: 6px;
    padding: 1rem 1.1rem 1.1rem;
    margin-bottom: 1.1rem;
}

.form-legend {
    font-size: 0.85rem;
    font-weight: 700;
    color: #4a3a60;
    padding: 0 0.4rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.form-legend small {
    font-size: 0.78rem;
    font-weight: 400;
    text-transform: none;
    color: #6b6b80;
    margin-left: 0.3em;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #3a3a50;
    margin-bottom: 0.3rem;
}

.form-group label .required {
    color: #c0392b;
    margin-left: 0.15em;
}

.field-error {
    display: block;
    font-size: 0.78rem;
    color: #c0392b;
    margin-top: 0.2rem;
}

.lead-manage-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 0.5rem;
}

/* Source badges */
.lead-source-badge {
    display: inline-block;
    padding: 0.1em 0.45em;
    margin-left: 0.35em;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 3px;
    vertical-align: middle;
    line-height: 1.4;
    background: #e8eaf0;
    color: #444;
}
.lead-source-badge--manual {
    background: #e0f3e8;
    color: #1a7a3a;
}
.lead-source-badge--gumtree {
    background: #fff7e0;
    color: #8a5c00;
}
.lead-source-badge--website_scrape {
    background: #e8f0fd;
    color: #1a4fa3;
}
.lead-source-badge--import_csv {
    background: #f0e8fd;
    color: #5a1aa3;
}

/* Search-hero with action button */
.search-hero-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.search-hero-actions .search-hero-title {
    margin: 0;
    flex: 1 1 auto;
}

.lead-manage-row > td {
    background: #f8faff;
}

.lead-manage-form {
    display: grid;
    gap: 0.65rem;
}

.lead-manage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.55rem;
}

.lead-manage-grid label {
    display: grid;
    gap: 0.28rem;
}

.lead-manage-grid-full {
    grid-column: 1 / -1;
}

.lead-manage-form input[type="text"],
.lead-manage-form input[type="datetime-local"],
.lead-manage-form select,
.lead-manage-form textarea {
    border: 1px solid #d8dce8;
    border-radius: 8px;
    padding: 0.4rem 0.5rem;
    font-size: 0.84rem;
    width: 100%;
}

.lead-manage-form textarea {
    resize: vertical;
    min-height: 2.6rem;
}

.lead-manage-activity {
    border-top: 1px dashed #d8deeb;
    padding-top: 0.45rem;
}

.lead-manage-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.lead-manage-close-btn {
    background: #eef2f8;
    color: #344156;
    border: 1px solid #d6deea;
}

.lead-manage-close-btn:hover {
    background: #dfe6f1;
}

.lead-manage-actions .btn-primary {
    background: #43204f;
    border: 1px solid #43204f;
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(67, 32, 79, 0.28);
}

.lead-manage-actions .btn-primary:hover {
    background: #34163d;
    border-color: #34163d;
}

.my-search-text-btn:hover {
    color: #1f2536;
    background: #edf1f9;
}

.my-search-text-btn--danger {
    color: #8d2b2b;
    background: #fff1f1;
    border-color: #efcaca;
}

.my-search-text-btn--danger:hover {
    color: #711b1b;
    background: #ffe6e6;
}

.my-search-text-btn--save {
    background: #43204f;
    border-color: #43204f;
    color: #ff8a00;
}

.my-search-text-btn--save:hover {
    background: #34163d;
    border-color: #34163d;
    color: #ff8a00;
}

.my-search-text-btn--save.is-saved {
    background: #e8f5ef;
    border-color: #b8dfcb;
    color: #1f6f4a;
    cursor: default;
}

@media (max-width: 980px) {
    .lead-action-form--wide {
        grid-template-columns: 1fr;
    }

    .lead-action-label {
        margin-bottom: -0.1rem;
    }
}

.search-lead-save-feedback {
    margin-bottom: 0.75rem;
}

.visit-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.9rem;
    min-width: 3.5rem;
    border: 1px solid #d6dcea;
    border-radius: 8px;
    background: #f6f8fc;
    color: #30384d;
    font-size: 0.82rem;
    font-weight: 400;
    text-decoration: none;
    padding: 0.26rem 0.68rem;
}

.visit-link-btn:hover {
    color: #1f2536;
    background: #edf1f9;
}

.my-searches-secondary-actions {
    margin-bottom: 0.6rem;
    display: flex;
    justify-content: flex-end;
}

.my-search-empty {
    border: 1px dashed #dbdeea;
    border-radius: 12px;
    background: #f9fafd;
    padding: 1rem;
    color: #565c6f;
}

.my-search-empty strong {
    display: block;
    color: #2b3044;
    margin-bottom: 0.22rem;
}

.my-searches-pager {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    flex-wrap: wrap;
    color: #5c6171;
    font-size: 0.78rem;
}

.my-searches-pager-links {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    flex-wrap: wrap;
}

.my-searches-pager-links a,
.my-searches-pager-links strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.65rem;
    height: 1.65rem;
    border-radius: 7px;
    padding: 0 0.4rem;
    font-size: 0.74rem;
}

.my-searches-pager-links a {
    text-decoration: none;
    color: #384056;
    background: #f4f6fb;
    border: 1px solid #e0e5f2;
}

.my-searches-pager-links a:hover {
    background: #e9eef8;
}

.my-searches-pager-links strong {
    background: #2f3244;
    border: 1px solid #2f3244;
    color: #ffffff;
}

@keyframes search-spin {
    to {
        transform: rotate(360deg);
    }
}

.empty-state {
    padding: 1.2rem;
    border: 1px dashed #d5d7df;
    border-radius: 12px;
    background: var(--surface-soft);
    color: var(--brand-muted);
}

.empty-state strong {
    color: var(--brand-ink);
    display: block;
    margin-bottom: 0.3rem;
}

.empty-state--no-results {
    border-color: #ffd4a3;
    background: linear-gradient(180deg, #fffaf4 0%, #fff3e7 100%);
}

.empty-state--no-results strong {
    color: #8f4a00;
}

.result-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.result-count {
    color: var(--brand-ink);
    font-weight: 600;
}

.result-summary {
    display: grid;
    gap: 0.2rem;
}

.result-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.export-quota-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border: 1px solid #dcdfea;
    border-radius: 999px;
    background: #f8f9fc;
    color: #4a4f5b;
    font-size: 0.76rem;
    line-height: 1.2;
}

.email-enrichment-form .btn.is-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    opacity: 0.92;
    cursor: progress;
}

.email-enrichment-form .btn.is-loading::before {
    content: "";
    width: 0.82rem;
    height: 0.82rem;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #ffffff;
    animation: search-spin 0.8s linear infinite;
    flex: 0 0 auto;
}

.result-context {
    color: var(--brand-muted);
    font-size: 0.86rem;
}

.alert-info--new-matches {
    margin-bottom: 0.8rem;
    border-color: #ffd4a3;
    background: #fff7ec;
    color: #8f4a00;
}

.result-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.results-new-filter {
    margin-bottom: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.55rem;
    padding: 0.45rem 0.62rem;
    border: 1px solid #ffe0bc;
    border-radius: 10px;
    background: #fffaf4;
}

.results-new-filter-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #8f4a00;
    font-size: 0.84rem;
    font-weight: 700;
}

.results-new-filter-checkbox {
    width: 0.95rem;
    height: 0.95rem;
    accent-color: #ff8a00;
    cursor: pointer;
}

.results-new-filter-meta {
    color: #8f4a00;
    font-size: 0.78rem;
    font-weight: 600;
}

.results-new-filter-empty {
    margin: -0.15rem 0 0.65rem;
    color: #8f4a00;
    font-size: 0.8rem;
}

.results-map-panel {
    margin-bottom: 0.85rem;
    border: 1px solid #e6e8ef;
    border-radius: 12px;
    padding: 0.75rem;
    background: #fcfcfe;
}

.results-map-canvas {
    width: 100%;
    height: 320px;
    border-radius: 10px;
    border: 1px solid #dde2ec;
    overflow: hidden;
}

.results-map-hint {
    margin: 0.2rem 0 0.7rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid #15803d;
    border-radius: 10px;
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    box-shadow: 0 8px 18px rgba(21, 128, 61, 0.24);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.35;
}

.result-stat {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border: 1px solid #e8e7ec;
    border-radius: 999px;
    background: #fbfbfd;
    color: #4a4f5b;
    font-size: 0.8rem;
}

.result-stat strong {
    color: #25233a;
    font-weight: 700;
}

.alert-info--due-reminder {
    margin-top: 0.65rem;
    border-color: #ffd7a8;
    background: #fff4e8;
    color: #7a3f00;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.alert-dismiss-btn {
    flex-shrink: 0;
    background: none;
    border: 1px solid #c97a2a;
    border-radius: 4px;
    color: #7a3f00;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0.2rem 0.65rem;
    line-height: 1.4;
}
.alert-dismiss-btn:hover {
    background: #ffd7a8;
}
.lead-select-column {
    width: 2.2rem;
    text-align: center;
    white-space: nowrap;
}

.lead-enrich-checkbox,
#select-enrich-all {
    width: 0.95rem;
    height: 0.95rem;
    accent-color: var(--brand-purple);
    cursor: pointer;
}

.lead-select-placeholder {
    color: #b6bbc8;
}

.leads-table tbody tr.lead-row--new-match td {
    background: #ebf9f0;
}

.leads-table tbody tr.lead-row--new-match:hover td {
    background: #ddf3e5;
}

.leads-table tbody tr.lead-row--new-match td:first-child {
    box-shadow: inset 4px 0 0 #15803d;
}

.new-match-pill {
    display: inline-flex;
    align-items: center;
    margin-left: 0.45rem;
    padding: 0.12rem 0.46rem;
    border-radius: 999px;
    border: 1px solid #166534;
    background: #16a34a;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    vertical-align: middle;
}

.lead-grid tbody tr.lead-main-row--managed td {
    background: #ffe7c2 !important;
    transition: background-color 320ms ease;
    animation: lead-row-managed-flash 1.4s ease;
}

.lead-grid tbody tr.lead-main-row--managed td:first-child {
    box-shadow: inset 6px 0 0 #ff8a00;
}

@keyframes lead-row-managed-flash {
    0% {
        background: #ffd793;
    }

    100% {
        background: #ffe7c2;
    }
}

.fit-band {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-right: 0.35rem;
}

.fit-band--high {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.fit-band--medium {
    background: #fff3d6;
    color: #9a580a;
    border: 1px solid #fbd38d;
}

.fit-band--low {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.fit-score {
    color: var(--brand-muted);
    font-size: 0.78rem;
    font-weight: 700;
    vertical-align: middle;
}

.opportunity-score {
    display: inline-block;
    min-width: 2.4rem;
    text-align: center;
    padding: 0.1rem 0.42rem;
    border-radius: 999px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.column-help-label {
    display: inline-flex;
    align-items: center;
    gap: 0.24rem;
    white-space: nowrap;
}

.opportunity-score-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0.94rem;
    height: 0.94rem;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #475569;
    font-size: 0.64rem;
    font-weight: 800;
    line-height: 1;
    vertical-align: middle;
    cursor: help;
}

.upgrade-strip {
    margin-top: 1rem;
    display: grid;
    gap: 0.75rem;
}

.search-upgrade-cta {
    border: 1px solid #e6deed;
    background: linear-gradient(180deg, #fcfbfe 0%, #f8f5fc 100%);
    border-radius: 14px;
    padding: 0.9rem 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.search-upgrade-copy {
    color: #4d5260;
    font-size: 0.98rem;
    font-weight: 500;
}

.search-upgrade-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.upsell-card {
    border: 1px solid #f3bb80;
    background: linear-gradient(180deg, #fffdfa 0%, #fff8f2 100%);
    color: #25233a;
    border-radius: 12px;
    padding: 0.75rem 0.85rem;
    display: grid;
    gap: 0.55rem;
}

.upsell-card-head {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.upsell-cue {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 999px;
    margin-top: 0.25rem;
    flex: 0 0 auto;
    border: 1px solid #e67900;
    background: #ff8a00;
}

.upsell-cue--history {
    background: #ff8a00;
}

.upsell-cue--export {
    background: #ff8a00;
}

.upsell-cue--maps {
    background: #ff8a00;
}

.upsell-card strong {
    color: #2f3143;
    display: block;
    line-height: 1.3;
}

.upsell-copy {
    margin: 0;
    color: #5b6070;
    font-size: 0.9rem;
    line-height: 1.4;
}

.upsell-upgrade-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: start;
    background: #43204f;
    color: #ff8a00;
    border: 1px solid #43204f;
    font-weight: 400;
}

.upsell-upgrade-btn:hover {
    background: #34163d;
    color: #ff8a00;
}

.auth-shell {
    min-height: 62vh;
    display: grid;
    place-items: center;
    padding: 1rem 0;
}

.auth-card {
    width: 100%;
    max-width: 560px;
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 18px 38px rgba(37, 35, 58, 0.14);
    padding: 1.2rem;
}

.auth-card .page-title {
    margin-bottom: 0.5rem;
}

.auth-meta {
    color: var(--brand-muted);
    margin-bottom: 1rem;
    font-size: 0.92rem;
}

.auth-password-stack {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.auth-password-field {
    position: relative;
    width: 100%;
}

.auth-password-field input {
    width: 100%;
    padding-right: 2.8rem;
}

.auth-password-toggle {
    position: absolute;
    right: 0.45rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.9rem;
    height: 1.9rem;
    border: 0;
    padding: 0;
    background: transparent;
    color: #566079;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-password-toggle-icon {
    width: 1.06rem;
    height: 1.06rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-password-toggle-icon--hide {
    display: none;
}

.auth-password-toggle.is-visible .auth-password-toggle-icon--show {
    display: none;
}

.auth-password-toggle.is-visible .auth-password-toggle-icon--hide {
    display: block;
}

.auth-password-toggle-label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.auth-password-toggle:hover {
    background: #f0f3f8;
}

.auth-password-toggle:focus-visible {
    outline: 2px solid #8ab4ff;
    outline-offset: 1px;
}

.auth-password-field input[type="password"]::-ms-reveal,
.auth-password-field input[type="password"]::-ms-clear {
    display: none;
}

.auth-card .form-group--action {
    margin-left: auto;
}

.auth-submit-row {
    margin-top: 0.8rem;
}

.auth-actions {
    margin-top: 0.8rem;
    font-size: 0.95rem;
}

.auth-actions a {
    color: var(--brand-purple);
    text-decoration: none;
    font-weight: 600;
}

.auth-actions a:hover {
    text-decoration: underline;
}

@media (max-width: 900px) {
    .field-area,
    .field-industry,
    .field-radius,
    .field-results,
    .field-submit {
        grid-column: span 12;
    }

    .field-submit {
        align-items: stretch;
    }

    .field-submit-label {
        display: none;
    }

    .field-submit .btn {
        width: 100%;
    }

    .search-plan-cap-row {
        grid-column: span 12;
        margin-top: -0.2rem;
    }

    #search-submit-btn {
        margin-top: 0;
    }

    .how-it-works-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .search-upgrade-cta {
        align-items: stretch;
    }

    .search-upgrade-actions {
        width: 100%;
        flex-direction: column;
    }

    .search-upgrade-actions .btn {
        width: 100%;
        text-align: center;
    }

    .result-actions {
        width: 100%;
    }

    .result-actions .btn {
        width: 100%;
        text-align: center;
    }

    .my-searches-launch {
        width: 100%;
        justify-content: stretch;
    }

    .my-searches-launch-btn {
        width: 100%;
        justify-content: space-between;
    }

    .search-panel-footer {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .search-clear-btn {
        width: 100%;
    }

    .search-tutorial-btn {
        width: 100%;
    }

    .my-searches-drawer {
        width: 100vw;
        max-width: 100vw;
        border-left: none;
        box-shadow: none;
        transform: translateY(104%);
        transition: transform 0.24s cubic-bezier(0.2, 0.9, 0.2, 1);
        border-top: 1px solid #e7e8ef;
    }

    .my-searches-drawer.is-open {
        transform: translateY(0);
    }

    .my-search-inline-form {
        width: 100%;
    }

    .my-search-inline-form input[type="text"] {
        width: 100%;
        max-width: none;
    }

    .my-search-inline-form textarea {
        width: 100%;
        max-width: none;
    }

    .my-searches-pager {
        align-items: flex-start;
        flex-direction: column;
    }

    .saved-search-alert-help {
        padding: 0.75rem;
    }

    .saved-search-alert-help__dialog {
        width: min(520px, 96vw);
    }
}

@media (prefers-reduced-motion: reduce) {
    .my-searches-overlay,
    .my-searches-drawer {
        transition: none;
    }

    .my-searches-launch-btn--active,
    .my-searches-tab--attention,
    #my-saved-leads-counter.is-updated,
    .lead-grid tbody tr.lead-main-row--managed td {
        animation: none;
    }
}
