@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');


:root {
  --blue: #3575b4; --blue-2: #5d93c5; --navy: #022240; --link: #2745b7;
  --sky: #b7ddff; --mist: #cce0f3; --bg: #f3f7fb; --line: #dbe5ef;
  --muted: #546a82; --danger: #b42318;
  --pad: clamp(20px, 5vw, 44px);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 15px/1.6 Poppins, system-ui, sans-serif; color: var(--navy); background: var(--bg); }
a { color: var(--blue); font-weight: 500; text-decoration: none; border-radius: 4px; transition: color .15s, background-color .15s, box-shadow .15s; }
a:hover { color: var(--navy); background: #e8f2fc; box-shadow: 0 0 0 3px #e8f2fc; }
a:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.button:hover, aside a:hover, .alt-link:hover, .thread-link:hover { box-shadow: none; }
aside .brand:hover { background: none; }
h1 { margin: 0 0 4px; font-size: 26px; line-height: 1.25; font-weight: 600; }
h2 { margin: 0 0 12px; font-size: 17px; font-weight: 600; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.pre { white-space: pre-wrap; }
.note { margin: 12px 0 0; }

label { display: block; margin-bottom: 14px; font-size: 14px; font-weight: 500; }
input, textarea, select {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  font: inherit; color: inherit; background: #fff; border: 1px solid var(--line); border-radius: 8px;
}
textarea { resize: vertical; }
select { width: auto; margin: 0; padding: 6px 10px; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 1px; border-color: var(--blue); }

button, .button {
  display: inline-block; padding: 10px 18px; font: 500 15px Poppins, system-ui, sans-serif; color: #fff;
  background: var(--blue); border: 0; border-radius: 8px; cursor: pointer; text-decoration: none;
}
button:hover, .button:hover { background: var(--navy); }
button.danger { background: none; color: var(--danger); padding-inline: 8px; }
button.danger:hover { background: #fdecea; color: var(--danger); }
.flash { padding: 12px 14px; margin-bottom: 20px; border-radius: 8px; background: #e8f2fc; border-left: 4px solid var(--blue); }
.flash.ok { background: #e7f6ec; border-color: #1f8a4c; }
.flash.err, .flash.warn { background: #fdecea; border-color: var(--danger); }

.i { font-style: normal; display: inline-block; width: 1.1em; text-align: center; }
button .i { margin-right: 8px; }

.brand { display: block; width: auto; align-self: flex-start; }
.brand img { display: block; width: auto; }

.login {
  isolation: isolate; min-height: 100vh; display: grid; place-items: center; padding: clamp(12px, 3vw, 24px);
  background:
    radial-gradient(circle at 15% 20%, rgba(53, 117, 180, .55), transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(93, 147, 197, .35), transparent 45%),
    var(--navy);
  background-attachment: fixed;
}
.watermark {
  --wm: min(105vh, 100vw);
  position: fixed; z-index: -1; pointer-events: none; user-select: none;
  height: var(--wm); width: auto; max-width: none;
  right: calc(var(--wm) * -.06); bottom: calc(var(--wm) * -.13);
  opacity: .14; transform: rotate(-12deg);
}
.shell {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(940px, 100%); min-height: 560px;
  background: #fff; border-radius: 24px; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
.shell.single { grid-template-columns: minmax(0, 1fr); width: min(440px, 100%); min-height: 0; }
.shell-brand {
  display: flex; flex-direction: column; padding: var(--pad); color: #fff;
  background: linear-gradient(160deg, var(--blue), var(--navy) 75%);
}
.shell-brand.centered { justify-content: center; }
.login-tag { margin: 40px 0 0; font-size: clamp(28px, 3.4vw, 40px); line-height: 1.15; font-weight: 600; }
.chat { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.bubble { margin: 0; padding: 10px 16px; border-radius: 18px; max-width: 80%; font-size: 14px; animation: pop .45s both; }
.bubble.bot { background: rgba(255, 255, 255, .14); color: #fff; border-bottom-left-radius: 4px; }
.bubble.me { align-self: flex-end; background: #fff; color: var(--navy); border-bottom-right-radius: 4px; }
.bubble:nth-child(2) { animation-delay: .7s; }
.bubble:nth-child(3) { animation-delay: 1.4s; }
.bubble:nth-child(n+4) { animation-delay: 2.1s; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.96); } }
.shell-form { align-self: center; padding: var(--pad); }
.shell-form > p.muted { margin-bottom: 28px; overflow-wrap: anywhere; }
.shell-form button { width: 100%; margin-top: 8px; padding: 12px; }
.install-logo { margin-bottom: 28px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.hint { display: block; margin-top: 2px; color: var(--muted); font-weight: 400; font-size: 13px; }

.wizard { margin: 32px 0 0; padding: 0; list-style: none; counter-reset: paso; }
.wizard li { counter-increment: paso; display: flex; align-items: center; gap: 12px; padding: 7px 0; color: rgba(255, 255, 255, .55); }
.wizard li::before {
  content: counter(paso); display: grid; place-items: center; flex: none; width: 28px; height: 28px;
  border-radius: 50%; border: 2px solid rgba(255, 255, 255, .3); font-size: 13px; font-weight: 600;
}
.wizard li.now { color: #fff; font-weight: 500; }
.wizard li.now::before { background: #fff; border-color: #fff; color: var(--navy); }
.wizard li.done { color: var(--mist); }
.wizard li.done::before { content: "\f00c"; font: 900 12px/1 "Font Awesome 6 Free"; background: var(--blue-2); border-color: var(--blue-2); color: #fff; }
.step-count { margin-bottom: 6px; color: var(--blue); font-size: 13px; font-weight: 600; }
.field-action { display: flex; gap: 8px; margin: 6px 0 14px; }
.field-action input { margin: 0; height: 46px; }
.shell-form .field-action button { display: grid; place-items: center; flex: none; width: 46px; height: 46px; margin: 0; padding: 0; font-size: 17px; }
.icon-btn .i { margin: 0; width: auto; }
.wizard-actions { display: flex; flex-direction: row-reverse; gap: 12px; margin-top: 24px; }
.wizard-actions button { flex: 1 1 0; width: auto; margin: 0; padding: 12px; border: 2px solid transparent; }
.wizard-actions button.ghost, .shell-form .field-action button { background: #fff; color: var(--blue); border: 2px solid var(--line); }
.wizard-actions button.ghost:hover, .shell-form .field-action button:hover { background: #e8f2fc; color: var(--navy); border-color: var(--blue); }
button:disabled { opacity: .45; pointer-events: none; }
.checks { margin: 0; padding: 0; list-style: none; }
.checks li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.checks li:last-child { border-bottom: 0; }
.checks .i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 12px; }
.checks .ok .i { background: #e7f6ec; color: #1f8a4c; }
.checks .fail .i { background: #fdecea; color: var(--danger); }
.summary { margin: 0; padding: 4px 18px; background: var(--bg); border-radius: 12px; }
.summary div { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.summary div:last-child { border-bottom: 0; }
.summary dt { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.summary dt .i { color: var(--blue); }
.summary dd { margin: 0; font-weight: 500; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pass-field { position: relative; display: block; margin-top: 6px; }
.pass-field input { margin: 0; padding-right: 48px; }
.pass-field .pass-toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); display: grid; place-items: center; width: 36px; height: 36px; margin: 0; padding: 0; background: none; color: var(--muted); border: 0; border-radius: 6px; font-size: 15px; }
.pass-field .pass-toggle:hover { background: var(--bg); color: var(--navy); }
.pass-toggle .i { margin: 0; width: auto; }
.pass-meter { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12px; font-weight: 500; color: var(--muted); }
.pass-meter:not([data-level]), .pass-meter[data-level=""] { display: none; }
.pass-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; flex: 1; }
.pass-bar i { height: 4px; border-radius: 2px; background: var(--line); }
.pass-label { min-width: 64px; text-align: right; }
.pass-meter[data-level="0"] i:first-child, .pass-meter[data-level="1"] i:first-child { background: var(--danger); }
.pass-meter[data-level="0"], .pass-meter[data-level="1"] { color: var(--danger); }
.pass-meter[data-level="2"] i:nth-child(-n+2) { background: #b45309; }
.pass-meter[data-level="2"] { color: #b45309; }
.pass-meter[data-level="3"] i:nth-child(-n+3) { background: var(--blue); }
.pass-meter[data-level="3"] { color: var(--blue); }
.pass-meter[data-level="4"] i { background: #1f8a4c; }
.pass-meter[data-level="4"] { color: #1f8a4c; }
.field-status { display: flex; align-items: center; gap: 8px; margin: -4px 0 14px; font-size: 13px; font-weight: 500; color: var(--muted); }
.field-status:empty { display: none; }
.field-status.ok { color: #1f8a4c; }
.field-status.err { color: var(--danger); }
.field-status.ok::before, .field-status.err::before { font: 900 13px/1 "Font Awesome 6 Free"; }
.field-status.ok::before { content: "\f058"; }
.field-status.err::before { content: "\f06a"; }

fieldset { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
legend { margin-bottom: 8px; padding: 0; font-size: 14px; font-weight: 500; }
.chat-fields { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--bg); border-radius: 14px; }
.chat-fields legend { float: left; width: 100%; margin-bottom: 4px; }
.chat-field { display: flex; flex-direction: column; align-items: flex-start; align-self: flex-start; max-width: 85%; margin: 0; font-size: 12px; font-weight: 500; color: var(--muted); }
.chat-field.me { align-self: flex-end; align-items: flex-end; }
.chat-field textarea { width: 100%; margin-top: 4px; padding: 9px 14px; line-height: 1.45; resize: none; overflow: hidden; border-radius: 16px 16px 16px 4px; field-sizing: content; }
.chat-field.me textarea { border-radius: 16px 16px 4px 16px; background: var(--blue); border-color: var(--blue); color: #fff; }
@supports (field-sizing: content) { .chat-field textarea { width: auto; min-width: 14ch; max-width: 100%; } }
@supports not (field-sizing: content) { .chat-field { width: 85%; } }

.uploads { display: flex; flex-direction: column; gap: 10px; }
.upload { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; align-items: center; gap: 14px; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.upload:hover { border-color: var(--blue); }
.upload:focus-within { outline: 3px solid var(--sky); outline-offset: 1px; border-color: var(--blue); }
.upload-info { display: flex; flex-direction: column; min-width: 0; }
.upload-info b { font-weight: 500; color: var(--navy); }
.upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 2px solid var(--line); border-radius: 8px; color: var(--blue); font-size: 13px; font-weight: 500; }
.upload:hover .upload-btn { border-color: var(--blue); background: #e8f2fc; }
.preview { display: grid; place-items: center; height: 56px; padding: 8px; border-radius: 8px; background: var(--bg); }
.preview.on-dark { background: var(--navy); }
.preview img { display: block; width: auto; height: 40px; max-width: 100%; object-fit: contain; }
.alt-link {
  display: flex; width: fit-content; align-items: center; gap: 8px; margin: 16px auto 0; padding: 8px 16px;
  border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--blue); text-decoration: none;
  transition: background-color .15s, color .15s;
}
.alt-link:hover { background: #e8f2fc; color: var(--navy); }
.alt-link:focus-visible { outline-offset: 2px; }

.steps { display: flex; gap: 8px; margin: 0 0 28px; padding: 0; list-style: none; counter-reset: paso; font-size: 13px; }
.steps li { flex: 1; counter-increment: paso; padding-top: 10px; border-top: 3px solid var(--line); color: var(--muted); }
.steps li::before { content: counter(paso) ". "; font-weight: 600; }
.steps li.now { border-color: var(--blue); color: var(--navy); font-weight: 500; }
.steps li.done { border-color: var(--blue-2); }

.hero-ico {
  display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 18px;
  border-radius: 16px; color: #fff; font-size: 22px;
  background: linear-gradient(135deg, var(--blue), var(--blue-2));
  box-shadow: 0 10px 24px rgba(53, 117, 180, .35);
}
.hero-ico .i { width: auto; }
.otp { font-weight: 600; letter-spacing: .12em; }
.otp-input { padding: 12px; font-size: 26px; font-weight: 600; letter-spacing: .5em; text-align: center; text-indent: .5em; }
.otp-input::placeholder { color: var(--line); }

.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
aside { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 24px; padding: 24px 16px; background: var(--navy); }
aside .brand { padding: 4px 8px 8px; }
aside nav { display: flex; flex-direction: column; gap: 2px; }
aside nav a { display: flex; gap: 12px; align-items: center; padding: 9px 12px; border-radius: 8px; color: var(--mist); text-decoration: none; font-weight: 500; }
aside nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
aside nav a[aria-current], aside nav a[aria-current]:hover { background: var(--blue); color: #fff; }
aside nav a[aria-current]:hover { background: var(--blue-2); }
aside nav a:focus-visible { outline: 3px solid var(--blue-2); outline-offset: 1px; }
.count { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 11px; background: var(--sky); color: var(--navy); font-size: 12px; text-align: center; }
aside form { margin-top: auto; }
aside form button { background: none; color: var(--mist); padding: 9px 12px; }
aside form button:hover { background: rgba(255, 255, 255, .08); color: #fff; }
main { padding: 40px 48px; min-width: 0; }
main > h1 + p { margin-bottom: 24px; }
main > h1:has(+ :not(p)) { margin-bottom: 24px; }

.format-legend { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 24px; padding: 0; list-style: none; }
.format-legend li { display: flex; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; }
.format-legend code { padding: 6px 10px; background: var(--bg); color: var(--muted); font: 12px/1.5 ui-monospace, Consolas, monospace; }
.format-legend span { padding: 6px 12px; color: var(--navy); }
.format-legend u { color: var(--blue); text-decoration: none; font-weight: 500; }

.text-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.text-head h2 { margin: 0; }
.cmd { padding: 2px 10px; border-radius: 999px; background: #e8f2fc; color: var(--blue); font: 500 13px/1.6 ui-monospace, Consolas, monospace; }
.text-item > .muted { margin: 4px 0 16px; }
.text-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: 24px; align-items: start; }
.text-grid textarea { margin: 0; min-height: 260px; font-size: 14px; line-height: 1.6; }

.tg { position: sticky; top: 24px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 12px 30px rgba(2, 34, 64, .08); }
.tg-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--navy); color: #fff; }
.tg-top img { width: 34px; height: 34px; padding: 5px; border-radius: 50%; background: #fff; object-fit: contain; }
.tg-top div { display: flex; flex-direction: column; line-height: 1.2; }
.tg-top b { font-size: 14px; font-weight: 600; }
.tg-top span { color: var(--mist); font-size: 12px; }
.tg-chat {
  min-height: 210px; padding: 16px 14px 18px;
  background-color: #dfe9f3;
  background-image: radial-gradient(rgba(53, 117, 180, .14) 1px, transparent 1px);
  background-size: 14px 14px;
}
.tg-bubble { position: relative; max-width: 90%; padding: 9px 12px 20px; border-radius: 14px 14px 14px 4px; background: #fff; font-size: 14px; line-height: 1.5; box-shadow: 0 1px 2px rgba(2, 34, 64, .12); overflow-wrap: anywhere; }
.tg-text a { color: var(--link); font-weight: 400; }
.tg-text a:hover { background: none; box-shadow: none; }
.tg-text:empty::before { content: "Escribe la respuesta para ver aquí cómo la recibe el cliente."; color: var(--muted); font-style: italic; }
.tg-extra p { margin: 10px 0 0; }
.tg-time { position: absolute; right: 10px; bottom: 4px; color: var(--muted); font-size: 11px; }
.tg-keys { display: grid; gap: 5px; max-width: 90%; margin-top: 6px; }
.tg-keys div { display: flex; gap: 5px; }
.tg-keys span { display: flex; align-items: center; justify-content: center; flex: 1; padding: 8px 6px; border-radius: 10px; background: rgba(255, 255, 255, .72); border: 1px solid rgba(53, 117, 180, .18); color: var(--blue); font-size: 13px; font-weight: 500; text-align: center; line-height: 1.2; }

@media (max-width: 1100px) {
  .text-grid { grid-template-columns: minmax(0, 1fr); }
  .text-grid textarea { min-height: 180px; }
  .tg { position: static; width: 100%; max-width: 420px; }
}
.save-bar { position: sticky; bottom: 0; padding: 16px 0; background: linear-gradient(transparent, var(--bg) 35%); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 24px; margin-bottom: 20px; }

.avatar { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--blue), var(--blue-2)); color: #fff; font-weight: 600; }
.tag { padding: 3px 10px; border-radius: 999px; background: #e8f2fc; color: var(--blue); font-size: 12px; font-weight: 600; white-space: nowrap; }
.tag.type-asesor { background: #fdf3e2; color: #9a5b00; }

.req { position: relative; margin-bottom: 16px; padding: 20px 24px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 1px 2px rgba(2, 34, 64, .04); }
.req.nuevo::before { content: ""; position: absolute; left: -1px; top: 18px; bottom: 18px; width: 4px; border-radius: 0 4px 4px 0; background: var(--blue); }
.req.atendido { padding-block: 14px; background: #fafcfe; }
.req.atendido > :not(.req-head) { display: none; }
.req.atendido .avatar { background: var(--line); color: var(--muted); }
.req-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.req-clean { margin: -8px 0 16px; }
.req-who { display: flex; flex-direction: column; min-width: 0; margin-right: auto; line-height: 1.35; }
.req-who b { font-weight: 600; }
.req-who .muted { display: flex; flex-wrap: wrap; gap: 0 10px; font-size: 13px; }
.req-sum { margin-top: 2px; overflow: hidden; color: var(--navy); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.req-sum b { font-weight: 600; }
.req-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 18px 0 16px; }
.req-field { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; }
.req-field span { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 500; }
.req-field .i { color: var(--blue); }
.req-field b, .req-field a { font-weight: 500; overflow-wrap: anywhere; }
.req-msg { grid-column: 1 / -1; margin: 0; padding: 12px 16px; border-left: 3px solid var(--blue-2); border-radius: 0 10px 10px 0; background: var(--bg); }
.req-msg span { color: var(--muted); font-size: 12px; font-weight: 500; }
.req-msg p { margin: 2px 0 0; }

.seg fieldset { display: inline-flex; margin: 0; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.seg label { position: relative; margin: 0; font-size: 13px; font-weight: 500; cursor: pointer; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.seg label span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 7px; color: var(--muted); }
.seg label:hover span { color: var(--navy); }
.seg input:checked + span { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(2, 34, 64, .12); }
.seg input[value="atendido"]:checked + span { color: #1f8a4c; }
.seg input:focus-visible + span { outline: 3px solid var(--sky); }
.seg .i { width: auto; font-size: 11px; }

.composer { display: flex; gap: 8px; align-items: flex-end; padding: 6px 6px 6px 8px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.composer:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--sky); }
.composer textarea { flex: 1; width: 100%; min-width: 0; margin: 0; border: 0; background: none; resize: none; field-sizing: content; max-height: 160px; }
.composer textarea:focus-visible { outline: 0; }

.who-link { color: var(--navy); font-weight: 600; text-decoration: none; }
.who-link:hover { color: var(--blue); }
.thread-link { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 10px 14px; border-radius: 10px; background: var(--bg); color: var(--navy); font-size: 14px; text-decoration: none; }
.thread-link:hover { background: #e8f2fc; }
.thread-link .i { color: var(--blue); }
.thread-link span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-link b { color: var(--blue); font-size: 13px; font-weight: 600; white-space: nowrap; }

.back-link { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px; color: var(--blue); font-weight: 500; text-decoration: none; }
.back-link:hover { color: var(--navy); }
.chat-page { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.chat-box { display: flex; flex-direction: column; height: calc(100vh - 140px); min-height: 460px; padding: 0; overflow: hidden; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.chat-head .req-who .muted { display: flex; flex-wrap: wrap; gap: 0 12px; }
.thread {
  flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 20px; overflow-y: auto;
  background-color: #dfe9f3;
  background-image: radial-gradient(rgba(53, 117, 180, .12) 1px, transparent 1px);
  background-size: 14px 14px;
}
.thread-empty { margin: auto; text-align: center; max-width: 34ch; }
.thread-day { align-self: center; margin: 10px 0 4px; }
.thread-day span { padding: 3px 10px; border-radius: 999px; background: rgba(2, 34, 64, .12); color: var(--navy); font-size: 12px; font-weight: 500; }
.thread-seg { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 12px; border-left: 3px solid var(--blue); border-radius: 0 12px 12px 0; background: rgba(255, 255, 255, .35); scroll-margin-top: 12px; }
.thread-seg.alt { border-left-color: #1f8a4c; }
.thread-seg:target { background: rgba(255, 255, 255, .7); }
.seg-head { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; color: var(--blue); font-size: 12px; font-weight: 600; }
.thread-seg.alt .seg-head { color: #1f8a4c; }
.seg-head .i { width: auto; }
.msg { position: relative; max-width: 75%; padding: 8px 12px 18px; border-radius: 14px 14px 14px 4px; background: #fff; box-shadow: 0 1px 2px rgba(2, 34, 64, .1); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.msg.out { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: var(--blue); color: #fff; }
.msg p { margin: 0; }
.msg span { position: absolute; right: 10px; bottom: 3px; font-size: 11px; color: var(--muted); }
.msg.out span { color: var(--mist); }
.msg.bot { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: #e8f2fc; color: var(--navy); }
.chat-box .composer { margin: 12px; }
.chat-side { position: sticky; top: 24px; max-height: calc(100vh - 140px); overflow-y: auto; }
.side-req { padding: 12px 0; border-top: 1px solid var(--line); font-size: 14px; }
.side-req-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.side-req-head .muted { font-size: 12px; }
.side-req p { margin: 4px 0; }
.side-req-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; }
.state { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--blue); }
.state.atendido { color: #1f8a4c; }

@media (max-width: 1000px) {
  .chat-page { grid-template-columns: minmax(0, 1fr); }
  .chat-box { height: 70vh; }
  .chat-side { position: static; max-height: none; }
}
.composer button { display: inline-flex; align-items: center; border-radius: 10px; white-space: nowrap; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stats div { display: flex; flex-direction: column; padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.stats b { font-size: 26px; font-weight: 600; line-height: 1.2; }
.stats span { color: var(--muted); font-size: 13px; }
.users { padding: 8px 12px; }
.users td { vertical-align: middle; }
.person { display: flex; align-items: center; gap: 12px; }
.person > span:last-child { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.person b { font-weight: 600; }
.person a, .person .muted { font-size: 13px; }
.count-pill { display: inline-grid; place-items: center; min-width: 28px; padding: 1px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: 13px; font-weight: 600; }
.count-pill.has { background: #e8f2fc; color: var(--blue); }

.cmd-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 20px; margin: 0; padding: 0; list-style: none; }
.cmd-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.cmd-fields { display: grid; grid-template-columns: minmax(180px, 260px) minmax(0, 1fr); gap: 0 16px; margin-top: 12px; }
.cmd-input { display: flex; align-items: stretch; margin-top: 6px; }
.cmd-input > span { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--line); border-right: 0; border-radius: 8px 0 0 8px; background: var(--bg); color: var(--muted); font-family: ui-monospace, Consolas, monospace; }
.cmd-input input { margin: 0; border-radius: 0 8px 8px 0; font-family: ui-monospace, Consolas, monospace; }
.text-item .actions { margin-top: 16px; }
.empty { margin-bottom: 20px; padding: 48px 24px; text-align: center; background: #fff; border: 1px dashed var(--line); border-radius: 14px; }

.item { display: grid; grid-template-columns: 1fr 96px; gap: 0 16px; }
.item .description, .item .url, .item .actions, .item h2 { grid-column: 1 / -1; }
.actions { display: flex; gap: 8px; align-items: center; }
.new { border-style: dashed; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; font-size: 14px; }
tr:last-child td { border-bottom: 0; }

@media (min-width: 801px) {
  .shell-form { max-height: min(720px, calc(100vh - 48px)); align-self: stretch; display: flex; flex-direction: column; justify-content: safe center; overflow-y: auto; overscroll-behavior: contain; }
  .wizard-actions { position: sticky; bottom: calc(var(--pad) * -1); margin-bottom: calc(var(--pad) * -1); padding: 16px 0 var(--pad); background: #fff; }
}

@media (max-width: 800px) {
  .shell { grid-template-columns: minmax(0, 1fr); gap: 24px; min-height: 0; width: min(440px, 100%); background: none; box-shadow: none; overflow: visible; border-radius: 0; }
  .shell-brand { padding: 0 var(--pad); background: none; }
  .login-tag { margin-top: 20px; font-size: 24px; }
  .chat, .wizard { display: none; }
  .upload { grid-template-columns: 72px minmax(0, 1fr); }
  .upload-btn { grid-column: 1 / -1; justify-content: center; }
  .chat-field { max-width: 100%; }
  .shell-form { background: #fff; border-radius: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  aside { position: static; height: auto; padding: 16px; gap: 12px; }
  aside nav { flex-direction: row; overflow-x: auto; }
  aside nav a { white-space: nowrap; gap: 8px; }
  aside form { position: absolute; top: 16px; right: 16px; margin: 0; }
  .composer .txt { display: none; }
  .composer button .i { margin: 0; }
  main { padding: 24px 16px; }
  .req { padding: 16px; }
  .cmd-fields { grid-template-columns: minmax(0, 1fr); }
  .users { padding: 4px 14px; }
  .users thead { display: none; }
  .users tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .users tr:last-child { border-bottom: 0; }
  .users td { padding: 0; border: 0; font-size: 13px; }
  .users td:first-child { grid-column: 1 / -1; margin-bottom: 4px; }
  .users td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { .bubble { animation: none; } }

.tg-ask { position: relative; width: fit-content; max-width: 80%; margin: 0 0 8px auto; padding: 7px 12px 18px; border-radius: 14px 14px 4px 14px; background: #cfe3f8; color: var(--navy); font-size: 14px; box-shadow: 0 1px 2px rgba(2, 34, 64, .1); overflow-wrap: anywhere; }
.tg-ask .tg-time { color: #4f6f8f; }
.preview-label { margin: 0 0 8px; color: var(--muted); font-size: 13px; font-weight: 500; }

a.add-card { display: flex; align-items: center; gap: 14px; border-style: dashed; color: var(--navy); }
a.add-card:hover { border-color: var(--blue); background: #fff; box-shadow: none; color: var(--navy); }
.add-card > .i { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: #e8f2fc; color: var(--blue); }
.add-card > span { display: flex; flex-direction: column; }
.add-card b { font-weight: 600; }

.list-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 24px; align-items: start; }
.list-preview { position: sticky; top: 24px; }
.item-card h2, .member-card h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.item-card h2 .i, .member-card h2 .i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #e8f2fc; color: var(--blue); font-size: 13px; }
.item-top { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 0 14px; }
.item-name input { font-weight: 600; }
.item-card .actions, .member-card .actions { margin-top: 4px; }

.member-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.member-head .req-who { margin-right: auto; }
.link-state { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.link-state.on { background: #e7f6ec; color: #1f8a4c; }
.link-state.off { background: #fdf3e2; color: #9a5b00; }
.link-state .i { width: auto; font-size: 11px; }
.join-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; padding: 12px 16px; border-radius: 10px; background: var(--bg); font-size: 14px; }
.join-box p { margin: 0; }
.join-box code { padding: 6px 12px; border-radius: 8px; background: #fff; border: 1px solid var(--line); color: var(--navy); font: 600 15px ui-monospace, Consolas, monospace; letter-spacing: .04em; user-select: all; }
.member-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.checks-group { display: flex; flex-wrap: wrap; gap: 8px; }
.checks-group legend { width: 100%; }
.check { position: relative; margin: 0; font-size: 13px; cursor: pointer; }
.check input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.check span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-weight: 500; }
.check span::before { content: ""; width: 14px; height: 14px; border: 2px solid var(--line); border-radius: 4px; }
.check input:checked + span { border-color: var(--blue); background: #e8f2fc; color: var(--navy); }
.check input:checked + span::before { content: "\f00c"; display: grid; place-items: center; border-color: var(--blue); background: var(--blue); color: #fff; font: 900 9px/1 "Font Awesome 6 Free"; }
.check input:focus-visible + span { outline: 3px solid var(--sky); }

@media (max-width: 1100px) {
  .list-page { grid-template-columns: minmax(0, 1fr); }
  .list-preview { position: static; max-width: 420px; }
}
@media (max-width: 800px) {
  .member-fields, .item-top { grid-template-columns: minmax(0, 1fr); }
}
.tabs { display: flex; gap: 4px; margin: 0 0 20px; padding: 4px; width: fit-content; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 9px; color: var(--muted); font-weight: 500; }
.tabs a:hover { background: var(--bg); box-shadow: none; color: var(--navy); }
.tabs a[aria-current] { background: var(--blue); color: #fff; }
.tabs .i { width: auto; }

.tg-anim .tg-chat { position: relative; display: flex; flex-direction: column; justify-content: flex-end; height: 330px; overflow: hidden; }
.tg-anim .tg-keys { max-width: 90%; }
.tg-menu { position: absolute; left: 10px; right: 10px; bottom: 8px; overflow: hidden; border-radius: 12px; background: #fff; box-shadow: 0 10px 30px rgba(2, 34, 64, .22); }
.tg-menu-item { display: flex; align-items: baseline; gap: 10px; padding: 9px 14px; font-size: 13px; border-top: 1px solid var(--line); }
.tg-menu-item:first-child { border-top: 0; }
.tg-menu-item b { color: var(--blue); font-weight: 600; white-space: nowrap; }
.tg-menu-item span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-menu-item.on { background: #e8f2fc; }
.tg-input { display: flex; align-items: center; gap: 2px; padding: 10px 14px; border-top: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 14px; }
.tg-input .i { margin-left: auto; color: var(--blue); }
.a-slash { color: var(--navy); }
.a-caret { width: 2px; height: 18px; background: var(--blue); }
.a-ph { margin-left: 4px; }

.a-ask, .a-reply, .a-keys, .a-menu, .a-slash, .a-ph, .a-caret, .tg-menu-item.on { animation: 10s linear infinite both; }
.a-slash { animation-name: tg-slash; }
.a-ph { animation-name: tg-ph; }
.a-caret { animation-name: tg-caret; }
.a-menu { animation-name: tg-menu; }
.tg-menu-item.on { animation-name: tg-pick; }
.a-ask { animation-name: tg-ask; }
.a-reply { animation-name: tg-reply; }
.a-keys { animation-name: tg-keys; }
@keyframes tg-slash { 0%, 8% { opacity: 0; } 9%, 44% { opacity: 1; } 45%, 100% { opacity: 0; } }
@keyframes tg-ph { 0%, 8% { opacity: 1; } 9%, 44% { opacity: 0; } 45%, 100% { opacity: 1; } }
@keyframes tg-caret { 0%, 4%, 10%, 16%, 22%, 28%, 34%, 40% { opacity: 1; } 2%, 7%, 13%, 19%, 25%, 31%, 37%, 43% { opacity: 0; } 45%, 100% { opacity: 0; } }
@keyframes tg-menu { 0%, 12% { opacity: 0; transform: translateY(16px); } 16%, 42% { opacity: 1; transform: none; } 46%, 100% { opacity: 0; transform: translateY(16px); } }
@keyframes tg-pick { 0%, 30% { background: #e8f2fc; } 33%, 40% { background: #cfe3f8; } 43%, 100% { background: #e8f2fc; } }
@keyframes tg-ask { 0%, 46% { opacity: 0; transform: translateY(12px); } 50%, 94% { opacity: 1; transform: none; } 98%, 100% { opacity: 0; } }
@keyframes tg-reply { 0%, 56% { opacity: 0; transform: translateY(12px); } 60%, 94% { opacity: 1; transform: none; } 98%, 100% { opacity: 0; } }
@keyframes tg-keys { 0%, 60% { opacity: 0; transform: translateY(12px); } 64%, 94% { opacity: 1; transform: none; } 98%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .a-ask, .a-reply, .a-keys, .a-menu, .a-slash, .a-ph, .a-caret, .tg-menu-item.on { animation: none; }
  .a-menu, .a-slash, .a-caret { display: none; }
}

.node { position: relative; }
.node.depth-2 { margin-left: 32px; }
.node.depth-3 { margin-left: 64px; }
.node.depth-2::before, .node.depth-3::before { content: ""; position: absolute; left: -18px; top: 0; bottom: 20px; width: 2px; border-radius: 2px; background: var(--line); }
.node-path { color: var(--muted); font-size: 13px; }
.add-child { margin: -8px 0 20px 24px; }
.add-child summary { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px dashed var(--line); border-radius: 10px; background: #fff; color: var(--blue); font-size: 14px; font-weight: 500; cursor: pointer; list-style: none; }
.add-child summary::-webkit-details-marker { display: none; }
.add-child summary:hover { border-color: var(--blue); background: #e8f2fc; }
.add-child[open] summary { margin-bottom: 10px; }

[data-cmdform] .mode-source { display: none; }
[data-cmdform].mode-source-on .mode-source { display: block; }
[data-cmdform].mode-source-on .mode-text { display: none; }
.show-menu { display: inline-block; margin-bottom: 14px; }
.tg-anim.no-keys .a-keys { display: none; }
p.hint { margin: -6px 0 14px; }

.cover-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 16px; }
.cover { display: flex; align-items: center; gap: 16px; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; flex: 1; min-width: 260px; }
.cover:hover { border-color: var(--blue); }
.cover:focus-within { outline: 3px solid var(--sky); border-color: var(--blue); }
.cover-img { display: grid; place-items: center; flex: none; width: 160px; min-height: 90px; overflow: hidden; border-radius: 8px; background: var(--bg); color: var(--muted); font-size: 13px; }
.cover-img img { display: block; width: 100%; height: auto; }
.cover-img > span { display: flex; align-items: center; gap: 6px; }
.cover-info { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.cover-info b { font-weight: 500; }
.cover:hover .upload-btn { border-color: var(--blue); background: #e8f2fc; }
.tg-extra .tg-photo { display: block; width: 100%; aspect-ratio: 16 / 9; margin: 10px 0 6px; border-radius: 8px; object-fit: cover; }

.join-box { display: block; }
.join-box b { display: block; margin-bottom: 2px; }
.join-box p { margin: 0 0 8px; }
.join-link { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.join-link code { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; letter-spacing: 0; }
.join-box .hint code { padding: 2px 6px; font-size: 12px; }
button.copy-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; background: #fff; color: var(--blue); border: 2px solid var(--line); font-size: 13px; }
button.copy-btn:hover { background: #e8f2fc; border-color: var(--blue); color: var(--navy); }
.copy-btn .i { margin: 0; width: auto; }
.member-head > div h2 { margin-bottom: 2px; }
.member-head > div .muted { margin: 0; font-size: 14px; }

@media (max-width: 800px) {
  .node.depth-2 { margin-left: 14px; }
  .node.depth-3 { margin-left: 28px; }
  .cover-img { width: 110px; }
}
.check input[type="radio"] + span::before { border-radius: 50%; }
.check input[type="radio"]:checked + span::before { content: ""; background: #fff; border: 4px solid var(--blue); }
.check input:disabled + span { opacity: .5; cursor: not-allowed; }

.cselect { position: relative; margin-top: 6px; }
.cselect-native { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.cselect-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; margin: 0; padding: 10px 12px; background: #fff; color: var(--navy); border: 1px solid var(--line); border-radius: 8px; font-weight: 400; text-align: left; }
.cselect-btn::after { content: "\f078"; font: 900 11px/1 "Font Awesome 6 Free"; color: var(--muted); transition: transform .15s; }
.cselect-btn[aria-expanded="true"]::after { transform: rotate(180deg); }
.cselect-btn:hover { background: #fff; border-color: var(--blue); }
.cselect-btn[aria-expanded="true"] { border-color: var(--blue); box-shadow: 0 0 0 3px var(--sky); }
.cselect-list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); max-height: 260px; margin: 0; padding: 6px; overflow-y: auto; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 14px 34px rgba(2, 34, 64, .16); }
.cselect-list li { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px calc(10px + var(--depth, 0) * 18px); border-radius: 7px; font-size: 14px; cursor: pointer; }
.cselect-list li::before { content: ""; flex: none; width: 14px; font: 900 11px/1 "Font Awesome 6 Free"; color: var(--blue); }
.cselect-list li[aria-selected="true"] { font-weight: 600; color: var(--navy); }
.cselect-list li[aria-selected="true"]::before { content: "\f00c"; }
.cselect-list li.active, .cselect-list li:hover { background: #e8f2fc; }
.seg .cselect, .req-head .cselect { margin: 0; }

.check.block { display: inline-block; margin: 0 0 14px; }
.cat-card .text-head { margin-bottom: 14px; }
.cat-card .actions { margin-top: 2px; }
.options { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.options h3 { margin: 0 0 10px; font-size: 15px; font-weight: 600; }
.option { margin-bottom: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.option > summary { display: flex; align-items: center; gap: 12px; padding: 10px 14px; cursor: pointer; list-style: none; }
.option > summary::-webkit-details-marker { display: none; }
.option > summary::before { content: "\f054"; font: 900 11px/1 "Font Awesome 6 Free"; color: var(--muted); transition: transform .15s; }
.option[open] > summary::before { transform: rotate(90deg); }
.option > summary b { font-weight: 600; white-space: nowrap; }
.option > summary .muted { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.option > summary:hover { background: var(--bg); border-radius: 10px; }
.option > form { padding: 4px 14px 14px; }
.options .add-child { margin: 10px 0 0; }
.options .add-child > form { margin-top: 10px; padding: 16px; border: 1px dashed var(--line); border-radius: 12px; }
.group-title { margin: 6px 0 8px; font-size: 14px; font-weight: 600; }
.member-card .checks-group legend { color: var(--muted); font-size: 13px; }

.flow > .muted { margin: 4px 0 18px; }
.flow-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 24px; align-items: start; }
.flow-steps { position: relative; margin: 0; padding: 0; list-style: none; }
.flow-steps::before { content: ""; position: absolute; left: 15px; top: 16px; bottom: 16px; width: 2px; background: var(--line); }
.flow-steps li { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 14px; margin-bottom: 6px; }
.step-n { position: relative; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 14px; font-weight: 600; }
.flow-steps li.alt .step-n { background: #fdf3e2; color: #9a5b00; border: 2px solid #f3d9a8; }
.flow-steps li.end .step-n { background: #1f8a4c; }
.flow-steps label { margin-bottom: 10px; }
.flow-steps textarea { min-height: 76px; }
.flow-preview { position: sticky; top: 24px; }
.flow-preview .tg-chat { max-height: calc(100vh - 160px); overflow-y: auto; }
.list-preview .tg-chat { position: relative; max-height: calc(100vh - 140px); overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; }
.flow-preview .tg-bubble, .flow-preview .tg-keys { margin-bottom: 8px; }
.tg-reply-keys span { background: #fff; border-color: var(--line); color: var(--navy); border-radius: 8px; }
.cmd-list .tag { margin-left: 6px; text-decoration: none; }
@media (max-width: 1100px) {
  .flow-grid { grid-template-columns: minmax(0, 1fr); }
  .flow-preview { position: static; max-width: 420px; }
}

.bot-section { margin: 32px 0 12px; font-size: 18px; }
.bot-section + .muted { margin-top: -6px; }
.bot-item { margin-bottom: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; scroll-margin-top: 16px; }
.bot-item > summary { display: flex; align-items: center; gap: 14px; padding: 14px 20px; cursor: pointer; list-style: none; border-radius: 14px; }
.bot-item > summary::-webkit-details-marker { display: none; }
.bot-item > summary::after { content: "\f078"; margin-left: auto; font: 900 12px/1 "Font Awesome 6 Free"; color: var(--muted); transition: transform .15s; }
.bot-item[open] > summary::after { transform: rotate(180deg); }
.bot-item > summary:hover { background: var(--bg); }
.bot-item[open] > summary { border-bottom: 1px solid var(--line); border-radius: 14px 14px 0 0; }
.bi-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.bi-kind { color: var(--muted); font-size: 14px; }
.bot-item.add { border-style: dashed; }
.bot-item.add .bi-label { color: var(--blue); }
.bot-body { display: block; padding: 20px; }
.bot-body > .muted { margin-bottom: 16px; }
.bot-body .options { margin-top: 20px; }
.bot-body .hint { margin: -6px 0 14px; }
.bot-body textarea { field-sizing: content; min-height: 76px; max-height: 320px; }

[data-nodeform] .kind-form { display: none; }
[data-nodeform].kind-form-on .kind-form { display: block; }
[data-nodeform].kind-form-on .kind-text { display: none; }
.form-steps { margin: 0 0 12px; padding: 0; list-style: none; counter-reset: paso; }
.form-step { counter-increment: paso; display: grid; grid-template-columns: 32px minmax(0, 1fr) 40px; gap: 12px; align-items: start; margin-bottom: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.form-step::before { content: counter(paso); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 600; font-size: 14px; }
.form-step label { margin-bottom: 10px; }
.form-step-opts { display: grid; grid-template-columns: minmax(160px, 220px) minmax(0, 1fr); gap: 0 12px; }
.form-step-opts label { margin-bottom: 0; }
.shell-form button.step-remove, button.step-remove { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; background: #fff; color: var(--danger); border: 1px solid var(--line); }
button.step-remove:hover { background: #fdecea; border-color: var(--danger); }
button.add-step { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px; padding: 9px 14px; background: #fff; color: var(--blue); border: 1px dashed var(--blue); }
button.add-step:hover { background: #e8f2fc; }
button.add-step .i, button.step-remove .i { margin: 0; width: auto; }
@media (max-width: 800px) {
  .form-step { grid-template-columns: minmax(0, 1fr) 40px; }
  .form-step::before { display: none; }
  .form-step-opts { grid-template-columns: minmax(0, 1fr); }
}
.opt-list .form-step { grid-template-columns: minmax(0, 1fr) 40px; } .opt-list .form-step::before { display: none; }

.node-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 24px; align-items: start; }
.node-editor .flow-preview .tg-chat { min-height: 220px; }
@media (max-width: 1100px) {
  .node-editor { grid-template-columns: minmax(0, 1fr); }
  .node-editor .flow-preview { position: static; max-width: 420px; }
}

.toast { position: fixed; z-index: 50; right: 24px; bottom: 24px; display: flex; align-items: center; gap: 12px; max-width: min(420px, calc(100vw - 48px)); padding: 12px 12px 12px 16px; border-radius: 12px; background: var(--navy); color: #fff; box-shadow: 0 14px 34px rgba(2, 34, 64, .3); animation: toast-in .25s ease-out; }
.toast > .i { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #1f8a4c; font-size: 12px; }
.toast.err > .i { background: var(--danger); }
.toast span { flex: 1; font-size: 14px; line-height: 1.4; }
button.toast-close { flex: none; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; background: none; color: var(--mist); border-radius: 8px; }
button.toast-close:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.toast-close .i { margin: 0; width: auto; }
.toast.hide { opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } .toast.hide { transition: none; } }
@media (max-width: 800px) { .toast { left: 16px; right: 16px; bottom: 16px; max-width: none; } }

input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.cover-row button.danger { padding: 8px 10px; }
.tg-cards { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.tg-card { position: relative; max-width: 90%; overflow: hidden; border-radius: 14px; background: #fff; box-shadow: 0 1px 2px rgba(2, 34, 64, .12); font-size: 14px; line-height: 1.5; }
.tg-card img { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: contain; background: var(--navy); }
.tg-card .tg-caption { padding: 8px 12px 20px; }
.tg-card + .tg-keys { margin-top: -4px; }
.tg-keys [data-cat] { cursor: pointer; }
.tg-keys [data-cat]:hover, .tg-keys [data-cat].on { background: var(--blue); border-color: var(--blue); color: #fff; }
.tg-keys [data-cat]:focus-visible { outline: 3px solid var(--sky); }
.tg-cards .tg-ask { align-self: flex-end; }
.cover { cursor: default; }
.cover-info .upload-btn { cursor: pointer; }
.cover-tabs { display: inline-flex; gap: 2px; margin: 4px 0 6px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); }
.cover-tabs button { margin: 0; padding: 4px 10px; border-radius: 6px; background: none; color: var(--muted); font-size: 12px; font-weight: 500; }
.cover-tabs button:hover { background: #fff; color: var(--navy); }
.cover-tabs button[aria-pressed="true"] { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(2, 34, 64, .12); }
.cover-info { flex: 1; min-width: 0; }
[data-cover-pane] { width: 100%; }
[data-cover-pane="url"] input { width: 100%; margin: 0; font-size: 13px; }
.cover-tabs button { white-space: nowrap; }
.list-items .bot-item.add { margin-bottom: 16px; }

.contact-row { display: grid; grid-template-columns: 2fr 1fr; gap: 0 12px; }
.contact-row > label:only-child { grid-column: 1 / -1; }
@media (max-width: 640px) { .contact-row { grid-template-columns: 1fr; } }

.contact-form h2 + .muted { margin-top: -6px; }
.contact-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.contact-field { display: flex; align-items: center; gap: 14px; margin: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; font-weight: 400; transition: border-color .15s; }
.contact-field:focus-within { border-color: var(--blue); }
.contact-ico { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 12px; background: #e8f2fc; color: var(--blue); font-size: 18px; }
.contact-main { display: block; flex: 1; min-width: 0; }
.contact-main label { margin: 0; font-weight: 400; }
.contact-name { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--navy); }
.contact-name code { padding: 1px 6px; border-radius: 5px; background: var(--bg); color: var(--muted); font-size: 11px; font-weight: 400; }
.contact-main input { margin-top: 4px; padding: 8px 10px; font-size: 14px; }
.contact-pair { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 10px; }
@media (max-width: 640px) {
  .contact-field { align-items: flex-start; }
  .contact-pair { grid-template-columns: 1fr; }
}

button.contact-ico { margin: 0; padding: 0; border: 0; cursor: pointer; transition: transform .15s, box-shadow .15s; }
button.contact-ico:hover { transform: scale(1.06); box-shadow: 0 0 0 3px var(--sky); background: #e8f2fc; color: var(--blue); }
.cb-ico[data-brand="whatsapp"] { background: #e3f8ea; color: #1a9e4b; }
.cb-ico[data-brand="facebook-f"], .cb-ico[data-brand="facebook"] { background: #e7effd; color: #1877f2; }
.cb-ico[data-brand="instagram"] { background: linear-gradient(45deg, #f9ce34, #ee2a7b 55%, #6228d7); color: #fff; }
.cb-ico[data-brand="tiktok"], .cb-ico[data-brand="x-twitter"], .cb-ico[data-brand="threads"], .cb-ico[data-brand="github"] { background: var(--navy); color: #fff; }
.cb-ico[data-brand="youtube"] { background: #fdeaea; color: #e62117; }
.cb-ico[data-brand="linkedin-in"], .cb-ico[data-brand="linkedin"] { background: #e6f0f8; color: #0a66c2; }
.cb-ico[data-brand="telegram"] { background: #e5f4fb; color: #229ed9; }
.cb-ico[data-brand="pinterest-p"] { background: #fde8ea; color: #e60023; }
.cb-list { margin: 0 0 12px; padding: 0; list-style: none; }
.cb-item { align-items: flex-start; }
.cb-tools { display: flex; flex-direction: column; gap: 2px; }
.cb-tools .icon-btn { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 6px; }
.cb-tools .icon-btn:disabled { opacity: .35; pointer-events: none; }
.icon-modal { width: min(640px, calc(100vw - 32px)); max-height: min(640px, calc(100vh - 48px)); padding: 0; border: 0; border-radius: 16px; box-shadow: 0 24px 64px rgba(2, 34, 64, .3); }
.icon-modal[open] { display: flex; flex-direction: column; }
.icon-modal::backdrop { background: rgba(2, 34, 64, .45); }
.icon-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 0; }
.icon-modal-head h2 { margin: 0; }
.icon-modal input[type="search"] { margin: 14px 20px 10px; width: auto; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; padding: 0 20px; overflow-y: auto; }
.icon-cell { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0; padding: 14px 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--navy); }
.icon-cell:hover, .icon-cell:focus-visible { border-color: var(--blue); background: #e8f2fc; color: var(--blue); }
.icon-cell i { font-size: 22px; }
.icon-cell span { max-width: 100%; overflow: hidden; color: var(--muted); font-size: 11px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.icon-count { margin: 0; padding: 10px 20px 16px; font-size: 12px; }
.cb-tools .icon-btn, .icon-modal-head .icon-btn { background: transparent; border: 0; color: var(--muted); box-shadow: none; }
.cb-tools .icon-btn:hover, .icon-modal-head .icon-btn:hover { background: #e8f2fc; color: var(--blue); }
.cb-tools .icon-btn.danger:hover { background: #fdecea; color: var(--danger); }
.cb-drag { display: grid; place-items: center; flex: none; align-self: center; width: 22px; height: 42px; margin: 0 -6px 0 -4px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: grab; touch-action: none; }
.cb-drag:hover, .cb-drag:focus-visible { background: var(--bg); color: var(--blue); }
.cb-item.dragging { position: relative; z-index: 2; transition: none; user-select: none; border-color: var(--blue); background: #f7fbff; box-shadow: 0 10px 24px rgba(2, 34, 64, .14); }
.cb-item.dragging .cb-drag { cursor: grabbing; }
.contact-form .muted .fa-grip-vertical { margin: 0 4px; color: var(--blue); }
.cb-list { gap: 14px; }
.cb-item { position: relative; }
.icon-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 20px 12px; }
.icon-filters button { margin: 0; padding: 6px 12px; border: 1px solid var(--line); border-radius: 99px; background: #fff; color: var(--muted); font-size: 13px; font-weight: 500; }
.icon-filters button:hover { border-color: var(--blue); color: var(--blue); }
.icon-filters button[aria-pressed="true"] { border-color: var(--blue); background: var(--blue); color: #fff; }
.icon-modal input[type="search"] { margin-bottom: 10px; }
.cb-list { gap: 8px; }
.cb-divider { display: flex; align-items: center; gap: 10px; padding: 0 4px 0 10px; color: var(--blue); font-size: 12px; font-weight: 500; }
.cb-divider .cb-drag { height: 28px; margin: 0; }
.cb-divider-label { display: flex; flex: 1; align-items: center; gap: 10px; }
.cb-divider-label::after { content: ""; flex: 1; border-top: 1px dashed var(--blue-2); }
.cb-divider .icon-btn { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 6px; }
.cb-divider.idle { color: var(--muted); }
.cb-divider.idle .cb-divider-label::after { border-color: var(--line); }
.cb-divider.dragging { border-radius: 8px; background: #f7fbff; box-shadow: 0 6px 16px rgba(2, 34, 64, .12); }
.cb-add { display: flex; flex-wrap: wrap; gap: 8px; }
