/* Sistema visual do painel, do login e da documentação, no idioma do WhatsApp para iOS:
   listas agrupadas, avatares redondos, filtros em pílula, balões sobre papel de parede.
   Claro e escuro seguem o sistema. Verde marca ação e estado ativo; o resto é neutro. */
:root {
    color-scheme: light dark;
    --bg: #f2f2f7;
    --surface: #ffffff;
    --surface-2: #f2f2f7;
    --bar: rgba(249, 249, 249, .82);
    --sidebar: #f7f7f8;
    --hairline: rgba(60, 60, 67, .18);
    --fill: rgba(118, 118, 128, .12);
    --fill-strong: rgba(118, 118, 128, .2);
    --text: #000000;
    --text-2: #5c5c62;
    --text-3: #6e6e73;
    --tint: #25d366;
    --on-tint: #06301a;
    --tint-text: #007a55;
    --tint-soft: #d8fdd2;
    --on-tint-soft: #15603e;
    --ok: #1fb45a;
    --wait: #ff9500;
    --down: #ff3b30;
    --warn-soft: #fff2d6;
    --on-warn-soft: #7a4a00;
    --error-soft: #ffe3e0;
    --on-error-soft: #a81c12;
    --info-soft: #e1f0ff;
    --on-info-soft: #0a4f8f;
    --error-text: #d70015;
    --wallpaper: #efe7dd;
    --bubble-in: #ffffff;
    --bubble-out: #d9fdd3;
    --bubble-text: #111b21;
    --bubble-meta: #5b6b74;
    --bubble-out-meta: #4a5f57;
    --bubble-out-link: #00664a;
    --tick-read: #027eb5;
    --avatar: #8a8f96;
    --on-avatar: #ffffff;
    --code-bg: #1c1c1e;
    --code-text: #e5e5ea;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .06);
    --shadow-2: 0 10px 40px rgba(0, 0, 0, .18);
    --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
    --r-cell: 12px;
    --r-sheet: 16px;
    --s1: 4px;
    --s2: 8px;
    --s3: 12px;
    --s4: 16px;
    --s5: 24px;
    --s6: 32px;
    --sidebar-w: 15rem;
    --ease: cubic-bezier(.32, .72, 0, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #000000;
        --surface: #1c1c1e;
        --surface-2: #2c2c2e;
        --bar: rgba(22, 22, 24, .82);
        --sidebar: #111113;
        --hairline: rgba(84, 84, 88, .6);
        --fill: rgba(118, 118, 128, .24);
        --fill-strong: rgba(118, 118, 128, .36);
        --text: #ffffff;
        --text-2: #aeaeb2;
        --text-3: #98989f;
        --tint-text: #21c063;
        --tint-soft: #103529;
        --on-tint-soft: #d8fdd2;
        --warn-soft: #3d2c0a;
        --on-warn-soft: #ffd60a;
        --error-soft: #3f1512;
        --on-error-soft: #ff9d94;
        --info-soft: #0c2a47;
        --on-info-soft: #8fc7ff;
        --error-text: #ff6961;
        --wallpaper: #0b141a;
        --bubble-in: #1f2c34;
        --bubble-out: #005c4b;
        --bubble-text: #e9edef;
        --bubble-meta: #a6b4bb;
        --bubble-out-meta: #c5dcd5;
        --bubble-out-link: #7ff0b0;
        --tick-read: #53bdeb;
        --avatar: #48484a;
        --code-bg: #111113;
        --shadow-1: none;
        --shadow-2: 0 10px 40px rgba(0, 0, 0, .6);
    }
}

*, *::before, *::after { box-sizing: border-box; }
[x-cloak] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.35;
    letter-spacing: -.005em;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

::selection { background: var(--tint-soft); color: var(--on-tint-soft); }
* { scrollbar-width: thin; scrollbar-color: var(--fill-strong) transparent; }
:focus-visible { outline: 2px solid var(--tint-text); outline-offset: 2px; }

h1, h2, h3, h4, p { margin: 0; }
a { color: var(--tint-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
button { font: inherit; color: inherit; }
ul { margin: 0; padding-left: 1.1rem; }
code, pre, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 13px; }

.ph { line-height: 1; font-size: 1.2em; vertical-align: -.15em; }
.spin { animation: spin .9s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.muted { color: var(--text-2); }
.small { font-size: 13px; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.break { overflow-wrap: anywhere; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.label { font-size: 13px; color: var(--text-2); }
.hint { font-size: 13px; color: var(--text-2); }
.sub { display: block; font-size: 13px; color: var(--text-2); }

/* ---------- Bolinhas de estado ---------- */
.dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--text-3); }
.dot--ok { background: var(--ok); }
.dot--wait { background: var(--wait); }
.dot--down, .dot--error { background: var(--down); }
.dot--neutral { background: var(--text-3); }
.dot--blink { animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* ---------- Estrutura ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--sidebar); border-right: .5px solid var(--hairline); }
.sidebar-brand { display: flex; align-items: center; gap: var(--s3); padding: var(--s4); }
.sidebar-brand strong { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.app-mark { display: block; flex: none; width: 34px; height: 34px; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 var(--s2); flex: 1; }
.nav-item { display: flex; align-items: center; gap: var(--s3); width: 100%; padding: 9px var(--s3); background: none; border: 0; border-radius: 10px; color: var(--text); font-size: 15px; font-weight: 500; text-align: left; text-decoration: none; cursor: pointer; transition: background-color .15s; }
.nav-item .ph { font-size: 21px; color: var(--text-2); }
.nav-item:hover { background: var(--fill); text-decoration: none; }
.nav-item[aria-current="page"] { background: var(--tint-soft); color: var(--on-tint-soft); font-weight: 600; }
.nav-item[aria-current="page"] .ph { color: var(--on-tint-soft); }
.sidebar-foot { display: flex; flex-direction: column; gap: 2px; padding: var(--s2); border-top: .5px solid var(--hairline); }
.live { display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--s3); font-size: 13px; color: var(--text-2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.page-head { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 10px var(--s5); background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: .5px solid var(--hairline); }
.page-head h1 { font-size: 28px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; }
.head-actions { display: flex; align-items: center; gap: var(--s2); }
.content { padding: var(--s4) var(--s5) var(--s6); display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
.content > [x-show], .stack { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }

/* ---------- Botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 6px 14px; background: var(--fill); color: var(--text); border: 0; border-radius: 999px; font-size: 15px; font-weight: 600; line-height: 1.1; text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color .15s, opacity .15s, transform .1s; }
.btn:hover:not(:disabled) { background: var(--fill-strong); text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(.97); opacity: .8; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--primary { background: var(--tint); color: var(--on-tint); }
.btn--primary:hover:not(:disabled) { background: #1fc05c; }
.btn--tinted { background: var(--tint-soft); color: var(--on-tint-soft); }
.btn--tinted:hover:not(:disabled) { background: var(--tint-soft); opacity: .85; }
.btn--danger { color: var(--error-text); }
.btn--danger:hover:not(:disabled) { background: var(--error-soft); color: var(--error-text); }
.btn--full { width: 100%; }
.btn--sm { min-height: 30px; padding: 4px 12px; font-size: 13px; }
.btn--icon { width: 36px; min-width: 36px; padding: 0; font-size: 16px; }
.btn--sm.btn--icon { width: 30px; min-width: 30px; font-size: 14px; }
.btn--plain { background: none; color: var(--tint-text); padding-inline: 6px; }
.btn--plain:hover:not(:disabled) { background: var(--fill); }
.btn--meta { background: #1877f2; color: #fff; }
.btn--meta:hover:not(:disabled) { background: #166fe5; }

/* ---------- Campos ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .field > .label { display: block; }
.input { width: 100%; min-height: 38px; padding: 7px 12px; background: var(--fill); color: var(--text); border: 0; border-radius: 10px; font-family: var(--font); font-size: 15px; caret-color: var(--tint-text); }
.input::placeholder { color: var(--text-2); opacity: 1; }
.input:focus { outline: 2px solid var(--tint); outline-offset: 0; }
.input:disabled { opacity: .55; cursor: not-allowed; }
.input--mono { font-family: var(--mono); font-size: 13px; }
textarea.input { resize: vertical; line-height: 1.4; }
select.input { -webkit-appearance: none; appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%238e8e93'%3E%3Cpath d='M213.66 101.66l-80 80a8 8 0 0 1-11.32 0l-80-80a8 8 0 0 1 11.32-11.32L128 164.69l74.34-74.35a8 8 0 0 1 11.32 11.32Z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: 14px; background-position: right 10px center; }
.input--search { padding-left: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%238e8e93'%3E%3Cpath d='M229.66 218.34l-50.07-50.06a88.11 88.11 0 1 0-11.31 11.31l50.06 50.07a8 8 0 0 0 11.32-11.32ZM40 112a72 72 0 1 1 72 72 72.08 72.08 0 0 1-72-72Z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: 17px; background-position: 11px center; }
.field-grid { display: grid; gap: var(--s3); grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); }
.fixed-value { padding: 8px 12px; background: var(--fill); border-radius: 10px; font-family: var(--mono); font-size: 13px; color: var(--text-2); }

/* Interruptor do iOS */
.switch { position: relative; display: inline-flex; flex: none; width: 51px; height: 31px; cursor: pointer; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: var(--fill-strong); border-radius: 999px; transition: background-color .2s; }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; background: #fff; border-radius: 50%; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 3px 1px rgba(0, 0, 0, .06); transition: transform .25s var(--ease); }
.switch input:checked + span { background: #34c759; }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--tint-text); outline-offset: 2px; }

.option-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: 10px var(--s4); background: var(--surface); border-radius: var(--r-cell); }
.panel-body > .option-row { background: var(--surface-2); }

/* Seleção em círculo, como na seleção de conversas */
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); column-gap: var(--s4); padding: var(--s1) var(--s4); background: var(--surface); border-radius: var(--r-cell); max-height: 20rem; overflow-y: auto; }
.panel-body .check-list { background: var(--surface-2); }
.check-list label { display: flex; align-items: center; gap: var(--s3); padding: 9px 0; border-bottom: .5px solid var(--hairline); cursor: pointer; font-family: var(--mono); font-size: 13px; }
.check-list input, .mode-option input { appearance: none; -webkit-appearance: none; flex: none; width: 22px; height: 22px; margin: 0; border: 1.5px solid var(--text-3); border-radius: 50%; background: transparent; cursor: pointer; }
.check-list input:checked, .mode-option input:checked { background: var(--tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2306301a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center/16px no-repeat; border-color: var(--tint); }
.check-list.disabled { opacity: .5; }
.check-list.disabled label, .check-list.disabled input { cursor: not-allowed; }

/* ---------- Grupos ---------- */
.panel { background: var(--surface); border-radius: var(--r-cell); box-shadow: var(--shadow-1); min-width: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s2) var(--s4); padding: 12px var(--s4); border-bottom: .5px solid var(--hairline); }
.panel-head h2, .panel-head h3 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.panel-body { padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
.panel--narrow { max-width: 34rem; }
.panel--medium { max-width: 46rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); align-items: start; }

.bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.bar--between { justify-content: space-between; }
.bar .input { width: auto; min-width: 10rem; }
.bar .input--search { flex: 1 1 14rem; max-width: 26rem; }

.tags { display: flex; flex-wrap: wrap; gap: var(--s1); align-items: center; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; background: var(--fill); color: var(--text-2); font-size: 12px; font-weight: 500; line-height: 1.5; white-space: nowrap; }
.tag--ok { background: var(--tint-soft); color: var(--on-tint-soft); }
.tag--warn { background: var(--warn-soft); color: var(--on-warn-soft); }
.tag--error { background: var(--error-soft); color: var(--on-error-soft); }
.tag--info { background: var(--info-soft); color: var(--on-info-soft); }
.tag--mono { font-family: var(--mono); font-size: 11px; }
.tag--strong { background: var(--text); color: var(--surface); }

.notice { display: flex; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-cell); background: var(--surface); font-size: 14px; }
.notice > .ph { margin-top: 1px; font-size: 18px; }
.notice ul { display: flex; flex-direction: column; gap: 3px; margin-top: var(--s1); }
.notice--info { background: var(--info-soft); color: var(--on-info-soft); }
.notice--warn { background: var(--warn-soft); color: var(--on-warn-soft); }
.notice--error { background: var(--error-soft); color: var(--on-error-soft); }
.notice-fold { padding: 10px var(--s4); background: var(--surface); border-radius: var(--r-cell); font-size: 14px; }
.notice-fold summary { display: flex; align-items: center; gap: var(--s2); cursor: pointer; font-weight: 600; }
.notice-fold ul { display: flex; flex-direction: column; gap: 3px; margin-top: var(--s2); color: var(--text-2); }

.empty { display: flex; flex-direction: column; align-items: center; gap: var(--s2); padding: var(--s6) var(--s4); text-align: center; color: var(--text-2); }
.empty > .ph { font-size: 38px; color: var(--text-3); }
.empty strong { font-size: 17px; font-weight: 600; color: var(--text); }
.empty--error > .ph { color: var(--error-text); }
.empty p { max-width: 34rem; }

.values { display: flex; flex-direction: column; }
.values > div { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: 9px 0; border-bottom: .5px solid var(--hairline); }
.values > div:last-child { border-bottom: 0; }
.key { color: var(--text-2); }

.code-block { margin: 0; padding: var(--s3); max-height: 16rem; overflow: auto; background: var(--code-bg); color: var(--code-text); border-radius: 10px; font-family: var(--mono); font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.copy-box { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); width: 100%; padding: 9px 12px; background: var(--fill); border: 0; border-radius: 10px; font-family: var(--mono); font-size: 12px; text-align: left; overflow-wrap: anywhere; cursor: pointer; }
.copy-box:hover { background: var(--fill-strong); }
.copy-box .ph { flex: none; color: var(--tint-text); }

/* ---------- Tabelas ---------- */
.scroll-x { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { padding: 8px var(--s4); text-align: left; font-size: 13px; font-weight: 500; color: var(--text-2); white-space: nowrap; border-bottom: .5px solid var(--hairline); }
.table td { padding: 10px var(--s4); border-bottom: .5px solid var(--hairline); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--fill); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 13px; white-space: nowrap; }
.num--error { color: var(--error-text); font-weight: 600; }
.num--warn { color: var(--on-warn-soft); font-weight: 600; }
.num--ok { color: var(--tint-text); }

/* ---------- Filtros em pílula ---------- */
.chips { display: flex; gap: var(--s2); overflow-x: auto; scrollbar-width: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 6px 13px; background: var(--fill); border: 0; border-radius: 999px; color: var(--text-2); font-size: 14px; font-weight: 500; cursor: pointer; transition: background-color .15s; white-space: nowrap; }
.chip:hover { background: var(--fill-strong); }
.chip[aria-pressed="true"], .chip[aria-selected="true"] { background: var(--tint-soft); color: var(--on-tint-soft); font-weight: 600; }
.chip-count { font-variant-numeric: tabular-nums; font-weight: 600; }

/* Abas: viram pílulas; com poucas opções, controle segmentado */
.tabs { display: flex; gap: var(--s2); overflow-x: auto; scrollbar-width: none; flex: none; }
.tab { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 6px 13px; background: var(--fill); border: 0; border-radius: 999px; color: var(--text-2); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background-color .15s; }
.tab:hover { background: var(--fill-strong); }
.tab[aria-selected="true"] { background: var(--tint-soft); color: var(--on-tint-soft); font-weight: 600; }
.tabs--segmented { gap: 0; padding: 2px; background: var(--fill); border-radius: 9px; }
.tabs--segmented .tab { flex: 1; justify-content: center; padding: 5px 8px; background: none; border-radius: 7px; color: var(--text); font-size: 13px; }
.tabs--segmented .tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 2px 6px rgba(0, 0, 0, .12); }
.sheet-tabs { padding: var(--s2) var(--s4); flex: none; }

/* ---------- Linhas de instância, como a lista de conversas ---------- */
.rows { background: var(--surface); border-radius: var(--r-cell); box-shadow: var(--shadow-1); overflow: hidden; }
.row { position: relative; display: grid; grid-template-columns: 52px minmax(11rem, 1.5fr) minmax(7.5rem, 1fr) minmax(6rem, .8fr) minmax(5.5rem, .7fr) minmax(8rem, 1fr) 15rem; align-items: center; column-gap: var(--s3); min-height: 68px; padding: 6px var(--s4) 6px var(--s3); transition: background-color .12s; }
.row:hover:not(.row--head) { background: var(--fill); }
/* Separador recuado, começa depois do avatar */
.row:not(.row--head)::after { content: ''; position: absolute; left: 76px; right: 0; bottom: 0; height: .5px; background: var(--hairline); }
.row:last-child::after { display: none; }
.row--head { min-height: 0; padding-block: 8px; border-bottom: .5px solid var(--hairline); }
.row-avatar { position: relative; width: 48px; height: 48px; justify-self: center; }
.row-avatar .avatar { width: 48px; height: 48px; font-size: 19px; }
.row-avatar .dot { position: absolute; right: -1px; bottom: -1px; width: 15px; height: 15px; border: 2.5px solid var(--surface); box-sizing: content-box; margin: -2px; }
.row-name { min-width: 0; }
.row-name strong { display: block; font-size: 16px; font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.row-name .tags { margin-top: 3px; }
.state-text { font-size: 13px; font-weight: 500; }
.row--ok .state-text { color: var(--tint-text); }
.row--wait .state-text { color: var(--on-warn-soft); }
.row--down .state-text, .row--error .state-text { color: var(--error-text); }
.cell { min-width: 0; font-size: 14px; }
.cell .num { display: block; overflow: hidden; text-overflow: ellipsis; }
.cell .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-value { color: var(--text-3); }
.row-actions { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.row-actions .btn--action { flex: 0 1 auto; }
.row-extra { display: none; flex-wrap: wrap; gap: 2px var(--s3); margin-top: 3px; font-size: 12px; color: var(--text-2); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); margin: 0; }
.stat-grid > div { display: flex; flex-direction: column; gap: 2px; padding: 12px var(--s4); border-right: .5px solid var(--hairline); }
.stat-grid > div:last-child { border-right: 0; }
.stat-grid dd { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-big { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.preview { max-height: 6rem; overflow-y: auto; min-width: 12rem; }
.preview-item { display: flex; justify-content: space-between; gap: var(--s3); padding: 2px 0; }
.chart { position: relative; height: 12rem; padding: var(--s3); }

/* Lista de itens: webhooks e QR codes */
.item-list { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-cell); overflow: hidden; }
.panel-body .item-list { background: var(--surface-2); }
.item-card { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: .5px solid var(--hairline); }
.item-card:last-child { border-bottom: 0; }
.qr-thumb { flex: none; display: grid; place-items: center; width: 6.5rem; height: 6.5rem; padding: 6px; background: #fff; border-radius: 10px; }
.qr-thumb img, .qr-thumb canvas { width: 100% !important; height: 100% !important; image-rendering: pixelated; }
.pin { font-family: var(--mono); font-size: 22px; letter-spacing: .4em; text-align: center; }

/* ---------- Folhas ---------- */
.backdrop { position: fixed; inset: 0; z-index: 50; display: flex; background: rgba(0, 0, 0, .35); }
.backdrop--high { z-index: 60; }
.backdrop--top { z-index: 70; }
.sheet { display: flex; flex-direction: column; width: min(var(--sheet-w, 34rem), calc(100% - 32px)); max-height: min(88dvh, 54rem); margin: auto; background: var(--bg); border-radius: var(--r-sheet); box-shadow: var(--shadow-2); overflow: hidden; animation: sheet-in .36s var(--ease); }
.sheet--center { --sheet-w: 30rem; }
.sheet--side { --sheet-w: 48rem; height: min(88dvh, 54rem); }
@keyframes sheet-in { from { transform: translateY(28px) scale(.985); } }
.sheet-head { position: relative; display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 8px 52px; background: var(--bar); border-bottom: .5px solid var(--hairline); flex: none; text-align: center; }
.sheet-head h2 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.sheet-head .sub { font-size: 12px; }
.sheet-close { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
.sheet-close.btn:active:not(:disabled) { transform: translateY(-50%) scale(.95); }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
.sheet-body h3 { font-size: 17px; font-weight: 600; }
.sheet-body > .stack > .btn--full:last-child { position: sticky; bottom: 0; z-index: 2; }
.sheet-foot { flex: none; display: flex; gap: var(--s2); padding: var(--s3) var(--s4); background: var(--bar); border-top: .5px solid var(--hairline); }

.steps { display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s4); font-size: 13px; font-weight: 500; flex: none; color: var(--text-3); }
.steps b { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: var(--s1); background: var(--fill); border-radius: 50%; font-size: 12px; font-weight: 600; }
.steps .active { color: var(--text); }
.steps .active b { background: var(--tint); color: var(--on-tint); }
.steps hr { flex: 1; border: 0; border-top: .5px solid var(--hairline); margin: 0; }

.fold { display: inline-flex; align-items: center; gap: 6px; padding: 0; background: none; border: 0; color: var(--tint-text); font-size: 14px; font-weight: 500; cursor: pointer; }
.fold .ph { font-size: 13px; transition: transform .2s; }
.fold[aria-expanded="true"] .ph { transform: rotate(90deg); }
.fold-body { display: flex; flex-direction: column; gap: var(--s3); }

.mode-option { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3) var(--s4); background: var(--surface); border-radius: var(--r-cell); cursor: pointer; }
.mode-option strong { display: block; font-weight: 600; }

.qr-frame { display: grid; place-items: center; margin-inline: auto; padding: var(--s3); width: min(100%, 17rem); aspect-ratio: 1; background: #fff; border-radius: var(--r-sheet); }
.qr-frame img { width: 100%; height: 100%; image-rendering: pixelated; }
.pairing-code { padding: var(--s4); background: var(--surface); border-radius: var(--r-cell); font-family: var(--mono); font-size: 28px; font-weight: 600; letter-spacing: .1em; text-align: center; overflow-wrap: anywhere; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }

/* ---------- Conversas ---------- */
.chat-screen { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: var(--surface); }
.chat-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(18rem, 25rem) minmax(0, 1fr); }
.chat-list { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-right: .5px solid var(--hairline); }
.chat-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: 8px var(--s3) 0; }
.chat-title { padding: 2px var(--s4) var(--s2); }
.chat-title h2 { font-size: 28px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; }
.chat-search { display: flex; gap: var(--s2); padding: 0 var(--s4) var(--s2); }
.chat-search .input { flex: 1; min-width: 0; }
.chat-contacts { flex: 1; min-height: 0; overflow-y: auto; }
.contact { position: relative; display: flex; align-items: center; gap: var(--s3); width: 100%; padding: 9px var(--s4) 9px var(--s3); background: none; border: 0; text-align: left; cursor: pointer; }
.contact::after { content: ''; position: absolute; left: 76px; right: 0; bottom: 0; height: .5px; background: var(--hairline); }
.contact:hover { background: var(--fill); }
.contact[aria-current="true"] { background: var(--fill-strong); }
.contact-name { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.contact-time { flex: none; font-size: 13px; color: var(--text-2); }
.contact-time.unread { color: var(--tint-text); font-weight: 500; }
.contact-meta { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-top: 2px; }
.avatar { position: relative; flex: none; display: grid; place-items: center; width: 48px; height: 48px; background: var(--avatar); color: var(--on-avatar); font-weight: 600; font-size: 19px; border-radius: 50%; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 36px; height: 36px; font-size: 15px; }
.avatar-count { flex: none; min-width: 20px; height: 20px; padding: 0 6px; background: var(--tint); color: var(--on-tint); border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.chat-area { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-head { display: flex; align-items: center; gap: var(--s2); padding: 7px var(--s3); background: var(--bar); border-bottom: .5px solid var(--hairline); flex: none; }
.chat-head .ident { flex: 1 1 8rem; min-width: 0; line-height: 1.2; }
.chat-head .ident strong { font-size: 16px; font-weight: 600; }
.chat-head .btn { background: none; color: var(--tint-text); }
.chat-head .btn:hover:not(:disabled) { background: var(--fill); }
.window-bar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: var(--s2); padding: 5px var(--s4); font-size: 13px; flex: none; text-align: center; }
.window-bar--open { background: var(--tint-soft); color: var(--on-tint-soft); }
.window-bar--closed { background: var(--warn-soft); color: var(--on-warn-soft); }
.window-bar .time { font-weight: 600; font-variant-numeric: tabular-nums; }
.msg-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: var(--s3) var(--s4); background-color: var(--wallpaper); background-image: var(--doodle-img); background-size: 400px; }
.messages { display: flex; flex-direction: column; gap: 3px; max-width: 58rem; margin-inline: auto; }
.msg { display: flex; }
.msg--mine { justify-content: flex-end; }
/* Espaço extra quando muda quem fala */
.msg:not(.msg--mine) + .msg--mine, .msg--mine + .msg:not(.msg--mine) { margin-top: 9px; }
.bubble { position: relative; max-width: min(34rem, 78%); padding: 6px 10px 5px; background: var(--bubble-in); color: var(--bubble-text); border-radius: 17px; font-size: 16px; line-height: 1.3; letter-spacing: -.01em; box-shadow: 0 1px 1px rgba(0, 0, 0, .1); overflow-wrap: anywhere; }
.msg--mine .bubble { background: var(--bubble-out); --bubble-meta: var(--bubble-out-meta); --tint-text: var(--bubble-out-link); }
/* Cauda do balão no último de cada sequência */
.msg:not(.msg--mine):has(+ .msg--mine) .bubble, .msg:not(.msg--mine):last-of-type .bubble { border-bottom-left-radius: 4px; }
.msg--mine:has(+ .msg:not(.msg--mine)) .bubble, .msg--mine:last-of-type .bubble { border-bottom-right-radius: 4px; }
.msg:not(.msg--mine):has(+ .msg--mine) .bubble::after, .msg:not(.msg--mine):last-of-type .bubble::after,
.msg--mine:has(+ .msg:not(.msg--mine)) .bubble::after, .msg--mine:last-of-type .bubble::after { content: ''; position: absolute; bottom: 0; width: 12px; height: 15px; background: inherit; }
.msg:not(.msg--mine):has(+ .msg--mine) .bubble::after, .msg:not(.msg--mine):last-of-type .bubble::after { left: -5px; clip-path: path('M12 0 C12 8 8 13 0 15 H12 Z'); }
.msg--mine:has(+ .msg:not(.msg--mine)) .bubble::after, .msg--mine:last-of-type .bubble::after { right: -5px; clip-path: path('M0 0 C0 8 4 13 12 15 H0 Z'); }
.bubble-text { white-space: pre-wrap; }
.bubble img, .bubble video { display: block; max-width: 100%; max-height: 24rem; border-radius: 12px; }
.bubble img.clickable, .bubble video.clickable { cursor: pointer; }
.bubble img.sticker { max-width: 12rem; max-height: 12rem; object-fit: contain; }
.bubble audio { display: block; width: 100%; min-width: min(15rem, 55vw); height: 36px; }
.bubble-caption { margin-top: var(--s1); }
.bubble-media { display: flex; align-items: center; gap: var(--s2); padding: var(--s1) 0; color: var(--bubble-meta); }
.bubble-link { display: flex; align-items: center; gap: var(--s2); padding: var(--s1) 0; color: inherit; }
.bubble-buttons { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.bubble-buttons span { padding: 5px 8px; border-top: .5px solid var(--hairline); color: var(--tint-text); font-size: 14px; font-weight: 500; text-align: center; }
.bubble a { color: var(--tint-text); }
.bubble-foot { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin-top: 1px; font-size: 11px; color: var(--bubble-meta); }
.reprocess { display: inline-grid; place-items: center; min-width: 24px; min-height: 24px; margin-block: -6px; padding: 0; background: none; border: 0; cursor: pointer; color: inherit; opacity: .6; font-size: 12px; }
.reprocess:hover, .reprocess:focus-visible { opacity: 1; }
@media (hover: hover) { .reprocess { opacity: 0; } .bubble:hover .reprocess { opacity: .6; } .bubble:hover .reprocess:hover, .reprocess:focus-visible { opacity: 1; } }
.bubble-foot .ph { font-size: 14px; vertical-align: -2px; }
.tick-error { color: var(--error-text); }
.tick-read { color: var(--tick-read); }
.bubble-type { font-size: 12px; color: var(--bubble-meta); }
.composer { flex: none; display: flex; flex-direction: column; gap: var(--s2); padding: 8px var(--s3) calc(8px + env(safe-area-inset-bottom)); background: var(--bar); border-top: .5px solid var(--hairline); }
.composer-row { display: flex; gap: var(--s2); align-items: center; }
.composer-row .input { flex: 1; min-width: 0; }
.composer-row--send .input { background: var(--surface); border-radius: 19px; box-shadow: inset 0 0 0 .5px var(--hairline); padding-inline: 14px; }
.composer-row--send .menu summary { background: none; color: var(--tint-text); font-size: 22px; }
.composer-row--send .menu summary:hover { background: var(--fill); }
.composer-row--send .btn--icon { background: none; color: var(--tint-text); font-size: 21px; }
.composer-row--send .btn--icon:hover:not(:disabled) { background: var(--fill); }
.composer-row--send .send { width: 36px; min-width: 36px; padding: 0; background: var(--tint); color: var(--on-tint); font-size: 18px; }
.recording { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s2); padding: 6px 6px 6px var(--s3); background: var(--error-soft); border-radius: 999px; color: var(--on-error-soft); font-weight: 500; }
.template-form { display: flex; flex-direction: column; gap: var(--s2); padding-top: var(--s2); border-top: .5px solid var(--hairline); }
.template-form .composer-row .narrow { flex: 0 0 7rem; }
.back-to-list { display: none; }

/* ---------- Aviso flutuante ---------- */
.toast { position: fixed; left: 50%; top: var(--s3); z-index: 90; display: flex; align-items: center; gap: var(--s3); width: min(25rem, calc(100vw - 32px)); margin-left: calc(min(25rem, calc(100vw - 32px)) / -2); padding: 10px var(--s4); background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-radius: 14px; box-shadow: var(--shadow-2); font-size: 14px; animation: sheet-in .3s var(--ease); }
.toast button { margin-left: auto; padding: 2px; background: none; border: 0; cursor: pointer; color: var(--text-2); }

/* ---------- Acesso ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: var(--s4); }
.auth-form { display: flex; flex-direction: column; gap: var(--s4); width: min(100%, 24rem); }
.auth-head { display: flex; flex-direction: column; align-items: center; gap: var(--s3); text-align: center; }
.auth-head .app-mark { width: 72px; height: 72px; }
.auth-head h1 { font-size: 28px; font-weight: 700; letter-spacing: -.025em; }
.center-screen { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: var(--s4); text-align: center; }
.center-screen > div { display: flex; flex-direction: column; align-items: center; gap: var(--s3); }

/* ---------- Documentação ---------- */
.doc { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: 100vh; }
.doc-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; background: var(--sidebar); border-right: .5px solid var(--hairline); }
.doc-sidebar .nav-item { font-size: 14px; padding: 7px var(--s3); }
.doc-body { min-width: 0; padding: var(--s6); max-width: 60rem; display: flex; flex-direction: column; gap: var(--s6); }
.doc-body section { scroll-margin-top: var(--s4); display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.doc-body h1 { font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.doc-body h2 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin-top: var(--s3); }
.doc-body h3 { font-size: 18px; font-weight: 600; margin-top: var(--s2); }
.doc-body h4 { font-size: 15px; font-weight: 600; }
.doc-body p, .doc-body li { max-width: 72ch; font-size: 16px; line-height: 1.5; }
.doc-body ul, .doc-body ol { padding-left: 1.25rem; margin: 0; display: flex; flex-direction: column; gap: var(--s1); }
.doc-body :not(pre) > code { padding: 1px 5px; background: var(--fill); border-radius: 5px; font-size: 13px; overflow-wrap: anywhere; }
.doc-body pre { margin: 0; padding: var(--s3) var(--s4); overflow-x: auto; background: var(--code-bg); color: var(--code-text); border-radius: var(--r-cell); font-family: var(--mono); font-size: 12.5px; line-height: 1.55; }
.doc-body pre code { background: none; color: inherit; font-size: inherit; }
.doc-body table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--surface); border-radius: var(--r-cell); overflow: hidden; }
.doc-body th { padding: 8px var(--s3); text-align: left; font-size: 13px; font-weight: 500; color: var(--text-2); border-bottom: .5px solid var(--hairline); }
.doc-body td { padding: 9px var(--s3); border-bottom: .5px solid var(--hairline); vertical-align: top; }
.doc-grid { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--r-cell); overflow: hidden; }
.doc-grid > * { padding: 10px var(--s4); border-bottom: .5px solid var(--hairline); display: flex; flex-direction: column; gap: 2px; min-width: 0; color: inherit; }
.doc-grid > *:last-child { border-bottom: 0; }
.doc-grid .ph { display: none; }
.doc-grid strong { font-size: 16px; font-weight: 600; }
.method { display: inline-block; min-width: 3.25rem; padding: 0 6px; border-radius: 5px; font-family: var(--mono); font-size: 11px; font-weight: 700; text-align: center; }
.method--get { background: var(--tint-soft); color: var(--on-tint-soft); }
.method--post { background: var(--info-soft); color: var(--on-info-soft); }
.method--put { background: var(--warn-soft); color: var(--on-warn-soft); }
.method--delete { background: var(--error-soft); color: var(--on-error-soft); }
.hljs { background: transparent !important; color: var(--code-text) !important; padding: 0 !important; }
.hljs-attr { color: #9bd1ff !important; }
.hljs-string { color: #a8e6a3 !important; }
.hljs-number, .hljs-literal { color: #ffd479 !important; }
.hljs-punctuation { color: #98989f !important; }

/* Menu suspenso nativo com <details> */
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary.is-disabled { opacity: .45; pointer-events: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; display: flex; flex-direction: column; min-width: 12rem; background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-radius: var(--r-cell); box-shadow: var(--shadow-2); overflow: hidden; }
.menu--up .menu-list { top: auto; right: auto; left: 0; bottom: calc(100% + 8px); }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: var(--s3); width: 100%; padding: 11px var(--s4); background: none; border: 0; border-bottom: .5px solid var(--hairline); color: var(--text); font-size: 15px; text-align: left; text-decoration: none; cursor: pointer; }
.menu-list > :last-child { border-bottom: 0; }
.menu-list a:hover, .menu-list button:hover { background: var(--fill); text-decoration: none; }

/* Alerta de confirmação do iOS */
.backdrop--alert { z-index: 80; align-items: center !important; justify-content: center; }
.alert { width: min(17.5rem, calc(100% - 48px)); background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); border-radius: 14px; overflow: hidden; text-align: center; animation: alert-in .2s var(--ease); }
@keyframes alert-in { from { transform: scale(1.08); } }
.alert p { padding: var(--s4); font-size: 15px; font-weight: 500; white-space: pre-line; overflow-wrap: anywhere; }
.alert-actions { display: grid; grid-template-columns: 1fr 1fr; border-top: .5px solid var(--hairline); }
.alert-actions button { padding: 11px; background: none; border: 0; color: var(--tint-text); font-size: 16px; cursor: pointer; }
.alert-actions button:hover { background: var(--fill); }
.alert-actions button:first-child { border-right: .5px solid var(--hairline); }
.alert-actions .alert-confirm { font-weight: 600; }
.alert-actions .alert-confirm--danger { color: var(--error-text); }

/* Documentação: notas e cartões dentro do texto */
.doc-note { display: block; }
.doc-note p, .doc-note li { font-size: 14px; }
.stat-number { font-size: 34px !important; font-weight: 700; letter-spacing: -.03em; transition: transform .2s; }
.doc-body .notice { font-size: 14px; }
.doc-body .notice p { font-size: 14px; }

/* Papel de parede: desenhos de linha bem discretos */
:root { --doodle-img: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22400%22 height=%22400%22 fill=%22none%22 stroke=%22%235c4830%22 stroke-opacity=%22.13%22 stroke-width=%221.3%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cg transform=%22translate(28 24) rotate(-32) scale(1.18) translate(-9 -9)%22%3E%3Ccircle cx=%229%22 cy=%229%22 r=%227%22/%3E%3Cpath d=%22M9 5v4l3 2%22/%3E%3C/g%3E%3Cg transform=%22translate(89 36) rotate(-22) scale(1.27) translate(-9 -9)%22%3E%3Cpath d=%22M3 9l4 4 8-9%22/%3E%3C/g%3E%3Cg transform=%22translate(165 21) rotate(-6) scale(0.98) translate(-9 -9)%22%3E%3Cpath d=%22M4 2h10v14H4zM7 6h4M7 9h4M7 12h2%22/%3E%3C/g%3E%3Cg transform=%22translate(223 26) rotate(34) scale(1.17) translate(-9 -9)%22%3E%3Cpath d=%22M6 13V4l9-2v9%22/%3E%3Ccircle cx=%224%22 cy=%2213%22 r=%222%22/%3E%3Ccircle cx=%2213%22 cy=%2211%22 r=%222%22/%3E%3C/g%3E%3Cg transform=%22translate(302 21) rotate(4) scale(1.03) translate(-9 -9)%22%3E%3Cpath d=%22M3 3l12 12M15 3C10 3 3 10 3 15%22/%3E%3C/g%3E%3Cg transform=%22translate(361 23) rotate(-15) scale(0.99) translate(-9 -9)%22%3E%3Ccircle cx=%229%22 cy=%229%22 r=%227%22/%3E%3Cpath d=%22M9 5v4l3 2%22/%3E%3C/g%3E%3Cg transform=%22translate(58 102) rotate(-10) scale(1.17) translate(-9 -9)%22%3E%3Ccircle cx=%229%22 cy=%229%22 r=%227%22/%3E%3Cpath d=%22M6 11c1 1 2 2 3 2s2-1 3-2M6 7h.5M12 7h.5%22/%3E%3C/g%3E%3Cg transform=%22translate(139 102) rotate(-0) scale(1.17) translate(-9 -9)%22%3E%3Cpath d=%22M3 3l12 12M15 3C10 3 3 10 3 15%22/%3E%3C/g%3E%3Cg transform=%22translate(198 95) rotate(-4) scale(1.15) translate(-9 -9)%22%3E%3Cpath d=%22M3 15l5-5 3 3 4-6%22/%3E%3Cpath d=%22M2 2v14h14%22/%3E%3C/g%3E%3Cg transform=%22translate(260 91) rotate(-32) scale(1.22) translate(-9 -9)%22%3E%3Ccircle cx=%229%22 cy=%229%22 r=%227%22/%3E%3Cpath d=%22M9 5v4l3 2%22/%3E%3C/g%3E%3Cg transform=%22translate(334 111) rotate(-16) scale(1.21) translate(-9 -9)%22%3E%3Cpath d=%22M2 4h14v10H2zM2 4l7 6 7-6%22/%3E%3C/g%3E%3Cg transform=%22translate(389 98) rotate(-26) scale(1.21) translate(-9 -9)%22%3E%3Cpath d=%22M4 2h10v14H4zM7 6h4M7 9h4M7 12h2%22/%3E%3C/g%3E%3Cg transform=%22translate(31 180) rotate(4) scale(0.98) translate(-9 -9)%22%3E%3Cpath d=%22M2 9c0-4 3-7 7-7s7 3 7 7-3 7-7 7c-1 0-2 0-3-1l-4 2 1-4c-1-1-1-3-1-4z%22/%3E%3C/g%3E%3Cg transform=%22translate(96 162) rotate(23) scale(1.12) translate(-9 -9)%22%3E%3Ccircle cx=%229%22 cy=%229%22 r=%227%22/%3E%3Cpath d=%22M9 5v4l3 2%22/%3E%3C/g%3E%3Cg transform=%22translate(176 179) rotate(12) scale(1.12) translate(-9 -9)%22%3E%3Cpath d=%22M9 16S2 12 2 7c0-3 2-4 4-4 1 0 2 1 3 2 1-1 2-2 3-2 2 0 4 1 4 4 0 5-7 9-7 9z%22/%3E%3C/g%3E%3Cg transform=%22translate(240 161) rotate(14) scale(1.15) translate(-9 -9)%22%3E%3Ccircle cx=%229%22 cy=%229%22 r=%227%22/%3E%3Cpath d=%22M6 11c1 1 2 2 3 2s2-1 3-2M6 7h.5M12 7h.5%22/%3E%3C/g%3E%3Cg transform=%22translate(294 163) rotate(-36) scale(1.18) translate(-9 -9)%22%3E%3Cpath d=%22M3 3l12 12M15 3C10 3 3 10 3 15%22/%3E%3C/g%3E%3Cg transform=%22translate(363 170) rotate(-21) scale(1.12) translate(-9 -9)%22%3E%3Cpath d=%22M2 9c0-4 3-7 7-7s7 3 7 7-3 7-7 7c-1 0-2 0-3-1l-4 2 1-4c-1-1-1-3-1-4z%22/%3E%3C/g%3E%3Cg transform=%22translate(56 226) rotate(28) scale(1.09) translate(-9 -9)%22%3E%3Cpath d=%22M4 13a5 5 0 0 1 10 0v2H4zM7 16a2 2 0 0 0 4 0M9 3v3%22/%3E%3C/g%3E%3Cg transform=%22translate(124 231) rotate(-28) scale(1.05) translate(-9 -9)%22%3E%3Cpath d=%22M3 5h12v9H3zM6 5l1-2h4l1 2%22/%3E%3Ccircle cx=%229%22 cy=%229%22 r=%222.5%22/%3E%3C/g%3E%3Cg transform=%22translate(210 227) rotate(-11) scale(1.10) translate(-9 -9)%22%3E%3Cpath d=%22M9 2v14M2 9h14%22/%3E%3Ccircle cx=%229%22 cy=%229%22 r=%223%22/%3E%3C/g%3E%3Cg transform=%22translate(279 224) rotate(-20) scale(1.01) translate(-9 -9)%22%3E%3Cpath d=%22M2 9c0-4 3-7 7-7s7 3 7 7-3 7-7 7c-1 0-2 0-3-1l-4 2 1-4c-1-1-1-3-1-4z%22/%3E%3C/g%3E%3Cg transform=%22translate(320 243) rotate(-17) scale(1.01) translate(-9 -9)%22%3E%3Cpath d=%22M3 9l4 4 8-9%22/%3E%3C/g%3E%3Cg transform=%22translate(398 230) rotate(34) scale(1.15) translate(-9 -9)%22%3E%3Cpath d=%22M4 2h10v14H4zM7 6h4M7 9h4M7 12h2%22/%3E%3C/g%3E%3Cg transform=%22translate(43 313) rotate(18) scale(1.18) translate(-9 -9)%22%3E%3Cpath d=%22M3 15l5-5 3 3 4-6%22/%3E%3Cpath d=%22M2 2v14h14%22/%3E%3C/g%3E%3Cg transform=%22translate(111 308) rotate(23) scale(1.26) translate(-9 -9)%22%3E%3Ccircle cx=%229%22 cy=%229%22 r=%227%22/%3E%3Cpath d=%22M9 5v4l3 2%22/%3E%3C/g%3E%3Cg transform=%22translate(164 297) rotate(-8) scale(1.12) translate(-9 -9)%22%3E%3Cpath d=%22M2 4h14v10H2zM2 4l7 6 7-6%22/%3E%3C/g%3E%3Cg transform=%22translate(221 292) rotate(-12) scale(1.01) translate(-9 -9)%22%3E%3Cpath d=%22M9 2l2 5 5 1-4 3 1 5-4-3-4 3 1-5-4-3 5-1z%22/%3E%3C/g%3E%3Cg transform=%22translate(289 302) rotate(34) scale(1.14) translate(-9 -9)%22%3E%3Cpath d=%22M3 3l12 12M15 3C10 3 3 10 3 15%22/%3E%3C/g%3E%3Cg transform=%22translate(353 310) rotate(-27) scale(1.16) translate(-9 -9)%22%3E%3Cpath d=%22M3 15l5-5 3 3 4-6%22/%3E%3Cpath d=%22M2 2v14h14%22/%3E%3C/g%3E%3Cg transform=%22translate(79 370) rotate(-29) scale(1.12) translate(-9 -9)%22%3E%3Cpath d=%22M4 13a5 5 0 0 1 10 0v2H4zM7 16a2 2 0 0 0 4 0M9 3v3%22/%3E%3C/g%3E%3Cg transform=%22translate(147 366) rotate(-31) scale(1.12) translate(-9 -9)%22%3E%3Cpath d=%22M4 2h10v14H4zM7 6h4M7 9h4M7 12h2%22/%3E%3C/g%3E%3Cg transform=%22translate(207 373) rotate(15) scale(1.12) translate(-9 -9)%22%3E%3Cpath d=%22M9 2v14M2 9h14%22/%3E%3Ccircle cx=%229%22 cy=%229%22 r=%223%22/%3E%3C/g%3E%3Cg transform=%22translate(253 379) rotate(-27) scale(1.13) translate(-9 -9)%22%3E%3Cpath d=%22M1 9l16-7-5 16-3-7z%22/%3E%3C/g%3E%3Cg transform=%22translate(345 374) rotate(11) scale(1.05) translate(-9 -9)%22%3E%3Ccircle cx=%229%22 cy=%229%22 r=%227%22/%3E%3Cpath d=%22M9 5v4l3 2%22/%3E%3C/g%3E%3Cg transform=%22translate(5 360) rotate(-25) scale(1.08) translate(-9 -9)%22%3E%3Cpath d=%22M9 16S2 12 2 7c0-3 2-4 4-4 1 0 2 1 3 2 1-1 2-2 3-2 2 0 4 1 4 4 0 5-7 9-7 9z%22/%3E%3C/g%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) {
    :root { --doodle-img: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22400%22 height=%22400%22 fill=%22none%22 stroke=%22%23ffffff%22 stroke-opacity=%22.055%22 stroke-width=%221.3%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cg transform=%22translate(28 24) rotate(-32) scale(1.18) translate(-9 -9)%22%3E%3Ccircle cx=%229%22 cy=%229%22 r=%227%22/%3E%3Cpath d=%22M9 5v4l3 2%22/%3E%3C/g%3E%3Cg transform=%22translate(89 36) rotate(-22) scale(1.27) translate(-9 -9)%22%3E%3Cpath d=%22M3 9l4 4 8-9%22/%3E%3C/g%3E%3Cg transform=%22translate(165 21) rotate(-6) scale(0.98) translate(-9 -9)%22%3E%3Cpath d=%22M4 2h10v14H4zM7 6h4M7 9h4M7 12h2%22/%3E%3C/g%3E%3Cg transform=%22translate(223 26) rotate(34) scale(1.17) translate(-9 -9)%22%3E%3Cpath d=%22M6 13V4l9-2v9%22/%3E%3Ccircle cx=%224%22 cy=%2213%22 r=%222%22/%3E%3Ccircle cx=%2213%22 cy=%2211%22 r=%222%22/%3E%3C/g%3E%3Cg transform=%22translate(302 21) rotate(4) scale(1.03) translate(-9 -9)%22%3E%3Cpath d=%22M3 3l12 12M15 3C10 3 3 10 3 15%22/%3E%3C/g%3E%3Cg transform=%22translate(361 23) rotate(-15) scale(0.99) translate(-9 -9)%22%3E%3Ccircle cx=%229%22 cy=%229%22 r=%227%22/%3E%3Cpath d=%22M9 5v4l3 2%22/%3E%3C/g%3E%3Cg transform=%22translate(58 102) rotate(-10) scale(1.17) translate(-9 -9)%22%3E%3Ccircle cx=%229%22 cy=%229%22 r=%227%22/%3E%3Cpath d=%22M6 11c1 1 2 2 3 2s2-1 3-2M6 7h.5M12 7h.5%22/%3E%3C/g%3E%3Cg transform=%22translate(139 102) rotate(-0) scale(1.17) translate(-9 -9)%22%3E%3Cpath d=%22M3 3l12 12M15 3C10 3 3 10 3 15%22/%3E%3C/g%3E%3Cg transform=%22translate(198 95) rotate(-4) scale(1.15) translate(-9 -9)%22%3E%3Cpath d=%22M3 15l5-5 3 3 4-6%22/%3E%3Cpath d=%22M2 2v14h14%22/%3E%3C/g%3E%3Cg transform=%22translate(260 91) rotate(-32) scale(1.22) translate(-9 -9)%22%3E%3Ccircle cx=%229%22 cy=%229%22 r=%227%22/%3E%3Cpath d=%22M9 5v4l3 2%22/%3E%3C/g%3E%3Cg transform=%22translate(334 111) rotate(-16) scale(1.21) translate(-9 -9)%22%3E%3Cpath d=%22M2 4h14v10H2zM2 4l7 6 7-6%22/%3E%3C/g%3E%3Cg transform=%22translate(389 98) rotate(-26) scale(1.21) translate(-9 -9)%22%3E%3Cpath d=%22M4 2h10v14H4zM7 6h4M7 9h4M7 12h2%22/%3E%3C/g%3E%3Cg transform=%22translate(31 180) rotate(4) scale(0.98) translate(-9 -9)%22%3E%3Cpath d=%22M2 9c0-4 3-7 7-7s7 3 7 7-3 7-7 7c-1 0-2 0-3-1l-4 2 1-4c-1-1-1-3-1-4z%22/%3E%3C/g%3E%3Cg transform=%22translate(96 162) rotate(23) scale(1.12) translate(-9 -9)%22%3E%3Ccircle cx=%229%22 cy=%229%22 r=%227%22/%3E%3Cpath d=%22M9 5v4l3 2%22/%3E%3C/g%3E%3Cg transform=%22translate(176 179) rotate(12) scale(1.12) translate(-9 -9)%22%3E%3Cpath d=%22M9 16S2 12 2 7c0-3 2-4 4-4 1 0 2 1 3 2 1-1 2-2 3-2 2 0 4 1 4 4 0 5-7 9-7 9z%22/%3E%3C/g%3E%3Cg transform=%22translate(240 161) rotate(14) scale(1.15) translate(-9 -9)%22%3E%3Ccircle cx=%229%22 cy=%229%22 r=%227%22/%3E%3Cpath d=%22M6 11c1 1 2 2 3 2s2-1 3-2M6 7h.5M12 7h.5%22/%3E%3C/g%3E%3Cg transform=%22translate(294 163) rotate(-36) scale(1.18) translate(-9 -9)%22%3E%3Cpath d=%22M3 3l12 12M15 3C10 3 3 10 3 15%22/%3E%3C/g%3E%3Cg transform=%22translate(363 170) rotate(-21) scale(1.12) translate(-9 -9)%22%3E%3Cpath d=%22M2 9c0-4 3-7 7-7s7 3 7 7-3 7-7 7c-1 0-2 0-3-1l-4 2 1-4c-1-1-1-3-1-4z%22/%3E%3C/g%3E%3Cg transform=%22translate(56 226) rotate(28) scale(1.09) translate(-9 -9)%22%3E%3Cpath d=%22M4 13a5 5 0 0 1 10 0v2H4zM7 16a2 2 0 0 0 4 0M9 3v3%22/%3E%3C/g%3E%3Cg transform=%22translate(124 231) rotate(-28) scale(1.05) translate(-9 -9)%22%3E%3Cpath d=%22M3 5h12v9H3zM6 5l1-2h4l1 2%22/%3E%3Ccircle cx=%229%22 cy=%229%22 r=%222.5%22/%3E%3C/g%3E%3Cg transform=%22translate(210 227) rotate(-11) scale(1.10) translate(-9 -9)%22%3E%3Cpath d=%22M9 2v14M2 9h14%22/%3E%3Ccircle cx=%229%22 cy=%229%22 r=%223%22/%3E%3C/g%3E%3Cg transform=%22translate(279 224) rotate(-20) scale(1.01) translate(-9 -9)%22%3E%3Cpath d=%22M2 9c0-4 3-7 7-7s7 3 7 7-3 7-7 7c-1 0-2 0-3-1l-4 2 1-4c-1-1-1-3-1-4z%22/%3E%3C/g%3E%3Cg transform=%22translate(320 243) rotate(-17) scale(1.01) translate(-9 -9)%22%3E%3Cpath d=%22M3 9l4 4 8-9%22/%3E%3C/g%3E%3Cg transform=%22translate(398 230) rotate(34) scale(1.15) translate(-9 -9)%22%3E%3Cpath d=%22M4 2h10v14H4zM7 6h4M7 9h4M7 12h2%22/%3E%3C/g%3E%3Cg transform=%22translate(43 313) rotate(18) scale(1.18) translate(-9 -9)%22%3E%3Cpath d=%22M3 15l5-5 3 3 4-6%22/%3E%3Cpath d=%22M2 2v14h14%22/%3E%3C/g%3E%3Cg transform=%22translate(111 308) rotate(23) scale(1.26) translate(-9 -9)%22%3E%3Ccircle cx=%229%22 cy=%229%22 r=%227%22/%3E%3Cpath d=%22M9 5v4l3 2%22/%3E%3C/g%3E%3Cg transform=%22translate(164 297) rotate(-8) scale(1.12) translate(-9 -9)%22%3E%3Cpath d=%22M2 4h14v10H2zM2 4l7 6 7-6%22/%3E%3C/g%3E%3Cg transform=%22translate(221 292) rotate(-12) scale(1.01) translate(-9 -9)%22%3E%3Cpath d=%22M9 2l2 5 5 1-4 3 1 5-4-3-4 3 1-5-4-3 5-1z%22/%3E%3C/g%3E%3Cg transform=%22translate(289 302) rotate(34) scale(1.14) translate(-9 -9)%22%3E%3Cpath d=%22M3 3l12 12M15 3C10 3 3 10 3 15%22/%3E%3C/g%3E%3Cg transform=%22translate(353 310) rotate(-27) scale(1.16) translate(-9 -9)%22%3E%3Cpath d=%22M3 15l5-5 3 3 4-6%22/%3E%3Cpath d=%22M2 2v14h14%22/%3E%3C/g%3E%3Cg transform=%22translate(79 370) rotate(-29) scale(1.12) translate(-9 -9)%22%3E%3Cpath d=%22M4 13a5 5 0 0 1 10 0v2H4zM7 16a2 2 0 0 0 4 0M9 3v3%22/%3E%3C/g%3E%3Cg transform=%22translate(147 366) rotate(-31) scale(1.12) translate(-9 -9)%22%3E%3Cpath d=%22M4 2h10v14H4zM7 6h4M7 9h4M7 12h2%22/%3E%3C/g%3E%3Cg transform=%22translate(207 373) rotate(15) scale(1.12) translate(-9 -9)%22%3E%3Cpath d=%22M9 2v14M2 9h14%22/%3E%3Ccircle cx=%229%22 cy=%229%22 r=%223%22/%3E%3C/g%3E%3Cg transform=%22translate(253 379) rotate(-27) scale(1.13) translate(-9 -9)%22%3E%3Cpath d=%22M1 9l16-7-5 16-3-7z%22/%3E%3C/g%3E%3Cg transform=%22translate(345 374) rotate(11) scale(1.05) translate(-9 -9)%22%3E%3Ccircle cx=%229%22 cy=%229%22 r=%227%22/%3E%3Cpath d=%22M9 5v4l3 2%22/%3E%3C/g%3E%3Cg transform=%22translate(5 360) rotate(-25) scale(1.08) translate(-9 -9)%22%3E%3Cpath d=%22M9 16S2 12 2 7c0-3 2-4 4-4 1 0 2 1 3 2 1-1 2-2 3-2 2 0 4 1 4 4 0 5-7 9-7 9z%22/%3E%3C/g%3E%3C/svg%3E"); }
}

/* ---------- Telas médias ---------- */
@media (max-width: 1320px) {
    .row { grid-template-columns: 52px minmax(10rem, 1.4fr) minmax(7rem, 1fr) minmax(7rem, 1fr) 14rem; }
    .row .cell--account, .row .cell--proxy { display: none; }
    .row-extra { display: flex; }
}

/* ---------- Celular: barra de abas embaixo, folhas sobem da base ---------- */
@media (max-width: 860px) {
    .app { display: block; padding-bottom: calc(54px + env(safe-area-inset-bottom)); }
    .sidebar { position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 40; height: auto; flex-direction: row; border-right: 0; border-top: .5px solid var(--hairline); padding-bottom: env(safe-area-inset-bottom); background: var(--bar); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
    .sidebar-brand, .sidebar-foot { display: none; }
    .nav { flex-direction: row; padding: 0; gap: 0; }
    .nav-item { flex: 1 1 0; flex-direction: column; gap: 1px; min-width: 0; padding: 6px 1px 4px; border-radius: 0; font-size: 10px; font-weight: 500; text-align: center; color: var(--text-2); background: none !important; }
    .nav-item .ph { font-size: 25px; }
    .nav-item[aria-current="page"] { color: var(--tint-text); font-weight: 600; }
    .nav-item[aria-current="page"] .ph { color: var(--tint-text); }
    .nav-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .page-head { padding: 8px var(--s4); }
    .page-head h1 { font-size: 26px; }
    .head-desktop { display: none; }
    .head-mobile { display: flex !important; }
    .content { padding: var(--s3); }
    .bar .input, .bar .input--search { flex: 1 1 100%; max-width: none; width: 100%; }
    .bar .btn--full-mobile { flex: 1 1 100%; }
    .filters-more { flex: 1 1 100%; }
    .filters-more .input { flex: 1 1 0 !important; min-width: 0; width: 0 !important; }
    .grid-2, .field-grid { grid-template-columns: minmax(0, 1fr); }
    .row--head { display: none; }
    .row { grid-template-columns: 52px auto minmax(0, 1fr); padding: 8px var(--s3) 10px var(--s2); row-gap: 1px; column-gap: var(--s2); }
    .row-avatar { grid-row: 1 / span 3; align-self: start; }
    .row-name { grid-column: 2 / -1; }
    .row-extra { flex-wrap: nowrap; overflow: hidden; white-space: nowrap; }
    .row .cell { grid-column: auto; }
    .row .cell { font-size: 13px; color: var(--text-2); }
    .filters-more .input { font-size: 13px; }
    .row-actions { grid-column: 2 / -1; justify-content: flex-start; margin-top: var(--s2); flex-wrap: wrap; }
    .row:not(.row--head)::after { left: 64px; }
    .stat-grid > div { border-right: 0; border-bottom: .5px solid var(--hairline); }

    .table--stack thead { display: none; }
    .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
    .table--stack tr { padding: var(--s2) 0; border-bottom: .5px solid var(--hairline); }
    .table--stack tbody tr:last-child { border-bottom: 0; }
    .table--stack td { display: flex; justify-content: space-between; gap: var(--s3); padding: 3px var(--s4); border: 0; text-align: right; }
    .table--stack td[data-l]::before { content: attr(data-l); flex: none; font-size: 13px; color: var(--text-2); text-align: left; }
    .table--stack td.td-empty { display: block; text-align: center; }

    .backdrop { align-items: flex-end; }
    .sheet, .sheet--center, .sheet--side { width: 100%; height: auto; max-height: calc(100dvh - 44px); margin: auto 0 0; border-radius: var(--r-sheet) var(--r-sheet) 0 0; animation-name: sheet-up; }
    .sheet--side { height: calc(100dvh - 44px); }
    @keyframes sheet-up { from { transform: translateY(40%); } }
    .sheet-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
    .chat-body { grid-template-columns: minmax(0, 1fr); }
    .chat-body.has-contact .chat-list, .chat-body:not(.has-contact) .chat-area { display: none; }
    .back-to-list { display: inline-flex; }
    .chat-head .btn span { display: none; }
    .bubble { max-width: 86%; }

    .doc { grid-template-columns: minmax(0, 1fr); }
    .doc-sidebar { position: sticky; z-index: 10; height: auto; flex-direction: column; border-right: 0; border-bottom: .5px solid var(--hairline); }
    .doc-sidebar .nav { flex-direction: row; overflow-x: auto; padding: 0 var(--s2) var(--s2); gap: var(--s1); scrollbar-width: none; }
    .doc-sidebar .nav-item { flex: none; width: auto; flex-direction: row; font-size: 13px; padding: 5px 11px; background: var(--fill) !important; border-radius: 999px; }
    .doc-sidebar .nav-item .ph { display: none; }
    .doc-sidebar .sidebar-brand { display: flex; padding: var(--s2) var(--s3); }
    .doc-body { padding: var(--s4); gap: var(--s5); }
    .doc-body h1 { font-size: 28px; }
}
.head-mobile { display: none; align-items: center; gap: var(--s1); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .spin { animation: none !important; }
}

/* MCP */
.mcp { display: flex; flex-direction: column; gap: var(--s4); max-width: 54rem; }
.mcp-intro { max-width: 65ch; color: var(--text-2); }
.mcp code { padding: 1px 5px; background: var(--fill); border-radius: 5px; font-family: var(--mono); font-size: .88em; overflow-wrap: anywhere; }
.notice--warn code { background: rgba(0, 0, 0, .08); }
.code-wrap { position: relative; }
.code-wrap .code-block { padding-top: 44px; max-height: none; }
.code-copy { position: absolute; top: 7px; right: 7px; background: rgba(255, 255, 255, .14); color: var(--code-text); }
.code-copy:hover:not(:disabled) { background: rgba(255, 255, 255, .24); color: var(--code-text); }
.mcp-faq { display: flex; flex-direction: column; margin: 0; }
.mcp-faq > div { padding: 12px var(--s4); border-bottom: .5px solid var(--hairline); }
.mcp-faq > div:last-child { border-bottom: 0; }
.mcp-faq dt { font-weight: 600; }
.mcp-faq dd { margin: 2px 0 0; color: var(--text-2); max-width: 70ch; }
.mcp th[scope="row"] { width: 9rem; font-weight: 600; text-align: left; vertical-align: top; color: var(--text); }
.queue-count { display: flex; align-items: center; gap: var(--s2); white-space: nowrap; }
@media (max-width: 860px) {
    .mcp th[scope="row"] { display: block; width: 100%; padding: 8px var(--s4) 0; }
    .mcp .table--stack td { display: block; padding-top: 0; text-align: left; }
}
