/* Ситуаційна кімната: графітовий фон, бурштиновий акцент для дзвінків CEO, сигнальні кольори для наслідків. */
:root {
  --bg: #12161c;
  --panel: #1a2029;
  --panel-2: #212935;
  --line: #2e3846;
  --text: #e7eaef;
  --muted: #9ba6b5;
  --accent: #f0a63a;
  --accent-ink: #1a1206;
  --crit: #e5584f;
  --ok: #4fb37a;
  --warn: #e8c547;
  --font-display: "IBM Plex Sans Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", Consolas, "DejaVu Sans Mono", monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); line-height: 1.5; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; line-height: 1.15; }
p { margin: 0; }
a { color: var(--accent); }
button {
  font: inherit; color: inherit; cursor: pointer; border: 1px solid var(--line);
  background: var(--panel-2); border-radius: 10px; padding: 8px 14px;
}
button:hover:not(:disabled) { border-color: var(--muted); }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); border-color: var(--accent); }
.btn-danger { border-color: var(--crit); color: var(--crit); background: transparent; }
input[type="text"], input[type="password"] {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; width: 100%;
}
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.eyebrow { font-family: var(--font-mono); font-size: 13px; color: var(--accent); letter-spacing: 0.06em; text-transform: uppercase; }
.muted { color: var(--muted); }
.note { font-size: 13px; color: var(--muted); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.tag { display: inline-block; font-family: var(--font-mono); font-size: 12px; padding: 1px 8px; border-radius: 999px; margin-right: 6px; border: 1px solid currentColor; vertical-align: 2px; }
.tag.bad { color: var(--crit); }
.tag.good { color: var(--ok); }
.tag.mid { color: var(--warn); }

/* дзвінок CEO */
.call { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: start; border: 1px solid var(--accent); background: linear-gradient(180deg, rgba(240,166,58,0.10), rgba(240,166,58,0.02)); }
.avatar {
  width: 84px; height: 84px; border-radius: 50%; background: var(--panel-2); border: 2px solid var(--accent);
  display: grid; place-items: center; font-family: var(--font-display); font-size: 30px; color: var(--accent); position: relative;
}
.ringing .avatar::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid var(--accent); animation: ring 1.2s ease-out infinite; }
@keyframes ring { from { transform: scale(0.9); opacity: 0.9; } to { transform: scale(1.3); opacity: 0; } }
.call-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.call-who { font-weight: 600; }
.call-meta { color: var(--muted); font-size: 14px; }
.quote { font-family: var(--font-display); font-weight: 500; line-height: 1.35; margin-top: 8px; }

/* варіанти */
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.opt { text-align: left; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--panel-2); display: flex; flex-direction: column; gap: 4px; }
.opt .key { font-family: var(--font-mono); font-weight: 600; color: var(--accent); font-size: 18px; }
.opt .title { font-weight: 600; }
.opt .desc { color: var(--muted); font-size: 14px; }
.opt[aria-pressed="true"] { border-color: var(--accent); background: rgba(240,166,58,0.16); }

/* лічильник голосів */
.bar { display: grid; grid-template-columns: 22px minmax(0, 1fr) 28px; gap: 8px; align-items: center; font-family: var(--font-mono); font-size: 14px; }
.bar .track { height: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.bar .track > i { display: block; height: 100%; background: var(--accent); }
.bar.win .track > i { background: var(--ok); }

/* картки */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.card { text-align: left; display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 10px 12px; font-size: 15px; background: var(--bg); }
.card .cost { font-family: var(--font-mono); color: var(--muted); white-space: nowrap; font-size: 13px; }
.card[aria-pressed="true"] { border-color: var(--accent); background: rgba(240,166,58,0.14); }
.card.inteam { box-shadow: inset 4px 0 0 var(--ok); }
.card.lost { text-decoration: line-through; }
.meter { flex: 1; height: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; min-width: 120px; }
.meter > i { display: block; height: 100%; background: var(--accent); }

/* докази */
.findings { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.finding { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: 14px; }
.finding.yes { border-color: var(--ok); }
.finding.no { color: var(--muted); }
.finding b { display: block; }
details.logs summary { cursor: pointer; color: var(--accent); font-size: 15px; padding: 4px 0; }
pre { font-family: var(--font-mono); font-size: 12.5px; line-height: 1.45; background: #0c0f13; border: 1px solid var(--line); border-radius: 8px; padding: 10px; overflow-x: auto; margin: 6px 0 0; white-space: pre; }
.log-title { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: 10px; }

.result { border-left: 4px solid var(--line); padding: 10px 14px; background: var(--panel-2); border-radius: 0 10px 10px 0; }
.result.bad { border-left-color: var(--crit); }
.result.good { border-left-color: var(--ok); }
.result.mid { border-left-color: var(--warn); }
.result ul { margin: 6px 0 0; padding-left: 20px; font-size: 14px; }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--crit); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 50; max-width: calc(100% - 32px); }
.conn { position: fixed; top: 0; left: 0; right: 0; background: var(--warn); color: #1a1600; text-align: center; font-size: 13px; padding: 4px; z-index: 40; }

@media (prefers-reduced-motion: reduce) { .ringing .avatar::after { animation: none; opacity: 0.6; } * { transition: none !important; } }

/* ---------- Переписка в стилі WhatsApp (темна тема) ---------- */
.wa { border-radius: 14px; overflow: hidden; border: 1px solid #222d34; background: #0b141a; font-family: var(--font-body); }
.wa-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #202c33; }
.wa-gava { flex: none; width: 40px; height: 40px; border-radius: 50%; background: #2a3942; color: #aebac1; display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.wa-hd { min-width: 0; }
.wa-title { color: #e9edef; font-weight: 600; font-size: 16px; }
.wa-sub { color: #8696a0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-typing-sub { color: #00a884; }
.wa-body { padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 2px; min-height: 120px;
  background-color: #0b141a;
  background-image: radial-gradient(rgba(255,255,255,0.035) 1px, transparent 1.2px), radial-gradient(rgba(255,255,255,0.025) 1px, transparent 1.2px);
  background-size: 22px 22px, 22px 22px; background-position: 0 0, 11px 11px; }
.wa-day { text-align: center; margin: 4px 0 8px; }
.wa-day span { display: inline-block; background: #182229; color: #8696a0; font-size: 12px; padding: 4px 10px; border-radius: 8px; }
.wa-row { display: flex; align-items: flex-start; gap: 8px; }
.wa-row.first { margin-top: 8px; }
.wa-ava, .wa-ava-sp { flex: none; width: 30px; height: 30px; }
.wa-ava { border-radius: 50%; color: #0b141a; display: grid; place-items: center; font-size: 11px; font-weight: 700; }
.wa-bub { position: relative; background: #202c33; color: #e9edef; border-radius: 8px; padding: 6px 9px 8px; max-width: 82%; font-size: 15px; line-height: 1.38; box-shadow: 0 1px 0.5px rgba(11,20,26,0.13); overflow-wrap: anywhere; }
.wa-bub.tail { border-top-left-radius: 0; }
.wa-bub.tail::before { content: ""; position: absolute; left: -8px; top: 0; border-width: 0 8px 10px 0; border-style: solid; border-color: transparent #202c33 transparent transparent; }
.wa-name { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.wa-role { color: #8696a0; font-weight: 400; }
.wa-pad { display: inline-block; width: 44px; }
.wa-time { position: absolute; right: 8px; bottom: 4px; font-size: 11px; color: #8696a0; }
.wa-bub.pop { animation: wa-pop 0.32s ease-out; transform-origin: top left; }
@keyframes wa-pop { from { opacity: 0; transform: translateY(6px) scale(0.96); } to { opacity: 1; transform: none; } }
.wa-dots { display: inline-flex; gap: 4px; align-items: center; padding: 11px 14px; animation: wa-pop 0.25s ease-out; }
.wa-dots i { width: 7px; height: 7px; border-radius: 50%; background: #8696a0; animation: wa-dot 1.2s infinite ease-in-out; }
.wa-dots i:nth-child(2) { animation-delay: 0.15s; }
.wa-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes wa-dot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.45; } 30% { transform: translateY(-4px); opacity: 1; } }
/* проектор: ті самі пропорції, крупніше */
.wa.big .wa-head { padding: 14px 20px; gap: 16px; }
.wa.big .wa-gava { width: 56px; height: 56px; font-size: 20px; }
.wa.big .wa-title { font-size: 24px; }
.wa.big .wa-sub { font-size: 18px; }
.wa.big .wa-body { padding: 16px 22px 22px; min-height: 260px; gap: 4px; }
.wa.big .wa-day span { font-size: 16px; padding: 6px 14px; }
.wa.big .wa-row { gap: 12px; }
.wa.big .wa-row.first { margin-top: 12px; }
.wa.big .wa-ava, .wa.big .wa-ava-sp { width: 52px; height: 52px; }
.wa.big .wa-ava { font-size: 18px; }
.wa.big .wa-bub { font-size: 30px; line-height: 1.32; padding: 10px 16px 14px; border-radius: 12px; max-width: 88%; }
.wa.big .wa-bub.tail { border-top-left-radius: 0; }
.wa.big .wa-bub.tail::before { left: -12px; border-width: 0 12px 15px 0; }
.wa.big .wa-name { font-size: 20px; margin-bottom: 4px; }
.wa.big .wa-pad { width: 72px; }
.wa.big .wa-time { font-size: 17px; right: 14px; bottom: 8px; }
.wa.big .wa-dots { padding: 18px 22px; gap: 7px; }
.wa.big .wa-dots i { width: 12px; height: 12px; }
@media (prefers-reduced-motion: reduce) { .wa-bub.pop, .wa-dots { animation: none; } .wa-dots i { animation: none; opacity: 0.8; } }
