﻿/* App-specific styles, on top of tokens.css */
* { box-sizing: border-box; }
html, body, #root { margin: 0; padding: 0; height: 100%; width: 100%; }
body {
  font-family: var(--font-sans);
  color: var(--fg-1);
  background: var(--ya-bg-soft);
  min-height: 100vh;
}

/* ---------- App shell ---------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.app-header {
  position: sticky; top: 0; z-index: 30;
  background: #fff;
  border-bottom: 1px solid var(--ya-line-soft);
}
.app-header-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 12px var(--gutter);
  display: flex; align-items: center; gap: var(--s-5);
}
.app-header-inner .logo { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.app-header-inner .logo img { height: 40px; width: auto; display: block; }
.app-header-inner .product-tag {
  font-size: 13px; color: var(--fg-3);
  border-inline-start: 1px solid var(--ya-line);
  padding-inline-start: 14px; padding-inline-end: 0;
  font-weight: 600;
}
.app-header-inner .product-tag b { color: var(--fg-1); display:block; font-size:14px;}
.app-header-spacer { flex: 1; }
.role-switch {
  display: flex; gap: 4px; background: var(--ya-bg-soft);
  border-radius: var(--r-pill); padding: 4px;
  border: 1px solid var(--ya-line-soft);
}
.role-switch button {
  border: 0; background: transparent;
  padding: 7px 14px; border-radius: var(--r-pill);
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--fg-3); cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.role-switch button.active { background: #fff; color: var(--ya-ink); box-shadow: var(--shadow-1); }

.app-main { flex: 1; width: 100%; }

/* ---------- Buttons (consistent with kit) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 22px;
  border-radius: var(--r-pill);
  font: inherit; font-weight: 700; font-size: 15px;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--dur-base) var(--ease-out);
  white-space: nowrap;
}
.btn-primary { background: var(--ya-red); color: #fff; box-shadow: var(--shadow-pop); }
.btn-primary:hover { background: var(--ya-red-deep); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary { background: #fff; color: var(--ya-ink); border-color: var(--ya-line); }
.btn-secondary:hover { border-color: var(--ya-ink); }
.btn-ghost { background: transparent; color: var(--fg-2); padding: 12px 14px; }
.btn-ghost:hover { color: var(--ya-red); }
.btn-mint { background: var(--ya-mint-deep); color: #fff; }
.btn-mint:hover { background: #2D9286; color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- Welcome ---------- */
.welcome-wrap {
  max-width: 760px; width: 100%; margin-inline: auto;
  padding: clamp(48px, 8vw, 96px) var(--gutter);
  text-align: center;
}
.welcome-eyebrow {
  font-size: 13px; letter-spacing: var(--tracking-caps);
  text-transform: uppercase; color: var(--ya-red);
  font-weight: 700; margin-bottom: var(--s-4);
}
.welcome-wrap h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5.5vw, 60px); font-weight: 800;
  line-height: 1.1; letter-spacing: -0.01em;
  margin: 0 0 var(--s-5);
}
.welcome-sub {
  font-size: 19px; line-height: 1.65; color: var(--fg-2);
  max-width: 620px; margin: 0 auto var(--s-7);
}
.welcome-trust {
  background: var(--ya-bg-cream);
  border: 1px solid #F5E7D2;
  border-radius: var(--r-lg);
  padding: 18px 22px;
  display: flex; gap: 14px; align-items: flex-start;
  text-align: start;
  margin-bottom: var(--s-7);
}
.welcome-trust .icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: #fff; display: flex; align-items: center; justify-content: center;
  color: var(--ya-yellow); flex: 0 0 auto;
  box-shadow: var(--shadow-1);
}
.welcome-trust p { margin: 0; font-size: 15px; line-height: 1.65; color: var(--fg-2); }
.welcome-trust b { color: var(--ya-ink); }
.welcome-divider {
  display: flex; justify-content: center; padding: var(--s-7) 0 0;
}
.welcome-divider img { width: 90px; }

/* ---------- Form ---------- */
.form-wrap {
  max-width: 960px; width: 100%; margin-inline: auto;
  padding: var(--s-7) var(--gutter) var(--s-7);
}
.form-card {
  background: #fff; border: 1px solid var(--ya-line);
  border-radius: var(--r-lg); padding: clamp(24px, 4vw, 40px);
  box-shadow: var(--shadow-1);
}
.form-card h2 { margin: 0 0 var(--s-2); font-family: var(--font-display); }
.form-card .lede { color: var(--fg-3); margin: 0 0 var(--s-6); font-size: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4) var(--s-4); }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; color: var(--fg-2); }
.field input, .field textarea, .field select {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--ya-line); border-radius: var(--r-md);
  font: inherit; font-size: 15px; background: #fff; color: var(--fg-1);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--ya-red);
  box-shadow: 0 0 0 3px rgba(237,76,76,.15);
}
.form-actions {
  display: flex; justify-content: space-between; align-items: center;
  gap: var(--s-3); margin-top: var(--s-6); flex-wrap: wrap;
}
.form-progress {
  display: flex; align-items: center; gap: 10px; margin-bottom: var(--s-5);
  font-size: 13px; color: var(--fg-3);
}
.form-progress .dots { display: flex; gap: 6px; }
.form-progress .dot {
  width: 26px; height: 4px; border-radius: 4px; background: var(--ya-line);
}
.form-progress .dot.done { background: var(--ya-mint-deep); }
.form-progress .dot.cur  { background: var(--ya-red); }

@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- Chat ---------- */
.chat-wrap {
  max-width: 760px; width: 100%; margin-inline: auto;
  padding: var(--s-6) var(--gutter) var(--s-7);
}
.chat-shell {
  background: #fff; border: 1px solid var(--ya-line);
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-1);
  display: flex; flex-direction: column;
  min-height: 560px;
}
.chat-head {
  padding: 16px 20px; border-bottom: 1px solid var(--ya-line-soft);
  display: flex; align-items: center; gap: 12px;
}
.chat-head .avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--ya-pink-soft), var(--ya-yellow-soft));
  display: flex; align-items: center; justify-content: center;
  color: var(--ya-red); font-weight: 800;
}
.chat-head .meta b { display:block; font-size: 15px; }
.chat-head .meta small { color: var(--fg-3); font-size: 12px; }
.chat-head .meta small .live::before {
  content: ""; display:inline-block; width:6px; height:6px;
  border-radius:50%; background: var(--ya-mint-deep);
  margin-inline-end: 6px; vertical-align: middle;
}
.chat-progress {
  margin-inline-start: auto;
  font-size: 13px; color: var(--fg-3); font-weight: 600;
}

.chat-body {
  padding: 20px; flex: 1;
  display: flex; flex-direction: column; gap: 14px;
  background: var(--ya-bg-soft);
  overflow-y: auto;
  max-height: 560px;
}
.bubble {
  max-width: 80%;
  padding: 12px 16px; border-radius: 18px;
  font-size: 15px; line-height: 1.55;
  animation: bubble-in .3s var(--ease-out) both;
}
@keyframes bubble-in { from { opacity:0; transform: translateY(6px);} to {opacity:1; transform: translateY(0);} }
.bubble.bot {
  background: #fff; border: 1px solid var(--ya-line-soft);
  align-self: flex-start; border-start-start-radius: 6px;
  color: var(--fg-1);
}
.bubble.user {
  background: var(--ya-red); color: #fff;
  align-self: flex-end; border-start-end-radius: 6px;
}
.bubble.helper {
  background: var(--ya-bg-cream);
  border: 1px solid #F5E7D2; color: var(--fg-2);
  font-size: 14px; line-height: 1.6;
  align-self: flex-start; max-width: 90%;
}
.bubble.helper b { color: var(--ya-ink); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chip {
  background: #fff; border: 1px solid var(--ya-line);
  border-radius: var(--r-pill); padding: 8px 14px;
  font: inherit; font-size: 13px; color: var(--fg-2);
  cursor: pointer; transition: all var(--dur-fast);
}
.chip:hover { border-color: var(--ya-red); color: var(--ya-red); }
.chip.skip { background: var(--ya-bg-cream); border-color:#F0DCBE; color: var(--fg-2);}

.typing { display: inline-flex; gap: 4px; align-self: flex-start; padding: 12px 16px; }
.typing span {
  width: 7px; height: 7px; border-radius:50%; background: var(--ya-ink-4);
  animation: blink 1.2s infinite both;
}
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,80%,100%{opacity:.2;} 40%{opacity:1;} }

.chat-input {
  display: flex; gap: 8px; padding: 12px 14px;
  border-top: 1px solid var(--ya-line-soft); background: #fff;
}
.chat-input input {
  flex: 1; padding: 12px 14px;
  border: 1px solid var(--ya-line); border-radius: var(--r-pill);
  font: inherit; font-size: 15px;
}
.chat-input input:focus { outline: none; border-color: var(--ya-red); }
.chat-input button {
  border: 0; background: var(--ya-red); color: #fff;
  width: 44px; height: 44px; border-radius: 50%;
  cursor: pointer; font-size: 18px;
}
.chat-input button:disabled { background: var(--ya-line); cursor: not-allowed; }

/* ---------- Processing ---------- */
.proc-wrap {
  max-width: 580px; width: 100%; margin-inline: auto;
  padding: var(--s-9) var(--gutter);
  text-align: center;
}
.proc-orb {
  width: 96px; height: 96px;
  border-radius: 50%; margin: 0 auto var(--s-5);
  background: radial-gradient(circle at 30% 30%, var(--ya-pink-soft), var(--ya-coral) 70%);
  position: relative;
  animation: pulse 1.6s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(237,76,76,0.3);
}
.proc-orb::after {
  content:""; position:absolute; inset:14px;
  border-radius:50%; border:2px dashed rgba(255,255,255,.6);
  animation: spin 4s linear infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(237,76,76,.25); }
  50%     { box-shadow: 0 0 0 18px rgba(237,76,76,0); }
}
@keyframes spin { to { transform: rotate(360deg);} }
.proc-wrap h2 { font-family: var(--font-display); margin-bottom: var(--s-3); }
.proc-wrap > p { color: var(--fg-3); margin-bottom: var(--s-7); }
.proc-steps {
  background: #fff; border: 1px solid var(--ya-line);
  border-radius: var(--r-lg); padding: var(--s-5);
  text-align: start;
  display: flex; flex-direction: column; gap: 12px;
}
.proc-step {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 4px;
  color: var(--fg-3); font-size: 15px;
  transition: color var(--dur-base);
}
.proc-step.active { color: var(--ya-ink); font-weight: 600; }
.proc-step.done { color: var(--fg-2); }
.proc-step .check {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--ya-line);
  font-size: 13px; flex: 0 0 auto;
  transition: all var(--dur-base);
}
.proc-step.active .check {
  border-color: var(--ya-red);
  background: rgba(237,76,76,.1); color: var(--ya-red);
  animation: spin 1s linear infinite;
}
.proc-step.done .check {
  background: var(--ya-mint-deep); border-color: var(--ya-mint-deep);
  color: #fff;
}

/* ---------- Dashboard ---------- */
.dash {
  display: grid; grid-template-columns: 320px 1fr;
  max-width: 1400px; margin: 0 auto;
  gap: var(--s-5); padding: var(--s-5) var(--gutter);
}
.dash-h1 {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 700; margin: 0 0 4px;
}
.dash-sub { color: var(--fg-3); font-size: 14px; margin: 0 0 var(--s-5); }

.metrics { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: var(--s-5); }
.metric {
  background: #fff; border: 1px solid var(--ya-line);
  border-radius: var(--r-md); padding: 14px 16px;
}
.metric .lbl { font-size: 12px; color: var(--fg-3); margin-bottom: 6px; }
.metric .num { font-family: var(--font-display); font-size: 30px; font-weight: 800; color: var(--ya-ink); line-height:1; }
.metric .delta { font-size:11px; color: var(--ya-mint-deep); margin-top: 6px; font-weight: 600; }
.metric.warn .num { color: var(--ya-red); }

.dash-cols { display: grid; grid-template-columns: 320px 1fr; gap: var(--s-5); align-items: flex-start; }

.cand-list {
  background: #fff; border: 1px solid var(--ya-line);
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-1);
  position: sticky; top: 80px;
}
.cand-list-head {
  padding: 14px 16px; border-bottom: 1px solid var(--ya-line-soft);
  display: flex; align-items: center; justify-content: space-between;
}
.cand-list-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.cand-list-head .count {
  background: var(--ya-pink-soft); color: var(--ya-red);
  font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: var(--r-pill);
}
.cand-search {
  padding: 10px 12px; border-bottom: 1px solid var(--ya-line-soft);
}
.cand-search input {
  width: 100%; padding: 8px 12px;
  border: 1px solid var(--ya-line-soft); border-radius: var(--r-pill);
  font: inherit; font-size: 13px; background: var(--ya-bg-soft);
}
.cand-search input:focus { outline: none; border-color: var(--ya-red); background: #fff; }

.cand-card {
  padding: 14px 16px; border-bottom: 1px solid var(--ya-line-soft);
  cursor: pointer; transition: background var(--dur-fast);
  border-inline-start: 3px solid transparent;
}
.cand-card:hover { background: var(--ya-bg-soft); }
.cand-card.active { background: #fff; border-inline-start-color: var(--ya-red); }
.cand-card .row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.cand-card .name { font-weight: 700; font-size: 15px; }
.cand-card .meta { font-size: 12px; color: var(--fg-3); margin-top: 2px; }
.cand-card .biz { font-size: 13px; color: var(--fg-2); margin-top: 6px; }
.cand-card .badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; padding: 3px 8px;
  border-radius: var(--r-pill); white-space: nowrap;
}
.tag-stage   { background: var(--ya-bg-cream); color: #8B5A1F; }
.tag-track   { background: rgba(56,181,162,.12); color: var(--ya-mint-deep); }
.tag-risk    { background: var(--ya-pink-soft); color: var(--ya-red); }
.tag-risk.low{ background: rgba(56,181,162,.12); color: var(--ya-mint-deep); }
.tag-risk.warn { background: rgba(249,182,1,.18); color: #8E6300; }
.tag-econ.pass { background: rgba(56,181,162,.12); color: var(--ya-mint-deep); }
.tag-econ.exception { background: rgba(249,182,1,.18); color: #8E6300; }
.tag-econ.fail { background: var(--ya-pink-soft); color: var(--ya-red); }
.tag-status  { background: var(--ya-line-soft); color: var(--fg-2); }

/* ---------- Candidate panel ---------- */
.panel {
  background: #fff; border: 1px solid var(--ya-line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-1);
  overflow: hidden;
}
.panel-head {
  padding: var(--s-5) var(--s-6);
  border-bottom: 1px solid var(--ya-line-soft);
  background:
    radial-gradient(800px 200px at 100% -20%, rgba(251,196,210,.4), transparent),
    #fff;
}
.panel-head .top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--s-4); flex-wrap: wrap;
}
.panel-head .who { display: flex; gap: 16px; align-items: center; }
.panel-head .ava {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--ya-coral), var(--ya-yellow));
  display:flex; align-items:center; justify-content:center;
  color: #fff; font-weight: 800; font-size: 22px;
}
.panel-head h2 {
  margin: 0; font-family: var(--font-display);
  font-size: 26px; font-weight: 700;
}
.panel-head .who-meta { font-size: 13px; color: var(--fg-3); margin-top: 2px;}
.panel-head .who-meta b { color: var(--fg-2); }

.panel-summary {
  display: grid; grid-template-columns: 1fr 1.3fr 1fr 1fr; gap: 0;
  margin-top: var(--s-5);
  border: 1px solid var(--ya-line-soft);
  border-radius: var(--r-md); overflow: hidden;
  background: var(--ya-bg-soft);
}
.panel-summary > div { padding: 12px 16px; border-inline-end: 1px solid var(--ya-line-soft); }
.panel-summary > div:last-child { border-inline-end: 0; }
.panel-summary .lbl { font-size: 11px; color: var(--fg-3); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; font-weight: 700; }
.panel-summary .val { font-size: 14px; font-weight: 600; color: var(--fg-1); }
.panel-summary .econ-inline.pass { color: var(--ya-mint-deep); }
.panel-summary .econ-inline.exception { color: #8E6300; }
.panel-summary .econ-inline.fail { color: var(--ya-red); }

@media (max-width: 720px) { .panel-summary { grid-template-columns: 1fr; } .panel-summary > div { border-inline-end: 0; border-bottom: 1px solid var(--ya-line-soft); }}

.ai-banner {
  display: flex; align-items: flex-start; gap: 12px;
  margin-top: var(--s-5);
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(249,182,1,.10), rgba(249,182,1,.05));
  border: 1px solid rgba(249,182,1,.4);
  border-radius: var(--r-md);
}
.ai-banner .icon {
  width: 32px; height: 32px; border-radius:50%;
  background: var(--ya-yellow); color: var(--ya-ink);
  display:flex; align-items:center; justify-content:center;
  flex: 0 0 auto;
}
.ai-banner .text b { color: var(--ya-ink); display:block; font-size: 14px; }
.ai-banner .text small { color: var(--fg-2); font-size: 13px; line-height: 1.5; }
.ai-banner .conf {
  margin-inline-start: auto;
  text-align: end;
  font-size: 12px;
}
.ai-banner .conf b { font-family: var(--font-display); font-size: 22px; color: var(--ya-mint-deep); display:block; line-height:1; }
.ai-banner .conf small { color: var(--fg-3); }

.sensitive-flag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--ya-pink-soft); color: var(--ya-red);
  font-weight: 700; font-size: 12px; padding: 4px 10px;
  border-radius: var(--r-pill);
}
.sensitive-flag.sticky { background: #FFF1E6; color: #B45309; border:1px solid #F8D49C; }

.economic-panel {
  margin-top: var(--s-5);
  border: 1px solid var(--ya-line);
  border-radius: var(--r-md);
  background: #fff;
  overflow: hidden;
}
.economic-panel.pass { border-color: rgba(56,181,162,.35); }
.economic-panel.exception { border-color: rgba(249,182,1,.45); }
.economic-panel.fail { border-color: rgba(237,76,76,.35); }
.economic-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 14px 16px;
  background: var(--ya-bg-soft);
  border-bottom: 1px solid var(--ya-line-soft);
}
.economic-head b { display: block; font-size: 15px; color: var(--ya-ink); }
.economic-head small { display: block; margin-top: 3px; color: var(--fg-3); font-size: 12px; }
.economic-status {
  padding: 4px 10px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 800; white-space: nowrap;
}
.economic-panel.pass .economic-status { background: rgba(56,181,162,.15); color: var(--ya-mint-deep); }
.economic-panel.exception .economic-status { background: rgba(249,182,1,.18); color: #8E6300; }
.economic-panel.fail .economic-status { background: var(--ya-pink-soft); color: var(--ya-red); }
.economic-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0; border-bottom: 1px solid var(--ya-line-soft);
}
.economic-grid > div {
  padding: 14px 16px;
  border-inline-end: 1px solid var(--ya-line-soft);
}
.economic-grid > div:last-child { border-inline-end: 0; }
.economic-grid .lbl {
  display: block; margin-bottom: 4px;
  color: var(--fg-3); font-size: 12px; font-weight: 700;
}
.economic-grid strong {
  font-family: var(--font-display);
  font-size: 23px; color: var(--ya-ink);
}
.economic-meter {
  height: 8px;
  margin: 14px 16px 0;
  background: var(--ya-line-soft);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.economic-meter > div {
  height: 100%;
  background: var(--ya-mint-deep);
}
.economic-panel.exception .economic-meter > div { background: var(--ya-yellow); }
.economic-panel.fail .economic-meter > div { background: var(--ya-red); }
.economic-sources {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 16px;
}
.economic-source {
  padding: 10px 12px;
  background: var(--ya-bg-soft);
  border: 1px solid var(--ya-line-soft);
  border-radius: var(--r-md);
  font-size: 13px;
}
.economic-source span { color: var(--fg-3); display: block; margin-bottom: 3px; }
.economic-source b { color: var(--ya-ink); }
.economic-source small { display: block; color: var(--fg-3); margin-top: 3px; line-height: 1.4; }
.economic-exceptions {
  margin: 0 16px 12px;
  padding: 10px 12px;
  background: rgba(249,182,1,.10);
  border: 1px solid rgba(249,182,1,.35);
  border-radius: var(--r-md);
  font-size: 13px; color: #785500;
}
.economic-panel p {
  margin: 0;
  padding: 0 16px 14px;
  color: var(--fg-3);
  font-size: 12px;
  line-height: 1.55;
}

.panel-body { padding: var(--s-5) var(--s-6); display: flex; flex-direction: column; gap: var(--s-5);}
.section h3 {
  margin: 0 0 var(--s-3);
  font-size: 13px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--ya-red);
  display: flex; align-items: center; gap: 8px;
}
.section h3 .num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--ya-pink-soft); color: var(--ya-red);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
}
.summary-card {
  border: 1px solid var(--ya-line);
  border-radius: var(--r-md); padding: 16px 18px;
  background: #fff; line-height: 1.7;
  font-size: 15px; color: var(--fg-2);
}
.summary-card.editing { background: var(--ya-bg-cream); border-color:#F0DCBE;}
.summary-card textarea {
  width:100%; min-height: 140px;
  border: 1px solid var(--ya-line); border-radius: var(--r-md);
  padding: 12px; font: inherit; font-size: 15px; line-height: 1.7;
  resize: vertical;
}
.summary-edit-actions { display:flex; gap: 8px; margin-top: 10px;}

.bullets { list-style: none; padding: 0; margin: 0; display:flex; flex-direction: column; gap: 8px; }
.bullets li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px;
  background: #fff; border: 1px solid var(--ya-line-soft); border-radius: var(--r-md);
  font-size: 14px; color: var(--fg-2);
}
.bullets li::before {
  content:""; width: 7px; height: 7px; border-radius:50%;
  background: var(--ya-mint-deep); margin-top: 8px; flex: 0 0 auto;
}
.bullets.missing li::before { background: var(--ya-yellow); }

.track-card {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(80,248,205,.18), rgba(56,181,162,.08));
  border: 1px solid rgba(56,181,162,.35);
  border-radius: var(--r-md);
}
.track-card .badge {
  background: var(--ya-mint-deep); color: #fff;
  font-size: 12px; font-weight: 700; padding: 4px 10px;
  border-radius: var(--r-pill); white-space: nowrap;
}
.track-card .body b { display:block; font-size: 18px; margin-bottom: 4px; }
.track-card .body p { margin: 0; font-size: 14px; color: var(--fg-2); line-height: 1.6; }

.followup-card {
  border: 1px dashed var(--ya-coral);
  background: #FFF8F8;
  border-radius: var(--r-md);
  padding: 16px 18px;
  display: flex; gap: 14px; align-items: flex-start;
}
.followup-card .q { font-style: italic; font-size: 15px; line-height: 1.6; color: var(--fg-1); flex: 1; }

.checklist { list-style:none; padding:0; margin:0; display:flex; flex-direction: column; gap: 8px; }
.checklist li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: #fff; border: 1px solid var(--ya-line-soft); border-radius: var(--r-md);
  cursor: pointer; transition: all var(--dur-fast);
  font-size: 14px;
}
.checklist li:hover { border-color: var(--ya-line); }
.checklist li.checked { background: var(--ya-bg-soft); color: var(--fg-3); text-decoration: line-through; }
.checklist .box {
  width: 20px; height: 20px; border-radius: 6px;
  border: 1.5px solid var(--ya-line); flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: #fff; color: #fff; font-size: 12px;
  transition: all var(--dur-fast);
}
.checklist li.checked .box { background: var(--ya-mint-deep); border-color: var(--ya-mint-deep); }

.panel-footer {
  padding: var(--s-5) var(--s-6);
  border-top: 1px solid var(--ya-line-soft);
  background: var(--ya-bg-soft);
  display: flex; flex-wrap: wrap; gap: 10px;
}
.panel-footer .group-label {
  width: 100%; font-size: 12px; color: var(--fg-3); text-transform: uppercase;
  letter-spacing: .08em; font-weight: 700; margin-bottom: 4px;
}

/* ---------- Confidence breakdown ---------- */
.conf-panel {
  margin-top: var(--s-5);
  border: 1px solid var(--ya-line);
  border-radius: var(--r-md);
  background: #fff;
  overflow: hidden;
}
.conf-head {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: linear-gradient(180deg, var(--ya-bg-soft), #fff);
  border-bottom: 1px solid var(--ya-line-soft);
  cursor: pointer;
}
.conf-title { flex: 1; display: flex; align-items: center; gap: 12px; }
.conf-title b { display:block; font-size: 14px; }
.conf-title small { color: var(--fg-3); font-size: 12px; }
.conf-chip {
  background: var(--ya-mint-deep); color:#fff;
  font-family: var(--font-display); font-weight: 800;
  font-size: 16px; padding: 4px 10px;
  border-radius: var(--r-pill);
}
.conf-toggle {
  border: 0; background: transparent; cursor: pointer;
  font-size: 22px; color: var(--fg-3);
  width: 28px; height: 28px; border-radius: 50%;
}
.conf-toggle:hover { background: var(--ya-line-soft); color: var(--ya-ink); }
.conf-meter-bg { fill: none; stroke: var(--ya-line-soft); stroke-width: 3.2; }
.conf-meter-fg {
  fill: none; stroke: var(--ya-mint-deep); stroke-width: 3.2;
  stroke-linecap: round;
  transition: stroke-dasharray .8s var(--ease-out);
}
.conf-meter-num {
  font-family: var(--font-display); font-weight: 800;
  font-size: 9px; fill: var(--ya-ink);
}
.conf-list {
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 14px;
}
.conf-row { padding-bottom: 12px; border-bottom: 1px dashed var(--ya-line-soft); }
.conf-row:last-child { border-bottom: 0; padding-bottom: 0; }
.conf-row-top { display:flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.conf-label b { font-size: 14px; color: var(--ya-ink); }
.conf-weight {
  font-size: 11px; color: var(--fg-3);
  margin-inline-start: 8px;
  background: var(--ya-line-soft); padding: 2px 8px; border-radius: var(--r-pill);
}
.conf-row-score { display: flex; align-items: center; gap: 8px; }
.conf-pill {
  font-family: var(--font-display); font-weight: 800;
  font-size: 16px; min-width: 38px; text-align: center;
  padding: 2px 10px; border-radius: var(--r-pill);
  background: var(--ya-bg-soft); color: var(--ya-ink);
  border: 1px solid var(--ya-line);
}
.conf-tag {
  font-size: 11px; font-weight: 700; padding: 3px 8px;
  border-radius: var(--r-pill);
}
.tier-high .conf-pill { background: rgba(56,181,162,.15); color: var(--ya-mint-deep); border-color: rgba(56,181,162,.4); }
.tier-high .conf-tag  { background: rgba(56,181,162,.15); color: var(--ya-mint-deep); }
.tier-mid  .conf-pill { background: rgba(249,182,1,.18);  color: #8E6300;            border-color: rgba(249,182,1,.4); }
.tier-mid  .conf-tag  { background: rgba(249,182,1,.18);  color: #8E6300; }
.tier-low  .conf-pill { background: var(--ya-pink-soft);  color: var(--ya-red);      border-color: rgba(237,76,76,.3); }
.tier-low  .conf-tag  { background: var(--ya-pink-soft);  color: var(--ya-red); }

.conf-bar {
  height: 6px; background: var(--ya-line-soft);
  border-radius: var(--r-pill); overflow: hidden;
}
.conf-bar-fill {
  height: 100%; border-radius: var(--r-pill);
  background: var(--ya-mint-deep);
  transition: width .8s var(--ease-out);
}
.tier-mid .conf-bar-fill  { background: var(--ya-yellow); }
.tier-low .conf-bar-fill  { background: var(--ya-red); }
.conf-note {
  margin-top: 8px; font-size: 13px; color: var(--fg-3);
  line-height: 1.5;
}
.conf-foot {
  padding: 10px 16px;
  background: var(--ya-bg-soft);
  border-top: 1px solid var(--ya-line-soft);
  font-size: 12px; color: var(--fg-3);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(31,31,31,.55);
  display: flex; align-items: center; justify-content: center;
  padding: var(--s-5); z-index: 100;
  animation: fade .2s var(--ease-out);
}
@keyframes fade { from{opacity:0;} to{opacity:1;}}
.modal {
  background: #fff; border-radius: var(--r-lg);
  max-width: 520px; width: 100%;
  box-shadow: var(--shadow-3);
  overflow: hidden;
  animation: pop .25s var(--ease-out);
}
@keyframes pop { from {transform: translateY(8px) scale(.98); opacity: 0;} to {transform: translateY(0) scale(1); opacity:1;}}
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--ya-line-soft); display:flex; justify-content: space-between; align-items: center; }
.modal-head h3 { margin: 0; font-size: 18px;}
.modal-head .x { border: 0; background: transparent; font-size: 22px; cursor: pointer; color: var(--fg-3); }
.modal-body { padding: 22px; }
.wa-preview {
  background: #ECE5DD; border-radius: var(--r-md);
  padding: 16px; min-height: 200px;
  display: flex; flex-direction: column; gap: 8px;
}
.wa-bubble {
  background: #DCF8C6; padding: 10px 14px;
  border-radius: 12px; max-width: 92%;
  font-size: 14px; line-height: 1.55; align-self: flex-end;
  position: relative;
  box-shadow: 0 1px 1px rgba(0,0,0,.1);
}
.wa-bubble small { display:block; text-align: end; font-size: 11px; color: #667781; margin-top: 4px; }
.wa-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.wa-meta .av { width: 32px; height: 32px; border-radius:50%; background: var(--ya-mint-deep); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size: 13px; }
.wa-meta b { font-size: 14px; }
.wa-meta small { font-size: 12px; color: var(--fg-3); }
.modal-actions {
  padding: 14px 22px; border-top: 1px solid var(--ya-line-soft);
  display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
  background: var(--ya-bg-soft);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 28px; inset-inline-start: 50%;
  transform: translateX(-50%);
  background: var(--ya-ink); color: #fff;
  padding: 14px 22px; border-radius: var(--r-pill);
  font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-3);
  display: inline-flex; align-items: center; gap: 10px;
  z-index: 200;
  animation: toast-in .3s var(--ease-out);
}
[dir="rtl"] .toast { transform: translateX(50%); }
@keyframes toast-in { from {opacity:0; transform: translateX(50%) translateY(8px);} to {opacity:1; transform: translateX(50%) translateY(0);} }
.toast .ok {
  width: 22px; height: 22px; border-radius:50%;
  background: var(--ya-mint-deep); color:#fff;
  display:flex; align-items:center; justify-content:center; font-size: 12px;
}

/* ---------- Responsive dashboard ---------- */
@media (max-width: 980px) {
  .dash-cols { grid-template-columns: 1fr; }
  .cand-list { position: static; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .economic-sources { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .economic-grid,
  .economic-sources { grid-template-columns: 1fr; }
  .economic-grid > div { border-inline-end: 0; border-bottom: 1px solid var(--ya-line-soft); }
  .economic-grid > div:last-child { border-bottom: 0; }
}
