/* bloco b4 · riscos, configurações, auditoria, copiloto (prefixo b4-) */

/* faixas de risco */
.b4-fx-b { background: var(--mint-soft); color: var(--mint-ink); }
.b4-fx-m { background: var(--orange-soft); color: var(--orange-deep); }
.b4-fx-a { background: #f9b48c; color: #6a2405; }
.b4-fx-c { background: #151515; color: #fff; }
.b4-nv { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 500; }
.b4-ic { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.b4-ic b { font: 500 12.5px var(--font-mono); margin-right: 4px; }
.b4-ic__n { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; font: 500 14px var(--font-mono); background: var(--surface-strong); }
.b4-div-t { display: flex; align-items: center; gap: 4px; margin-top: 3px; font-size: 11.5px; color: var(--orange-ink); }
.b4-sub { display: flex; align-items: center; gap: 4px; margin-top: 4px; font-size: 11.5px; color: var(--ink-muted); }
.b4-semdono { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.b4-semdono small { font-size: 11.5px; color: var(--alert); }
.b4-acao { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; max-width: 300px; font-size: 13px; line-height: 1.35; }
.b4-acao b { font-weight: 500; }
.b4-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.b4-txt { font-size: 15px; line-height: 1.55; margin-bottom: 14px; }
.b4-esc { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.b4-esc > div { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--surface-raised); box-shadow: inset 0 0 0 1px var(--line); }
.b4-esc > div.is-on { box-shadow: inset 0 0 0 2px var(--purple); }
.b4-esc b { font-weight: 500; } .b4-esc span { font-size: 13px; color: var(--ink-muted); }
.b4-opts4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.b4-opts3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.b4-opts4 .k-opt__i, .b4-opts3 .k-opt__i { font: 500 15px var(--font-mono); }
.b4-vivo { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--surface-sunken); margin-top: 4px; }
.b4-vivo .b4-ic__n { width: 48px; height: 48px; border-radius: 14px; font-size: 20px; }
.b4-vivo b { font-weight: 500; display: block; } .b4-vivo small { font-size: 12.5px; color: var(--ink-muted); }
.b4-vivo-s { margin-bottom: 12px; }
.b4-cks { display: flex; gap: 14px; flex-wrap: wrap; color: var(--ink); font-size: 14px; }
.b4-cks label { display: inline-flex; gap: 6px; align-items: center; }

/* mapa 4×4 */
.b4-g-map { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); }
@media (max-width: 1200px) { .b4-g-map { grid-template-columns: 1fr; } }
.b4-map { display: flex; gap: 8px; align-items: stretch; }
.b4-map__y { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 12px; color: var(--ink-muted); text-align: center; }
.b4-map__x { font-size: 12px; color: var(--ink-muted); text-align: center; margin: 6px 0 0 40px; }
.b4-riskmap { flex: 1; grid-template-rows: repeat(4, 92px) 24px; }
.b4-cell { position: relative; cursor: pointer; transition: transform .1s, opacity .15s, box-shadow .15s; }
.b4-cell:hover { box-shadow: inset 0 0 0 2px rgba(21,21,21,.25); }
.b4-cell.is-on { box-shadow: inset 0 0 0 3px var(--purple); }
.b4-cell.is-dim { opacity: .45; }
.b4-cell em { position: absolute; right: 8px; bottom: 6px; font: 500 11px var(--font-mono); font-style: normal; opacity: .55; }
.b4-cell a { font: 500 11px var(--font-mono); background: rgba(255,255,255,.94); color: #151515; padding: 4px 8px; border-radius: 99px; }
.b4-cell a:hover { background: #fff; box-shadow: 0 0 0 2px var(--purple); }
.b4-cell a.b4-div { box-shadow: 0 0 0 2px var(--orange); }
.b4-cell a.b4-nodono { outline: 2px dashed var(--alert); outline-offset: 1px; }
.b4-leg { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: 12.5px; color: var(--ink-muted); }
.b4-leg span { display: inline-flex; align-items: center; gap: 6px; }
.b4-leg i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.b4-leg-div { box-shadow: inset 0 0 0 2px var(--orange); background: #fff; }
.b4-leg-nd { outline: 2px dashed var(--alert); outline-offset: -2px; background: #fff; }

/* liga/desliga */
.b4-sw { width: 40px; height: 22px; border-radius: 99px; background: var(--surface-strong); position: relative; flex: none; transition: background .2s; box-shadow: inset 0 0 0 1px var(--line); }
.b4-sw span { position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: left .2s; }
.b4-sw.is-on { background: var(--purple); box-shadow: none; }
.b4-sw.is-on span { left: 20px; }
.b4-sw.is-lock { opacity: .55; cursor: not-allowed; }
.b4-edit { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; margin: -4px -8px; border-radius: 8px; font-size: 13.5px; text-align: left; }
.b4-edit .bs-i { opacity: 0; color: var(--ink-faint); }
.b4-edit:hover { background: var(--surface-sunken); } .b4-edit:hover .bs-i { opacity: 1; }

/* configurações */
.b4-op { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.b4-op:last-child { border-bottom: 0; padding-bottom: 2px; }
.b4-op:first-child { padding-top: 2px; }
.b4-op > span { flex: 1; min-width: 0; }
.b4-op b { display: block; font-weight: 500; font-size: 14.5px; }
.b4-op small { display: block; font-size: 12.5px; color: var(--ink-muted); margin-top: 2px; }
.b4-sel { font: inherit; font-size: 14px; height: 38px; padding: 0 12px; border-radius: 12px; border: 0; background: var(--surface-sunken); box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--ink); }
.b4-pc { display: grid; grid-template-columns: repeat(3, 24px); gap: 3px; }
.b4-pl { width: 24px; height: 22px; border-radius: 6px; display: grid; place-items: center; font: 500 10px var(--font-mono); font-style: normal; color: var(--ink-faint); background: var(--surface-sunken); box-shadow: inset 0 0 0 1px var(--line); }
.b4-pl.on { background: var(--purple); color: #fff; box-shadow: none; }
button.b4-pl:hover { box-shadow: inset 0 0 0 2px var(--purple-300); }
.b4-permleg { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--ink-muted); padding: 0 4px; }
.b4-permleg span { display: inline-flex; align-items: center; gap: 6px; }
.b4-rn { display: inline-grid; place-items: center; width: 30px; height: 26px; border-radius: 8px; background: var(--surface-sunken); font-weight: 500; }
.b4-pad { display: block; font-size: 13px; color: var(--ink-muted); line-height: 1.4; max-width: 420px; }
.b4-h4 { font-size: 15px; font-weight: 500; margin: 18px 0 8px; }
.b4-drop { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px; border-radius: 16px; border: 1.5px dashed var(--line-strong); color: var(--ink-muted); text-align: center; }
.b4-drop:hover { border-color: var(--purple-300); background: var(--purple-tint); }
.b4-drop b { color: var(--ink); font-weight: 500; } .b4-drop small { font-size: 12.5px; }
.b4-prog { width: 260px; height: 8px; border-radius: 9px; background: var(--surface-strong); overflow: hidden; margin-top: 10px; }
.b4-prog i { display: block; height: 100%; width: 35%; border-radius: 9px; background: var(--purple); animation: b4-prog 1.2s ease-in-out infinite; }
.b4-prog--run { width: 100%; } .b4-prog--run i { width: 0; animation: none; transition: width .25s; }
@keyframes b4-prog { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.b4-lidos { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.b4-lidos > div { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 14px; background: var(--mint-tint); }
.b4-lidos b { font-weight: 500; font-size: 16px; } .b4-lidos small { font-size: 12.5px; color: var(--ink-muted); }
.b4-dif.is-off { opacity: .5; }

/* auditoria */
.b4-av-ag { background: radial-gradient(circle at 35% 30%, #fff 0 10%, #ab74ec 45%, #770ccd 100%); width: 30px; height: 30px; }
.b4-hash { font-family: var(--font-mono); letter-spacing: .5px; }
.k-hero__d .b4-hash { font-size: 30px; }
.b4-row-on { box-shadow: inset 3px 0 0 var(--purple); background: var(--purple-tint); }

/* copiloto */
.b4-cop-tabs { margin: -6px 0 0; }
.b4-chat { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 16px; height: calc(100vh - 262px); min-height: 520px; }
.b4-chat__list { background: var(--surface-raised); border-radius: var(--k-r, 22px); box-shadow: 0 1px 0 var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.b4-chat__nova { margin: 0 4px 10px; justify-content: center; }
.b4-chat__lh { font: 500 11px var(--font-mono); text-transform: uppercase; letter-spacing: .6px; color: var(--ink-faint); padding: 6px 10px; }
.b4-conv { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 10px 12px; border-radius: 12px; }
.b4-conv:hover { background: var(--surface-sunken); }
.b4-conv.is-on { background: var(--surface-sunken); box-shadow: inset 3px 0 0 var(--purple); }
.b4-conv b { font-weight: 500; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b4-conv small { grid-column: 1 / -1; font-size: 12px; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b4-conv em { font-style: normal; font: 400 10.5px var(--font-mono); color: var(--ink-faint); white-space: nowrap; }
.b4-chat__main { background: var(--surface-raised); border-radius: var(--k-r, 22px); box-shadow: 0 1px 0 var(--line); display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.b4-chat__h { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.b4-chat__h b { font-weight: 500; display: block; } .b4-chat__h small { font-size: 12.5px; color: var(--ink-muted); }
.b4-lang { margin: 0; }
.b4-chat__msgs { flex: 1; overflow-y: auto; padding: 22px 24px; display: flex; flex-direction: column; gap: 18px; }
.b4-chat__ola { margin: auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 620px; }
.b4-chat__ola h3 { font-size: 26px; font-weight: 500; letter-spacing: -.5px; margin-top: 8px; }
.b4-chat__ola p { color: var(--ink-muted); }
.b4-ola__s { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; width: 100%; }
.b4-ola__s .b4-sug { justify-content: flex-start; height: auto; padding: 12px 14px; border-radius: 14px; text-align: left; white-space: normal; }
.b4-msg { display: flex; gap: 12px; align-items: flex-start; max-width: 860px; }
.b4-msg--eu { align-self: flex-end; }
.b4-msg--eu > div { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 18px 18px 4px 18px; font-size: 14.5px; line-height: 1.5; }
.b4-msg--ia .k-ia__orb { margin-top: 4px; }
.b4-bub { background: var(--surface-sunken); padding: 14px 18px; border-radius: 4px 18px 18px 18px; font-size: 14.5px; line-height: 1.55; min-width: 0; }
.b4-bub.is-warn { background: var(--orange-tint); }
.b4-bub p + p, .b4-bub p + ul, .b4-bub ul + p, .b4-bub p + ol { margin-top: 8px; }
.b4-bub ul, .b4-bub ol { padding-left: 20px; margin-top: 6px; } .b4-bub li { margin: 3px 0; }
.b4-bub b { font-weight: 500; }
.b4-bub__who { font-size: 12px; color: var(--ink-muted); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.b4-iatag { font: 500 10px var(--font-mono); text-transform: uppercase; letter-spacing: .5px; padding: 2px 6px; border-radius: 6px; background: var(--purple-soft); color: var(--purple-ink); }
.b4-srcs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.b4-srcs small { font-size: 11.5px; color: var(--ink-faint); margin-right: 2px; }
.b4-src { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 4px; border-radius: 99px; background: var(--surface-raised); box-shadow: inset 0 0 0 1px var(--line); font-size: 12.5px; font-weight: 500; }
.b4-src i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--purple-soft); color: var(--purple-ink); font: 500 10.5px var(--font-mono); font-style: normal; }
.b4-src:hover { box-shadow: inset 0 0 0 1.5px var(--purple); color: var(--purple); }
.b4-bub__a { display: flex; gap: 4px; margin-top: 10px; }
.b4-bub__a button { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 8px; border-radius: 8px; font-size: 12px; color: var(--ink-muted); }
.b4-bub__a button:hover { background: var(--surface-strong); color: var(--ink); }
.b4-dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.b4-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-faint); animation: b4-dot 1s infinite; }
.b4-dots i:nth-child(2) { animation-delay: .15s; } .b4-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes b4-dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.b4-chat__f { padding: 12px 18px 14px; border-top: 1px solid var(--line); }
.b4-chat__sugs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 10px; scrollbar-width: none; }
.b4-sug { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 32px; padding: 0 12px; border-radius: 99px; font-size: 13px; color: var(--ink-muted); background: var(--surface-raised); box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; }
.b4-sug:hover { color: var(--purple); box-shadow: inset 0 0 0 1.5px var(--purple-300); }
.b4-sug .bs-i { color: var(--purple); flex: none; }
.b4-in { display: flex; align-items: flex-end; gap: 8px; padding: 8px 8px 8px 16px; border-radius: 18px; background: var(--surface-sunken); box-shadow: inset 0 0 0 1px var(--line-strong); }
.b4-in:focus-within { box-shadow: inset 0 0 0 2px var(--purple); }
.b4-in textarea { flex: 1; border: 0; outline: none; resize: none; background: none; font: inherit; font-size: 14.5px; color: var(--ink); padding: 9px 0; max-height: 160px; line-height: 1.45; }
.b4-in__mic, .b4-in__env { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.b4-in__mic { color: var(--ink-muted); } .b4-in__mic:hover { background: var(--surface-strong); color: var(--ink); }
.b4-in__env { background: var(--purple); color: #fff; } .b4-in__env:hover { background: var(--purple-400); }
.b4-in__env .bs-i { transform: rotate(45deg); }
.b4-in.is-rec { box-shadow: inset 0 0 0 2px var(--alert); }
.b4-in.is-rec .b4-in__mic { background: var(--alert); color: #fff; animation: b4-rec 1s ease-in-out infinite; }
@keyframes b4-rec { 50% { box-shadow: 0 0 0 6px rgba(245,102,27,.25); } }
.b4-in__n { display: block; font-size: 11.5px; color: var(--ink-faint); margin-top: 6px; padding-left: 4px; }
.b4-agc { display: flex; align-items: center; gap: 10px; }
.b4-agc .k-ia__orb.is-off { filter: grayscale(1); opacity: .5; }
@media (max-width: 1100px) { .b4-chat { grid-template-columns: 1fr; height: auto; } .b4-chat__list { max-height: 220px; } .b4-chat__main { height: 70vh; } .b4-opts4 { grid-template-columns: 1fr 1fr; } }
.b4-semdono small { max-width: 190px; line-height: 1.3; }
#kt-rs-todos .k-pes small, #kt-rs-mapa .k-pes small { display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#kt-rs-todos .b4-acao { max-width: 220px; }
:is([id^="kt-rs-"], [id^="kt-cf-"], [id^="kt-au-"], [id^="kt-cop-"]) .k-pes b,
:is([id^="kt-rs-"], [id^="kt-cf-"], [id^="kt-au-"], [id^="kt-cop-"]) .k-pes small { display: block; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#kt-cf-perm td:nth-child(2) { min-width: 150px; }
#kt-cf-perm th { white-space: normal; font-size: 12px; line-height: 1.25; vertical-align: bottom; }
#kt-cf-perm td, #kt-cf-perm th { padding-left: 6px; padding-right: 6px; }
#kt-au-uso td:nth-child(2), #kt-au-ia td:nth-child(2) { min-width: 0; }
#kt-au-trilha td:nth-child(2) { min-width: 260px; }
.b4-ic > span:last-child { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
[id^="kt-rs-plano"] td:nth-child(2) { min-width: 220px; }
#kt-cf-acc td:nth-child(2) { min-width: 190px; }
#kt-cf-perm .b4-pc { grid-template-columns: repeat(3, 21px); gap: 2px; }
#kt-cf-perm .b4-pl { width: 21px; height: 20px; font-size: 9.5px; }
#kt-rs-todos th, #kt-rs-todos th button { white-space: normal; text-align: left; line-height: 1.25; }
#kt-rs-todos td:nth-child(2) { min-width: 260px; }
