:root {
    color-scheme: dark;
    --canvas: #080a0f;
    --surface: #10131a;
    --surface-raised: #171b24;
    --surface-soft: #0d1016;
    --line: rgba(255,255,255,.09);
    --line-strong: rgba(255,255,255,.15);
    --text: #f7f8fb;
    --muted: #929aab;
    --orange: #ff6b00;
    --orange-soft: rgba(255,107,0,.12);
    --green: #38d994;
    --green-soft: rgba(56,217,148,.12);
    --red: #ff6474;
    --red-soft: rgba(255,100,116,.11);
    --amber: #ffbd59;
    --amber-soft: rgba(255,189,89,.12);
    --blue: #6da9ff;
    --radius: 18px;
    --shadow: 0 22px 60px rgba(0,0,0,.34);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--text); background: var(--canvas); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button, a { transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.auth-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; background: radial-gradient(circle at 50% 20%, #1b1e28 0, var(--canvas) 46%); }
.auth-glow { position: absolute; width: 420px; height: 420px; border-radius: 50%; filter: blur(100px); opacity: .16; pointer-events: none; }
.auth-glow-a { background: var(--orange); top: -210px; right: -120px; }
.auth-glow-b { background: #4d7cff; bottom: -260px; left: -130px; }
.auth-card { width: min(440px, 100%); padding: 42px; border: 1px solid var(--line); border-radius: 26px; background: rgba(16,19,26,.88); box-shadow: var(--shadow); backdrop-filter: blur(22px); text-align: center; position: relative; }
.brand-mark { width: 68px; height: 68px; margin: 0 auto 22px; display: grid; place-items: center; border: 1px solid rgba(255,107,0,.26); border-radius: 21px; background: var(--orange-soft); box-shadow: 0 0 0 8px rgba(255,107,0,.035); }
.brand-mark img { width: 38px; height: 38px; object-fit: contain; }
.eyebrow { margin: 0; color: var(--orange); font-size: .69rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.auth-card h1 { margin: 9px 0 10px; font-size: clamp(1.8rem, 5vw, 2.35rem); letter-spacing: -.045em; }
.auth-card > p:not(.eyebrow):not(.auth-error) { margin: 0 auto 26px; max-width: 330px; color: var(--muted); line-height: 1.6; }
.google-button { width: 100%; min-height: 50px; border: 1px solid var(--line-strong); border-radius: 14px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--text); background: #fff; color: #16181d; font-weight: 750; cursor: pointer; }
.google-button:hover { transform: translateY(-1px); box-shadow: 0 10px 25px rgba(0,0,0,.25); }
.google-button:disabled { opacity: .58; cursor: wait; transform: none; }
.auth-error { min-height: 21px; margin: 16px 0 0; color: var(--red); font-size: .84rem; }

.topbar { min-height: 72px; padding: 0 28px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 22px; background: rgba(8,10,15,.86); backdrop-filter: blur(20px); position: sticky; top: 0; z-index: 30; }
.topbar-brand { display: flex; align-items: center; gap: 13px; }
.topbar-brand img { width: 38px; height: 38px; object-fit: contain; }
.topbar-brand span { color: var(--orange); font-size: .61rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.topbar-brand h1 { margin: 3px 0 0; font-size: 1.13rem; letter-spacing: -.025em; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.passive-pill { min-height: 36px; padding: 0 13px; border: 1px solid rgba(56,217,148,.22); border-radius: 999px; display: inline-flex; align-items: center; gap: 8px; color: #bfffe3; background: var(--green-soft); font-size: .73rem; font-weight: 750; }
.passive-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(56,217,148,.12); }
.secondary-button, .ghost-button, .primary-button, .danger-button, .icon-button { border: 1px solid var(--line-strong); border-radius: 11px; color: var(--text); background: rgba(255,255,255,.04); font-weight: 720; cursor: pointer; text-decoration: none; }
.secondary-button, .ghost-button { min-height: 38px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; }
.secondary-button:hover, .ghost-button:hover, .icon-button:hover { background: rgba(255,255,255,.09); border-color: rgba(255,255,255,.23); }

main { width: min(1680px, 100%); margin: 0 auto; padding: 22px 26px 32px; }
.safety-banner { min-height: 68px; padding: 13px 17px; border: 1px solid rgba(56,217,148,.16); border-radius: 16px; display: flex; align-items: center; gap: 13px; background: linear-gradient(90deg, var(--green-soft), rgba(56,217,148,.025)); }
.safety-icon { width: 35px; height: 35px; flex: 0 0 35px; border-radius: 11px; display: grid; place-items: center; color: #06180f; background: var(--green); font-weight: 900; }
.safety-banner strong { font-size: .88rem; }
.safety-banner p { margin: 4px 0 0; color: #a8b4af; font-size: .76rem; }
.safety-banner > span { margin-left: auto; color: var(--muted); font-size: .72rem; white-space: nowrap; }

.stats-grid { margin: 16px 0; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.stats-grid article { min-height: 112px; padding: 18px 19px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); position: relative; overflow: hidden; }
.stats-grid article::after { content: ""; position: absolute; width: 64px; height: 64px; right: -24px; bottom: -28px; border-radius: 50%; background: var(--orange); filter: blur(34px); opacity: .15; }
.stats-grid span { display: block; color: var(--muted); font-size: .72rem; font-weight: 720; }
.stats-grid strong { display: block; margin: 7px 0 2px; font-size: 1.8rem; letter-spacing: -.045em; }
.stats-grid small { color: #6f788a; font-size: .67rem; }
.stats-grid .stat-warning strong { color: var(--amber); }

.review-workspace { min-height: calc(100vh - 318px); border: 1px solid var(--line); border-radius: 20px; display: grid; grid-template-columns: minmax(330px, 390px) minmax(0,1fr); overflow: hidden; background: var(--surface-soft); box-shadow: var(--shadow); }
.candidate-panel { min-width: 0; border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; }
.panel-heading { min-height: 81px; padding: 18px 19px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.panel-heading h2 { margin: 4px 0 0; font-size: 1.12rem; letter-spacing: -.02em; }
.icon-button { width: 38px; height: 38px; font-size: 1.2rem; }
.icon-button.is-loading { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.filters { padding: 14px; border-bottom: 1px solid var(--line); }
.search-field { height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; display: flex; align-items: center; gap: 9px; background: rgba(255,255,255,.025); }
.search-field:focus-within { border-color: rgba(255,107,0,.62); box-shadow: 0 0 0 3px rgba(255,107,0,.09); }
.search-field svg { width: 17px; fill: none; stroke: var(--muted); stroke-width: 2; }
.search-field input { width: 100%; border: 0; outline: 0; color: var(--text); background: transparent; font-size: .78rem; }
.search-field input::placeholder { color: #686f7e; }
.filter-row { margin-top: 9px; display: grid; grid-template-columns: 1fr 1.12fr 1fr; gap: 7px; }
.filter-row label > span { display: none; }
.filter-row select { width: 100%; height: 37px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; color: #cbd1dc; background: #151922; font-size: .68rem; }
.candidate-count { margin: 0; padding: 10px 15px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .67rem; }
.candidate-list { min-height: 280px; max-height: calc(100vh - 510px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #323846 transparent; }
.load-more-button { min-height: 42px; margin: 10px 14px 14px; border: 1px solid var(--line); border-radius: 10px; color: #cbd1dc; background: rgba(255,255,255,.035); font-size: .7rem; font-weight: 720; cursor: pointer; }
.load-more-button:hover { background: rgba(255,255,255,.075); }
.bulk-reject-button { min-height: 38px; margin: 0 14px 14px; border: 1px solid rgba(239,68,68,.35); border-radius: 10px; color: #f87171; background: rgba(239,68,68,.07); font-size: .7rem; font-weight: 720; cursor: pointer; transition: background .15s; }
.bulk-reject-button:hover:not(:disabled) { background: rgba(239,68,68,.15); }
.bulk-reject-button:disabled { opacity: .45; cursor: not-allowed; }
.candidate-card { width: 100%; padding: 15px 16px; border: 0; border-bottom: 1px solid var(--line); display: block; color: var(--text); background: transparent; text-align: left; cursor: pointer; }
.candidate-card:hover { background: rgba(255,255,255,.035); }
.candidate-card.active { background: linear-gradient(90deg, var(--orange-soft), rgba(255,107,0,.025)); box-shadow: inset 3px 0 var(--orange); }
.card-meta { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .63rem; }
.source-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); }
.source-dot.website { background: var(--green); }
.card-status { margin-left: auto; padding: 3px 7px; border-radius: 999px; color: var(--amber); background: var(--amber-soft); text-transform: capitalize; }
.card-status.approved { color: var(--green); background: var(--green-soft); }
.card-status.rejected { color: var(--red); background: var(--red-soft); }
.candidate-card h3 { margin: 9px 0 5px; overflow: hidden; color: #fff; font-size: .8rem; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.candidate-card p { margin: 0; display: -webkit-box; overflow: hidden; color: #aeb5c1; font-size: .72rem; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.card-foot { margin-top: 9px; display: flex; justify-content: space-between; gap: 10px; color: #727a89; font-size: .62rem; }
.conflict-mini { color: var(--amber); }
.list-state { padding: 42px 24px; text-align: center; color: var(--muted); font-size: .78rem; line-height: 1.6; }

.detail-panel { min-width: 0; background: #0d1016; }
.detail-empty { height: 100%; min-height: 520px; padding: 40px; display: grid; align-content: center; justify-items: center; text-align: center; color: var(--muted); }
.detail-empty > div { width: 62px; height: 62px; border: 1px solid var(--line); border-radius: 20px; display: grid; place-items: center; color: var(--orange); background: var(--orange-soft); font-size: 1.5rem; }
.detail-empty h2 { margin: 18px 0 7px; color: var(--text); font-size: 1.2rem; }
.detail-empty p { max-width: 440px; margin: 0; font-size: .8rem; line-height: 1.6; }
.review-form { min-height: 100%; }
.detail-header { min-height: 96px; padding: 20px 23px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.detail-mobile-back { display: none; }
.badge-row { min-height: 20px; display: flex; flex-wrap: wrap; gap: 6px; }
.meta-badge, .reason-chip { padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; color: #abb3c0; background: rgba(255,255,255,.03); font-size: .61rem; font-weight: 700; text-transform: capitalize; }
.detail-header h2 { margin: 7px 0 3px; font-size: 1.1rem; letter-spacing: -.02em; }
.detail-header p { margin: 0; color: var(--muted); font-size: .69rem; }
.status-badge { padding: 7px 11px; border-radius: 999px; color: var(--amber); background: var(--amber-soft); font-size: .67rem; font-weight: 800; text-transform: uppercase; }
.status-badge.approved { color: var(--green); background: var(--green-soft); }
.status-badge.rejected { color: var(--red); background: var(--red-soft); }
.conflict-alert { margin: 16px 22px 0; padding: 13px 15px; border: 1px solid rgba(255,189,89,.24); border-radius: 12px; background: var(--amber-soft); }
.conflict-alert strong { color: var(--amber); font-size: .78rem; }
.conflict-alert p { margin: 4px 0 0; color: #c4ae84; font-size: .69rem; line-height: 1.45; }
.editor-grid, .information-grid { padding: 18px 22px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.editor-field, .note-field { display: block; }
.editor-field > span, .note-field > span { display: flex; justify-content: space-between; margin-bottom: 7px; color: #dce1ea; font-size: .7rem; font-weight: 750; }
.editor-field textarea, .note-field textarea { width: 100%; resize: vertical; border: 1px solid var(--line); border-radius: 12px; padding: 12px 13px; color: var(--text); background: var(--surface-raised); font-size: .78rem; line-height: 1.55; }
.editor-field textarea:focus, .note-field textarea:focus { border-color: rgba(255,107,0,.58); }
.editor-field small { display: block; margin-top: 6px; color: #697181; font-size: .62rem; }
.info-card { min-height: 126px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.section-title { margin-bottom: 10px; color: #d8dde7; font-size: .7rem; font-weight: 750; }
.fact-list, .evidence-list { display: flex; flex-wrap: wrap; gap: 6px; }
.fact-pill { padding: 6px 8px; border-radius: 8px; color: #bad6ff; background: rgba(109,169,255,.1); font-size: .64rem; }
.fact-pill.warning { color: var(--amber); background: var(--amber-soft); }
.empty-copy { margin: 3px 0; color: var(--muted); font-size: .69rem; line-height: 1.5; }
.evidence-block { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.025); }
.evidence-block strong { display: block; color: #dce1e9; font-size: .68rem; }
.evidence-block p { margin: 5px 0 0; color: #929aaa; font-size: .66rem; line-height: 1.5; white-space: pre-wrap; }
.conversation-card { margin: 14px 22px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.conversation-card summary { padding: 12px 14px; color: #cbd1dc; font-size: .7rem; font-weight: 720; cursor: pointer; }
.conversation-list { padding: 0 14px 14px; display: grid; gap: 7px; }
.conversation-line { max-width: 78%; padding: 8px 10px; border-radius: 10px; color: #c9d0dc; background: #1a1f2a; font-size: .68rem; line-height: 1.5; white-space: pre-wrap; }
.conversation-line.human { margin-left: auto; color: #ffe2cd; background: rgba(255,107,0,.13); }
.conversation-line.automation { color: #8992a2; border: 1px dashed var(--line); background: transparent; }
.note-field { margin: 14px 22px 0; }
.note-field em { color: var(--muted); font-size: .61rem; font-style: normal; font-weight: 500; }
.note-field textarea { min-height: 64px; }
.review-reasons { min-height: 26px; margin: 12px 22px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.reason-chip { color: var(--amber); border-color: rgba(255,189,89,.17); background: var(--amber-soft); }
.review-actions { min-height: 70px; margin-top: 12px; padding: 13px 22px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; bottom: 0; background: rgba(13,16,22,.95); backdrop-filter: blur(12px); }
.review-actions > div { display: flex; gap: 8px; }
.review-actions button { min-height: 40px; padding: 0 14px; }
.primary-button { color: #1b0b00; border-color: var(--orange); background: var(--orange); }
.primary-button:hover { background: #ff8128; }
.danger-button { color: var(--red); border-color: rgba(255,100,116,.25); background: var(--red-soft); }
.danger-button:hover { border-color: rgba(255,100,116,.48); }
.review-actions button:disabled { opacity: .48; cursor: wait; }
#review-action-status { margin: 0; color: var(--muted); font-size: .68rem; }
#review-action-status.success { color: var(--green); }
#review-action-status.error { color: var(--red); }
.learning-toast { position: fixed; right: 22px; bottom: 22px; z-index: 100; max-width: min(390px, calc(100vw - 28px)); padding: 12px 15px; border: 1px solid rgba(56,217,148,.24); border-radius: 12px; color: #caffea; background: #10241b; box-shadow: var(--shadow); font-size: .74rem; }
.learning-toast.error { color: #ffd2d7; border-color: rgba(255,100,116,.3); background: #281319; }

@media (max-width: 1050px) {
    .review-workspace { grid-template-columns: 330px minmax(0,1fr); }
    .editor-grid, .information-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .topbar { padding: 10px 15px; min-height: 66px; }
    .topbar-brand span, .passive-pill, .ghost-button { display: none; }
    .topbar-brand h1 { font-size: 1rem; }
    main { padding: 14px 12px 24px; }
    .safety-banner { align-items: flex-start; }
    .safety-banner > span { display: none; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stats-grid article { min-height: 96px; padding: 15px; }
    .review-workspace { display: block; min-height: 0; }
    .candidate-panel { border-right: 0; }
    .candidate-list { max-height: none; }
    .learning-toast { right: 14px; bottom: 14px; }
    .detail-panel { border-top: 1px solid var(--line); }
    .detail-panel.has-selection { position: fixed; inset: 0; z-index: 50; overflow-y: auto; background: var(--surface-soft); }
    .detail-header { padding: 16px; align-items: flex-start; }
    .detail-mobile-back { width: 34px; height: 34px; flex: 0 0 34px; padding: 0; border: 1px solid var(--line); border-radius: 10px; display: grid; place-items: center; color: var(--text); background: var(--surface-raised); font-size: 1.35rem; cursor: pointer; }
    .detail-header > div { min-width: 0; flex: 1; }
    .detail-header h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .editor-grid, .information-grid { padding: 14px 14px 0; }
    .conversation-card, .note-field { margin-left: 14px; margin-right: 14px; }
    .review-reasons { margin-left: 14px; margin-right: 14px; }
    .review-actions { padding: 11px 14px calc(11px + env(safe-area-inset-bottom)); align-items: stretch; flex-direction: column; }
    .review-actions > div { display: grid; grid-template-columns: 1fr 1fr; }
    .review-actions .secondary-button { grid-column: 1 / -1; }
    .review-actions button { width: 100%; }
}

@media (max-width: 430px) {
    .stats-grid { gap: 8px; }
    .filter-row { grid-template-columns: 1fr; }
    .topbar-actions .secondary-button { padding: 0 10px; }
    .auth-card { padding: 32px 23px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
