:root {
  --bg: #f5f6fa; --card: #fff; --text: #1d2433; --muted: #6b7385; --line: #e6e8ef;
  --primary: #3b5bdb; --primary-dark: #2f4ac0; --good: #2b8a3e; --mid: #1c7ed6; --warn: #e8590c; --error: #c92a2a;
  --radius: 14px; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 16px rgba(16,24,40,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Arial Hebrew", Arial, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; }
[hidden] { display: none !important; }
h1 { font-size: 24px; margin: 12px 0 8px; }
h2 { font-size: 17px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 16px 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.screen { min-height: 100vh; }
.screen.center { display: flex; align-items: center; justify-content: center; padding: 24px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card.narrow { width: 100%; max-width: 480px; text-align: center; }
.card-head { display: flex; justify-content: space-between; align-items: center; }

.logo { width: 56px; height: 56px; margin: 0 auto; border-radius: 16px; background: linear-gradient(135deg, var(--primary), #7048e8);
  color: #fff; font-weight: 800; font-size: 20px; display: flex; align-items: center; justify-content: center; letter-spacing: .5px; }
.logo.sm { width: 30px; height: 30px; border-radius: 9px; font-size: 12px; margin: 0; display: inline-flex; }

.btn { border: 0; border-radius: 10px; padding: 11px 18px; font: inherit; font-weight: 600; cursor: pointer; transition: background .15s, opacity .15s; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.ghost { background: #eef1fb; color: var(--primary); }
.btn.ghost:hover { background: #e2e7f8; }
.btn.wide { width: 100%; margin-top: 16px; }
.btn:disabled { opacity: .55; cursor: default; }
.link { background: none; border: 0; color: var(--primary); font: inherit; cursor: pointer; padding: 4px; }
.link:hover { text-decoration: underline; }

label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 6px; }
.hint { font-weight: 400; color: var(--muted); }
input, select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; color: var(--text); }
input:focus, select:focus { outline: 2px solid #c5d0fa; border-color: var(--primary); }
#apikey-input { margin-top: 12px; }

.progress { height: 10px; background: #e9ecf5; border-radius: 99px; overflow: hidden; margin: 22px 0 10px; }
.bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), #7048e8); transition: width .4s; }
.status { font-weight: 600; margin: 8px 0 4px; }
.detail { font-size: 12px; color: var(--muted); min-height: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: Consolas, Menlo, monospace; }
.error { white-space: pre-line; color: var(--error); background: #fff5f5; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.notice { color: #8a5a00; background: #fff8e6; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.trust { text-align: right; padding: 0 18px 0 0; margin: 14px 0 0; color: var(--muted); font-size: 14px; }
.trust li { margin: 6px 0; }

.spinner { width: 34px; height: 34px; margin: 16px auto 6px; border: 3px solid #dfe4f5; border-top-color: var(--primary); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 24px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.content { padding: 24px; max-width: 1200px; margin: 0 auto; }
.grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
@media (max-width: 1000px) { .grid { grid-template-columns: 1fr; } }

.profile-name { font-size: 20px; font-weight: 700; }
.profile-headline { color: var(--muted); margin: 2px 0 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { background: #eef1fb; color: #34408a; border-radius: 99px; padding: 4px 10px; font-size: 13px; }
.facts { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; color: var(--muted); margin-top: 10px; }

.section-title { margin: 28px 0 12px; }
.jobs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.job-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.job-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.job-title { font-weight: 700; font-size: 16px; }
.job-company { color: var(--muted); font-size: 14px; }
.score { min-width: 52px; text-align: center; border-radius: 10px; padding: 6px 8px; font-weight: 800; font-size: 15px; }
.score.high { background: #ebfbee; color: var(--good); }
.score.mid { background: #e7f5ff; color: var(--mid); }
.score.low { background: #fff4e6; color: var(--warn); }
.job-reason { font-size: 14px; color: #3d4556; flex: 1; }
.job-actions { display: flex; gap: 8px; margin-top: 4px; }
.job-actions .btn { padding: 9px 14px; font-size: 14px; }

.result { display: grid; grid-template-columns: 320px 1fr; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .result { grid-template-columns: 1fr; } }
.side { position: sticky; top: 76px; }
.gap { padding-right: 18px; margin: 0; font-size: 14px; }
.gap li { margin: 5px 0; }
.gap.good li::marker { color: var(--good); }
.gap.mid li::marker { color: var(--mid); }
.gap.warn li::marker { color: var(--warn); }
.big-score { font-size: 34px; font-weight: 800; color: var(--primary); }
.tabs { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.tab { background: none; border: 0; padding: 9px 14px; border-radius: 10px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; }
.tab.active { background: #eef1fb; color: var(--primary); }
.spacer { flex: 1; }
.frame-wrap { background: #e9ecf3; border-radius: 10px; padding: 18px; }
#doc-frame { width: 100%; height: calc(100vh - 230px); min-height: 600px; border: 0; background: #fff; border-radius: 4px; box-shadow: 0 2px 12px rgba(0,0,0,.08); }

.overlay { position: fixed; inset: 0; background: rgba(245,246,250,.82); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 50; }
.overlay-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 34px; text-align: center; max-width: 380px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1d2433; color: #fff; padding: 12px 18px; border-radius: 10px; z-index: 60; font-size: 14px; max-width: 80vw; }
.toast.err { background: var(--error); }

.card.wide-card { width: 100%; max-width: 620px; text-align: center; }
.providers { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin: 18px 0 12px; text-align: right; }
.provider { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; background: #fff; font: inherit; text-align: right; color: var(--text); }
.provider:hover { border-color: #c5d0fa; }
.provider.active { border-color: var(--primary); background: #f3f5ff; }
.provider .p-name { font-weight: 700; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; margin-top: 4px; }
.badge.free { background: #ebfbee; color: var(--good); }
.badge.paid { background: #f1f3f5; color: var(--muted); }
.help-box { background: #f8f9fc; border-radius: 10px; padding: 12px 14px; text-align: right; font-size: 14px; margin-bottom: 12px; }
.help-box ol { margin: 6px 0 0; padding-right: 20px; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; }
.done-box { background: #ebfbee; border-radius: 10px; padding: 14px; text-align: right; margin-top: 12px; }
.top-actions { display: flex; gap: 14px; }

/* ===== main layout v2 ===== */
.layout { display: grid; grid-template-columns: 330px 1fr; gap: 20px; padding: 20px 24px; max-width: 1440px; margin: 0 auto; align-items: start; }
@media (max-width: 980px) { .layout { grid-template-columns: 1fr; } }
.sidebar { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; padding-left: 4px; }
.sidebar::-webkit-scrollbar { width: 8px; } .sidebar::-webkit-scrollbar-thumb { background: #dfe3ee; border-radius: 8px; }
.panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.panel h3 { margin: 0 0 6px; font-size: 15px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; }
.panel label { margin-top: 12px; }
.tiny { font-size: 12px; }
.btn.sm { padding: 8px 12px; font-size: 13px; }
.check { display: flex !important; gap: 8px; align-items: center; font-weight: 500 !important; font-size: 13px !important; cursor: pointer; }
.check input { width: auto; }
.seg { display: flex; background: #eef1fb; border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: none; padding: 7px; border-radius: 8px; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button.on { background: #fff; color: var(--primary); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.range-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.range-row input[type=range] { flex: 1; padding: 0; border: 0; accent-color: var(--primary); }
.range-v { min-width: 84px; text-align: left; font-size: 13px; font-weight: 600; color: var(--primary); }
.chips-f { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-f button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 11px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text); }
.chips-f button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chips-f button .n { opacity: .65; margin-right: 4px; font-size: 11px; }

.mini-name { font-weight: 700; font-size: 16px; }
.mini-head { color: var(--muted); font-size: 13px; margin: 2px 0 8px; }
.mini-facts { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.mini-facts span { background: #f3f4f8; border-radius: 6px; padding: 2px 8px; }
.skeleton { background: linear-gradient(90deg, #eef0f5 25%, #f6f7fa 50%, #eef0f5 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; }
.skeleton.line { height: 14px; margin: 8px 0; } .skeleton.short { width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }

.results { min-width: 0; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 12px; }
.sort { display: flex; align-items: center; gap: 8px; } .sort label { margin: 0; font-weight: 500; color: var(--muted); }
.sort select { width: auto; padding: 7px 10px; }
.jobs { display: flex; flex-direction: column; gap: 12px; }
.job { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; transition: box-shadow .15s; }
.job:hover { box-shadow: 0 2px 4px rgba(16,24,40,.06), 0 10px 28px rgba(16,24,40,.09); }
.job-title { font-weight: 700; font-size: 16px; }
.job-sub { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.size-badge { font-size: 11px; background: #f1f3f9; color: #4a5470; border-radius: 6px; padding: 1px 7px; }
.size-badge.loading { color: var(--muted); font-style: italic; }
.ring { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 15px; grid-row: span 2; }
.ring span { background: #fff; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; }
.ring small { display: block; font-size: 9px; font-weight: 600; color: var(--muted); margin-top: -4px; }
.facts-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.fact { font-size: 12.5px; background: #f6f7fb; border-radius: 8px; padding: 4px 9px; color: #3d4556; white-space: nowrap; }
.fact b { font-weight: 700; }
.fact.est::after { content: ' (הערכה)'; color: var(--muted); font-size: 11px; }
.fact.good { background: #ebfbee; color: var(--good); } .fact.mid { background: #e7f5ff; color: var(--mid); } .fact.warn { background: #fff4e6; color: var(--warn); }
.job-reason { grid-column: 1 / -1; font-size: 14px; color: #3d4556; margin-top: 2px; }
.job-actions2 { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.job-actions2 .btn { padding: 8px 14px; font-size: 13.5px; }
.btn.saved { background: #fff4e6; color: var(--warn); }
.empty { text-align: center; color: var(--muted); padding: 48px 20px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.job.skel { height: 132px; }

/* ===== activity panel ===== */
.activity { position: fixed; left: 20px; bottom: 20px; width: 380px; max-width: calc(100vw - 40px); background: #fff; border-radius: 14px; box-shadow: 0 8px 32px rgba(16,24,40,.18); z-index: 40; overflow: hidden; }
.act-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #1d2433; color: #fff; border: 0; font: inherit; font-weight: 600; cursor: pointer; text-align: right; }
.act-head #act-title { flex: 1; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #69db7c; }
.dot.busy { background: #ffd43b; animation: pulse 1s infinite; }
.dot.err { background: #ff6b6b; }
@keyframes pulse { 50% { opacity: .35; } }
.caret { transition: transform .2s; }
.activity.collapsed .caret { transform: rotate(180deg); }
.activity.collapsed .act-body { display: none; }
.act-body { max-height: 46vh; overflow-y: auto; padding: 10px 14px 12px; }
.act-steps { list-style: none; margin: 0; padding: 0; }
.act-steps li { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; padding: 5px 0; }
.act-steps .ic { width: 16px; height: 16px; flex: none; margin-top: 2px; border-radius: 50%; }
.act-steps .running .ic { border: 2px solid #dfe4f5; border-top-color: var(--primary); animation: spin .8s linear infinite; }
.act-steps .done .ic { background: var(--good); mask: none; position: relative; }
.act-steps .done .ic::after { content: ''; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.act-steps .error .ic { background: var(--error); }
.act-steps .done .tx { color: #3d4556; } .act-steps .error .tx { color: var(--error); }
.act-steps li.thought { display: block; background: #f6f4ff; border-right: 3px solid #7048e8; border-radius: 8px; padding: 8px 10px; margin: 6px 0; }
.thought .tt { font-size: 12px; font-weight: 700; color: #5f3dc4; margin-bottom: 3px; }
.thought ul { margin: 0; padding-right: 16px; font-size: 13px; color: #3d3555; }
.thought li { padding: 1px 0 !important; display: list-item !important; }
.loading-card { text-align: center; max-width: 560px; margin: 60px auto; }

.verified { font-size: 11px; font-weight: 700; color: var(--good); background: #ebfbee; border-radius: 6px; padding: 1px 6px; vertical-align: middle; }
.years-edit { display: flex !important; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px !important; margin-top: 10px !important; }
.years-edit input { width: 70px; padding: 6px 8px; }

details.extras, details.notes-box { margin-top: 10px; background: #f8f9fc; border-radius: 10px; padding: 8px 12px; }
details.notes-box { margin-top: 14px; }
details summary { cursor: pointer; font-weight: 600; font-size: 13.5px; }
details textarea { width: 100%; margin-top: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; resize: vertical; }
details.notes-box .btn { margin-top: 8px; }

.view-switch { display: flex; flex-direction: column; gap: 4px; }
.view-switch .seg { width: fit-content; }
.view-switch .seg button { padding: 7px 14px; }

/* ===== web additions ===== */
.hero { max-width: 760px; text-align: center; }
.hero h1 { font-size: 32px; margin: 18px 0 8px; }
.hero .lead { font-size: 17px; color: #3d4556; line-height: 1.6; }
.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 26px 0 8px; text-align: right; }
@media (max-width: 700px) { .steps3 { grid-template-columns: 1fr; } .hero h1 { font-size: 26px; } }
.step3 { background: #f8f9fc; border-radius: 12px; padding: 14px; }
.step3 b { display: block; margin-bottom: 4px; }
.step3 .num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 13px; font-weight: 800; margin-left: 6px; }
.privacy { font-size: 13px; color: var(--muted); margin-top: 14px; }
.drop { border: 2px dashed #c5d0fa; border-radius: 14px; padding: 26px 16px; background: #f8f9ff; cursor: pointer; transition: background .15s; }
.drop:hover, .drop.over { background: #eef1fb; }
.drop input { display: none; }
.drop .big { font-weight: 700; font-size: 16px; }
.or { margin: 14px 0; color: var(--muted); font-size: 13px; }
textarea.paste { width: 100%; min-height: 120px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; resize: vertical; }
.how-li { text-align: right; font-size: 13.5px; background: #fff8e6; border-radius: 10px; padding: 10px 12px; margin-top: 12px; }
.how-li ol { margin: 4px 0 0; padding-right: 18px; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 20px; }
.footer a { color: var(--muted); }
.paste-job { margin-top: 10px; }
.src-tag { font-size: 11px; color: var(--muted); }
@media (max-width: 700px) {
  .topbar { padding: 10px 12px; } .layout { padding: 12px; } .content { padding: 12px; }
  .activity { left: 10px; bottom: 10px; width: calc(100vw - 20px); }
  .top-actions { gap: 4px; } .top-actions .link { font-size: 13px; }
  #doc-frame { height: 70vh; min-height: 420px; }
}
