:root {
  --navy: #0f2038;
  --navy-2: #1b2f4b;
  --ink: #0f1c2e;
  --muted: #6b7a90;
  --slate: #8ea3bf;
  --line: #dfe6ef;
  --surface: #f4f7fb;
  --bg: #ffffff;
  --dark: #0b1a2c;
  --dark-2: #12243a;
  --dark-line: rgba(255, 255, 255, 0.12);
  --dark-text: #e9eef5;
  --ok: #1f8a5b;
  --warn: #b7791f;
  --bad: #c0392b;
  --radius: 18px;
  --tab-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Inter", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.dark { background: var(--dark); color: var(--dark-text); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; }
.ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 18px; height: 18px; }
.ico.lg { width: 28px; height: 28px; }

#app { min-height: 100vh; padding-bottom: calc(var(--tab-h) + var(--safe-b) + 12px); }
#app.no-tabs { padding-bottom: calc(24px + var(--safe-b)); }
.page { padding: 18px 18px 8px; max-width: 560px; margin: 0 auto; }

/* ---------- логотип и заголовки ---------- */
.logo { display: block; height: 26px; width: auto; }
.logo text { font-weight: 600; letter-spacing: 0.08em; }
.topbar .logo { min-width: 0; flex: 0 1 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.topbar.center { justify-content: center; position: relative; }
.topbar.center .tb-left { position: absolute; left: 0; }
.topbar.center .tb-right { position: absolute; right: 0; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--navy); }
.icon-btn.ring { border: 1px solid var(--line); background: var(--surface); }
.h1 { font-size: 34px; line-height: 1.08; font-weight: 800; letter-spacing: -0.02em; margin: 18px 0 16px; }
.h1 .soft { color: #5b6f8c; }
.dark .h1 .soft { color: var(--slate); }
.h2 { font-size: 22px; font-weight: 800; margin: 22px 0 12px; letter-spacing: -0.01em; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.link { color: var(--muted); font-size: 15px; display: inline-flex; align-items: center; gap: 2px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* ---------- кнопки ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 54px; border-radius: 999px; font-weight: 700; font-size: 18px; padding: 0 22px;
  transition: transform .08s ease, opacity .2s;
}
.btn:active { transform: scale(0.985); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.white { background: #fff; color: var(--navy); }
.btn.outline { border: 1.5px solid var(--navy); color: var(--navy); background: transparent; font-weight: 500; }
.btn.ghost-dark { border: 1.5px solid rgba(255,255,255,.28); color: #c9d4e3; font-weight: 500; }
.btn.sm { min-height: 42px; font-size: 16px; }
.btn.split { justify-content: space-between; }
.btn + .btn { margin-top: 10px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chip-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  border: 1px solid var(--line); border-radius: 14px; background: #fff; font-size: 16px; color: var(--ink);
}
.chip-btn.on { border-color: var(--navy); }

/* ---------- тёмный экран подбора ---------- */
.pill-new {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--dark-line); background: rgba(255,255,255,.04); color: var(--dark-text); font-weight: 600;
  white-space: nowrap; flex: none;
}
.pill-new .ico { color: var(--slate); }
.flow { position: relative; height: 212px; margin: 6px -4px 0; }
.flow svg.lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.flow svg.lines path { fill: none; stroke: rgba(255,255,255,.35); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.flow .node { position: absolute; top: 72px; width: 21%; text-align: center; font-size: 14px; }
.flow .node.you { left: 0; }
.flow .node.co { right: 0; }
.flow .disc {
  width: 100%; aspect-ratio: 1; border-radius: 50%; border: 1px solid rgba(255,255,255,.3);
  background: radial-gradient(circle at 50% 40%, #1c3150, #0e1d31); display: grid; place-items: center; margin-bottom: 6px;
}
.flow .disc .ico { width: 44%; height: 44%; color: #e7edf6; }
.flow .node .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.flow .factors { position: absolute; left: 25%; right: 25%; top: 0; display: grid; gap: 10px; }
.factor {
  display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 12px; border-radius: 16px;
  border: 1px solid var(--dark-line); background: rgba(255,255,255,.04); font-size: 13px; line-height: 1.2;
}
.factor .name { flex: 1; min-width: 0; }
.bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 22px; flex: none; }
.bars i { width: 4px; border-radius: 2px; background: currentColor; opacity: .25; }
.bars i.on { opacity: 1; }
.bars i:nth-child(1) { height: 30%; } .bars i:nth-child(2) { height: 45%; } .bars i:nth-child(3) { height: 60%; }
.bars i:nth-child(4) { height: 80%; } .bars i:nth-child(5) { height: 100%; }
.dark .bars { color: #c8d5e6; }

.gauge { position: relative; width: 190px; margin: 4px auto 0; text-align: center; }
.gauge svg { width: 100%; height: auto; display: block; }
.gauge .val { position: absolute; left: 0; right: 0; top: 30%; font-size: 52px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.gauge .val sup { font-size: 0.55em; vertical-align: 0.55em; margin-left: 2px; }
.gauge .cap { position: absolute; left: 0; right: 0; top: 62%; font-size: 20px; color: #5b6f8c; }
.dark .gauge .cap { color: var(--slate); }
.gauge-note { text-align: center; font-size: 15px; margin: 2px 0 14px; color: #c9d4e3; }

.hero {
  position: relative; border-radius: 22px; overflow: hidden; min-height: 200px; padding: 22px;
  display: flex; flex-direction: column; justify-content: flex-end; color: #fff;
  border: 1px solid var(--dark-line);
}
.hero .art { position: absolute; inset: 0; }
.hero .art .ico { position: absolute; right: -6%; bottom: -10%; width: 62%; height: auto; aspect-ratio: 1; stroke-width: 0.6; opacity: .22; color: #bcd0ec; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,18,32,.92) 0%, rgba(8,18,32,.55) 60%, rgba(8,18,32,.2) 100%); }
.hero > *:not(.art) { position: relative; z-index: 1; }
.hero .title { font-size: 30px; font-weight: 800; line-height: 1.08; letter-spacing: -0.01em; margin-bottom: 14px; }
.meta { display: flex; flex-wrap: wrap; gap: 10px 20px; font-size: 16px; }
.meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero .date { margin-top: 10px; font-size: 14px; opacity: .8; }

/* ---------- светлые экраны ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card + .card { margin-top: 12px; }
.card.soft { background: var(--surface); }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1.5px solid var(--line); border-radius: 999px; padding: 3px; margin-bottom: 14px; }
.seg button { min-height: 44px; border-radius: 999px; font-size: 17px; color: var(--ink); }
.seg button.on { background: var(--navy); color: #fff; }
.search {
  display: flex; align-items: center; gap: 12px; height: 54px; border-radius: 16px; padding: 0 16px;
  background: var(--surface); border: 1px solid var(--line); margin-bottom: 12px;
}
.search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: 0; font-size: 17px; }
.search .ico { color: var(--navy); }
.filters { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; margin: 0 -18px 12px; padding-left: 18px; padding-right: 18px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.select {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 36px 0 14px;
  border: 1px solid var(--line); border-radius: 14px; background: #fff; flex: none; color: var(--ink);
}
.select.on { border-color: var(--navy); background: var(--surface); }
.select select { position: absolute; inset: 0; opacity: 0; width: 100%; font-size: 16px; }
.select .chev { position: absolute; right: 10px; }

.vcard { display: flex; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; width: 100%; text-align: left; }
.vcard + .vcard { margin-top: 12px; }
.thumb { position: relative; width: 104px; min-height: 112px; flex: none; border-radius: 12px; overflow: hidden; display: grid; place-items: center; }
.thumb .ico { width: 54px; height: 54px; color: rgba(255,255,255,.9); stroke-width: 1.3; position: relative; z-index: 1; }
.vcard .body { flex: 1; min-width: 0; }
.vcard .top { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.vcard .top .grow { flex: 1; }
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 8px; font-size: 12px; font-weight: 700; background: var(--navy); color: #fff; }
.badge.grey { background: #e9eef5; color: var(--muted); font-weight: 600; }
.badge.ok { background: #e3f4ec; color: var(--ok); }
.badge.warn { background: #fdf3e1; color: var(--warn); }
.badge.bad { background: #fbe9e7; color: var(--bad); }
.vcard .t { font-size: 18px; font-weight: 800; line-height: 1.15; margin-bottom: 6px; }
.vcard .line { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 15px; margin-top: 4px; min-width: 0; }
.vcard .line > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcard .salary { color: var(--ink); font-weight: 700; font-size: 17px; }
.save-btn { color: var(--navy); margin: -6px -6px 0 0; width: 34px; height: 34px; display: grid; place-items: center; }
.save-btn.on .ico { fill: var(--navy); }

.match-card { display: grid; grid-template-columns: 44% 1fr; gap: 14px; align-items: center; }
.match-card .gauge { width: 100%; max-width: 170px; }
.match-card .gauge .val { font-size: 40px; }
.match-card .gauge .cap { font-size: 17px; }
.mini-factors { display: grid; gap: 8px; }
.mini-factor { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; font-size: 14px; background: #fff; }
.mini-factor .name { flex: 1; }
.mini-factor .bars { color: var(--navy); }

.facts { display: grid; gap: 12px; margin: 8px 0 14px; }
.fact { display: flex; align-items: center; gap: 14px; font-size: 16px; }
.fact .ico { color: var(--navy); }
.desc { white-space: pre-wrap; font-size: 15.5px; line-height: 1.5; color: #273449; margin: 6px 0 14px; }
.divider { height: 1px; background: var(--line); margin: 12px 0; }

/* статистика работодателя */
.stats { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { display: flex; gap: 12px; padding: 14px; align-items: flex-start; }
.stat:nth-child(odd) { border-right: 1px solid var(--line); }
.stat:nth-child(n+3) { border-top: 1px solid var(--line); }
.stat .ico { color: var(--navy); margin-top: 4px; }
.stat b { display: block; font-size: 24px; line-height: 1.1; }
.stat span { font-size: 13px; color: var(--muted); }
.company { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: #e9eef5; display: grid; place-items: center; font-weight: 800; font-size: 22px; color: #34465f; flex: none; }
.avatar.sm { width: 52px; height: 52px; font-size: 18px; }
.company .name { font-size: 21px; font-weight: 700; }
.vac-sel { width: 100%; text-align: left; }
.vac-sel.on { border-color: var(--navy); box-shadow: 0 0 0 1px var(--navy) inset; }
.vac-sel .t { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 15px; margin-top: 8px; }
.status i { width: 10px; height: 10px; border-radius: 50%; background: var(--navy); }
.status.pending i { background: var(--warn); } .status.rejected i { background: var(--bad); }
.cand { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.cand .n { font-size: 19px; font-weight: 800; }
.cand .line { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); margin-top: 4px; }
.cand .ring { width: 92px; }
.cand .ring .gauge, .match-card .gauge { width: 100%; }
.cand .ring .val { font-size: 26px; top: 28%; }
.cand .ring .cap { font-size: 11px; top: 64%; }
.cand-actions { margin-top: 12px; display: grid; gap: 8px; }
.cand-actions .btn { min-height: 42px; font-size: 16px; }
.cand-actions .btn + .btn { margin-top: 0; }

/* формы */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.input, .field select, .field textarea {
  width: 100%; min-height: 50px; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
  background: var(--surface); font-size: 16px; outline: 0; color: var(--ink);
}
.field textarea { min-height: 110px; resize: vertical; }
.input:focus, .field select:focus, .field textarea:focus { border-color: var(--navy); background: #fff; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch { width: 52px; height: 32px; border-radius: 999px; background: #cfd8e4; position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch.on { background: var(--navy); }
.switch.on::after { transform: translateX(20px); }

/* нижняя панель */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: rgba(255,255,255,.96);
  border-top: 1px solid var(--line); backdrop-filter: blur(10px);
}
.dark .tabs { background: rgba(9,21,36,.96); border-top-color: var(--dark-line); }
.tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 13px; color: var(--muted); position: relative; }
.tabs button.on { color: var(--navy); font-weight: 600; }
.dark .tabs button { color: #8796ab; }
.dark .tabs button.on { color: #fff; }
.tabs button.on::after { content: ""; position: absolute; bottom: 6px; width: 46%; height: 3px; border-radius: 3px; background: currentColor; }
.tabs .ico { width: 26px; height: 26px; }
.tabs button.on .ico { fill: currentColor; stroke: currentColor; }
.tabs button.on .ico.keep { fill: none; }

/* шторка */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; background: rgba(5,12,22,.45); display: flex; align-items: flex-end; animation: fade .2s; }
.sheet {
  width: 100%; max-height: 88vh; overflow-y: auto; background: #fff; color: var(--ink); border-radius: 26px 26px 0 0;
  padding: 10px 18px calc(18px + var(--safe-b)); animation: up .25s ease; max-width: 560px; margin: 0 auto;
}
.sheet .grip { width: 44px; height: 5px; border-radius: 3px; background: #cfd8e4; margin: 4px auto 14px; }
.sheet .h1 { font-size: 30px; margin-top: 8px; margin-bottom: 6px; }
.reason { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 60px; padding: 0 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); font-size: 17px; text-align: left; }
.reason + .reason { margin-top: 8px; }
.reason .grow { flex: 1; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* разное */
.empty { text-align: center; padding: 36px 14px; color: var(--muted); }
.empty .ico { width: 48px; height: 48px; color: #a9b6c8; margin-bottom: 10px; }
.empty b { display: block; color: var(--ink); font-size: 19px; margin-bottom: 6px; }
.dark .empty b { color: #fff; }
.dark .empty { color: #a9b6c8; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 16px); transform: translateX(-50%); z-index: 60;
  background: #13243a; color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 15px; max-width: 90vw; text-align: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); animation: up .2s;
}
.skeleton { border-radius: 14px; background: linear-gradient(90deg, #eef2f7 0%, #f7f9fc 50%, #eef2f7 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.dark .skeleton { background: linear-gradient(90deg, #13253b 0%, #1a2f48 50%, #13253b 100%); background-size: 200% 100%; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.landing { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 24px; background: var(--dark); color: var(--dark-text); }
.landing .logo { height: 34px; margin: 0 auto 26px; }
.landing p { color: #a9b6c8; max-width: 340px; margin: 12px auto 26px; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; }
.dark .notice { background: rgba(255,255,255,.05); border-color: var(--dark-line); color: #c9d4e3; }
.contact-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--surface); margin-top: 10px; font-weight: 600; word-break: break-word; }
.mt { margin-top: 14px; } .mt-l { margin-top: 22px; }
