:root {
    color-scheme: light;
    --canvas: #f5f7f9;
    --surface: #fff;
    --surface-soft: #f7f9fa;
    --surface-hover: #edf2f3;
    --border: #e4e9ed;
    --text: #172b35;
    --muted: #5a6c76;
    --subtle: #626f78;
    --accent: #087f68;
    --accent-soft: #e5f5ef;
    --purple: #7554b6;
    --warning: #986016;
    --danger: #c1394b;
    --shadow: 0 4px 24px #152d3a04;
    --type-caption: 12px;
    --type-ui: 13px;
    --type-body-small: 14px;
    --type-body: 16px;
    --type-title-small: 18px;
    --type-title: 22px;
    --type-heading: 28px;
    --type-display: 36px;
    --sidebar-width: 250px;
    --sidebar-collapsed-width: 72px;
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --canvas: #101619;
    --surface: #182024;
    --surface-soft: #1d272c;
    --surface-hover: #253238;
    --border: #2b373d;
    --text: #edf3f3;
    --muted: #9aadb5;
    --subtle: #7c929d;
    --accent: #65d5b0;
    --accent-soft: #183b32;
    --purple: #bda1eb;
    --warning: #edbf70;
    --danger: #ff98a4;
    --shadow: none;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--text); font: var(--type-body-small)/1.6 'DM Sans', sans-serif; }
button, input, select, textarea { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button:not(:disabled), select, summary { cursor: pointer; }
button:disabled { cursor: not-allowed; }
select { min-height: 40px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background-color: var(--surface-soft); color: var(--text); }
select option { background-color: var(--surface); color: var(--text); }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
h1, h2, h3, .metric-value { font-family: 'Manrope', sans-serif; }
.skip-link { position: fixed; top: -80px; left: 20px; z-index: 100; padding: 12px; background: var(--surface); }
.skip-link:focus { top: 12px; }
.sidebar { width: var(--sidebar-width); position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--border); z-index: 35; transition: width .22s ease; }
.brand { display: flex; gap: 12px; align-items: center; font: 800 var(--type-title) 'Manrope', sans-serif; letter-spacing: -.7px; }
.brand-logo { display: block; flex: 0 0 38px; width: 38px; height: 38px; object-fit: contain; }
.brand small { display: block; color: var(--subtle); font: 600 var(--type-caption) 'DM Sans', sans-serif; letter-spacing: 2px; margin-top: 5px; }

/* Sidebar header: brand + collapse toggle, aligned with the 76px topbar. */
.sidebar-header { position: relative; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 76px; padding: 0 16px 0 20px; border-bottom: 1px solid var(--border); overflow: hidden; }
.sidebar .brand { min-width: 0; gap: 11px; font-size: var(--type-title-small); text-decoration: none; }
.sidebar .brand-logo { flex-basis: 36px; width: 36px; height: 36px; transition: opacity .15s; }
.brand-name { min-width: 0; white-space: nowrap; overflow: hidden; transition: opacity .15s; }
.sidebar-collapse { flex-shrink: 0; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--subtle); transition: background .15s, color .15s, border-color .15s, opacity .15s; }
.sidebar-collapse:hover { background: var(--surface-hover); color: var(--text); border-color: var(--border); }
.panel-chevron { transform-box: fill-box; transform-origin: center; transition: transform .22s ease; }

/* Navigation sections. */
.sidebar-scroll { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 22px 14px; }
.nav-label { height: 16px; margin: 0 0 10px; padding: 0 10px; font-size: var(--type-caption); font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; white-space: nowrap; color: var(--subtle); transition: opacity .15s; }
.side-nav + .nav-label { margin-top: 26px; }
.side-nav { display: flex; flex-direction: column; gap: 5px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 14px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: var(--type-body-small); font-weight: 600; text-align: left; white-space: nowrap; transition: background .15s, color .15s; text-decoration: none; }
.nav-link svg { flex-shrink: 0; }
#nav-user-management[hidden], #nav-billing[hidden] { display: none; }
.nav-link:hover { background: var(--surface-soft); color: var(--text); }
.nav-link.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.secondary-button[aria-disabled="true"], .secondary-button.is-disabled { opacity: .55; cursor: not-allowed; }
.secondary-button[aria-disabled="true"]:hover, .secondary-button.is-disabled:hover { color: inherit; background: var(--surface); }
.nav-text { min-width: 0; overflow: hidden; transition: opacity .15s; }
.sidebar-footer { flex-shrink: 0; max-height: calc(100dvh - 160px); overflow-y: auto; padding: 14px; border-top: 1px solid var(--border); }
.sidebar-footer form { margin: 0; }
.credit-card { margin-bottom: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: linear-gradient(145deg, var(--accent-soft), var(--surface-soft) 65%); }
.credit-card-heading, .credit-usage-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.credit-card-label { color: var(--muted); font-size: var(--type-caption); font-weight: 700; letter-spacing: 1px; }
.credit-plan { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--accent); font-size: var(--type-caption); font-weight: 700; }
.credit-card-balance { display: flex; align-items: center; gap: 10px; margin: 14px 0; }
#credit-balance { display: block; font: 800 var(--type-heading)/1.2 'Manrope', sans-serif; letter-spacing: -.8px; overflow-wrap: anywhere; }
.credit-card-caption { display: block; color: var(--muted); font-size: var(--type-caption); }
.credit-ring { width: 40px; height: 40px; flex-shrink: 0; transform: rotate(-90deg); fill: none; stroke-width: 3.5; }
.credit-ring-track { stroke: var(--border); }
.credit-ring-value { stroke: var(--accent); stroke-linecap: round; }
.credit-usage-row { color: var(--muted); font-size: var(--type-caption); }
.credit-usage-row strong { color: var(--text); white-space: nowrap; font-size: var(--type-caption); }
#credit-usage-meter { display: block; appearance: none; width: 100%; height: 5px; margin: 8px 0 10px; overflow: hidden; border: 0; border-radius: 8px; background: var(--border); color: var(--accent); accent-color: var(--accent); }
#credit-usage-meter::-webkit-progress-bar { background: var(--border); }
#credit-usage-meter::-webkit-progress-value { background: var(--accent); border-radius: 8px; }
#credit-usage-meter::-moz-progress-bar { background: var(--accent); border-radius: 8px; }
.credit-renewal { margin: 0; color: var(--muted); font-size: var(--type-caption); }
.credit-live-status { margin: 4px 0 12px; color: var(--subtle); font-size: var(--type-caption); }
.credit-card[data-state="error"] .credit-live-status { color: var(--danger); }
.credit-card[data-state="low"] .credit-usage-row strong { color: var(--warning); }
.credit-plan-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-radius: 8px; padding: 8px 12px; background: #137e65; color: #fff; font-size: var(--type-body-small); font-weight: 700; }
.credit-plan-link:hover { background: #0d6a54; }
.billing-summary, .billing-section-heading, .billing-topup, .billing-plan-title { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.billing-summary { margin-bottom: 32px; background: linear-gradient(120deg, var(--accent-soft), var(--surface)); }
.billing-section-heading { margin: 20px 0 12px; }
.billing-period { display: grid; gap: 5px; font-size: var(--type-caption); color: var(--muted); }
.billing-period select { padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: var(--surface); }
.billing-plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; margin: 20px 0; }
.billing-plan { display: flex; flex-direction: column; min-width: 0; }
.billing-plan-featured { border-color: var(--accent); }
.billing-plan-selected { outline: 3px solid var(--accent); outline-offset: 3px; scroll-margin-top: 24px; }
.billing-price { margin: 20px 0 0; font: 800 var(--type-heading)/1.5 'Manrope', sans-serif; letter-spacing: -.7px; }
.billing-price small { font: 400 var(--type-caption) 'DM Sans', sans-serif; letter-spacing: 0; color: var(--muted); }
.billing-features { flex: 1; padding-left: 18px; margin: 20px 0 24px; color: var(--muted); font-size: var(--type-caption); }
.billing-features li { margin-bottom: 9px; }
.billing-topup { margin: 26px 0; }
#billing-trial-offer[hidden] { display: none; }
.billing-history-scroll { overflow-x: auto; }
.billing-history td:first-child { min-width: 210px; overflow-wrap: anywhere; }
.billing-history td:last-child { min-width: 180px; }
.billing-history .secondary-button { margin: 3px; padding: 7px 10px; font-size: var(--type-body-small); }
body[data-page="billing"] button:disabled { opacity: .5; }
@media (max-width: 1100px) { .billing-plan-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
    .billing-summary, .billing-section-heading, .billing-topup { flex-direction: column; align-items: flex-start; }
}
.eyebrow { color: var(--accent); font-size: var(--type-caption); font-weight: 700; letter-spacing: 1.7px; text-transform: uppercase; }
.theme-setting { display: flex; align-items: center; gap: 8px; color: var(--subtle); font-size: var(--type-caption); }
.theme-setting select { padding: 4px 8px; font-size: var(--type-body-small); }
.app-main { margin-left: var(--sidebar-width); min-width: 0; transition: margin-left .22s ease; }
.topbar { height: 76px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding: 0 38px; background: var(--surface); }
.breadcrumb { display: flex; align-items: center; gap: 15px; color: var(--subtle); font-size: var(--type-caption); }
.breadcrumb strong { color: var(--text); font-size: var(--type-body); font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.theme-toggle { display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; padding: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--muted); cursor: pointer; }
.theme-toggle:hover { background: var(--surface-hover); color: var(--accent); }
.theme-toggle .theme-icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .theme-icon-moon { display: none; }
.profile-dot { border: 3px solid var(--canvas); background: var(--accent-soft); color: var(--accent); border-radius: 50%; width: 34px; height: 34px; display: grid; place-content: center; font-size: var(--type-caption); font-weight: 700; }
.account-menu { position: relative; }
.account-menu-trigger { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 12px 6px 8px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); list-style: none; cursor: pointer; }
.account-menu-trigger::-webkit-details-marker { display: none; }
.account-menu-trigger:hover, .account-menu[open] .account-menu-trigger { background: var(--surface-soft); border-color: var(--border); }
.account-menu-trigger .profile-dot { flex-shrink: 0; width: 34px; height: 34px; border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); border-radius: 10px; }
.account-menu-trigger-name { display: grid; gap: 2px; min-width: 0; max-width: 180px; text-align: left; }
.account-menu-caption { color: var(--subtle); font-size: var(--type-caption); line-height: 1.2; }
.account-menu-trigger-name strong { overflow: hidden; color: var(--text); font-size: var(--type-body-small); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.account-menu-chevron { flex-shrink: 0; color: var(--subtle); }
.account-menu[open] .account-menu-chevron { transform: rotate(180deg); }
.account-menu-panel { position: absolute; z-index: 60; top: calc(100% + 8px); right: 0; display: grid; gap: 4px; width: min(300px, calc(100vw - 32px)); padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 12px 32px #152d3a20; }
.account-menu-identity { display: grid; gap: 2px; padding: 10px; overflow: hidden; border-bottom: 1px solid var(--border); }
.account-menu-identity strong, .account-menu-identity span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu-identity strong { color: var(--text); font-size: var(--type-body-small); }
.account-menu-identity span { color: var(--muted); font-size: var(--type-caption); }
.account-menu-panel a, .account-menu-panel button { display: flex; align-items: center; width: 100%; min-height: 42px; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font-size: var(--type-body-small); text-align: left; }
.account-menu-panel a:hover, .account-menu-panel button:hover { background: var(--surface-hover); }
.account-menu-panel form { margin: 0; border-top: 1px solid var(--border); }
.account-menu-panel button { cursor: pointer; }
.page-content { max-width: 1660px; margin: 0 auto; padding: 34px 38px 28px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.page-heading h1 { font-size: var(--type-heading); line-height: 1.4; font-weight: 800; letter-spacing: -1.1px; margin: 6px 0; }
.page-description { font-size: var(--type-caption); color: var(--muted); }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; border-radius: 8px; padding: 10px 16px; font-size: var(--type-body-small); font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.primary-button { background: #137e65; color: white; box-shadow: 0 3px 6px #087f6815; }
.primary-button:hover { background: #0d6a54; }
.secondary-button { background: var(--surface); border-color: var(--border); color: var(--text); }
.workspace-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 38px 24px; color: var(--subtle); font-size: var(--type-caption); }
.workspace-footer nav { display: flex; flex-wrap: wrap; gap: 16px; }
.workspace-footer a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); }
.workspace-footer a:hover { color: var(--accent); }
.menu-toggle { display: none; border: 1px solid var(--border); padding: 3px 9px; border-radius: 6px; }
.sidebar-backdrop { position: fixed; inset: 0; background: #06111580; z-index: 34; }

/* Collapsed rail (desktop only): icons stay, labels fade out, tooltips on hover. */
@media (min-width: 901px) {
    :root[data-sidebar="collapsed"] .credit-card { padding: 8px 0; background: transparent; border: 0; }
    :root[data-sidebar="collapsed"] .credit-card-heading,
    :root[data-sidebar="collapsed"] .credit-card-caption,
    :root[data-sidebar="collapsed"] .credit-usage-row,
    :root[data-sidebar="collapsed"] #credit-usage-meter,
    :root[data-sidebar="collapsed"] .credit-renewal,
    :root[data-sidebar="collapsed"] .credit-live-status,
    :root[data-sidebar="collapsed"] .credit-plan-link { display: none; }
    :root[data-sidebar="collapsed"] .credit-card-balance { flex-direction: column; gap: 5px; margin: 0; }
    :root[data-sidebar="collapsed"] #credit-balance { font: 700 var(--type-caption)/1.4 'DM Sans', sans-serif; letter-spacing: 0; text-align: center; }
    :root[data-sidebar="collapsed"] { --sidebar-width: var(--sidebar-collapsed-width); }
    :root[data-sidebar="collapsed"] .sidebar-header { justify-content: center; padding: 0; cursor: pointer; }
    :root[data-sidebar="collapsed"] .sidebar .brand { gap: 0; }
    :root[data-sidebar="collapsed"] .brand-name,
    :root[data-sidebar="collapsed"] .nav-text { display: none; width: 0; opacity: 0; }
    :root[data-sidebar="collapsed"] .nav-label { display: none; opacity: 0; }
    :root[data-sidebar="collapsed"] .sidebar-scroll { padding: 18px 0; overflow: visible; }
    :root[data-sidebar="collapsed"] .side-nav + .side-nav { margin-top: 20px; }
    :root[data-sidebar="collapsed"] .nav-link { width: 44px; height: 44px; padding: 0; margin: 0 auto; justify-content: center; border-radius: 10px; }
    :root[data-sidebar="collapsed"] .sidebar-footer { padding: 14px 0; display: flex; justify-content: center; }
    /* The expand button sits over the logo and appears on hover/focus, keeping it keyboard reachable. */
    :root[data-sidebar="collapsed"] .sidebar-collapse { position: absolute; inset: 0; margin: auto; opacity: 0; background: var(--surface-hover); color: var(--text); width: 36px; height: 36px; border: 1px solid var(--border); }
    :root[data-sidebar="collapsed"] .sidebar-header:hover .sidebar-collapse,
    :root[data-sidebar="collapsed"] .sidebar-collapse:focus-visible { opacity: 1; }
    :root[data-sidebar="collapsed"] .sidebar-header:hover .brand-logo { opacity: 0; }
    :root[data-sidebar="collapsed"] .panel-chevron { transform: rotate(180deg); }
    :root[data-sidebar="collapsed"] .nav-link::after { content: attr(data-tooltip); position: absolute; left: calc(100% + 14px); top: 50%; z-index: 50; padding: 6px 12px; border-radius: 8px; background: var(--text); color: var(--surface); font-size: var(--type-caption); font-weight: 600; white-space: nowrap; pointer-events: none; opacity: 0; transform: translate(-4px, -50%); transition: opacity .12s, transform .12s; box-shadow: 0 4px 16px rgba(0,0,0,0.18); }
    :root[data-sidebar="collapsed"] .nav-link:hover::after,
    :root[data-sidebar="collapsed"] .nav-link:focus-visible::after { opacity: 1; transform: translate(0, -50%); }
}
@media (prefers-reduced-motion: reduce) {
    .sidebar, .app-main, .panel-chevron, .brand-name, .nav-text, .nav-label { transition: none; }
}
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); gap: 22px; }
.overview-hero { display: flex; justify-content: space-between; align-items: center; gap: 24px; border: 1px solid #376f60; border-radius: 14px; padding: 28px 30px; margin-bottom: 26px; background: linear-gradient(110deg, #113e33, #1b5142); color: #fff; position: relative; overflow: hidden; }
.overview-hero:after { content: ''; width: 220px; height: 220px; border: 1px solid #ffffff12; border-radius: 50%; position: absolute; right: 18%; top: -60px; pointer-events: none; box-shadow: 0 0 0 40px #ffffff04, 0 0 0 80px #ffffff03; }
.overview-hero .eyebrow { color: #a0dbc4; }
.overview-hero h2 { font-size: var(--type-title); font-weight: 600; letter-spacing: -.6px; margin: 6px 0; }
.overview-hero p:not(.eyebrow) { color: #bbd9cd; max-width: 450px; font-size: var(--type-caption); }
.overview-hero a { background: #fff; color: #194e3c; z-index: 1; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 26px; }
.metric-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); }
.metric-label { font-size: var(--type-caption); color: var(--muted); font-weight: 600; }
.metric-value { display: block; font-size: var(--type-display); font-weight: 800; line-height: 1.4; letter-spacing: -1px; margin: 11px 0 6px; }
.metric-note { font-size: var(--type-caption); color: var(--subtle); }
.metric-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 6px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 23px; min-width: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.panel-heading h2 { font-size: var(--type-body-small); font-weight: 700; letter-spacing: -.3px; }
.panel-heading a { font-size: var(--type-caption); color: var(--accent); font-weight: 600; }
.panel-subtitle { color: var(--subtle); font-size: var(--type-caption); margin-top: 3px; }
.pipeline-row { display: grid; grid-template-columns: 100px 1fr 32px; align-items: center; gap: 16px; margin: 23px 0; color: var(--muted); font-size: var(--type-caption); }
.pipeline-track { background: var(--surface-hover); height: 9px; border-radius: 4px; overflow: hidden; }
.pipeline-fill { height: 100%; background: var(--accent); min-width: 0; border-radius: 4px; transition: width .4s; }
.pipeline-row:nth-child(3) .pipeline-fill { background: #82b6cb; }
.pipeline-row:nth-child(4) .pipeline-fill { background: #b5a1d9; }
.pipeline-row:nth-child(5) .pipeline-fill { background: #d5b36d; }
.pipeline-count { text-align: right; color: var(--text); font-weight: 600; }
.overview-table { width: 100%; border-collapse: collapse; text-align: left; }
.overview-table th { font-size: var(--type-caption); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; padding: 0 0 13px; color: var(--subtle); border-bottom: 1px solid var(--border); }
.overview-table td { padding: 15px 0; border-bottom: 1px solid var(--border); font-size: var(--type-caption); }
.overview-table tr:last-child td { border: 0; }
.overview-table td small { color: var(--subtle); font-size: var(--type-caption); display: block; margin-top: 3px; }
.status-chip { display: inline-block; background: var(--accent-soft); color: var(--accent); border-radius: 5px; padding: 3px 8px; font-size: var(--type-caption); }
.quick-action { display: flex; align-items: center; gap: 13px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.quick-action:last-child { border-bottom: 0; }
.quick-action .action-icon { border: 1px solid var(--border); border-radius: 9px; background: var(--surface-soft); padding: 10px; color: var(--accent); }
.quick-action strong { display: block; font-size: var(--type-caption); font-weight: 600; }
.quick-action small { display: block; font-size: var(--type-caption); color: var(--subtle); margin-top: 3px; }
.quick-action > span:last-child { margin-left: auto; color: var(--subtle); }
.data-error { background: var(--surface); color: var(--danger); border: 1px solid var(--danger); padding: 16px; border-radius: 8px; margin-bottom: 22px; font-size: var(--type-caption); }
.data-error button { text-decoration: underline; margin-left: 10px; }
.workflow-toolbar { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 22px; }
.discovery-guidance { margin-bottom: 23px; padding: 16px 20px; color: var(--muted); border: 1px solid var(--border); background: var(--surface); border-radius: 10px; font-size: var(--type-caption); }
.processing-row { opacity: .4; pointer-events: none; }

/* Theme-aware Tailwind utility overrides are emitted in tailwind.css. */
.page-content input, .page-content select, .page-content textarea { background-color: var(--surface-soft); border-color: var(--border); color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--subtle); }
#queue-panel, #inspector-card { border-radius: 12px; }
#queue-panel { min-height: 560px; }
#inspector-card { position: sticky; top: 20px; }
#queue-title { font-size: var(--type-body); }
#table-body td { padding: 16px 10px; }
#filter-sort, #filter-status, #filter-source, #filter-lead-type { max-width: 100%; }
#job-profile-modal, #profile-modal, #bulk-pitch-modal, #screenshot-lightbox { background: #071317b8; }
#job-profile-modal > div, #profile-modal > div, #bulk-pitch-modal > div { max-height: 90vh; overflow-y: auto; }
.source-option.plan-locked { min-width: 0; align-content: flex-start; padding: 7px; border: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border)); border-radius: 8px; background: color-mix(in srgb, var(--warning) 7%, var(--surface)); color: var(--subtle); }
.source-option.plan-locked input { opacity: .55; cursor: not-allowed; }
.source-option.plan-locked { flex-wrap: wrap; }
.source-option.plan-locked .plan-upgrade-link { white-space: normal; }
#discovery-source-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.plan-locked-panel { padding: 10px; border: 1px solid color-mix(in srgb, var(--warning) 38%, var(--border)); border-radius: 10px; background: color-mix(in srgb, var(--warning) 5%, var(--surface)); }
.plan-locked-panel input:disabled, .plan-locked-panel select:disabled, .plan-locked-panel textarea:disabled, .plan-locked-panel button:disabled, #custom-service-editor.plan-locked input:disabled, #custom-service-editor.plan-locked textarea:disabled, #custom-service-editor.plan-locked button:disabled { opacity: .55; cursor: not-allowed; }
.plan-upgrade-link { display: inline-flex; align-items: center; justify-content: center; width: fit-content; max-width: 100%; min-height: 32px; margin-top: 5px; padding: 5px 9px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-size: var(--type-caption); font-weight: 700; line-height: 1.4; text-decoration: underline; text-underline-offset: 2px; }
.plan-upgrade-link:hover { border-color: var(--accent); background: var(--surface-hover); }
.source-option .plan-upgrade-link { flex: 0 0 100%; }
#btn-discovery-submit.is-plan-locked, #btn-discovery-submit:disabled { border: 1px solid var(--border); background: var(--surface-hover); color: var(--subtle); box-shadow: none; opacity: 1; cursor: not-allowed; }
.plan-locked-panel > .plan-upgrade-link, #custom-service-editor > .plan-upgrade-link { margin-top: 12px; }
#custom-service-editor.plan-locked { border-color: color-mix(in srgb, var(--warning) 38%, var(--border)); background: color-mix(in srgb, var(--warning) 5%, var(--surface)); }
#custom-service-editor.plan-locked > summary { color: var(--warning); }
#custom-service-editor.plan-locked > summary::after { content: "Upgrade required"; margin-left: 8px; color: var(--warning); font: 600 var(--type-caption) 'DM Sans', sans-serif; }
@media (min-width: 720px) { #discovery-source-options { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.discovery-progress-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: #07171991; backdrop-filter: blur(10px); }
.discovery-progress-overlay.hidden { display: none; }
.discovery-progress-card { width: 100%; max-width: 620px; max-height: calc(100dvh - 48px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; background: var(--surface); border: 1px solid color-mix(in srgb, var(--border) 80%, transparent); border-radius: 24px; box-shadow: 0 32px 100px #02151240, 0 4px 16px #02151215; animation: discovery-enter .3s ease-out; }
.discovery-progress-topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 22px 28px; border-bottom: 1px solid var(--border); }
.discovery-progress-brand { display: flex; align-items: center; gap: 8px; font-size: var(--type-caption); font-weight: 700; letter-spacing: 1.2px; color: var(--text); }
.discovery-progress-brand > span:last-child { font-weight: 600; color: var(--subtle); letter-spacing: .8px; }
.discovery-progress-logo { width: 26px; height: 26px; object-fit: cover; border-radius: 6px; }
.discovery-live-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--border)); border-radius: 20px; color: var(--accent); background: var(--accent-soft); font-size: var(--type-caption); font-weight: 600; white-space: nowrap; }
.discovery-live-badge > span, .discovery-activity-pulse { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.discovery-progress-intro { text-align: center; padding: 24px 28px 19px; background: radial-gradient(ellipse at 50% 0, var(--accent-soft), transparent 72%); }
.discovery-orbit { display: grid; place-items: center; position: relative; width: 62px; height: 62px; margin: 0 auto 18px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.discovery-orbit::before { content: ''; position: absolute; inset: -1px; border-radius: inherit; border: 1.5px solid transparent; border-top-color: var(--accent); border-right-color: color-mix(in srgb, var(--accent) 25%, transparent); animation: discovery-orbit 2s linear infinite; }
.discovery-orbit svg { width: 30px; height: 30px; }
.discovery-progress-eyebrow { margin: 0 0 9px; font-size: var(--type-caption); font-weight: 700; letter-spacing: 1.8px; color: var(--accent); }
.discovery-progress-intro h2 { margin: 0; color: var(--text); font-size: clamp(22px, 3.5vw, 28px); line-height: 1.3; letter-spacing: -1px; font-weight: 800; text-wrap: balance; }
.discovery-progress-intro h2 span { color: var(--accent); }
#loading-overlay-text { color: var(--muted); font-size: var(--type-caption); line-height: 1.8; margin: 10px auto 0; max-width: 430px; min-height: 22px; }
.discovery-progress-body { padding: 0 28px 24px; }
.discovery-progress-metrics { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 18px; background: var(--surface-soft); }
.discovery-progress-metrics.hidden { display: none; }
.discovery-progress-metrics > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; }
.discovery-progress-metrics > div + div { border-left: 1px solid var(--border); }
.discovery-progress-metrics span { color: var(--muted); font-size: var(--type-caption); }
.discovery-progress-metrics strong { color: var(--text); font: 800 var(--type-title) 'Manrope', sans-serif; letter-spacing: -.7px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.discovery-progress-metrics > div:last-child strong { color: var(--accent); }
.discovery-progress-bar { display: block; appearance: none; width: 100%; height: 4px; border: 0; border-radius: 4px; overflow: hidden; background: var(--border); color: var(--accent); }
.discovery-progress-bar::-webkit-progress-bar { background: var(--border); border-radius: 4px; }
.discovery-progress-bar::-webkit-progress-value { background: var(--accent); border-radius: 4px; transition: width .4s ease; }
.discovery-progress-bar::-moz-progress-bar { background: var(--accent); border-radius: 4px; }
.discovery-progress-bar:indeterminate { background: linear-gradient(90deg, var(--border) 0%, var(--accent) 50%, var(--border) 100%); background-size: 200% 100%; animation: discovery-scanning 2s linear infinite; }
.discovery-progress-bar:indeterminate::-webkit-progress-bar { background: transparent; }
.discovery-activity-heading { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 10px; }
.discovery-activity-heading h3 { margin: 0; color: var(--text); font-size: var(--type-caption); font-weight: 600; }
.discovery-activity-heading > span { display: flex; align-items: center; gap: 6px; color: var(--subtle); font-size: var(--type-caption); }
.discovery-activity-pulse { opacity: .6; animation: discovery-heartbeat 2s ease-in-out infinite; }
.discovery-activity-feed { height: 144px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--border) transparent; padding: 6px 14px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 12px; text-align: left; }
.discovery-log-line { position: relative; padding: 10px 0 10px 14px; color: var(--muted); font: var(--type-caption)/1.8 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; border-bottom: 1px solid var(--border); }
.discovery-log-line::before { content: ''; position: absolute; left: 0; top: 18px; width: 4px; height: 4px; border-radius: 50%; background: var(--subtle); }
.discovery-log-line:last-child { border-bottom: 0; color: var(--text); }
.discovery-log-success, .discovery-log-success:last-child { color: var(--accent); }
.discovery-log-success::before { background: var(--accent); }
.discovery-log-warning, .discovery-log-warning:last-child { color: var(--warning); }
.discovery-log-warning::before { background: var(--warning); }
.discovery-progress-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 28px; border-top: 1px solid var(--border); background: var(--surface-soft); }
.discovery-progress-footer p { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--muted); font-size: var(--type-caption); }
.discovery-progress-footer svg { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; }
.discovery-progress-dismiss { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 38px; padding: 8px 13px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-size: var(--type-caption); font-weight: 600; transition: background .15s, border-color .15s; white-space: nowrap; }
.discovery-progress-dismiss.hidden { display: none; }
.discovery-progress-dismiss:hover { background: var(--surface-hover); border-color: var(--subtle); }
@keyframes discovery-enter { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes discovery-orbit { to { transform: rotate(360deg); } }
@keyframes discovery-scanning { to { background-position: -200% 0; } }
@keyframes discovery-heartbeat { 50% { opacity: 1; } }
@media (max-height: 700px) {
    .discovery-progress-intro { padding: 18px 24px; }
    .discovery-orbit, .discovery-progress-eyebrow { display: none; }
    .discovery-progress-intro h2 { font-size: var(--type-title); }
    .discovery-activity-feed { height: 80px; }
    .discovery-activity-heading { margin-top: 14px; }
    .discovery-progress-footer { position: sticky; bottom: 0; }
}
@media (max-width: 480px) {
    .discovery-progress-overlay { padding: 14px; }
    .discovery-progress-card { border-radius: 18px; max-height: calc(100dvh - 28px); }
    .discovery-progress-topline, .discovery-progress-footer { padding: 16px 18px; }
    .discovery-progress-brand > span:last-child { display: none; }
    .discovery-progress-intro { padding: 25px 18px 20px; }
    .discovery-progress-body { padding: 0 18px 18px; }
    .discovery-progress-metrics > div { flex-direction: column; align-items: flex-start; gap: 5px; padding: 12px 14px; }
    .discovery-progress-footer { flex-wrap: wrap; gap: 10px; }
    .discovery-progress-dismiss { min-height: 44px; }
    .discovery-activity-feed { height: 135px; }
}
@media (prefers-reduced-motion: reduce) {
    .discovery-progress-card, .discovery-orbit::before, .discovery-progress-bar:indeterminate, .discovery-activity-pulse { animation: none; }
    .discovery-progress-dismiss { transition: none; }
    .discovery-progress-bar::-webkit-progress-value { transition: none; }
}
body[data-page="discovery"] #discovery-modal { position: static; display: block; padding: 0; background: transparent; backdrop-filter: none; }
body[data-page="discovery"] #discovery-modal > div { max-width: none; max-height: none; overflow: visible; box-shadow: var(--shadow); }
body[data-page="discovery"] #discovery-modal [aria-label="Close discovery"], body[data-page="discovery"] #discovery-title { display: none; }
body[data-page="discovery"] #discovery-modal > div > div:first-child { display: none; }
body[data-page="discovery"] #discovery-modal #modal-map-canvas { min-height: 360px; }
body[data-page="discovery"] #discovery-panel-local { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.workspace-hidden { display: none !important; }
@media (max-width: 1200px) {
    :root { --sidebar-width: 224px; }
    .page-content { padding: 28px 24px; }
    .topbar { padding: 0 24px; }
    .overview-grid { grid-template-columns: 1fr; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); visibility: hidden; transition: transform .2s; width: 264px; }
    .nav-open .sidebar { transform: translateX(0); visibility: visible; }
    .app-main { margin-left: 0; }
    .menu-toggle { display: block; }
    #inspector-card { position: static; }
}
@media (max-width: 640px) {
    .page-content { padding: 24px 16px; }
    .topbar { height: auto; min-height: 64px; padding: 12px 16px; flex-wrap: wrap; gap: 12px; }
    .topbar-right { gap: 8px; }
    .theme-setting > span, .account-menu-trigger-name { display: none; }
    .page-heading { align-items: flex-start; flex-direction: column; gap: 16px; }
    .page-heading h1 { font-size: var(--type-heading); }
    .overview-hero { flex-direction: column; align-items: flex-start; padding: 23px; }
    .metric-grid { gap: 10px; }
    .metric-card { padding: 15px; }
    .metric-value { font-size: var(--type-heading); }
    .panel { padding: 18px; }
    .workspace-footer { padding: 12px 16px 24px; font-size: var(--type-caption); }
    .workspace-footer span:last-child { display: none; }
    .pipeline-row { grid-template-columns: 85px 1fr 25px; gap: 8px; }
    body[data-page="discovery"] #discovery-panel-local { grid-template-columns: 1fr; }
    #queue-panel { padding: 15px; overflow: hidden; min-width: 0; }
    #inspector-card { height: 650px; min-width: 0; }
    #discovery-tab-local, #discovery-tab-jobs { font-size: var(--type-body-small); }
}

/* --- Sign in / Register --------------------------------------------------- */
.auth-body { display: block; background: var(--canvas); }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 34px 32px; box-shadow: var(--shadow); }
.auth-card .brand { margin-bottom: 26px; }
.auth-card h1 { font: 700 var(--type-title) 'Manrope', sans-serif; letter-spacing: -.6px; margin: 0 0 6px; }
.auth-subtitle { color: var(--muted); font-size: var(--type-ui); margin: 0 0 22px; }
.auth-error { background: color-mix(in srgb, var(--danger) 12%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); color: var(--danger); border-radius: 9px; padding: 11px 13px; font-size: var(--type-caption); font-weight: 600; margin: 0 0 18px; }
.auth-form { display: grid; gap: 7px; }
.auth-form label { font-size: var(--type-caption); font-weight: 600; margin-top: 9px; }
.auth-optional { color: var(--subtle); font-weight: 400; }
.auth-form input { background: var(--surface-soft); border: 1px solid var(--border); border-radius: 9px; padding: 11px 13px; color: var(--text); width: 100%; }
.auth-form input:focus { border-color: var(--accent); background: var(--surface); }
.auth-form input[aria-invalid="true"] { border-color: var(--danger); }
.auth-hint { color: var(--subtle); font-size: var(--type-caption); }
.auth-field-error { color: var(--danger); font-size: var(--type-caption); font-weight: 600; }
.password-strength { display: flex; align-items: center; gap: 10px; color: var(--subtle); font-size: var(--type-caption); }
.password-strength meter { flex: 1; width: auto; height: 8px; border: 0; border-radius: 8px; background: var(--surface-hover); }
.password-strength meter::-webkit-meter-bar { border: 0; border-radius: 8px; background: var(--surface-hover); }
.password-strength meter::-webkit-meter-optimum-value,
.password-strength meter::-webkit-meter-suboptimum-value,
.password-strength meter::-webkit-meter-even-less-good-value { border-radius: 8px; background: var(--accent); }
.password-strength meter::-moz-meter-bar { border-radius: 8px; background: var(--accent); }
.password-strength meter[data-strength="weak"]::-webkit-meter-optimum-value,
.password-strength meter[data-strength="weak"]::-webkit-meter-suboptimum-value,
.password-strength meter[data-strength="weak"]::-webkit-meter-even-less-good-value,
.password-strength meter[data-strength="weak"]::-moz-meter-bar { background: var(--danger); }
.password-strength meter[data-strength="fair"]::-webkit-meter-optimum-value,
.password-strength meter[data-strength="fair"]::-webkit-meter-suboptimum-value,
.password-strength meter[data-strength="fair"]::-webkit-meter-even-less-good-value,
.password-strength meter[data-strength="fair"]::-moz-meter-bar { background: var(--warning); }
.auth-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.auth-submit { margin-top: 20px; width: 100%; padding: 12px; font-size: var(--type-body-small); }
.auth-switch { text-align: center; color: var(--muted); font-size: var(--type-caption); margin: 20px 0 0; }
.auth-switch a { color: var(--accent); font-weight: 600; }
.auth-legal { margin: 18px 0 0; color: var(--muted); font-size: var(--type-caption); line-height: 1.7; text-align: center; }
.auth-legal a { color: var(--accent); font-weight: 600; }
.auth-notice { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); color: var(--accent); border-radius: 9px; padding: 11px 13px; font-size: var(--type-caption); font-weight: 600; margin: 0 0 18px; }
.deletion-card { max-width: 700px; margin-inline: auto; }
#deletion-confirm-form[hidden], #deletion-check-status[hidden] { display: none; }
.deletion-consequences { padding-left: 22px; color: var(--muted); }
.deletion-consequences li { margin-block: 12px; }
.deletion-consequences a { color: var(--accent); text-decoration: underline; }
.deletion-acknowledge { display: flex; gap: 12px; align-items: flex-start; }
.settings-form .deletion-acknowledge input { width: 20px; flex: 0 0 20px; margin-top: 3px; }
.auth-label-row { display: flex; justify-content: space-between; align-items: baseline; margin-top: 9px; }
.auth-label-row label { margin-top: 0; }
.auth-label-row a { color: var(--accent); font-size: var(--type-caption); font-weight: 600; }
.verify-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); color: var(--text); border-radius: 12px; padding: 12px 16px; margin: 0 0 18px; font-size: var(--type-ui); }
.policy-notice { overflow-wrap: anywhere; }
.policy-notice p, .policy-notice form { min-width: 0; max-width: 100%; }
.policy-notice button { white-space: normal; }
.verify-banner strong { color: var(--accent); }
.verify-banner .secondary-button { white-space: nowrap; }

/* --- Settings ------------------------------------------------------------- */
.outreach-action { display: block; margin-top: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--accent); font-size: var(--type-caption); cursor: pointer; white-space: nowrap; }
.outreach-overlay { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; background: #0008; }
.outreach-overlay.hidden { display: none; }
.outreach-card { width: min(100%, 560px); max-height: 90dvh; overflow-y: auto; padding: 24px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.outreach-card header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.outreach-card form { display: grid; gap: 10px; margin-block: 20px; }
.outreach-quick-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.outreach-card textarea, .outreach-card select { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: var(--surface-soft); }
.outreach-card li { padding-block: 12px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.outreach-card small { display: block; color: var(--muted); margin-top: 4px; }
.outreach-card li p { white-space: pre-wrap; }
.outreach-card .hidden { display: none; }
.outreach-tabs { display: flex; gap: 4px; margin-top: 16px; border-bottom: 1px solid var(--border); }
.outreach-tabs [role="tab"] { padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-weight: 600; cursor: pointer; }
.outreach-tabs [role="tab"][aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.outreach-card input[type="tel"], .outreach-card input[type="datetime-local"] { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: var(--surface-soft); }
.outreach-phone { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); }
.outreach-phone > div { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; }
.outreach-phone strong { font-family: ui-monospace, monospace; }
.outreach-phone-invalid strong { color: #ef4444; text-decoration: line-through; }
.outreach-phone a { text-decoration: none; }
.outreach-card fieldset { display: grid; gap: 6px; margin: 0; padding: 12px; border: 1px solid var(--border); border-radius: 12px; }
.outreach-card legend { padding-inline: 4px; font-weight: 600; }
.outreach-card fieldset label { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; padding: 6px; border-radius: 8px; cursor: pointer; }
.outreach-card fieldset label:has(input:checked) { background: var(--surface-soft); }
.outreach-card fieldset label small { grid-column: 2; margin-top: 0; }
.outreach-log-call { margin-top: 6px; }
@media (max-width: 640px) {
    .outreach-overlay { padding: 8px; }
    .outreach-card { padding: 16px; max-height: 96dvh; }
    .outreach-tabs [role="tab"] { flex: 1; }
    .outreach-phone a, .outreach-phone button { flex: 1; text-align: center; }
}
.settings-grid { display: grid; gap: 22px; max-width: 760px; }
.settings-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 26px 26px 24px; box-shadow: var(--shadow); }
.settings-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 18px; }
.settings-heading h2 { font: 600 var(--type-title-small) 'Manrope', sans-serif; letter-spacing: -.4px; margin: 0 0 4px; }
.settings-subtitle { color: var(--muted); font-size: var(--type-caption); margin: 0 0 4px; }
.settings-badge { flex-shrink: 0; border-radius: 999px; padding: 5px 11px; font-size: var(--type-caption); font-weight: 700; letter-spacing: .6px; text-transform: uppercase; white-space: nowrap; }
.settings-badge-on { background: var(--accent-soft); color: var(--accent); }
.settings-badge-warn { background: color-mix(in srgb, var(--warning) 15%, transparent); color: var(--warning); }
.settings-badge-off { background: var(--surface-hover); color: var(--subtle); }
.settings-error, .settings-notice { border-radius: 9px; padding: 10px 13px; font-size: var(--type-caption); font-weight: 600; margin: 0 0 16px; }
.settings-error { background: color-mix(in srgb, var(--danger) 12%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); color: var(--danger); }
.settings-notice { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); color: var(--accent); }
.settings-form { display: grid; gap: 14px; }
.settings-row { display: grid; gap: 6px; }
.settings-row-split { grid-template-columns: 1fr 1fr; gap: 14px; }
.settings-row-split > div { display: grid; gap: 6px; }
.settings-form label { font-size: var(--type-caption); font-weight: 600; }
.settings-optional { color: var(--subtle); font-weight: 400; }
.settings-form input, .settings-form select { background: var(--surface-soft); border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; color: var(--text); width: 100%; }
.settings-form input:focus, .settings-form select:focus { border-color: var(--accent); background: var(--surface); }
.auth-form input:focus-visible, .settings-form input:focus-visible, .settings-form select:focus-visible,
.page-content input:focus-visible, .page-content select:focus-visible, .page-content textarea:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}
.settings-hint { color: var(--subtle); font-size: var(--type-caption); line-height: 1.5; }
.settings-section { font: 600 var(--type-ui) 'Manrope', sans-serif; margin: 12px 0 0; padding-top: 16px; border-top: 1px solid var(--border); }
.settings-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.settings-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.settings-form button[disabled], .settings-card button[disabled] { opacity: .55; cursor: progress; }
.settings-grid-follow { margin-top: 22px; }
.settings-card > .settings-section { margin-top: 22px; margin-bottom: 4px; }
.industry-picker-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.industry-picker-tools input { flex: 1 1 180px; min-width: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-soft); color: var(--text); }
.industry-picker-tools button { min-height: 38px; padding: 6px 10px; white-space: nowrap; }
.industry-picker-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 8px; max-height: 16rem; overflow-y: auto; padding: 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--text); font-size: var(--type-caption); }
.industry-picker-options label { min-width: 0; display: flex; align-items: flex-start; gap: 8px; padding: 5px 4px; border-radius: 6px; cursor: pointer; }
.industry-picker-options label[hidden] { display: none; }
.industry-picker-options input { flex: 0 0 auto; margin-top: 4px; }
.industry-picker-options input:disabled { cursor: not-allowed; }
.industry-picker-tools button:disabled { opacity: .55; cursor: not-allowed; }
.discovery-help, .plans-help { margin-top: 8px; color: var(--muted); font-size: var(--type-caption); line-height: 1.55; }
.discovery-help summary, .plans-help summary { width: fit-content; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.discovery-help p, .plans-help p { margin: 7px 0 0; }
.plans-help { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); }
.plans-help p + p { margin-top: 10px; }
@media (max-width: 640px) { .settings-row-split { grid-template-columns: 1fr; } }

/* --- Discovery outcome banner --------------------------------------------- */
.queue-notice { border-radius: 10px; padding: 11px 14px; font-size: var(--type-caption); font-weight: 600; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); color: var(--accent); }
.queue-notice-warn { background: color-mix(in srgb, var(--warning) 13%, transparent); border-color: color-mix(in srgb, var(--warning) 35%, transparent); color: var(--warning); }
