:root {
  color-scheme: light;
  --bg: var(--vkui--color_background, #eef2f7);
  --card: var(--vkui--color_background_content, #ffffff);
  --card-soft: var(--vkui--color_background_secondary, #f4f7fa);
  --text: var(--vkui--color_text_primary, #172033);
  --muted: var(--vkui--color_text_secondary, #69788f);
  --line: rgba(82, 104, 135, .17);
  --accent: #087ea4;
  --accent-2: #1eaa7a;
  --accent-soft: rgba(8, 126, 164, .10);
  --warning: #a66008;
  --warning-soft: #fff5e4;
  --danger: #c44754;
  --shadow: 0 16px 44px rgba(31, 48, 73, .11);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: var(--vkui--color_background, #09111e);
    --card: var(--vkui--color_background_content, #111d2f);
    --card-soft: var(--vkui--color_background_secondary, #17253a);
    --text: var(--vkui--color_text_primary, #f4f7fb);
    --muted: var(--vkui--color_text_secondary, #9aabc1);
    --line: rgba(158, 179, 207, .16);
    --accent: #39c4df;
    --accent-2: #48d69f;
    --accent-soft: rgba(57, 196, 223, .11);
    --warning: #ffc46e;
    --warning-soft: rgba(255, 196, 110, .09);
    --danger: #ff8b96;
    --shadow: 0 18px 55px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  background:
    radial-gradient(circle at 8% -4%, rgba(57, 196, 223, .13), transparent 22rem),
    radial-gradient(circle at 105% 18%, rgba(72, 214, 159, .10), transparent 24rem),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-shell {
  width: min(100%, 640px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: var(--safe-top) 14px calc(18px + var(--safe-bottom));
}

.topbar {
  min-height: 62px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 5;
  padding-top: 4px;
  background: linear-gradient(var(--bg) 72%, transparent);
}

.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #031319;
  font-size: 23px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.brand strong, .brand small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand strong { font-size: 14px; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 1px; }

.privacy-badge {
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 10px;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: var(--card);
  cursor: pointer;
  font-size: 22px;
}

.hidden { visibility: hidden !important; pointer-events: none !important; }

.progress-track {
  height: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--line);
  margin: 0 2px 18px;
}
.progress-track span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .25s ease;
}

#screen { min-height: calc(100dvh - 150px - var(--safe-top) - var(--safe-bottom)); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: clamp(20px, 5vw, 30px);
  animation: appear .18s ease-out;
}

@keyframes appear {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

.hero { padding-top: clamp(28px, 8vh, 72px); }
.hero-orbit {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  margin-bottom: 28px;
  color: #071820;
  font-size: 39px;
  font-weight: 950;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 36px rgba(24, 178, 172, .22);
}

.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .13em;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin: 9px 0 14px; font-size: clamp(34px, 10vw, 53px); line-height: .98; letter-spacing: -.055em; }
h2 { margin: 8px 0 10px; font-size: clamp(25px, 7vw, 34px); line-height: 1.08; letter-spacing: -.035em; }
h3 { margin-bottom: 9px; font-size: 17px; }
.lead { color: var(--muted); font-size: 16px; line-height: 1.5; }
.fine { color: var(--muted); font-size: 12px; line-height: 1.45; }
.section-note { color: var(--muted); line-height: 1.45; margin-bottom: 18px; }

.trust-row { display: grid; gap: 8px; margin: 22px 0; }
.trust-item { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: 13px; line-height: 1.4; }
.trust-item b { color: var(--text); }
.trust-icon { width: 25px; flex: 0 0 25px; text-align: center; }

.primary, .secondary, .choice, .text-button {
  width: 100%;
  min-height: 50px;
  border-radius: 15px;
  cursor: pointer;
}

.primary {
  border: 0;
  padding: 13px 18px;
  color: #04151b;
  font-weight: 850;
  background: linear-gradient(105deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 28px rgba(29, 173, 169, .18);
}
.primary:disabled { opacity: .48; cursor: wait; }

.secondary {
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--card-soft);
  padding: 12px 16px;
  font-weight: 750;
}

.text-button { border: 0; color: var(--accent); background: transparent; padding: 8px; }

.field-label { display: block; font-weight: 760; margin-bottom: 8px; }
.field-help { display: block; color: var(--muted); font-size: 12px; margin-top: 7px; line-height: 1.4; }
input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 15px;
  outline: 0;
  color: var(--text);
  background: var(--card-soft);
  padding: 13px 15px;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.form-actions { display: grid; gap: 10px; margin-top: 18px; }
.choice-list { display: grid; gap: 10px; margin-top: 18px; }
.choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  padding: 14px 15px;
  color: var(--text);
  background: var(--card-soft);
  text-align: left;
}
.choice:hover, .choice:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.choice strong { display: block; line-height: 1.25; }
.choice small { display: block; color: var(--muted); margin-top: 4px; line-height: 1.3; }
.choice .arrow { color: var(--accent); font-size: 21px; }
.choice.compact { min-height: 45px; padding: 11px 14px; }

.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.choice-grid .choice { display: block; min-height: 76px; }

.message {
  margin-top: 14px;
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  padding: 11px 13px;
  color: var(--muted);
  background: var(--accent-soft);
  font-size: 13px;
  line-height: 1.45;
}
.message.warning { border-left-color: var(--warning); background: var(--warning-soft); color: var(--text); }
.message.error { border-left-color: var(--danger); color: var(--danger); }

.loading { min-height: 56vh; display: grid; place-items: center; text-align: center; color: var(--muted); }
.spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 16px;
  border: 4px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.salary-hero {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid rgba(8, 126, 164, .28);
  border-radius: 19px;
  background: linear-gradient(145deg, var(--accent-soft), transparent);
}
.salary-hero small { color: var(--muted); }
.salary-hero strong { display: block; font-size: clamp(31px, 9vw, 45px); letter-spacing: -.04em; margin-top: 3px; }
.salary-hero span { display: block; margin-top: 5px; color: var(--muted); font-size: 13px; }

.band {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 7px;
  align-items: center;
  margin: 13px 0 18px;
}
.band-box { border: 1px solid var(--line); border-radius: 13px; padding: 11px; background: var(--card-soft); }
.band-box small, .metric small { display: block; color: var(--muted); margin-bottom: 4px; }
.band-box strong { font-size: 17px; }
.band-separator { color: var(--muted); }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0; }
.metric { padding: 12px 9px; border-radius: 14px; background: var(--card-soft); }
.metric strong { display: block; font-size: 20px; }
.metric small { font-size: 10px; line-height: 1.2; }

.plain-list { margin: 8px 0 0; padding-left: 20px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.source-list { display: grid; gap: 8px; margin-top: 10px; }
.source-proof {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 10px 11px;
  color: var(--text);
  background: var(--card-soft);
  font-size: 12px;
  text-decoration: none;
}
.source-proof span { min-width: 0; }
.source-proof b, .source-proof small { display: block; }
.source-proof small { margin-top: 3px; color: var(--muted); line-height: 1.35; }
.source-proof em { flex: 0 0 auto; color: var(--accent-2); font-size: 10px; font-style: normal; }
.source-proof.primary-source { border-color: rgba(8, 126, 164, .4); background: var(--accent-soft); }

.result-section { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 18px; }
.human-result { font-size: 16px; line-height: 1.48; }
.confidence { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.confidence::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--warning); }
.confidence.high::before { background: var(--accent-2); }
.confidence.low::before { background: var(--danger); }

details { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
summary { cursor: pointer; color: var(--muted); font-size: 13px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + var(--safe-bottom));
  z-index: 20;
  transform: translate(-50%, 20px);
  width: min(calc(100% - 28px), 520px);
  padding: 12px 14px;
  border-radius: 13px;
  color: #fff;
  background: rgba(14, 24, 39, .94);
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
  text-align: center;
  font-size: 13px;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.app-footer { color: var(--muted); font-size: 10px; line-height: 1.45; padding: 18px 10px 4px; text-align: center; }

@media (max-width: 380px) {
  .app-shell { padding-left: 10px; padding-right: 10px; }
  .card { padding: 18px; border-radius: 20px; }
  .choice-grid { grid-template-columns: 1fr; }
  .metrics { gap: 5px; }
  .metric strong { font-size: 17px; }
}

@media (min-width: 700px) {
  .app-shell { padding-left: 20px; padding-right: 20px; }
  .card { margin-top: 12px; }
}

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