/* Wi Тендеры — в стиле сайта Workintelligence: угольный фон, серебро, Inter + Cormorant Garamond. */
:root {
  --bg: #080808;
  --panel: rgba(255, 255, 255, 0.025);
  --panel-2: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #f5f5f5;
  --muted: #9a9a9a;
  --mist: #c9c9c9;
  --high: #ff8a80;
  --high-bg: rgba(255, 82, 82, 0.1);
  --mid: #ffd27a;
  --mid-bg: rgba(255, 196, 0, 0.08);
  --low: #8fd3ff;
  --low-bg: rgba(64, 170, 255, 0.08);
  --ok: #8ee6b0;
  --ok-bg: rgba(60, 220, 130, 0.08);
  --radius: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(1200px 600px at 15% -10%, rgba(255, 255, 255, 0.045), transparent 60%), radial-gradient(900px 500px at 100% 0%, rgba(255, 255, 255, 0.03), transparent 55%);
  background-attachment: fixed;
  color: var(--text);
  font: 14px/1.55 Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: rgba(255, 255, 255, 0.85); color: #000; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 500; }
.display { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 500; letter-spacing: 0.01em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace; }
.hidden { display: none !important; }

/* ---------- Кнопки и поля ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-2); background: transparent; color: var(--text);
  padding: 10px 18px; border-radius: 999px; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none;
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s, opacity 0.2s;
}
.btn:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.25); }
.btn-primary { background: #fff; color: #000; border-color: #fff; }
.btn-primary:hover { background: #e9e9e9; box-shadow: 0 0 24px rgba(255, 255, 255, 0.16); }
.btn-mini { padding: 6px 12px; font-size: 12px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn-ghost { border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); }

input, textarea, select {
  width: 100%; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 14px; color: var(--text); font: inherit; outline: none; transition: border-color 0.25s, background 0.25s;
}
input:focus, textarea:focus { border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.05); }
::placeholder { color: rgba(255, 255, 255, 0.28); }
label.field { display: block; }
label.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }

/* ---------- Каркас ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 12px 24px; border-bottom: 1px solid var(--line); background: rgba(8, 8, 8, 0.82); backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 8px; }
.brand b { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 22px; font-weight: 600; letter-spacing: 0.02em; }
.brand span { color: var(--muted); font-size: 13px; }
.topbar .spacer { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; color: var(--mist); white-space: nowrap; }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.chip.warn .dot { background: var(--mid); box-shadow: 0 0 8px var(--mid); }

.layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; max-width: 1360px; margin: 0 auto; padding: 24px; }
.sidebar { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 100px); display: flex; flex-direction: column; gap: 12px; }
.sidebar .list { overflow: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 2px; }
.titem { text-align: left; width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; font: inherit; transition: border-color 0.2s, background 0.2s; }
.titem:hover { border-color: var(--line-2); }
.titem.active { border-color: rgba(255, 255, 255, 0.35); background: var(--panel-2); }
.titem .t { font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.titem .m { display: flex; gap: 8px; align-items: center; margin-top: 6px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }

.panel { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 22px; box-shadow: 0 24px 80px -32px rgba(0, 0, 0, 0.9); }
.panel + .panel { margin-top: 16px; }
.panel h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin-bottom: 14px; font-weight: 500; }
.panel.narrow { max-width: 460px; }
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.center-page h1 { font-size: 34px; margin-bottom: 8px; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

/* ---------- Новый разбор ---------- */
.hero h1 { font-size: 40px; line-height: 1.1; margin-bottom: 8px; }
.hero p { margin: 0 0 18px; color: var(--mist); max-width: 720px; }
.drop {
  border: 1.5px dashed var(--line-2); border-radius: var(--radius); padding: 34px 20px; text-align: center; cursor: pointer;
  transition: border-color 0.25s, background 0.25s; background: rgba(255, 255, 255, 0.015);
}
.drop:hover, .drop.over { border-color: rgba(255, 255, 255, 0.45); background: rgba(255, 255, 255, 0.04); }
.drop .big { font-size: 16px; font-weight: 500; }
.files { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.file { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; }
.file .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file.bad { border-color: rgba(255, 138, 128, 0.35); }
.file.bad .s { color: var(--high); }
.file .x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; padding: 0 4px; }
details.paste summary { cursor: pointer; color: var(--muted); margin-top: 14px; }
details.paste textarea { margin-top: 10px; min-height: 140px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.feature { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.feature b { display: block; margin-bottom: 4px; font-weight: 500; }

/* ---------- Прогресс ---------- */
.progress { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.06); overflow: hidden; margin: 14px 0 8px; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, #fff, #9a9a9a); border-radius: 99px; transition: width 0.6s; }
.shimmer { background: linear-gradient(90deg, rgba(255,255,255,0.03), rgba(255,255,255,0.09), rgba(255,255,255,0.03)); background-size: 200% 100%; animation: sh 1.8s linear infinite; border-radius: 10px; height: 14px; margin: 10px 0; }
@keyframes sh { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Разбор ---------- */
.head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; }
.head h1 { font-size: 30px; line-height: 1.15; max-width: 820px; word-break: break-word; }
.verdict { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: center; }
.ring { width: 112px; height: 112px; position: relative; }
.ring svg { transform: rotate(-90deg); }
.ring .v { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .v b { font-size: 30px; font-weight: 500; display: block; line-height: 1; }
.ring .v span { font-size: 11px; color: var(--muted); }
.decision { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 28px; line-height: 1.15; margin-bottom: 8px; }
.decision.go { color: var(--ok); } .decision.care { color: var(--mid); } .decision.no { color: var(--high); }
.summary { color: var(--mist); margin: 0 0 8px; }
.reasons { margin: 0; padding-left: 18px; color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.kpi { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--panel); min-width: 0; }
.kpi span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 6px; }
.kpi b { font-weight: 500; font-size: 17px; word-break: break-word; }
.kpi i { display: block; font-style: normal; font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi.alert b { color: var(--mid); }

.facts { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 0; }
.facts div { padding: 9px 0; border-bottom: 1px solid var(--line); }
.facts div:nth-child(odd) { color: var(--muted); padding-right: 12px; }
.facts div:nth-last-child(-n + 2) { border-bottom: 0; }

.risk { border: 1px solid var(--line); border-left: 3px solid var(--low); border-radius: 12px; padding: 14px 16px; background: var(--low-bg); }
.risk + .risk { margin-top: 10px; }
.risk.high { border-left-color: var(--high); background: var(--high-bg); }
.risk.medium { border-left-color: var(--mid); background: var(--mid-bg); }
.risk .rt { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; }
.risk .rt b { font-weight: 500; font-size: 15px; }
.sev { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; padding: 2px 8px; border-radius: 99px; border: 1px solid currentColor; white-space: nowrap; }
.sev.high { color: var(--high); } .sev.medium { color: var(--mid); } .sev.low { color: var(--low); }
.risk p { margin: 6px 0 0; color: var(--mist); }
.quote { margin: 10px 0 0; padding: 8px 12px; border-left: 2px solid var(--line-2); color: var(--muted); font-size: 13px; background: rgba(0, 0, 0, 0.25); border-radius: 0 8px 8px 0; }
.quote cite { display: block; font-style: normal; font-size: 11px; margin-top: 4px; opacity: 0.8; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.filters button.on { background: #fff; color: #000; border-color: #fff; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .d { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13px; }
.timeline .past { opacity: 0.5; }
.timeline .soon .d { color: var(--mid); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button.on { background: #fff; color: #000; border-color: #fff; }
ul.clean { margin: 0; padding-left: 18px; }
ul.clean li { margin: 5px 0; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.check:last-child { border-bottom: 0; }
.check input { width: 18px; height: 18px; margin-top: 1px; accent-color: #fff; flex: none; }
.check.done .cn { text-decoration: line-through; color: var(--muted); }
.tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; margin-left: 6px; white-space: nowrap; }

.chat { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.msg { padding: 12px 14px; border-radius: 12px; white-space: pre-wrap; word-break: break-word; }
.msg.q { align-self: flex-end; background: #fff; color: #000; max-width: 85%; }
.msg.a { border: 1px solid var(--line); background: var(--panel); }
.msg .src { font-size: 11px; color: var(--muted); margin-top: 6px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.ask { display: flex; gap: 8px; }
.ask input { flex: 1; }

.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal .panel { width: min(760px, 100%); max-height: 90vh; display: flex; flex-direction: column; }
.modal textarea { min-height: 360px; flex: 1; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 13px; }
#profileForm textarea { min-height: 64px; flex: none; font-family: inherit; font-size: 14px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #fff; color: #000; padding: 10px 18px; border-radius: 99px; z-index: 60; box-shadow: 0 10px 40px rgba(0,0,0,0.6); max-width: calc(100% - 32px); }
.toast.err { background: var(--high); }
.empty { text-align: center; padding: 36px 12px; color: var(--muted); }
.banner { border: 1px solid rgba(255, 210, 122, 0.35); background: var(--mid-bg); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; color: var(--mist); }

/* ---------- Проверка под компанию и расчёт выгоды ---------- */
.pcheck { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pcheck:last-child { border-bottom: 0; }
.pcheck i { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 600; }
.pcheck.ok i { background: var(--ok-bg); color: var(--ok); border: 1px solid var(--ok); }
.pcheck.warn i { background: var(--mid-bg); color: var(--mid); border: 1px solid var(--mid); }
.pcheck.fail i { background: var(--high-bg); color: var(--high); border: 1px solid var(--high); }
.fin { display: grid; grid-template-columns: 2fr repeat(3, 1fr) 1.6fr; gap: 12px; align-items: end; }
.fin-out { margin-top: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv span { color: var(--muted); }
.kv b { font-weight: 500; text-align: right; }
.kv.big b { font-size: 17px; }
.kv.good b { color: var(--ok); }
.kv.bad b { color: var(--high); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #9a9a9a 50%), linear-gradient(135deg, #9a9a9a 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
select option { background: #121212; }
.banner a, .muted a { color: var(--text); }

/* ---------- Адаптив ---------- */
@media (max-width: 1000px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fin { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fin-out { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; padding: 16px; gap: 16px; }
  .sidebar { position: static; max-height: none; }
  .sidebar .list { max-height: 260px; }
  .grid2 { grid-template-columns: 1fr; }
  .topbar { padding: 10px 16px; gap: 8px; }
  .topbar .hide-sm { display: none; }
  .fin { grid-template-columns: 1fr; }
  .hero h1 { font-size: 30px; }
  .head h1 { font-size: 24px; }
  .verdict { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .facts div:nth-child(odd) { border-bottom: 0; padding-bottom: 0; font-size: 12px; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
  .panel { padding: 16px; }
}

/* ---------- Экран нового разбора: компактные подсказки, понятные действия ---------- */
.notice { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; border: 1px solid var(--line); background: var(--panel-2); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }
.notice.warn { border-color: rgba(255, 210, 122, 0.35); background: var(--mid-bg); }
.notice > div:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 280px; }
.notice b { font-weight: 500; }
.notice .row { flex-wrap: nowrap; }
.notice .x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 14px; padding: 4px 6px; }
.notice .x:hover { color: var(--text); }
.drop { padding: 30px 20px 26px; }
.drop:focus-visible { outline: none; border-color: rgba(255, 255, 255, 0.55); }
.drop-ico { font-size: 26px; line-height: 1; color: var(--muted); margin-bottom: 8px; }
.drop .big { margin-bottom: 4px; }
.opts { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: end; margin-top: 16px; }
.toggle { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; cursor: pointer; transition: border-color 0.2s; }
.toggle:hover { border-color: var(--line-2); }
.toggle input { width: 18px; height: 18px; accent-color: #fff; flex: none; margin: 0; }
.toggle > span { display: flex; flex-direction: column; line-height: 1.3; }
.toggle b { font-weight: 500; }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.actions #goHint { flex: 1; min-width: 0; }
.list-empty { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px dashed var(--line); border-radius: 12px; }
.list-empty b { font-weight: 500; }
@media (max-width: 860px) {
  .opts { grid-template-columns: 1fr; }
  .actions { flex-wrap: wrap; }
  .actions #goHint { flex-basis: 100%; }
  .actions .btn { flex: 1 1 auto; }
  .list-empty { display: none; }
}

/* ---------- Печать (Сохранить как PDF) ---------- */
@media print {
  body { background: #fff; color: #000; }
  .topbar, .sidebar, .no-print, .ask, .chips, .filters, .tabs { display: none !important; }
  .layout { display: block; padding: 0; }
  .panel, .kpi, .risk { background: #fff !important; border-color: #ccc; box-shadow: none; break-inside: avoid; }
  .muted, .summary, .risk p, .quote, .kpi span, .facts div:nth-child(odd) { color: #333 !important; }
  .decision.go, .decision.care, .decision.no, .sev { color: #000 !important; }
  [data-tabpane] { display: block !important; }
}
