/* «Сигнал» — вариант «Спокойствие» (красный телефон) */
@import url("colors_and_type.css");
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text); }

.cx { min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 56px; padding: 40px 40px 90px; }
[data-theme="light"] .cx { background: radial-gradient(circle at 70% 0%, rgba(37,99,235,.1), transparent 42%), #dfe6f2; }

/* explainer */
.cx-explain { max-width: 380px; }
.cx-explain .eyebrow { margin-bottom: 14px; }
.cx-explain h1 { font-size: 34px; font-weight: 800; line-height: 1.06; margin: 0 0 14px; }
.cx-explain p { color: var(--text-2); font-size: 15px; line-height: 1.6; margin: 0 0 22px; }
.cx-phil { display: grid; gap: 10px; }
.cx-phil-row { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); padding: 13px 15px; }
.cx-phil-ic { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; }
.cx-phil-row b { font-size: 14px; font-weight: 700; display: block; }
.cx-phil-row small { font-size: 12px; color: var(--text-2); line-height: 1.35; }
.cx-toggle { margin-top: 22px; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--soft-fill); color: var(--text); font-weight: 650; font-size: 13px; cursor: pointer; }

/* device */
.cx-device { width: 390px; border-radius: 46px; border: 1px solid var(--line-2); background: #05080f; padding: 12px; box-shadow: 0 50px 100px -50px rgba(0,0,0,.85); flex-shrink: 0; }
.cx-screen { border-radius: 36px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); height: 808px; display: flex; flex-direction: column; position: relative; transition: background .5s var(--ease); }
/* ambient mood: красный ореол только когда есть критичное */
.cx-screen.mood-red::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--red) 22%, transparent), transparent 55%); z-index: 0; }
.cx-screen.mood-amber::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--amber) 16%, transparent), transparent 55%); z-index: 0; }
.cx-screen.mood-green::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--green) 14%, transparent), transparent 50%); z-index: 0; }

.ca-status { height: 38px; flex-shrink: 0; display: flex; align-items: flex-end; justify-content: space-between; padding: 0 26px 4px; font-family: var(--font-mono); font-size: 12px; font-weight: 600; z-index: 2; }
.ca-body { flex: 1; overflow-y: auto; padding: 6px 18px 18px; z-index: 2; }
.ca-body::-webkit-scrollbar { width: 0; }
.ca-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.ca-mk { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(140deg, var(--cyan), var(--blue)); color: #fff; display: flex; align-items: center; justify-content: center; }
.ca-head b { font-size: 14px; font-weight: 750; display: block; } .ca-head small { font-size: 11px; color: var(--text-3); }

/* mood hero */
.ca-hero { text-align: center; padding: 18px 14px 22px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); margin-bottom: 16px; }
.ca-hero.red { border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.ca-orb { width: 92px; height: 92px; border-radius: 999px; margin: 4px auto 14px; display: flex; align-items: center; justify-content: center; position: relative; }
.ca-orb i { position: absolute; inset: 0; border-radius: 999px; opacity: .22; }
.ca-orb .core { width: 64px; height: 64px; border-radius: 999px; display: flex; align-items: center; justify-content: center; color: #04111d; }
.ca-orb.pulse i { animation: caPulse 2.6s var(--ease) infinite; }
@keyframes caPulse { 0%{transform:scale(.7);opacity:.5;} 70%{transform:scale(1.5);opacity:0;} 100%{opacity:0;} }
@media (prefers-reduced-motion: reduce){ .ca-orb.pulse i{ animation:none; } }
.ca-hero h2 { font-size: 23px; font-weight: 800; line-height: 1.1; margin-bottom: 7px; }
.ca-hero p { font-size: 13.5px; color: var(--text-2); line-height: 1.5; max-width: 30ch; margin: 0 auto; }
.ca-greet { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; }

/* health traffic light */
.ca-health { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 15px; margin-bottom: 14px; }
.ca-health-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 11px; }
.ca-health-h b { font-size: 13.5px; } .ca-health-h span { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.ca-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; gap: 2px; background: var(--surface-2); }
.ca-bar i { display: block; }
.ca-bar .g { background: var(--green); } .ca-bar .a { background: var(--amber); } .ca-bar .r { background: var(--red); }
.ca-legend { display: flex; gap: 16px; margin-top: 11px; }
.ca-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-2); }
.ca-legend i { width: 9px; height: 9px; border-radius: 999px; }

.ca-seclbl { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin: 4px 0 10px; }

/* problem card with escalation */
.ca-card { position: relative; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 14px; margin-bottom: 10px; overflow: hidden; }
.ca-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.ca-card.red::before { background: var(--red); } .ca-card.amber::before { background: var(--amber); }
.ca-card .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ca-card .area { font-size: 14px; font-weight: 750; }
.ca-card .src { font-family: var(--font-mono); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.ca-metric { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.ca-metric b { font-family: var(--font-mono); font-size: 20px; font-weight: 700; }
.ca-metric small { font-size: 11px; color: var(--text-3); }
.ca-esc { display: flex; align-items: center; gap: 10px; border-radius: 12px; padding: 11px 13px; margin-bottom: 10px; }
.ca-esc .ei { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #04111d; }
.ca-esc .et b { font-size: 13px; font-weight: 750; display: block; } .ca-esc .et small { font-size: 11px; color: var(--text-2); line-height: 1.3; }
.ca-reason { font-size: 12.5px; color: var(--text-2); line-height: 1.45; margin-bottom: 11px; }
.ca-reason b { color: var(--text); }
.ca-actions { display: flex; gap: 8px; }
.ca-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--soft-fill); color: var(--text); font-weight: 700; font-size: 12.5px; cursor: pointer; font-family: var(--font-body); }
.ca-btn.primary { color: #04111d; border-color: transparent; }
[data-theme="light"] .ca-btn.primary { color: #fff; }
.ca-btn.acked { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); border-color: color-mix(in srgb, var(--green) 28%, transparent); }

/* settings */
.ca-set-block { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 16px; margin-bottom: 13px; }
.ca-set-block > b { font-size: 14px; font-weight: 750; display: block; margin-bottom: 4px; }
.ca-set-block > p { font-size: 12px; color: var(--text-3); line-height: 1.45; margin-bottom: 13px; }
.ca-levels { display: grid; gap: 8px; }
.ca-level { display: flex; align-items: flex-start; gap: 11px; padding: 12px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; text-align: left; font-family: var(--font-body); }
.ca-level.on { border-color: color-mix(in srgb, var(--cyan) 45%, var(--line)); background: linear-gradient(120deg, color-mix(in srgb, var(--cyan) 8%, var(--surface)), var(--surface)); }
.ca-level .rb { width: 18px; height: 18px; border-radius: 999px; border: 2px solid var(--line-2); flex-shrink: 0; margin-top: 1px; position: relative; }
.ca-level.on .rb { border-color: var(--cyan); }
.ca-level.on .rb::after { content: ""; position: absolute; inset: 3px; border-radius: 999px; background: var(--cyan); }
.ca-level b { font-size: 13.5px; font-weight: 700; display: block; }
.ca-level small { font-size: 11.5px; color: var(--text-2); line-height: 1.35; }
.ca-preview { display: flex; align-items: center; gap: 10px; margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-2); }
.ca-mini-bar { display: flex; height: 9px; flex: 1; border-radius: 999px; overflow: hidden; gap: 2px; }
.ca-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ca-switch { width: 46px; height: 27px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); position: relative; cursor: pointer; flex-shrink: 0; transition: background .2s var(--ease); }
.ca-switch.on { background: var(--green); border-color: transparent; }
.ca-switch i { position: absolute; top: 2px; left: 2px; width: 21px; height: 21px; border-radius: 999px; background: #fff; transition: left .2s var(--ease); }
.ca-switch.on i { left: 21px; }
.ca-time { font-family: var(--font-mono); font-size: 14px; font-weight: 700; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface-2); color: var(--text); padding: 7px 11px; }

/* nav */
.ca-nav { flex-shrink: 0; display: flex; justify-content: space-around; padding: 10px 6px 22px; border-top: 1px solid var(--line); background: var(--bg-2); z-index: 2; }
.ca-nav button { display: flex; flex-direction: column; align-items: center; gap: 3px; background: none; border: none; color: var(--text-3); font-size: 9.5px; cursor: pointer; font-family: var(--font-body); position: relative; }
.ca-nav button.on { color: var(--cyan); }
.ca-nav .nb { position: absolute; top: -3px; right: 50%; margin-right: -18px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; color: #fff; font-size: 9px; font-weight: 700; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); }

@media (max-width: 860px) { .cx-explain { display: none; } .cx { gap: 0; padding: 0; } .cx-device { width: 100vw; max-width: 420px; border-radius: 0; border: none; padding: 0; } .cx-screen { border-radius: 0; height: 100vh; } }

/* scenario switcher */
.cx-scenario { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 5px; padding: 6px 6px 6px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--header-bg); backdrop-filter: blur(14px); box-shadow: var(--shadow); }
.cx-sc-lbl { font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin-right: 4px; }
.cx-sc-btn { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-body); font-size: 12.5px; font-weight: 650; color: var(--text-2); padding: 8px 13px; border-radius: 10px; border: 1px solid transparent; background: transparent; cursor: pointer; }
.cx-sc-btn:hover { color: var(--text); }
.cx-sc-btn .d { width: 8px; height: 8px; border-radius: 999px; background: var(--text-3); }
.cx-sc-btn .d.green { background: var(--green); } .cx-sc-btn .d.deviation { background: var(--amber); } .cx-sc-btn .d.problem { background: var(--red); }
.cx-sc-btn.on { color: var(--text); background: var(--surface); border-color: var(--line-2); }
.cx-sc-btn.on.green { border-color: color-mix(in srgb, var(--green) 50%, var(--line)); }
.cx-sc-btn.on.deviation { border-color: color-mix(in srgb, var(--amber) 50%, var(--line)); }
.cx-sc-btn.on.problem { border-color: color-mix(in srgb, var(--red) 50%, var(--line)); }
@media (max-width: 560px) { .cx-sc-lbl { display: none; } .cx-sc-btn { padding: 8px 10px; font-size: 12px; } }

/* Ответственная роль на карточке сигнала (привязка к ролям) */
.ca-owner { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-3); margin: 2px 0 10px; }
.ca-owner b { color: var(--text-2); font-weight: 650; }

/* назад в демо */
.cx-back { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-body); font-size: 12px; font-weight: 600; color: var(--text-3); text-decoration: none; margin-bottom: 14px; }
.cx-back svg { transform: rotate(180deg); }
.cx-back:hover { color: var(--green); }

/* ===== телефон-центричная раскладка (как phone.html) ===== */
.phone-solo .cx-scenario { width: 100%; max-width: 460px; margin: 0 auto; justify-content: center; }
.cx-phil-strip { width: 100%; max-width: 460px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cx-phil-chip { display: flex; align-items: center; gap: 9px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.cx-phil-chip .ic { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; }
.cx-phil-chip b { font-size: 12px; display: block; line-height: 1.2; }
.cx-phil-chip small { font-size: 10.5px; color: var(--text-3); display: block; margin-top: 2px; line-height: 1.25; }
@media (max-width: 560px) { .cx-phil-strip { grid-template-columns: 1fr; } }

/* фикс: в телефон-центричной раскладке сценарий-переключатель в потоке (не fixed) */
.phone-solo .cx-scenario { position: static; transform: none; left: auto; top: auto; }
