:root {
  --ink: #182033;
  --muted: #647087;
  --faint: #8a94a8;
  --line: #dfe4ee;
  --line-strong: #cbd3e1;
  --surface: #ffffff;
  --canvas: #f4f6fb;
  --sidebar: rgba(250, 251, 254, .88);
  --green: #087f79;
  --green-dark: #066660;
  --green-bright: #35c4b8;
  --green-soft: #e5f7f4;
  --blue: #3f5cf6;
  --blue-dark: #3047cf;
  --blue-soft: #e9edff;
  --coral: #e9665a;
  --coral-soft: #fff0ed;
  --amber: #a76800;
  --amber-soft: #fff3d9;
  --red: #b64250;
  --red-soft: #fdecef;
  --shadow: 0 18px 48px rgba(39, 52, 92, .1);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; font-size: 14px; letter-spacing: 0; }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible { outline: 3px solid rgba(63, 92, 246, .22); outline-offset: 2px; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
.lucide { width: 18px; height: 18px; stroke-width: 1.8; flex: 0 0 auto; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 25px 16px 20px; border-right: 1px solid rgba(203, 211, 225, .8); background: var(--sidebar); color: var(--ink); display: flex; flex-direction: column; z-index: 30; backdrop-filter: blur(18px) saturate(1.2); }
.brand { min-height: 56px; padding: 0 9px 26px; display: flex; align-items: center; gap: 13px; border-bottom: 1px solid var(--line); }
.brand > span:last-child { min-width: 0; display: grid; gap: 2px; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; color: #fff; background: var(--blue); border-radius: 8px; box-shadow: 0 8px 20px rgba(63, 92, 246, .2); }
.brand-mark .lucide { width: 21px; height: 21px; stroke-width: 2.2; }
.brand-name { font-size: 18px; line-height: 1.1; }
.brand small { color: #7b86a0; font-size: 9px; text-transform: uppercase; }
.nav { display: grid; gap: 5px; padding-top: 24px; }
.nav-item { width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 7px; display: flex; align-items: center; gap: 11px; color: #65718a; background: transparent; text-align: left; font-weight: 650; transition: color .16s ease, background .16s ease, transform .16s ease; }
.nav-item:hover { color: var(--ink); background: #eef1f8; transform: translateX(2px); }
.nav-item.active { color: var(--blue-dark); background: var(--blue-soft); box-shadow: inset 3px 0 var(--blue); transform: none; }
.sidebar-foot { margin-top: auto; min-height: 54px; padding: 12px 10px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; color: #59657d; }
.sidebar-foot > span:last-child { display: grid; gap: 2px; }
.sidebar-foot strong { font-size: 12px; }
.sidebar-foot small { color: #8993a8; font-size: 10px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-bright); box-shadow: 0 0 0 4px rgba(53, 196, 184, .12); }

.main { min-width: 0; }
.topbar { height: 78px; padding: 0 36px; border-bottom: 1px solid rgba(203, 211, 225, .76); background: rgba(250, 251, 254, .78); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20; backdrop-filter: blur(18px) saturate(1.2); }
.page-heading h1 { margin: 4px 0 0; font-size: 21px; line-height: 1.15; }
.eyebrow { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.2; font-weight: 800; text-transform: uppercase; }
.privacy-label { color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; gap: 7px; }
.privacy-label .lucide { width: 16px; color: var(--blue); }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.mobile-menu { display: none; }
.view { display: none; width: 100%; max-width: 1500px; margin: 0 auto; padding: 30px 36px 64px; }
.view.active { display: block; animation: view-in .32s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(9px) scale(.995); } to { opacity: 1; transform: translateY(0) scale(1); } }

.search-workspace { border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(255, 255, 255, .9); overflow: hidden; box-shadow: inset 0 3px var(--blue), 0 14px 38px rgba(39, 52, 92, .08); }
.workspace-head { height: 56px; padding: 0 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; background: rgba(246, 248, 253, .88); }
.mode-tabs { height: 100%; display: flex; gap: 5px; align-items: center; }
.mode-tab { height: 34px; padding: 0 11px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #748097; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; transition: color .16s ease, background .16s ease, border-color .16s ease; }
.mode-tab .lucide { width: 15px; height: 15px; }
.mode-tab:hover { color: var(--ink); background: #edf0f7; }
.mode-tab.active { color: var(--blue-dark); background: #fff; border-color: var(--line-strong); box-shadow: 0 2px 8px rgba(39, 52, 92, .07); }
.research-depth { height: 36px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; display: inline-flex; align-items: center; gap: 2px; background: #e9edf5; }
.depth-button { height: 28px; padding: 0 9px; border: 0; border-radius: 6px; display: inline-flex; align-items: center; gap: 6px; color: #748097; background: transparent; font-size: 11px; font-weight: 700; transition: color .16s ease, background .16s ease, transform .16s ease; }
.depth-button .lucide { width: 14px; height: 14px; }
.depth-button:hover { color: var(--ink); }
.depth-button.active { color: #fff; background: var(--blue); box-shadow: 0 4px 12px rgba(63, 92, 246, .2); }
.depth-button:disabled { opacity: .55; cursor: wait; }
.single-panel, .bulk-panel { padding: 25px 22px; background: rgba(255, 255, 255, .86); }
.search-form { display: grid; grid-template-columns: minmax(0, 1fr) 158px; gap: 10px; }
.search-field { height: 54px; position: relative; display: block; }
.search-field > .lucide { position: absolute; left: 17px; top: 17px; color: #46504c; z-index: 1; }
.search-field input { width: 100%; height: 54px; padding: 0 65px 0 49px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; outline: none; font-size: 15px; box-shadow: inset 0 1px 2px rgba(39, 52, 92, .03); }
.search-field input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(63, 92, 246, .1); }
.search-field kbd { position: absolute; right: 13px; top: 15px; height: 24px; padding: 0 7px; border: 1px solid var(--line); border-bottom-color: #bfc7c4; border-radius: 3px; display: inline-flex; align-items: center; color: var(--faint); background: #f7f8f7; font-family: inherit; font-size: 10px; }
.primary-button, .secondary-button, .danger-button, .back-button { min-height: 38px; padding: 0 14px; border: 1px solid transparent; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; font-weight: 700; font-size: 12px; }
.primary-button { color: #fff; background: var(--blue); border-color: var(--blue); box-shadow: 0 6px 16px rgba(63, 92, 246, .18); transition: background .16s ease, transform .16s ease, box-shadow .16s ease; }
.primary-button:hover { color: #fff; background: var(--blue-dark); border-color: var(--blue-dark); box-shadow: 0 8px 22px rgba(63, 92, 246, .25); transform: translateY(-1px); }
#searchButton { min-height: 54px; border-radius: 8px; }
.primary-button:disabled { opacity: .55; cursor: wait; }
.secondary-button { color: var(--ink); background: #fff; border-color: var(--line-strong); }
.secondary-button:hover { color: var(--blue-dark); background: var(--blue-soft); border-color: #b8c3ff; }
.danger-button { color: var(--red); background: #fff; border-color: #e4bbbb; }
.danger-button:hover { background: var(--red-soft); }
.back-button { padding-left: 0; color: var(--blue); background: transparent; }
.icon-button { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 5px; display: inline-grid; place-items: center; color: inherit; background: transparent; }
.icon-button:hover { background: #edf0ef; }

.bulk-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(250px, .55fr); gap: 14px; }
.bulk-textarea-wrap { display: grid; gap: 7px; color: #4f5b73; font-size: 12px; font-weight: 700; }
.bulk-textarea-wrap textarea { width: 100%; min-height: 158px; padding: 12px 14px; resize: vertical; border: 1px solid var(--line-strong); border-radius: 6px; outline: none; line-height: 1.5; }
.bulk-textarea-wrap small { color: var(--muted); text-align: right; font-weight: 500; }
.dropzone { min-height: 158px; border: 1px dashed #a9b4af; border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; color: var(--muted); background: #f7f9f8; }
.dropzone > .lucide { width: 28px; height: 28px; color: var(--blue); }
.dropzone.dragging { border-color: var(--blue); background: var(--blue-soft); }
.dropzone strong { color: var(--ink); }
.bulk-actions { min-height: 48px; padding-top: 12px; display: flex; justify-content: space-between; align-items: end; color: var(--muted); }

.notice { margin-top: 14px; min-height: 48px; padding: 7px 9px 7px 14px; border: 1px solid; border-radius: 6px; display: grid; grid-template-columns: 18px 1fr 36px; align-items: center; gap: 10px; }
.notice.error { color: #843333; border-color: #e7c2c2; background: var(--red-soft); }
.loading-state { min-height: 98px; margin-top: 16px; padding: 20px; border: 1px solid #2b3ec0; border-radius: 8px; color: #fff; background: #263aaf; display: grid; grid-template-columns: 44px 1fr auto; gap: 16px; align-items: center; animation: view-in .28s ease both; }
.loading-state p { margin: 5px 0 0; color: #cbd3ff; }
.loader { width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, .34); border-radius: 8px; display: grid; place-items: center; color: #fff; background: rgba(255, 255, 255, .08); animation: pulse 1.4s ease-in-out infinite; }
.loader .lucide { width: 23px; height: 23px; }
.loading-time { color: var(--faint); font-size: 11px; }
.loading-actions { min-width: 70px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.cancel-search { border: 1px solid rgba(255, 255, 255, .3); color: #fff; background: rgba(255, 255, 255, .08); }
.cancel-search .lucide { width: 14px; height: 14px; }
@keyframes pulse { 50% { background: rgba(255, 255, 255, .22); box-shadow: 0 0 0 6px rgba(255, 255, 255, .08); transform: scale(1.03); } }

.empty-state { min-height: 410px; display: grid; place-content: center; justify-items: center; text-align: center; color: var(--muted); }
.empty-visual { width: 94px; height: 94px; margin-bottom: 22px; border: 1px solid #c3cdfc; border-radius: 8px; display: grid; place-items: center; position: relative; overflow: hidden; color: var(--blue); background: var(--blue-soft); box-shadow: 10px 10px 0 #dfe4f4; }
.empty-visual .lucide { width: 44px; height: 44px; stroke-width: 1.3; }
.scan-line { position: absolute; left: 13px; right: 13px; height: 1px; top: 24px; background: var(--green-bright); box-shadow: 0 0 8px rgba(53, 196, 184, .7); animation: scan 2.4s ease-in-out infinite alternate; }
@keyframes scan { to { transform: translateY(43px); } }
.empty-copy h2 { margin: 7px 0 8px; font-size: 28px; line-height: 1.15; }
.empty-copy h2 em { color: var(--blue); font-style: normal; font-weight: 750; }
.empty-copy p:last-child { margin: 0; }
.role-list { max-width: 620px; margin-top: 20px; display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.role-list span { min-height: 28px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 6px; display: inline-flex; align-items: center; color: #59657d; background: rgba(255, 255, 255, .72); font-size: 11px; }

.result { margin-top: 18px; animation: view-in .34s ease both; }
.result-toolbar, .section-heading { min-height: 42px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.toolbar-actions { display: flex; gap: 7px; }
.company-panel { border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; overflow: hidden; box-shadow: 0 12px 34px rgba(39, 52, 92, .07); }
.company-head { min-height: 118px; padding: 23px 24px; display: grid; grid-template-columns: minmax(0, 1.2fr) auto; gap: 24px; align-items: center; border-bottom: 1px solid var(--line); color: var(--ink); background: #f8f9fe; }
.company-identity { min-width: 0; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 14px; align-items: start; }
.company-avatar { width: 50px; height: 50px; border-radius: 8px; display: grid; place-items: center; color: #fff; background: var(--blue); font-size: 19px; font-weight: 800; box-shadow: 0 9px 22px rgba(63, 92, 246, .2); }
.company-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.company-title-row h2 { margin: 0; font-size: 22px; line-height: 1.3; overflow-wrap: anywhere; }
.registry-chip { min-height: 22px; padding: 0 7px; border-radius: 5px; display: inline-flex; align-items: center; color: var(--green-dark); background: var(--green-soft); font-size: 10px; font-weight: 750; }
.legal-name { margin: 6px 0 0; color: var(--muted); line-height: 1.4; }
.company-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.company-actions a { min-height: 36px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 7px; display: inline-flex; align-items: center; gap: 7px; color: var(--ink); background: #fff; font-size: 11px; font-weight: 700; }
.company-actions a.primary-contact { color: #fff; border-color: var(--blue); background: var(--blue); }
.company-actions a:hover { text-decoration: none; color: var(--blue-dark); border-color: #b8c3ff; background: var(--blue-soft); }
.company-actions a.primary-contact:hover { color: #fff; border-color: var(--blue-dark); background: var(--blue-dark); }
.company-body { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr); }
.company-facts { padding: 19px 22px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 22px; }
.fact { min-width: 0; }
.fact-label { display: block; margin-bottom: 5px; color: var(--faint); font-size: 9px; text-transform: uppercase; font-weight: 750; }
.fact-value { display: block; line-height: 1.45; overflow-wrap: anywhere; }
.research-summary { padding: 19px 22px; border-left: 1px solid #c6e5e1; background: var(--green-soft); }
.research-summary strong { display: block; font-size: 12px; }
.research-metrics { margin-top: 12px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.research-metric b { display: block; font-size: 21px; line-height: 1; }
.research-metric span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.research-error { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 7px; align-items: start; color: #843333; font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.research-error svg { width: 14px; height: 14px; margin-top: 1px; }
.domain-list { margin-top: 13px; color: var(--muted); font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.company-source { min-height: 40px; padding: 9px 22px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 7px; color: var(--muted); background: #fbfcfb; font-size: 10px; }
.company-source a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.contacts-heading { margin: 26px 0 11px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.contacts-heading h2, .section-heading h2, .sources-layout h2 { margin: 4px 0 0; font-size: 18px; }
.count-badge { min-width: 24px; height: 22px; margin-left: 5px; padding: 0 7px; border-radius: 11px; display: inline-grid; place-items: center; color: #35423d; background: #dde4e1; font-size: 11px; vertical-align: 2px; }
.filter-field { min-width: 210px; height: 36px; padding-left: 10px; border: 1px solid var(--line-strong); border-radius: 5px; display: flex; align-items: center; color: var(--muted); background: #fff; }
.filter-field .lucide { width: 15px; }
.filter-field select { width: 100%; height: 34px; padding: 0 28px 0 8px; border: 0; outline: none; color: var(--ink); background: transparent; font-size: 11px; }
.contacts-list { display: grid; gap: 8px; }
.contact-card { border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.contact-card.priority { border-left: 3px solid var(--blue); }
.contact-summary { min-height: 78px; padding: 14px 17px; display: grid; grid-template-columns: minmax(210px, 1fr) minmax(180px, .85fr) minmax(190px, .9fr) 122px 24px; gap: 16px; align-items: center; cursor: pointer; }
.contact-summary:hover { background: #f8f9fe; }
.contact-card:hover { border-color: #b7c1d4; box-shadow: 0 8px 22px rgba(39, 52, 92, .06); transform: translateY(-1px); }
.contact-card.open { border-color: #aebafd; box-shadow: 0 10px 26px rgba(39, 52, 92, .08); transform: none; }
.person { min-width: 0; display: flex; align-items: center; gap: 11px; }
.person-avatar { width: 38px; height: 38px; border-radius: 7px; display: grid; place-items: center; color: var(--blue-dark); background: var(--blue-soft); font-size: 12px; font-weight: 800; flex: 0 0 auto; }
.person strong, .position strong { display: block; overflow-wrap: anywhere; }
.person small, .position small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.type-label { width: fit-content; min-height: 19px; margin-top: 5px; padding: 0 6px; border-radius: 3px; display: inline-flex !important; align-items: center; color: var(--blue) !important; background: var(--blue-soft); font-size: 9px !important; font-weight: 750; text-transform: uppercase; }
.type-label.decision_maker { color: var(--green-dark) !important; background: var(--green-soft); }
.contact-links { min-width: 0; display: grid; gap: 4px; font-size: 12px; }
.contact-links a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.no-data { color: #9ca5a1; }
.confidence { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 750; }
.confidence::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.confidence.high { color: var(--green); }.confidence.high::before { background: #2b9a72; }
.confidence.medium { color: var(--amber); }.confidence.medium::before { background: #d39127; }
.confidence.low { color: var(--red); }.confidence.low::before { background: #c45050; }
.expand-mark { color: var(--muted); transition: transform .15s ease; }
.contact-card.open .expand-mark { transform: rotate(180deg); }
.contact-details { display: none; padding: 17px 19px 18px 66px; border-top: 1px solid var(--line); background: #fafbfa; grid-template-columns: minmax(0, 1.2fr) minmax(240px, .8fr); gap: 24px; }
.contact-card.open .contact-details { display: grid; }
.detail-group h3 { margin: 0 0 9px; color: var(--faint); font-size: 9px; text-transform: uppercase; }
.evidence { margin: 0 0 12px; color: #45504c; line-height: 1.5; }
.source-list-inline { display: grid; gap: 7px; }
.source-item { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 7px; align-items: start; }
.source-item .lucide { width: 14px; height: 14px; margin-top: 2px; color: var(--blue); }
.source-item a { overflow-wrap: anywhere; font-size: 11px; }
.source-item time { color: var(--faint); font-size: 9px; }
.verified, .uncertain { margin-top: 8px; display: flex; align-items: center; gap: 6px; font-size: 10px; }
.verified { color: var(--green); }.uncertain { color: var(--amber); }
.note-editor { display: grid; align-content: start; gap: 7px; }
.note-editor textarea { width: 100%; min-height: 78px; padding: 9px; resize: vertical; border: 1px solid var(--line-strong); border-radius: 5px; }
.note-actions { text-align: right; }
.note-actions button { min-height: 32px; }
.contacts-empty { min-height: 140px; padding: 24px; border: 1px dashed var(--line-strong); border-radius: 7px; display: grid; place-items: center; text-align: center; color: var(--muted); background: #fff; }
.contacts-empty strong { color: var(--ink); }
.contacts-progress { min-height: 58px; padding: 13px 15px; border: 1px solid #cdded7; border-radius: 7px; display: flex; align-items: center; gap: 11px; color: #36594d; background: var(--green-soft); }
.contacts-progress .lucide { width: 18px; height: 18px; flex: 0 0 auto; }
.contacts-progress strong { display: block; color: var(--green-dark); }
.contacts-progress span { display: block; margin-top: 2px; font-size: 10px; }

.bulk-results { margin-top: 24px; }
.summary-strip { margin-bottom: 12px; border: 1px solid var(--line-strong); border-radius: 8px; display: grid; grid-template-columns: repeat(4, 1fr); overflow: hidden; background: var(--line); gap: 1px; }
.summary-item { padding: 14px 16px; background: #fff; }
.summary-item strong { display: block; font-size: 19px; }.summary-item span { color: var(--muted); font-size: 10px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; }
table { width: 100%; min-width: 700px; border-collapse: collapse; }
th { height: 42px; padding: 0 15px; border-bottom: 1px solid var(--line); color: #748097; background: #eef1f7; text-align: left; font-size: 9px; text-transform: uppercase; }
td { padding: 13px 15px; border-bottom: 1px solid #e9edeb; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.table-company { font-weight: 700; }.table-query { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.status-pill { min-height: 22px; padding: 0 7px; border-radius: 4px; display: inline-flex; align-items: center; font-size: 10px; font-weight: 700; }
.status-pill.found { color: var(--green); background: var(--green-soft); }.status-pill.not_found, .status-pill.error { color: var(--red); background: var(--red-soft); }.status-pill.multiple { color: var(--amber); background: var(--amber-soft); }
.table-action { border: 0; color: var(--blue); background: transparent; font-weight: 700; }
.history-heading { margin-bottom: 15px; }.empty-inline { padding: 50px; text-align: center; color: var(--muted); }
.history-filters { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 10px; margin-bottom: 14px; }
.history-filters label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; }
.history-filters input, .history-filters select { min-width: 0; width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; padding: 9px 10px; background: #fff; color: var(--ink); }
.copy-value { display: inline-flex; vertical-align: middle; align-items: center; justify-content: center; width: 25px; height: 25px; margin-left: 4px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; }
.copy-value:hover { background: var(--surface); color: var(--accent); }
.copy-value svg { width: 14px; height: 14px; }
.copy-text { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: copy; }
.copy-text:hover { color: var(--accent); text-decoration: underline; text-decoration-style: dotted; }
.contact-links > span { display: flex; align-items: center; gap: 3px; min-width: 0; }
.contact-links > span a { min-width: 0; }
.contact-copy-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.contact-copy-heading h3 { margin-right: auto; }
.contact-card .detail-group > p { margin: 7px 0; overflow-wrap: anywhere; }
@media (max-width: 850px) { .history-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .history-filters { grid-template-columns: 1fr; } }

.sources-layout { max-width: 980px; }
.source-list { margin-top: 16px; border-top: 1px solid var(--line); }
.source-row { min-height: 82px; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 15px; align-items: center; border-bottom: 1px solid var(--line); }
.source-row p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.source-logo { width: 42px; height: 42px; border-radius: 8px; display: grid; place-items: center; font-size: 10px; font-weight: 800; }
.source-logo.registry { color: #815407; background: var(--amber-soft); }.source-logo.web { color: var(--green-dark); background: var(--green-soft); }.source-logo.public { color: #763f2b; background: #f6e8e1; }.source-logo.local { color: var(--blue); background: var(--blue-soft); }
.connection { min-height: 23px; padding: 0 7px; border-radius: 4px; display: inline-flex; align-items: center; font-size: 10px; font-weight: 750; }.connection.active { color: var(--green); background: var(--green-soft); }.connection.limited { color: var(--amber); background: var(--amber-soft); }
.api-settings { min-height: 78px; margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 7px; display: grid; grid-template-columns: minmax(220px, 1fr) minmax(220px, .75fr) auto; gap: 16px; align-items: end; background: #fff; }
.api-settings p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }.api-settings label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }.api-settings input { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 5px; outline: none; }
.policy-note { margin-top: 16px; padding: 14px 16px; border-left: 3px solid var(--blue); display: flex; gap: 11px; color: #304a67; background: var(--blue-soft); }.policy-note p { margin: 3px 0 0; color: #576b81; font-size: 11px; }

.users-layout { max-width: 1100px; }
.user-create { margin: 16px 0; padding: 16px; border: 1px solid var(--line); border-radius: 7px; display: grid; grid-template-columns: minmax(170px, 1fr) minmax(220px, 1.2fr) 170px auto; gap: 14px; align-items: end; background: #fff; }
.user-create label, .dialog-fields label, .login-form label { min-width: 0; display: grid; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 700; }
.user-create input, .user-create select, .dialog-fields input, .login-form input { width: 100%; height: 40px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--ink); background: #fff; outline: none; font-size: 13px; }
.user-create input:focus, .user-create select:focus, .dialog-fields input:focus, .login-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(49, 92, 140, .1); }
.users-table select { height: 32px; padding: 0 28px 0 8px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.self-label { margin-left: 7px; padding: 2px 5px; border-radius: 3px; color: var(--blue); background: var(--blue-soft); font-size: 9px; font-weight: 700; }
.user-actions { display: flex; justify-content: flex-end; gap: 3px; }
.user-actions .icon-button { border: 1px solid var(--line); background: #fff; }
.user-actions .icon-button:disabled { opacity: .35; cursor: not-allowed; }
.dialog-fields { display: grid; gap: 12px; margin-top: 17px; }
.dialog-actions { margin-top: 18px; display: flex; justify-content: flex-end; }

.login-page { min-width: 0; min-height: 100vh; overflow-x: hidden; background: #edf0f8; }
.login-shell { width: min(960px, calc(100vw - 32px)); min-height: 540px; margin: max(7vh, 36px) auto; display: grid; grid-template-columns: minmax(340px, 1fr) minmax(360px, 1fr); border: 1px solid #ccd4e8; border-radius: 8px; overflow: hidden; background: #fff; box-shadow: 0 28px 70px rgba(39, 52, 92, .16); animation: view-in .4s ease both; }
.login-brand { padding: 54px; display: flex; align-items: flex-start; gap: 15px; position: relative; overflow: hidden; color: #fff; background: #354fdc; }
.login-brand::before { content: "B2B"; position: absolute; right: -18px; bottom: -26px; color: #4962e5; font-size: 168px; line-height: 1; font-weight: 800; pointer-events: none; }
.login-brand > * { position: relative; z-index: 1; }
.login-brand .brand-mark { width: 46px; height: 46px; flex: 0 0 auto; color: var(--blue); background: #fff; box-shadow: none; }
.login-brand h1 { margin: 2px 0 3px; font-size: 30px; letter-spacing: 0; }
.login-brand p { margin: 0; color: #cad2ff; font-size: 10px; text-transform: uppercase; }
.login-form { min-width: 0; padding: 58px; display: grid; align-content: center; gap: 17px; }
.login-heading { margin-bottom: 7px; }
.login-heading h2 { margin: 6px 0 0; font-size: 27px; }
.login-form input { height: 46px; font-size: 14px; }
.password-input { min-width: 0; position: relative; display: block; }
.password-input input { padding-right: 45px; }
.password-input button { position: absolute; top: 5px; right: 5px; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 4px; display: grid; place-items: center; color: var(--muted); background: transparent; }
.password-input button:hover { background: #edf1ef; }
.login-submit { width: 100%; min-height: 46px; margin-top: 3px; }
.login-error { padding: 10px 12px; border: 1px solid #e3bcbc; border-radius: 5px; color: #8a3030; background: var(--red-soft); font-size: 12px; line-height: 1.4; }

dialog { width: min(560px, calc(100vw - 32px)); padding: 21px; border: 0; border-radius: 8px; box-shadow: var(--shadow); } dialog::backdrop { background: rgba(11, 17, 15, .45); }.dialog-head { display: flex; align-items: center; justify-content: space-between; }.dialog-head h2 { margin: 0; font-size: 18px; } dialog > p { color: var(--muted); }.candidates-list { display: grid; gap: 7px; margin-top: 16px; }.candidate-button { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; text-align: left; }.candidate-button:hover { border-color: var(--blue); background: var(--blue-soft); }.candidate-button strong, .candidate-button span { display: block; }.candidate-button span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.toast { position: fixed; right: 22px; bottom: 22px; max-width: 360px; padding: 11px 15px; border-radius: 6px; color: #fff; background: #252c29; box-shadow: var(--shadow); z-index: 100; }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 78px minmax(0, 1fr); }
  .sidebar { padding-left: 10px; padding-right: 10px; }
  .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .brand > span:last-child, .nav-item span, .sidebar-foot > span:last-child { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .sidebar-foot { justify-content: center; }
  .contact-summary { grid-template-columns: minmax(185px, 1fr) minmax(155px, .8fr) minmax(150px, .8fr) 100px 20px; gap: 10px; }
  .company-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: -250px; width: 244px; transition: left .2s ease; box-shadow: var(--shadow); }
  .sidebar.open { left: 0; }
  .brand { justify-content: flex-start; padding-left: 10px; padding-right: 10px; }
  .brand > span:last-child, .nav-item span, .sidebar-foot > span:last-child { display: grid; }
  .nav-item { justify-content: flex-start; padding: 0 12px; }
  .sidebar-foot { justify-content: flex-start; }
  .topbar { height: 64px; padding: 0 14px; gap: 10px; }
  .mobile-menu { display: inline-grid; flex: 0 0 auto; }
  .page-heading h1 { font-size: 16px; }
  .privacy-label { display: none; }
  .view { padding: 15px 12px 38px; }
  .workspace-head { padding: 0 10px; }
  .workspace-head { height: auto; min-height: 50px; padding-top: 7px; padding-bottom: 7px; flex-wrap: wrap; }
  .research-depth { margin-left: auto; }
  .mode-tab { padding: 0 8px; }
  .single-panel, .bulk-panel { padding: 14px 12px; }
  .search-form { grid-template-columns: 1fr; }
  .search-field kbd { display: none; }
  .search-field input { padding-right: 14px; }
  .primary-button { min-height: 44px; }
  .bulk-grid { grid-template-columns: 1fr; }
  .loading-state { grid-template-columns: 40px 1fr; padding: 15px; }
  .loading-actions { grid-column: 1 / -1; min-width: 0; justify-content: space-between; padding-left: 51px; }
  .empty-state { min-height: 360px; }
  .result-toolbar { align-items: center; }
  .toolbar-actions .secondary-button { width: 38px; padding: 0; font-size: 0; }
  .toolbar-actions .secondary-button .lucide { width: 17px; }
  .company-head { grid-template-columns: 1fr; gap: 14px; padding: 17px; }
  .company-actions { justify-content: flex-start; }
  .company-body { grid-template-columns: 1fr; }
  .company-facts { padding: 17px; grid-template-columns: 1fr 1fr; }
  .research-summary { border-left: 0; border-top: 1px solid var(--line); padding: 17px; }
  .company-source { padding: 9px 17px; }
  .contacts-heading { align-items: flex-start; flex-direction: column; }
  .filter-field { width: 100%; }
  .contact-summary { grid-template-columns: 1fr 22px; padding: 14px; }
  .contact-summary .position, .contact-summary .contact-links, .contact-summary .confidence { grid-column: 1; margin-left: 49px; }
  .contact-summary .expand-mark { grid-column: 2; grid-row: 1; }
  .contact-details { padding: 15px; grid-template-columns: 1fr; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .source-row { grid-template-columns: 42px minmax(0, 1fr); padding: 14px 0; }.source-row .connection { grid-column: 2; justify-self: start; }
  .api-settings { grid-template-columns: 1fr; }
  .user-create { grid-template-columns: 1fr; }
  .login-shell { width: calc(100% - 24px); max-width: 440px; min-height: 0; margin: 24px auto; grid-template-columns: minmax(0, 1fr); }
  .login-brand { padding: 25px; }
  .login-form { padding: 28px 24px 32px; }
  .toast { left: 12px; right: 12px; bottom: 12px; }
}

@media (max-width: 430px) {
  .company-facts { grid-template-columns: 1fr; }
  .company-actions a { flex: 1; }
  .mode-tab .lucide { display: none; }
  .depth-button .lucide { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
