/* Wiki — visual */

:root {
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, Menlo, Consolas, monospace;
  --rail-w: 52px;
  --side-w: 232px;
  --head-h: 48px;

  /* Claro */
  --rail: #f4f4f5;
  --panel: #ffffff;
  --canvas: #f4f4f5;
  --card: #ffffff;
  --input: #ffffff;
  --border: #e4e4e7;
  --text: #18181b;
  --text-2: #3f3f46;
  --muted: #71717a;
  --icon: #52525b;
  --hover: #f4f4f5;
  --active: #ececef;
  --primary: #3A2FC1;
  --primary-hover: #2F25A3;
  --primary-soft: #eef0ff;
  --link: #4f46e5;
  --orange: #f97316;
  --pdf: #e5484d;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --red: #dc2626;
  --amber: #b45309;
  --amber-bg: #fef3c7;
  --blue: #0369a1;
  --blue-bg: #e0f2fe;
  --code-bg: #f4f4f5;
  --mark: #fef08a;
  --shadow: 0 1px 2px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.14);
  color-scheme: light;
}

/* Escuro — base #21252F, áreas escuras #1A1D24, ícones #C5CEDE, textos #EBEEF5 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --rail: #1A1D24; --panel: #21252F; --canvas: #1A1D24; --card: #21252F; --input: #1A1D24;
    --border: #2F3441; --text: #EBEEF5; --text-2: #D6DBE5; --muted: #8F98AA; --icon: #C5CEDE;
    --hover: #2A2F3B; --active: #2F3542;
    --primary: #3A2FC1; --primary-hover: #4A3FD6; --primary-soft: #28245A; --link: #8f89ff;
    --green: #4ade80; --green-bg: #17352A; --red: #f87171; --amber: #fbbf24; --amber-bg: #3A3020;
    --blue: #7dd3fc; --blue-bg: #18304A; --code-bg: #1A1D24; --mark: #5c4b00;
    --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 12px 36px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --rail: #1A1D24; --panel: #21252F; --canvas: #1A1D24; --card: #21252F; --input: #1A1D24;
  --border: #2F3441; --text: #EBEEF5; --text-2: #D6DBE5; --muted: #8F98AA; --icon: #C5CEDE;
  --hover: #2A2F3B; --active: #2F3542;
  --primary: #3A2FC1; --primary-hover: #4A3FD6; --primary-soft: #28245A; --link: #8f89ff;
  --green: #4ade80; --green-bg: #17352A; --red: #f87171; --amber: #fbbf24; --amber-bg: #3A3020;
  --blue: #7dd3fc; --blue-bg: #18304A; --code-bg: #1A1D24; --mark: #5c4b00;
  --shadow: 0 1px 2px rgba(0,0,0,.3); --shadow-lg: 0 12px 36px rgba(0,0,0,.5);
  color-scheme: dark;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--canvas); -webkit-font-smoothing: antialiased; overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
input::placeholder, textarea::placeholder { color: var(--muted); }
[hidden] { display: none !important; }
.ic { flex-shrink: 0; display: block; }
.grow { flex: 1; min-width: 0; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center-text { text-align: center; }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 2px; }
kbd { font-family: var(--font); font-size: 11.5px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--border); border-bottom-width: 2px; background: var(--card); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }

/* Grid */
.app { display: grid; height: 100vh; height: 100dvh; grid-template-columns: var(--rail-w) var(--side-w) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.app > * { min-height: 0; }

/* Rail */
.rail { background: var(--rail); border-right: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0; z-index: 30; }
.logo { width: 34px; height: 34px; border-radius: 50%; background: var(--orange); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 11px; letter-spacing: -.3px; margin-bottom: 10px; }
.rail-btn { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--icon); }
.rail-btn:hover { background: var(--hover); color: var(--text); }
.rail-btn.active { background: var(--active); color: var(--text); }
.rail-bottom { margin-top: auto; }
.rail-avatar { position: relative; width: 34px; height: 34px; border-radius: 9px; background: var(--active); color: var(--icon); display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.rail-avatar .dot { position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%; background: #22c55e; border: 2px solid var(--rail); }

/* Sidebar */
.sidebar { background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow-y: auto; z-index: 20; }
.col-head, .topbar { height: var(--head-h); flex-shrink: 0; display: flex; align-items: center; gap: 8px; padding: 0 14px; }
.col-title { font-weight: 600; }
.searchbar { display: flex; align-items: center; gap: 8px; margin: 0 12px 10px; padding: 0 10px; height: 34px; border: 1px solid var(--border); border-radius: 8px; color: var(--icon); background: var(--input); }
.searchbar:focus-within { border-color: var(--primary); }
.searchbar input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; height: 100%; }
.side-nav { display: flex; flex-direction: column; gap: 1px; padding: 0 8px 16px; }
.side-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text-2); text-align: left; width: 100%; }
.side-item .ic { color: var(--icon); }
.side-item:hover { background: var(--hover); color: var(--text); }
.side-item.active { background: var(--active); color: var(--text); font-weight: 500; }
.side-item.muted { color: var(--muted); }
.side-item .count { font-size: 12px; color: var(--muted); }
.ic-blank { width: 16px; flex-shrink: 0; }
.side-cat { position: relative; }
.icon-picker { position: fixed; width: 262px; }
.icon-scroll { max-height: min(380px, 60vh); overflow-y: auto; }
.icon-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 2px 4px 4px; }
.icon-grid button { height: 32px; border-radius: 7px; display: grid; place-items: center; color: var(--icon); }
.icon-grid button:hover { background: var(--hover); color: var(--text); }
.icon-grid button.cur { background: var(--primary-soft); color: var(--link); box-shadow: inset 0 0 0 1px var(--primary); }
.side-label { padding: 16px 10px 6px; font-size: 12px; color: var(--muted); }
.side-add input { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--primary); border-radius: 8px; background: var(--input); outline: 0; margin: 4px 0; }

/* Main */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { background: var(--panel); border-bottom: 1px solid var(--border); }
.topbar-title { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.topbar form { margin: 0; }
.canvas { flex: 1; overflow-y: auto; padding: 28px 24px 48px; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; display: inline-grid; place-items: center; color: var(--icon); flex-shrink: 0; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.mobile-only { display: none; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 8px; font-weight: 500; font-size: 13.5px; white-space: nowrap; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--hover); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }

/* Card */
.doc { max-width: 820px; margin: 0 auto; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 32px 40px; box-shadow: var(--shadow); }
.doc h1 { font-size: 26px; line-height: 1.25; letter-spacing: -.4px; margin: 0 0 20px; }
.crumb { display: inline-block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumb:hover { color: var(--link); }
.doc-foot { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.doc-foot a { color: var(--link); }

/* Listas */
.doc-list { padding: 6px 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 22px; border-bottom: 1px solid var(--border); }
.row:last-child { border-bottom: 0; }
.row > .ic { color: var(--icon); }
a.row:hover { background: var(--hover); }
.row form { margin: 0; }
.row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-body strong { font-weight: 500; }
.row-body small { color: var(--muted); font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pdf-tag { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 5px; background: color-mix(in srgb, var(--pdf) 16%, transparent); color: var(--pdf); white-space: nowrap; }
.empty { color: var(--muted); text-align: center; padding: 30px 20px; margin: 0; }

/* Busca */
.results { max-width: 820px; margin: 0 auto; }
.results .big-search { margin-bottom: 14px; }
.did-you-mean { margin: 0 0 6px; font-size: 14px; color: var(--text-2); }
.did-you-mean a { color: var(--link); font-weight: 600; font-style: italic; }
.results-count { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.result { display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; margin-bottom: 8px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; transition: border-color .12s; }
.result:hover { border-color: var(--primary); }
.result-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.result-meta:empty { display: none; }
.result-title { font-size: 15.5px; font-weight: 600; color: var(--text); }
.result-snip { font-size: 13.5px; line-height: 1.6; color: var(--text-2); }
.in-pdf { color: var(--pdf); font-style: normal; font-weight: 500; }
.result mark, .live mark { background: color-mix(in srgb, var(--orange) 22%, transparent); color: var(--text); padding: 0 1px; border-radius: 3px; }
.empty-results { text-align: center; }
.empty-results p { margin: 0 0 8px; }

/* Busca ao vivo */
form[data-live] { position: relative; }
.live { position: absolute; left: -1px; right: -1px; top: calc(100% + 6px); z-index: 150; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); overflow: hidden; color: var(--text); text-align: left; }
.searchbar .live { min-width: 340px; }
.live-item { display: block; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.live-item:last-child { border-bottom: 0; }
.live-item.on, .live-item:hover { background: var(--hover); }
.live-item strong { display: block; font-size: 14px; font-weight: 500; }
.live-item small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.45; margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.live-item .live-cat { display: inline; font-size: 11.5px; color: var(--muted); margin-left: 6px; font-weight: 400; }
.live-foot { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; font-size: 12.5px; color: var(--muted); background: var(--canvas); }
.live-foot a { color: var(--link); }
.live-dym { padding: 9px 14px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--canvas); }
.live-dym a { color: var(--link); font-weight: 600; font-style: italic; }
.live-empty { padding: 14px; font-size: 13px; color: var(--muted); }

/* Busca grande (página de resultados) */
.big-search { display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 48px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--icon); box-shadow: var(--shadow); margin-bottom: 28px; }
.big-search:focus-within { border-color: var(--primary); }
.big-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; height: 100%; font-size: 15px; }

/* Início — balcão de atendimento: conversa à esquerda, "continuar de onde parou" à direita */
.canvas-home { padding-top: 0; }
.hero { position: relative; z-index: 2; margin: 0 -24px; padding: clamp(28px, 5vh, 52px) 24px 30px; border-bottom: 1px solid var(--border); }
.desk { max-width: 1080px; margin: 0 auto; }
.desk.has-side { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 48px; align-items: start; }
.desk-main { min-width: 0; }

.greet { display: flex; gap: 12px; align-items: flex-start; }
.greet-av { margin-top: 20px; }
.greet-body { min-width: 0; flex: 1; }
.greet-who { margin: 0 0 5px 2px; font-size: 12px; font-weight: 500; color: var(--muted); }
.greet-bubble { max-width: 600px; padding: 14px 18px 15px; background: var(--card); border: 1px solid var(--border); border-radius: 4px 16px 16px 16px; }
.greet-bubble h1 { margin: 0; font-size: 21px; font-weight: 650; letter-spacing: -.3px; line-height: 1.3; }
.greet-bubble p { margin: 4px 0 0; font-size: 14.5px; line-height: 1.55; color: var(--text-2); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.quick-btn { padding: 6px 13px; border: 1px solid color-mix(in srgb, var(--link) 45%, var(--border)); border-radius: 16px; background: none; color: var(--link); font: 500 13px var(--font); cursor: pointer; text-align: left; transition: background .15s; }
.quick-btn:hover { background: var(--primary-soft); }
.quick-btn:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

.ask { display: flex; align-items: center; gap: 10px; margin: 22px 0 0 44px; height: 52px; padding: 0 6px 0 14px; text-align: left; border-radius: 12px; background: var(--input);
  border: 1px solid var(--border); transition: border-color .15s, box-shadow .15s; }
.ask:focus-within { border-color: var(--link); box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 18%, transparent); }
.ask-ic { display: grid; color: var(--muted); }
.ask input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: 15px; color: var(--text); }
.ask input::-webkit-search-cancel-button { display: none; }
.ask-go { height: 40px; padding: 0 18px; border: 0; border-radius: 8px; background: var(--primary); color: #fff; font: 600 14px var(--font); cursor: pointer; flex: none; }
.ask-go:hover { background: var(--primary-hover); }
.ask-go:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.ask .live { top: calc(100% + 8px); left: 0; right: 0; }

.desk-side { padding-top: 22px; }
.side-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.side-head h2 { margin: 0; font-size: 13px; font-weight: 600; color: var(--text-2); }
.side-all { border: 0; background: none; padding: 0; color: var(--link); font: 500 12.5px var(--font); cursor: pointer; }
.side-all:hover { text-decoration: underline; }
.resume { list-style: none; margin: 0; padding: 0; }
.resume-item { display: flex; gap: 10px; width: 100%; padding: 9px 8px; margin: 0 -8px; width: calc(100% + 16px); border: 0; border-radius: 8px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.resume-item:hover { background: var(--hover); }
.resume-item .ic { flex: none; margin-top: 2px; color: var(--icon); }
.resume-item.pinned .ic { color: var(--link); }
.resume-txt { display: flex; flex-direction: column; min-width: 0; }
.resume-txt strong { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resume-txt small { font-size: 12px; color: var(--muted); }

/* Abaixo: índice de categorias + atualizados */
.home { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 48px; max-width: 1080px; margin: 0 auto; padding: 30px 0 40px; align-items: start; }
.sec-title { display: flex; align-items: baseline; gap: 8px; font-size: 14px; font-weight: 600; margin: 0 0 6px; color: var(--text); }
.sec-title span { font-weight: 400; font-size: 13px; color: var(--muted); }
.idx-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
.idx-list a { display: flex; align-items: center; gap: 11px; padding: 10px 2px; border-bottom: 1px solid var(--border); color: var(--text); }
.idx-ic { display: grid; color: var(--icon); flex: none; }
.idx-name { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idx-n { flex: none; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.idx-list a:hover .idx-name, .idx-list a:hover .idx-ic { color: var(--link); }
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list a { display: flex; flex-direction: column; gap: 2px; padding: 10px 2px; border-bottom: 1px solid var(--border); }
.news-title { font-size: 14px; font-weight: 500; color: var(--text); }
.news-meta { font-size: 12.5px; color: var(--muted); }
.news-list a:hover .news-title { color: var(--link); }

@media (max-width: 960px) {
  .desk.has-side, .home { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .desk-side { padding-top: 0; }
}
@media (max-width: 700px) {
  .hero { margin: 0 -10px; padding: 22px 10px 24px; }
  .ask { margin-left: 0; } .greet-av { display: none; }
  .ask-go { padding: 0 12px; }
  .idx-list { grid-template-columns: 1fr; }
}

/* PDFs */
.files { margin-top: 24px; }
.prose + .files { margin-top: 28px; }
.files-title { font-size: 15px; margin: 0 0 10px; }
.file-list { display: flex; flex-direction: column; gap: 8px; }
.file { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--canvas); }
.file.open { border-color: var(--primary); }
.file form { margin: 0; }
.file-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; text-align: left; padding: 2px; }
.file-ic { width: 34px; height: 40px; border-radius: 5px; background: var(--pdf); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; flex-shrink: 0; }
.file-info { display: flex; flex-direction: column; min-width: 0; }
.file-info strong { font-weight: 500; font-size: 13.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.file-info small { color: var(--muted); font-size: 12px; }
button.file-main:hover strong { color: var(--link); }
.file-add { margin: 0; }
.file-add label, .file-add.as-label { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border: 1px dashed var(--border); border-radius: 10px; color: var(--icon); cursor: pointer; font-size: 13.5px; }
.file-add label:hover, .file-add.as-label:hover { border-color: var(--primary); color: var(--link); }
.file-add.drag label { border-color: var(--primary); background: var(--primary-soft); }
.viewer { margin-top: 12px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.viewer-bar { display: flex; align-items: center; gap: 4px; padding: 4px 6px 4px 12px; border-bottom: 1px solid var(--border); font-size: 13px; background: var(--canvas); }
.viewer-bar span { flex: 1; }
.viewer iframe { display: block; width: 100%; height: 78vh; border: 0; background: #525659; }

/* Texto dos artigos */
.prose { font-size: 15px; line-height: 1.75; color: var(--text-2); overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p { margin: 0 0 14px; }
.prose h2 { font-size: 17px; font-weight: 600; color: var(--text); margin: 36px 0 12px; scroll-margin-top: 16px; }
.prose h3 { font-size: 15px; font-weight: 600; color: var(--text); margin: 26px 0 8px; scroll-margin-top: 16px; }
.prose .anchor { display: none; }
.prose a { color: var(--link); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--link) 35%, transparent); }
.prose a:hover { border-bottom-color: var(--link); }
.prose a.wikilink.missing { color: var(--red); border-bottom-style: dashed; }
.prose strong { color: var(--text); font-weight: 600; }
.prose em { color: var(--text); }
.prose code { font-family: var(--mono); font-size: .85em; background: var(--canvas); padding: 2px 6px; border-radius: 5px; color: var(--text); }
.prose img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); display: block; margin: 8px 0 16px; cursor: zoom-in; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }
.prose blockquote { margin: 0 0 16px; padding: 0 0 0 14px; border-left: 2px solid var(--border); color: var(--muted); }
.prose ul { margin: 0 0 16px; padding-left: 20px; }
.prose ul > li { margin: 6px 0; padding-left: 2px; }
.prose ul > li::marker { color: var(--muted); }

/* Passo a passo: sequência vertical ligada por uma linha */
.prose ol { list-style: none; counter-reset: step; padding: 0; margin: 0 0 20px; }
.prose ol > li { counter-increment: step; position: relative; padding: 0 0 18px 42px; min-height: 26px; }
.prose ol > li:last-child { padding-bottom: 0; }
.prose ol > li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary); color: #fff;
  font-size: 12px; font-weight: 700; display: grid; place-items: center; line-height: 1; z-index: 1;
}
.prose ol > li::after { content: ''; position: absolute; left: 12.5px; top: 30px; bottom: 4px; width: 1.5px; background: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.prose ol > li:last-child::after { display: none; }
.prose ol > li { padding-top: 1px; }

/* Checklist */
.prose ul.tasks { list-style: none; padding: 0; }
.prose ul.tasks > li { margin: 0; padding: 0; }
.task { display: flex; align-items: flex-start; gap: 12px; padding: 4px 0; cursor: pointer; }
.task input { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin: 4px 0 0; flex-shrink: 0; border: 1.5px solid var(--icon); border-radius: 5px; cursor: pointer; display: grid; place-items: center; transition: background .12s, border-color .12s; }
.task input:checked { background: var(--green); border-color: var(--green); }
.task input:checked::after { content: ''; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.task input:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--muted) 60%, transparent); }

/* Tabelas */
.table-wrap { overflow-x: auto; margin: 0 0 18px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 14px; }
.prose th, .prose td { padding: 9px 12px 9px 0; text-align: left; border-bottom: 1px solid var(--border); }
.prose th { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.prose tr:last-child td { border-bottom: 0; }

/* Código */
.code-block { position: relative; margin: 0 0 18px; border-radius: 10px; background: var(--canvas); }
.code-block pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.65; color: var(--text); white-space: pre-wrap; }
.code-block pre code { background: none; padding: 0; font-size: inherit; }
.code-copy { position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--icon); padding: 4px 8px; border-radius: 6px; background: var(--card); border: 1px solid var(--border); opacity: 0; transition: opacity .15s; }
.code-block:hover .code-copy, .code-copy:focus { opacity: 1; }

/* Avisos: barra fina na lateral */
.callout { display: flex; gap: 10px; padding: 10px 14px; margin: 0 0 18px; border-left: 2px solid var(--c); background: color-mix(in srgb, var(--c) 7%, transparent); border-radius: 0 8px 8px 0; }
.callout-ic { color: var(--c); margin-top: 4px; }
.callout-body { flex: 1; min-width: 0; font-size: 14.5px; }
.callout-title { font-weight: 600; color: var(--text); }
.callout-body p { margin: 0 0 6px; }
.callout-body > :last-child { margin-bottom: 0; }
.callout-tip { --c: var(--green); }
.callout-warn { --c: var(--amber); }
.callout-danger { --c: var(--red); }
.callout-info { --c: var(--blue); }

/* Editor */
.editor { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.doc-edit { display: flex; flex-direction: column; gap: 12px; }
.title-input { border: 0; outline: 0; background: none; font-size: 24px; font-weight: 700; letter-spacing: -.3px; width: 100%; padding: 0; }
.cat-select { width: fit-content; max-width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--input); outline: 0; }
.toolbar { display: flex; gap: 2px; padding: 4px; border: 1px solid var(--border); border-bottom: 0; border-radius: 8px 8px 0 0; background: var(--canvas); }
.toolbar button { width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; color: var(--icon); }
.toolbar button:hover { background: var(--hover); color: var(--text); }
#content { display: block; width: 100%; min-height: 340px; resize: vertical; border: 1px solid var(--border); border-radius: 0 0 8px 8px; background: var(--input); outline: 0; padding: 14px 16px; font-family: var(--mono); font-size: 13.5px; line-height: 1.7; }
#content:focus { border-color: var(--primary); }
#content.drop { border-color: var(--primary); background: var(--primary-soft); }
#preview { min-height: 340px; padding: 4px 0; }
.summary { height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--input); outline: 0; }
.summary:focus { border-color: var(--primary); }
.link-danger { align-self: flex-start; color: var(--red); font-size: 13px; margin-top: 8px; }
.link-danger:hover { text-decoration: underline; }
.seg { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--canvas); border: 1px solid var(--border); }
.seg-btn { height: 28px; padding: 0 12px; border-radius: 6px; color: var(--muted); font-size: 13px; }
.seg-btn.active { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

/* Login */
.auth { max-width: 380px; display: flex; flex-direction: column; gap: 14px; padding: 28px; }
.auth h1 { font-size: 22px; margin: 0 0 4px; }
.auth p { margin: 0; }
.auth a { color: var(--link); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; color: var(--muted); }
.field input { height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--input); outline: 0; }
.field input:focus { border-color: var(--primary); }

/* Menu do usuário / tema */
.menu-wrap { position: relative; }
.popover { position: absolute; z-index: 100; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; }
.user-menu { left: calc(100% + 10px); bottom: 0; width: 250px; }
.pop-head { padding: 8px 10px; }
.pop-head strong { display: block; font-weight: 500; }
.pop-head small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.pop-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 8px; text-align: left; }
.pop-item .ic { color: var(--icon); }
.pop-item:hover { background: var(--hover); }
.pop-label { padding: 6px 10px 4px; font-size: 12px; color: var(--muted); }
.pop-sep { height: 1px; background: var(--border); margin: 6px 0; }
.popover form { margin: 0; }
.theme-picker { display: flex; gap: 8px; padding: 4px 10px 8px; }
.theme-opt { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.theme-opt small { font-size: 11.5px; color: var(--muted); }
.sw { width: 60px; height: 46px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px; border: 2px solid var(--border); overflow: hidden; }
.sw-light { background: #fff; color: #18181b; }
.sw-dark { background: #21252F; color: #EBEEF5; }
.sw-sys b { flex: 1; height: 100%; display: grid; place-items: center; }
.sw-sys b:first-child { background: #21252F; color: #EBEEF5; }
.sw-sys b:last-child { background: #fff; color: #18181b; }
.theme-opt.selected .sw { border-color: var(--primary); }

/* Painel de detalhes */
body.has-details .app { grid-template-columns: var(--rail-w) var(--side-w) minmax(0, 1fr) var(--details-w); }
body.has-details.details-closed .app { grid-template-columns: var(--rail-w) var(--side-w) minmax(0, 1fr); }
body.details-closed .details { display: none; }
body:not(.details-closed) .details-opener { display: none; }
:root { --details-w: 290px; }
.details { background: var(--panel); border-left: 1px solid var(--border); display: flex; flex-direction: column; min-width: 0; z-index: 25; }
.details-head { height: var(--head-h); flex-shrink: 0; display: flex; align-items: center; padding: 0 8px 0 16px; border-bottom: 1px solid var(--border); }
.details-title { flex: 1; font-weight: 500; }
.details-scroll { flex: 1; overflow-y: auto; padding-bottom: 20px; }
.sect { border-bottom: 1px solid var(--border); }
.sect > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 12px 16px; cursor: pointer; user-select: none; }
.sect > summary::-webkit-details-marker { display: none; }
.sect > summary:hover { background: var(--hover); }
.sect > summary .chev { color: var(--icon); transition: transform .15s; }
.sect[open] > summary .chev { transform: rotate(90deg); }
.badge { margin-left: auto; font-size: 11px; padding: 1px 7px; border-radius: 5px; background: var(--active); color: var(--text-2); }
.info { list-style: none; margin: 0; padding: 2px 16px 14px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.info li { display: flex; align-items: center; gap: 10px; min-height: 30px; }
.info li > .ic { color: var(--icon); opacity: .8; }
.info li > span { color: var(--muted); flex-shrink: 0; }
.info li > b, .info li > a { margin-left: auto; font-weight: 500; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: right; }
.info li > a { color: var(--link); display: inline-flex; align-items: center; gap: 2px; }
.info li > a:hover { text-decoration: underline; }
.details-empty { color: var(--muted); font-size: 13px; padding: 0 16px 12px; margin: 0; }
.details-empty a { color: var(--link); }
.notes { display: flex; flex-direction: column; }
.note { display: flex; gap: 10px; padding: 10px 16px; }
.note + .note { border-top: 1px solid var(--border); }
.note-ini { width: 28px; height: 28px; border-radius: 50%; background: var(--primary-soft); color: var(--link); display: grid; place-items: center; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.note-main { flex: 1; min-width: 0; }
.note-head { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.note-head strong { font-weight: 600; }
.note-head small { color: var(--muted); font-size: 11.5px; }
.note-head form { margin: 0 0 0 auto; }
.note-del { color: var(--muted); opacity: 0; padding: 2px; border-radius: 4px; }
.note:hover .note-del { opacity: 1; }
.note-del:hover { color: var(--red); }
.note-body { margin: 3px 0 0; font-size: 13px; line-height: 1.55; color: var(--text-2); overflow-wrap: anywhere; }
.note-body.clamped { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.read-more { color: var(--link); font-size: 12.5px; margin-top: 2px; }
.note-form { display: flex; align-items: flex-end; gap: 6px; margin: 6px 12px 14px; padding: 6px 6px 6px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--input); }
.note-form:focus-within { border-color: var(--primary); }
.note-form textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: none; font-size: 13px; line-height: 1.5; padding: 5px 0; max-height: 160px; }
.note-send { width: 30px; height: 30px; border-radius: 8px; background: var(--primary); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.note-send:hover { background: var(--primary-hover); }
.icon-btn.xs { width: 22px; height: 22px; }

/* Administração de usuários */
.admin { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.admin > .doc, .admin > form.doc { width: 100%; max-width: none; margin: 0; }
.admin.admin-wide { max-width: none; margin: 0; }
.admin-head { display: flex; align-items: flex-end; gap: 16px; padding: 4px 2px 2px; }
.admin-head > div { flex: 1; }
.admin-head h1 { font-size: 24px; letter-spacing: -.3px; margin: 0 0 4px; }
.admin-head p { margin: 0; font-size: 13.5px; }
.u-filter { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; width: 220px; border: 1px solid var(--border); border-radius: 8px; background: var(--input); color: var(--icon); }
.u-filter input { border: 0; background: none; outline: 0; flex: 1; min-width: 0; color: var(--text); font: inherit; font-size: 13.5px; }
.u-filter:focus-within { border-color: var(--primary); }
.doc.users { padding: 0; overflow: hidden; }
.u-grid { display: grid; grid-template-columns: minmax(0, 1fr) 160px 200px 180px 120px 20px; align-items: center; gap: 24px; padding: 0 24px; }
.u-head { height: 40px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); background: var(--canvas); border-bottom: 1px solid var(--border); }
.u-row { min-height: 68px; border-bottom: 1px solid var(--border); color: var(--text); transition: background .12s; }
.u-row:last-of-type { border-bottom: 0; }
.u-row:hover { background: var(--hover); }
.u-row:hover .u-go { color: var(--text); transform: translateX(2px); }
.u-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.u-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.u-txt strong { font-weight: 500; font-size: 14px; display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-txt small, .u-last small { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-txt strong > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.u-you { flex-shrink: 0; font-size: 11px; font-weight: 500; padding: 1px 7px; border-radius: 20px; border: 1px solid var(--border); color: var(--muted); }
.u-ini { width: 36px; height: 36px; border-radius: 50%; background: var(--primary-soft); color: var(--link); display: grid; place-items: center; font-size: 12.5px; font-weight: 600; flex-shrink: 0; }
.u-perm { display: flex; align-items: center; gap: 8px; }
.u-perm small { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.u-bar { flex: 1; height: 5px; border-radius: 5px; background: var(--active); overflow: hidden; }
.u-bar i { display: block; height: 100%; border-radius: 5px; background: var(--primary); }
.u-last { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--text-2); min-width: 0; }
.u-go { color: var(--muted); display: grid; place-items: center; transition: transform .12s, color .12s; }
.u-row.is-off .u-who, .u-row.is-off .u-perm, .u-row.is-off .u-last { opacity: .5; }
.u-empty { padding: 20px; margin: 0; text-align: center; font-size: 13.5px; }
.setting-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--active); color: var(--icon); display: grid; place-items: center; flex-shrink: 0; }
.tag { display: inline-block; font-size: 12px; font-weight: 500; padding: 2px 8px; border-radius: 6px; background: var(--active); color: var(--text-2); }
.tag-admin { background: var(--primary-soft); color: var(--link); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status.on { color: var(--green); } .status.on::before { background: var(--green); }
.status.off { color: var(--muted); }
.setting { display: flex; align-items: center; gap: 16px; padding: 18px 22px; margin: 0; }
.setting-text { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.setting-text strong { font-weight: 500; }
.setting-text small { color: var(--muted); font-size: 13px; line-height: 1.5; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch > span { position: absolute; inset: 0; border-radius: 22px; background: var(--active); border: 1px solid var(--border); transition: background .15s; }
.switch > span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + span { background: var(--primary); border-color: var(--primary); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.form-card { padding: 22px 26px; display: flex; flex-direction: column; gap: 14px; }
.card-title { font-size: 15px; font-weight: 600; margin: 0; }
.card-head { display: flex; align-items: center; gap: 10px; }
.card-head .card-title { flex: 1; }
.perm-actions { display: flex; gap: 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field > span em { font-style: normal; font-size: 12px; }
.pass-wrap { display: flex; align-items: center; gap: 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--input); padding-right: 4px; }
.pass-wrap:focus-within { border-color: var(--primary); }
.pass-wrap input { flex: 1; min-width: 0; border: 0 !important; background: none !important; font-family: var(--mono); }
.check-row { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.check-row input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--primary); flex-shrink: 0; }
.check-row span, .role-opt span, .perm > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.check-row strong, .role-opt strong, .perm strong { font-weight: 500; font-size: 14px; }
.check-row small, .role-opt small, .perm small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-opt { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; background: var(--canvas); }
.role-opt:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.role-opt input { margin: 3px 0 0; accent-color: var(--primary); flex-shrink: 0; }
.perm-group { display: flex; flex-direction: column; }
.perm-group-title { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; padding: 8px 0 4px; }
.perm { display: flex; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.perm-group .perm:last-child { border-bottom: 0; }
.perm > span:first-child { flex: 1; }
.admin-note { display: none; align-items: center; gap: 8px; margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--primary-soft); color: var(--text-2); font-size: 13px; }
.admin-note .ic { color: var(--link); }
.perms-card[data-admin] .admin-note { display: flex; }
.perms-card[data-admin] .perm-group, .perms-card[data-admin] .perm-actions { opacity: .45; pointer-events: none; }
.danger-zone { flex-direction: row; align-items: center; gap: 16px; }
.danger-zone > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.danger-zone strong { font-weight: 500; }
.danger-zone small { color: var(--muted); font-size: 12.5px; }
.btn-danger { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.btn-danger:hover { background: color-mix(in srgb, var(--red) 22%, transparent); }
@media (max-width: 860px) {
  .grid-2, .role-pick { grid-template-columns: 1fr; }
  .u-grid { grid-template-columns: minmax(0, 1fr) auto auto 16px; gap: 12px; padding: 0 14px; }
  .u-filter { width: 100%; }
  .admin-head { flex-direction: column; align-items: stretch; }
  .hide-sm { display: none !important; }
  .form-card { padding: 18px; }
}

/* Aviso */
.toast { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 200; padding: 10px 16px; border-radius: 10px; background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: 13.5px; max-width: calc(100vw - 32px); }
.toast-erro { border-color: var(--red); }
.scrim { display: none; }

/* Celular */
@media (max-width: 860px) {
  .app { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
  .sidebar { position: fixed; left: var(--rail-w); top: 0; bottom: 0; width: min(260px, calc(100vw - var(--rail-w) - 20px)); transform: translateX(-110%); transition: transform .2s; box-shadow: var(--shadow-lg); padding-top: 4px; }
  body.side-open .sidebar { transform: none; }
  body.side-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 15; }
  .mobile-only { display: inline-grid; }
  .canvas { padding: 14px 10px 32px; }
  .doc { padding: 20px 18px; border-radius: 10px; }
  .doc-list { padding: 4px 0; }
  .row { padding: 12px 14px; }
  .doc h1, .home h1 { font-size: 21px; }
  .topbar { padding: 0 8px; }
  .topbar .seg-btn { padding: 0 8px; }
  .viewer iframe { height: 70vh; }
  .user-menu { width: 230px; }
}
@media (max-width: 1180px) {
  body.has-details .app, body.has-details.details-closed .app { grid-template-columns: var(--rail-w) var(--side-w) minmax(0, 1fr); }
  .details { position: fixed; right: 0; top: 0; bottom: 0; width: min(300px, 88vw); box-shadow: var(--shadow-lg); z-index: 40; display: none; }
  body.details-open .details { display: flex !important; }
  body.details-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 35; }
  .details-opener { display: inline-grid !important; }
}
@media (max-width: 860px) {
  body.has-details .app, body.has-details.details-closed .app { grid-template-columns: var(--rail-w) minmax(0, 1fr); }
}
.u-row[hidden] { display: none; }

/* Página da categoria (texto + blocos de artigo) */
.cat-page { max-width: 820px; margin: 0 auto 8px; display: flex; flex-direction: column; gap: 14px; }
.cat-page > .prose { padding: 0 4px; }
.cat-page > .prose > :first-child { margin-top: 0; }
.cat-page > .prose > :last-child { margin-bottom: 0; }
.cat-block.doc { max-width: none; width: 100%; margin: 0; }
.cat-missing { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border: 1px dashed var(--border); border-radius: 12px; color: var(--muted); font-size: 13.5px; }
.cat-rest-label { max-width: 820px; margin: 22px auto 8px; padding: 0 4px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.cat-edit #content { min-height: 380px; }
.toolbar { align-items: center; }
.tb-sep { width: 1px; height: 18px; background: var(--border); margin: 0 6px; }
.tb-select { margin-left: auto; height: 30px; padding: 0 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--input); color: var(--text); font: inherit; font-size: 13px; max-width: 240px; }

/* Personalizar menu */
.side-custom { opacity: 0; transition: opacity .12s; color: var(--icon); }
.sidebar:hover .side-custom, .side-custom:focus-visible { opacity: 1; }
.side-sep { height: 1px; background: var(--border); margin: 10px 10px; }
.menu-edit { max-width: 860px; }
.m-help { margin: 0; line-height: 1.55; }
.m-help .ic { display: inline-block; vertical-align: -2px; }
.m-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.m-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--canvas); }
.m-item.dragging { border-color: var(--primary); box-shadow: var(--shadow-lg); opacity: .9; }
.m-item.is-hidden { opacity: .45; }
.m-section { background: transparent; border-style: dashed; }
.m-section .m-name { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.m-grip { cursor: grab; color: var(--muted); display: grid; place-items: center; width: 20px; height: 30px; touch-action: none; flex-shrink: 0; }
.m-item.dragging .m-grip { cursor: grabbing; }
.m-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--icon); border: 1px solid var(--border); background: var(--card); flex-shrink: 0; }
.m-icon:hover { border-color: var(--primary); color: var(--text); }
.m-noicon { color: var(--muted); font-size: 16px; line-height: 1; }
.m-item input.m-name, .m-item input.m-url { flex: 1; min-width: 0; height: 32px; padding: 0 10px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--text); font: inherit; font-size: 14px; outline: 0; }
.m-item input.m-name:hover, .m-item input.m-url:hover { border-color: var(--border); }
.m-item input.m-name:focus, .m-item input.m-url:focus { border-color: var(--primary); background: var(--input); }
.m-link-fields { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.m-link-fields .m-name { flex: 1 1 140px; }
.m-link-fields .m-url { flex: 2 1 200px; font-size: 13px; color: var(--text-2); }
.m-new { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; padding: 0 6px; }
.m-new input { accent-color: var(--primary); }
.m-type { font-size: 12px; color: var(--muted); white-space: nowrap; width: 100px; text-align: right; flex-shrink: 0; }
.m-btn { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; color: var(--icon); flex-shrink: 0; }
.m-btn:hover { background: var(--hover); color: var(--text); }
.m-btn .i-off, .m-item.is-hidden .m-btn .i-on { display: none; }
.m-item.is-hidden .m-btn .i-off { display: block; }
.m-btn-ghost { pointer-events: none; }
[data-m-picker] { position: fixed; z-index: 160; }
@media (max-width: 860px) { .m-type { display: none; } }

/* Opções de layout da página da categoria */
.cat-wrap { --cw: 820px; max-width: var(--cw); margin: 0 auto; }
.cat-wrap.w-larga { --cw: 1180px; }
.cat-wrap.w-cheia { --cw: none; }
.cat-wrap.p-esquerda { margin-left: 0; }
.cat-wrap .cat-page, .cat-wrap .cat-rest-label { max-width: none; margin-left: 0; margin-right: 0; }
.cat-wrap > .doc-list { max-width: none; margin: 0; }
.cat-wrap.t-centro .cat-page > .prose { text-align: center; }
.cat-wrap.t-justificado .cat-page > .prose { text-align: justify; }
.opt-grid { display: grid; grid-template-columns: 1.35fr 1fr 1.1fr; gap: 12px; }
@media (max-width: 1100px) { .opt-grid { grid-template-columns: 1fr; } }
.opt-grid .field > span { margin-bottom: 0; }
.seg-radio { display: flex; padding: 2px; border-radius: 8px; background: var(--canvas); border: 1px solid var(--border); }
.seg-radio label { position: relative; flex: 1; text-align: center; cursor: pointer; }
.seg-radio input { position: absolute; opacity: 0; pointer-events: none; }
.seg-radio span { display: block; height: 30px; line-height: 30px; padding: 0 6px; border-radius: 6px; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.seg-radio input:checked + span { background: var(--primary); color: #fff; }
.seg-radio input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 1px; }

/* Cartão de edição com largura arrastável */
.page-card { position: relative; max-width: calc(var(--cw, 820px) + var(--pad, 0px)); }
.page-card.w-cheia { max-width: none; }
.page-card.p-esquerda { margin-left: 0; }
.page-card.resizing { user-select: none; }
.pg-handle { position: absolute; top: 0; bottom: 0; width: 18px; cursor: ew-resize; z-index: 3; touch-action: none; }
.pg-handle.h-left { left: -10px; } .pg-handle.h-right { right: -10px; }
.pg-handle::after { content: ''; position: sticky; top: 45vh; display: block; margin: 120px auto 0; width: 6px; height: 54px; border-radius: 6px; background: var(--primary); opacity: .35; transition: opacity .12s; }
.page-card:hover .pg-handle::after { opacity: .7; }
.pg-handle:hover::after, .page-card.resizing .pg-handle::after { opacity: 1; }
.page-card.p-esquerda .h-left { display: none; }
.page-card.resizing { outline: 1px dashed var(--primary); outline-offset: 4px; }
.width-tools { display: flex; align-items: center; gap: 4px; }
.stage-w { font-size: 12.5px; font-variant-numeric: tabular-nums; padding: 3px 9px; border-radius: 20px; background: var(--primary-soft); color: var(--link); white-space: nowrap; }
.page-opts { border: 1px solid var(--border); border-radius: 10px; padding: 0 14px; background: var(--canvas); }
.page-opts > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; height: 40px; font-size: 13.5px; color: var(--text-2); }
.page-opts > summary::-webkit-details-marker { display: none; }
.page-opts > summary .ic { color: var(--icon); }
.page-opts[open] { padding-bottom: 12px; }
.page-opts[open] > summary { margin-bottom: 4px; }
.page-opts p { margin: 10px 0 0; line-height: 1.5; }
.page-preview { min-height: 200px; }
.page-preview.t-centro .prose { text-align: center; }
.page-preview.t-justificado .prose { text-align: justify; }
/* Artigo publicado */
.article-wrap { max-width: var(--cw, 820px); }
.article-wrap.w-cheia { max-width: none; }
.article-wrap.p-esquerda { margin-left: 0; }
.article-wrap.t-centro .prose { text-align: center; }
.article-wrap.t-justificado .prose { text-align: justify; }
@media (max-width: 860px) { .width-tools { display: none; } .pg-handle { display: none; } }
.prose .cat-block { margin: 14px 0; text-align: left; } .prose .cat-block a { border-bottom: 0; color: inherit; }

/* Navegador (breadcrumb) no topo */
.crumbs { display: flex; align-items: center; gap: 4px; font-weight: 400; color: var(--muted); }
.crumbs a { color: var(--muted); padding: 3px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; flex-shrink: 1; }
.crumbs a:hover { color: var(--text); background: var(--hover); }
.crumbs > span { color: var(--text); font-weight: 500; padding: 3px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.crumb-sep { color: var(--muted); opacity: .6; flex-shrink: 0; }
.nav-back { flex-shrink: 0; }
@media (max-width: 700px) { .crumbs a, .crumbs .crumb-sep { display: none; } }


/* Login */
.canvas-login { display: flex; padding: 16px; }
.auth2 { flex: 1; width: 100%; min-height: 100%; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(380px, 1fr); background: var(--card); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-lg); }
.auth2-side { position: relative; overflow: hidden; padding: clamp(32px, 5vw, 72px); display: flex; flex-direction: column; justify-content: space-between; gap: 28px; color: #fff; background: radial-gradient(circle at 15% 10%, #5a4ff0 0%, transparent 45%), linear-gradient(160deg, #3A2FC1 0%, #2A2196 100%); }
.auth2-side::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5; background-image: radial-gradient(1.2px 1.2px at 20px 30px, #fff 50%, transparent 51%), radial-gradient(1px 1px at 120px 90px, #fff 50%, transparent 51%), radial-gradient(1px 1px at 70px 150px, #fff 50%, transparent 51%); background-size: 170px 170px; }
.auth2-side > * { position: relative; z-index: 1; }
.auth2-side h2 { font-size: clamp(30px, 3.2vw, 52px); line-height: 1.15; letter-spacing: -.6px; font-weight: 400; margin: 0 0 12px; }
.auth2-side h2 b { font-weight: 700; }
.auth2-side p { margin: 0; max-width: 560px; color: rgba(255,255,255,.85); font-size: clamp(14.5px, 1.1vw, 17px); line-height: 1.6; }
.auth2-feats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.auth2-feats li { display: flex; gap: 14px; align-items: flex-start; font-size: clamp(14px, 1vw, 15.5px); line-height: 1.45; color: rgba(255,255,255,.92); }
.auth2-feats .ic { flex-shrink: 0; width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: rgba(255,255,255,.12); color: #fff; }
.auth2-feats b { display: block; font-weight: 600; color: #fff; }
.auth2-form { padding: 44px clamp(32px, 5vw, 88px); display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.auth2-form > * { width: 100%; max-width: 420px; margin-left: auto; margin-right: auto; }
.auth2-form > .auth2-row { width: 100%; }
.auth2-form h1 { font-size: clamp(24px, 1.8vw, 30px) !important; }
.auth2-form h1 { font-size: 24px; font-weight: 600; margin: 0; letter-spacing: -.3px; }
.auth2-lead { margin: -6px 0 10px; color: var(--muted); font-size: 14px; }
.float { position: relative; display: block; }
.float input { width: 100%; height: 54px; padding: 20px 44px 6px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--input); color: var(--text); font: inherit; font-size: 14.5px; outline: 0; transition: border-color .12s, box-shadow .12s; }
.float input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
.float > span { position: absolute; left: 15px; top: 17px; font-size: 14px; color: var(--muted); pointer-events: none; transition: all .14s ease; }
.float input:focus + span, .float input:not(:placeholder-shown) + span { top: 8px; font-size: 11.5px; }
.float-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--icon); }
.float-eye:hover { background: var(--hover); }
.auth2-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.auth2-row input { width: 16px; height: 16px; accent-color: var(--primary); margin: 0; }
.auth2-submit { height: 46px; font-size: 14.5px; justify-content: center; border-radius: 10px; margin-top: 4px; }
.auth2-foot { margin: 6px 0 0; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); text-align: center; }
@media (max-width: 860px) { .auth2 { grid-template-columns: 1fr; min-height: 0; } .auth2-side { display: none; } .auth2-form { padding: 32px 24px; } }
.auth2-or { display: flex; align-items: center; gap: 12px; font-size: 12.5px; color: var(--muted); }
.auth2-or::before, .auth2-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth2-sso { height: 44px; justify-content: center; gap: 8px; border-radius: 10px; background: var(--active); color: var(--text); font-size: 14px; }
.auth2-sso:hover { background: var(--hover); }
.auth2-sso-note { margin: -4px 0 0; text-align: center; }

/* Copiar artigo (subcategoria) — admin */
.row-copy { position: relative; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--muted); opacity: 0; transition: opacity .15s, background .15s, color .15s; flex: none; }
.row:hover .row-copy, .row-copy:focus-visible, .row-copy[data-state] { opacity: 1; }
.row-copy:hover { background: var(--hover); color: var(--text); }
.row-copy.ok { color: var(--link, var(--primary)); }
.row-copy[data-state]::after { content: attr(data-state); position: absolute; right: calc(100% + 6px); top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: 12px; font-weight: 500; padding: 4px 8px; border-radius: 6px; background: var(--panel, var(--bg)); border: 1px solid var(--border); color: var(--text); pointer-events: none; }
@media (hover: none) { .row-copy { opacity: 1; } }

/* API de busca */
.api-key { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.api-key input { flex: 1; min-width: 200px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
form.perm { margin: 0; }
.perm > .perm-text { flex: 1; display: flex; flex-direction: column; gap: 2px; } .perm > .perm-text small { color: var(--muted); font-size: 13px; }

/* Assistente (chat) */
.hero.chatting .greet, .hero.chatting .desk-side { display: none; }
.hero.chatting .desk { display: block; max-width: 760px; }
.hero.chatting .ask { margin: 0; }
.hero.chatting { padding-top: 24px; }
.chat { display: none; text-align: left; margin: 0 auto 12px; max-width: 760px; }
.hero.chatting .chat { display: block; animation: chat-in .3s ease; }
@keyframes chat-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.chat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 12.5px; color: var(--muted); }
.chat-top > span { display: inline-flex; align-items: center; gap: 6px; } .chat-top .ic { color: var(--link); }
.chat-reset { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border); background: var(--card); color: var(--text-2); border-radius: 8px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.chat-reset:hover { border-color: var(--link); color: var(--text); }
.chat-log { display: flex; flex-direction: column; gap: 14px; max-height: min(62vh, 640px); overflow-y: auto; padding: 4px 4px 8px; scroll-behavior: smooth; }
.msg { display: flex; gap: 10px; align-items: flex-start; animation: chat-in .25s ease; }
.msg.me { justify-content: flex-end; }
.msg .bubble { max-width: 86%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.55; }
.msg.me .bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; word-break: break-word; }
.msg.bot .bubble { background: color-mix(in srgb, var(--card) 92%, transparent); border: 1px solid var(--border); border-top-left-radius: 4px; min-width: 64px;  }
.bot-av { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: #fff;
  background: var(--orange); }
.msg.bot .prose { font-size: 14px; }
.msg.bot .prose > :first-child { margin-top: 0; } .msg.bot .prose > :last-child { margin-bottom: 0; }
.msg.bot .prose h1, .msg.bot .prose h2, .msg.bot .prose h3 { font-size: 15px; margin: 12px 0 6px; }
.msg.bot .pre { opacity: 0; transform: translateY(4px); }
.msg.bot .in { opacity: 1; transform: none; transition: opacity .3s, transform .3s; }
.typing { display: inline-flex; gap: 4px; padding: 4px 2px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.chat-srcs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; } .chat-srcs .chat-src { margin-top: 0; }
.chat-src { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding: 6px 12px; border-radius: 8px; background: var(--primary-soft); color: var(--link); font-size: 13px; font-weight: 500; }
.chat-src:hover { background: color-mix(in srgb, var(--primary) 30%, transparent); }
.chat-more { margin-top: 10px; } .chat-more small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips.left { justify-content: flex-start; margin-top: 0; }
.chip { padding: 7px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--text-2);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: border-color .15s, color .15s; }
.chip:hover { border-color: var(--link); color: var(--text); }
.chip { font: inherit; font-size: 13px; cursor: pointer; }
.chip.sm { padding: 5px 10px; font-size: 12.5px; }
.chat-all { display: block; margin-top: 10px; font-size: 12.5px; color: var(--muted); } .chat-all:hover { color: var(--link); }
@media (prefers-reduced-motion: reduce) { .msg, .hero.chatting .chat { animation: none; } .typing i { animation: none; opacity: .6; } }
@media (max-width: 700px) { .msg .bubble { max-width: 100%; } .bot-av { display: none; } }

/* Histórico de conversas */
.chat-btns { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chat-pin.on { border-color: var(--link); color: var(--link); background: var(--primary-soft); }
.hist-link { display: inline-flex !important; align-items: center; gap: 6px; color: var(--muted) !important; white-space: nowrap; margin-left: auto; }
.hist-link:hover { color: var(--text) !important; text-decoration: none !important; }
.hist { position: fixed; inset: 0; z-index: 400; display: flex; justify-content: flex-end; background: rgba(8, 10, 16, .45); }
.hist[hidden] { display: none; }
.hist-card { width: min(400px, 100%); height: 100%; display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); animation: hist-in .2s ease; }
@keyframes hist-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.hist-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: var(--head-h); padding: 0 10px 0 18px; border-bottom: 1px solid var(--border); flex: none; }
.hist-head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.hist-search { display: flex; align-items: center; gap: 8px; margin: 12px 14px 4px; padding: 0 10px; height: 36px; border: 1px solid var(--border); border-radius: 8px; background: var(--input); color: var(--muted); flex: none; }
.hist-search:focus-within { border-color: var(--link); }
.hist-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: 14px var(--font); }
.hist-body { flex: 1; overflow-y: auto; padding: 4px 8px 10px; }
.hist-group { margin: 14px 10px 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.hist-item { position: relative; display: flex; align-items: center; border-radius: 8px; }
.hist-item:hover, .hist-item.cur { background: var(--hover); }
.hist-open { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.hist-ic { display: grid; color: var(--icon); flex: none; margin-top: 2px; }
.hist-item.pinned .hist-ic { color: var(--link); }
.hist-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.hist-title { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-when { font-size: 12px; color: var(--muted); }
.hist-acts { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: none; gap: 2px; padding-left: 18px;
  background: linear-gradient(90deg, transparent, var(--hover) 16px); }
@media (hover: none) { .hist-acts { display: flex; position: static; transform: none; background: none; padding: 0 4px 0 0; } }
.hist-item:hover .hist-acts, .hist-item:focus-within .hist-acts, .hist-item.confirming .hist-acts { display: flex; }
.hist-act { display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; font: 500 12px var(--font); }
.hist-act:hover { background: var(--active); color: var(--text); }
.hist-act.on { color: var(--link); }
.hist-act.danger:hover, .hist-act.confirm { color: var(--red); }
.hist-item.renaming { padding: 5px 6px; } .hist-item.renaming .hist-acts { display: none !important; }
.hist-input { flex: 1; min-width: 0; height: 30px; padding: 0 8px; border: 1px solid var(--link); border-radius: 6px; background: var(--input); color: var(--text); font: inherit; outline: 0; }
.hist-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 40px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.hist-empty .ic { width: 22px; height: 22px; opacity: .7; } .hist-empty p { margin: 0; line-height: 1.5; }
.hist-err { margin: 4px 6px; padding: 8px 10px; border-radius: 8px; background: var(--amber-bg); color: var(--amber); font-size: 13px; }
.hist-foot { margin: 0; padding: 10px 18px 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); flex: none; }
@media (prefers-reduced-motion: reduce) { .hist-card { animation: none; } }


/* Assistente: resposta sendo escrita + "Essa resposta ajudou?" */
.llm-live { white-space: pre-wrap; }
.llm-status { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.fb { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.fb span { margin-right: 4px; }
.fb button { border: 1px solid var(--border); background: none; color: var(--text-2); border-radius: 7px; padding: 3px 9px; font: inherit; cursor: pointer; }
.fb button:hover { border-color: var(--link); color: var(--text); }
.fb button:focus-visible { outline: 2px solid var(--link); outline-offset: 1px; }

/* =========================================================
 * Movimento — transições suaves no sistema todo.
 * Só opacity/transform (rodam na GPU, sem travar). Respeita "reduzir movimento".
 * ======================================================= */
:root { --t: .16s; --ease: cubic-bezier(.2, .7, .2, 1); --ease-out: cubic-bezier(.16, 1, .3, 1); }

/* Troca de página: o menu fica parado, só o conteúdo entra deslizando. */
@view-transition { navigation: auto; }
.rail { view-transition-name: rail; }
.sidebar { view-transition-name: sidebar; }
.main { view-transition-name: page; }
.details { view-transition-name: details; }
::view-transition-group(page), ::view-transition-group(details) { animation-duration: .28s; animation-timing-function: var(--ease-out); }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-group(rail), ::view-transition-group(sidebar) { animation-duration: .2s; }
::view-transition-old(page) { animation: vt-out .2s var(--ease) both; }
::view-transition-new(page) { animation: vt-in .26s var(--ease-out) both; }
@keyframes vt-out { to { opacity: 0; transform: scale(.985) translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; } }

/* Entrada em cascata: os blocos da página sobem um depois do outro (app.js marca quais). */
.enter { animation: enter .6s var(--ease-out) both; animation-delay: calc(min(var(--i, 0), 10) * 55ms); will-change: transform, opacity; }
@keyframes enter { from { opacity: 0; transform: translateY(22px); } }

/* Hover / foco: cor, borda e sombra mudam suavemente em tudo que é clicável. */
a, button, .btn, .icon-btn, .row, .side-item, .rail-btn, .rail-avatar, .chip, .live-item, .pop-item, .idx-list a, .news-list a,
.resume-item, .hist-item, .hist-act, .chat-reset, .chat-src, .quick-btn, .fb button, .tip, .result, .seg-btn, .m-btn, .file, .u-row,
input, textarea, select, .ask, .hist-search {
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease), border-color var(--t) var(--ease),
              box-shadow var(--t) var(--ease), opacity var(--t) var(--ease), transform .12s var(--ease);
}
.idx-ic, .row .ic:last-child, .side-item .ic { transition: transform .2s var(--ease-out), color var(--t) var(--ease); }
.idx-list a:hover .idx-ic { transform: translateX(2px); }
.row:hover > .ic:last-child { transform: translateX(3px); }

/* Clique: o botão "afunda" um pouquinho. */
.btn:active, .icon-btn:active, .ask-go:active, .quick-btn:active, .chip:active, .chat-reset:active, .chat-src:active,
.rail-btn:active, .fb button:active, .hist-act:active, .resume-item:active, .m-btn:active { transform: scale(.97); }

/* Menus, busca ao vivo, avisos e painéis entram com fade + deslize. */
.popover:not([hidden]) { animation: pop-in .18s var(--ease-out); transform-origin: bottom left; }
.live { animation: drop-in .16s var(--ease-out); transform-origin: top center; }
.toast { animation: toast-in .32s var(--ease-out); }
.toast.out { animation: toast-out .22s var(--ease) forwards; }
.viewer:not([hidden]) { animation: fade-up .24s var(--ease-out); }
.callout, .did-you-mean { animation: fade-up .3s var(--ease-out) both; }
@keyframes pop-in { from { opacity: 0; transform: translateY(6px) scale(.97); } }
@keyframes drop-in { from { opacity: 0; transform: translateY(-6px) scale(.99); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -12px); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, -12px); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

/* Histórico: entra e sai deslizando, com o fundo escurecendo. */
.hist:not([hidden]) { animation: fade .2s var(--ease); }
.hist.closing { animation: fade-out .18s var(--ease) forwards; }
.hist.closing .hist-card { animation: hist-out .18s var(--ease) forwards; }
.hist-card { animation: hist-in .3s var(--ease-out); }
@keyframes hist-out { to { transform: translateX(28px); opacity: 0; } }

/* Celular: menu lateral e painel de detalhes deslizam; o fundo escurece com fade. */
@media (max-width: 860px) {
  .sidebar { transition: transform .3s var(--ease-out); will-change: transform; }
  body.side-open .scrim { animation: fade .22s var(--ease); }
}
@media (max-width: 1180px) {
  body.details-open .details { animation: slide-left .3s var(--ease-out); }
  body.details-open .scrim { animation: fade .22s var(--ease); }
}
@keyframes slide-left { from { transform: translateX(100%); } }

/* Conteúdo da página: rolagem suave em âncoras ("ir para a seção"). */
.canvas { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
.desk-side:not([hidden]) { animation: fade-up .55s var(--ease-out) .2s both; }
@media (prefers-reduced-motion: reduce) { .desk-side:not([hidden]) { animation: none; } }

/* =========================================================
 * Tela inicial ⇄ conversa: transição orquestrada (app.js põe .vt-chat / .vt-home no <html>).
 * Campo de pergunta e categorias deslizam até o novo lugar, o avatar voa até a 1ª resposta,
 * a mensagem sobe do campo até o balão, o resto da tela inicial sai de cena.
 * ======================================================= */
:is(.vt-chat, .vt-home) .ask { view-transition-name: composer; }
:is(.vt-chat, .vt-home) .greet-av { view-transition-name: greet-av; }
:is(.vt-chat, .vt-home) .greet-bubble { view-transition-name: greet-bubble; }
:is(.vt-chat, .vt-home) .greet-who { view-transition-name: greet-who; }
:is(.vt-chat, .vt-home) .quick { view-transition-name: quick; }
:is(.vt-chat, .vt-home) .desk-side { view-transition-name: side; }
:is(.vt-chat, .vt-home) .chat-top { view-transition-name: chat-top; }
:is(.vt-chat, .vt-home) .home { view-transition-name: below; }
:is(.vt-chat, .vt-home) .topbar { view-transition-name: topbar; }
html:is(.vt-chat, .vt-home)::view-transition-old(topbar), html:is(.vt-chat, .vt-home)::view-transition-new(topbar) { animation: none; }

html:is(.vt-chat, .vt-home)::view-transition-group(*) { animation-duration: .85s; animation-timing-function: cubic-bezier(.2, .9, .1, 1); }
html:is(.vt-chat, .vt-home)::view-transition-old(page) { animation: fade-out .25s var(--ease) both; }
html:is(.vt-chat, .vt-home)::view-transition-new(page) { animation: fade .45s var(--ease) .2s both; }

/* Indo para a conversa */
html.vt-chat::view-transition-old(greet-bubble) { animation: vt-lift-out .5s var(--ease) both; }
html.vt-chat::view-transition-old(greet-who) { animation: fade-out .2s var(--ease) both; }
html.vt-chat::view-transition-old(quick) { animation: vt-drop-out .38s var(--ease) both; }
html.vt-chat::view-transition-old(side) { animation: vt-side-out .5s var(--ease) both; }
html.vt-chat::view-transition-new(chat-top) { animation: vt-top-in .5s var(--ease-out) .35s both; }
html.vt-chat::view-transition-new(chat-user) { animation: vt-user-in .75s cubic-bezier(.34, 1.4, .64, 1) .12s both; }

/* Voltando para a tela inicial ("Nova conversa") */
html.vt-home::view-transition-new(greet-bubble) { animation: vt-lift-out .6s var(--ease-out) .2s reverse both; }
html.vt-home::view-transition-new(greet-who) { animation: fade .3s var(--ease) .35s both; }
html.vt-home::view-transition-new(quick) { animation: vt-drop-out .5s var(--ease-out) .35s reverse both; }
html.vt-home::view-transition-new(side) { animation: vt-side-out .6s var(--ease-out) .3s reverse both; }
html.vt-home::view-transition-old(chat-top) { animation: fade-out .2s var(--ease) both; }
html.vt-home::view-transition-old(chat-user) { animation: vt-user-out .45s var(--ease) both; }

@keyframes vt-lift-out { to { opacity: 0; transform: translateY(-32px) scale(.94); filter: blur(8px); } }
@keyframes vt-drop-out { to { opacity: 0; transform: translateY(18px); } }
@keyframes vt-side-out { to { opacity: 0; transform: translateX(56px); } }
@keyframes vt-top-in { from { opacity: 0; transform: translateY(-12px); } }
@keyframes vt-user-in { from { opacity: 0; transform: translateY(150px) scale(.78); } 55% { opacity: 1; } }
@keyframes vt-user-out { to { opacity: 0; transform: translateY(150px) scale(.78); } }

/* Modo conversa: o chat ocupa a tela inteira (campo de pergunta embaixo); categorias ficam abaixo, apagadas. */
.hero.chatting { height: calc(100dvh - var(--head-h)); padding-bottom: 20px; display: flex; flex-direction: column; }
.hero.chatting .desk { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; }
.hero.chatting .desk-main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.hero.chatting .chat { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-bottom: 14px; }
.hero.chatting .chat-log { flex: 1; min-height: 0; max-height: none; }
.hero.chatting ~ .home { opacity: .4; transition: opacity .3s var(--ease); }
.hero.chatting ~ .home:hover, .hero.chatting ~ .home:focus-within { opacity: 1; }
@media (max-width: 700px) { .hero.chatting { padding-bottom: 12px; } }
.hero.chatting .desk { max-width: 1040px; }
.hero.chatting .chat { width: 100%; max-width: none; margin-left: 0; margin-right: 0; }
.hero.chatting .ask { width: 100%; }
.hero.chatting .msg .bubble { max-width: min(82%, 820px); }
.hero.chatting .desk { align-items: stretch; }

/* =========================================================
 * Mascote do assistente (views/_mascot.php). Humor em data-mood no .bot-av:
 * think (procurando) · write (escrevendo) · happy (respondeu) · sad (não achou) · wave (oi/obrigado)
 * oops (xingamento) · love (👍) · idle (parado) · still (mensagens antigas, sem animação)
 * ======================================================= */
.bot-av:has(.mascot) { width: 38px; height: 38px; background: none; box-shadow: none; overflow: visible; }
.greet-av:has(.mascot) { width: 44px; height: 44px; margin-top: 12px; }
.mascot { width: 100%; height: 100%; overflow: visible; }
.mascot * { transform-box: fill-box; transform-origin: center; }
.m-shape { fill: var(--orange); }
.m-arm { fill: none; stroke: var(--orange); stroke-width: 3.4; stroke-linecap: round; transform-origin: 0% 100%; opacity: 0; }
.m-white { fill: #fff; }
.m-pupils { fill: #2b1a10; transition: transform .25s var(--ease); }
.m-cheek { fill: #ffd0b5; opacity: .55; }
.m-happy, .m-smile, .m-frown { fill: none; stroke: #fff; stroke-width: 2.1; stroke-linecap: round; }
.m-happy, .m-frown, .m-talk { opacity: 0; }
.m-talk { fill: #2b1a10; stroke: #fff; stroke-width: 1.1; }
.m-fx { opacity: 0; }
.m-dots { fill: var(--muted); }
.m-heart { fill: #ff5c8a; }
.m-drop { fill: #7dd3fc; }
.m-body { transform-origin: 50% 100%; }

/* parado: respira e pisca */
.bot-av[data-mood="idle"] .m-body { animation: m-breathe 3.2s ease-in-out infinite; }
.bot-av:is([data-mood="idle"], [data-mood="think"], [data-mood="write"], [data-mood="love"], [data-mood="wave"]) .m-eyes { animation: m-blink 4.2s infinite; }
@keyframes m-breathe { 50% { transform: scale(1.03, .97); } }
@keyframes m-blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }

/* procurando: olha para os lados, inclina, "…" pensando */
.bot-av[data-mood="think"] .m-body { animation: m-tilt 1.6s ease-in-out infinite; }
.bot-av[data-mood="think"] .m-pupils { animation: m-look 1.6s ease-in-out infinite; }
.bot-av[data-mood="think"] .m-dots { opacity: 1; }
.bot-av[data-mood="think"] .m-dots circle { animation: m-dot 1.2s infinite; }
.bot-av[data-mood="think"] .m-dots circle:nth-child(2) { animation-delay: .2s; }
.bot-av[data-mood="think"] .m-dots circle:nth-child(3) { animation-delay: .4s; }
@keyframes m-tilt { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(5deg); } }
@keyframes m-look { 0%, 100% { transform: translate(-1.6px, -.6px); } 45%, 55% { transform: translate(1.6px, -.6px); } }
@keyframes m-dot { 0%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-1.5px); } }

/* escrevendo: quica no ritmo e "fala" */
.bot-av[data-mood="write"] .m-body { animation: m-bounce .46s ease-in-out infinite; }
.bot-av[data-mood="write"] .m-smile { opacity: 0; }
.bot-av[data-mood="write"] .m-talk { opacity: 1; animation: m-talk .23s ease-in-out infinite alternate; }
.bot-av[data-mood="write"] .m-pupils { transform: translate(.8px, .4px); }
@keyframes m-bounce { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-2.5px) scale(.98, 1.02); } }
@keyframes m-talk { from { transform: scaleY(.35); } to { transform: scaleY(1.1); } }

/* respondeu: pulinho feliz (^^) */
.bot-av[data-mood="happy"] .m-body { animation: m-hop .7s cubic-bezier(.3, 1.6, .5, 1) 2; }
.bot-av:is([data-mood="happy"], [data-mood="wave"], [data-mood="love"]) .m-eyes { opacity: 0; }
.bot-av:is([data-mood="happy"], [data-mood="wave"], [data-mood="love"]) .m-happy { opacity: 1; }
.bot-av:is([data-mood="happy"], [data-mood="love"]) .m-cheek { opacity: .9; }
@keyframes m-hop { 0% { transform: translateY(0) scale(1); } 25% { transform: translateY(0) scale(1.08, .9); } 55% { transform: translateY(-6px) scale(.95, 1.06); } 85% { transform: translateY(0) scale(1.04, .96); } 100% { transform: none; } }

/* não achou: tristinho, balança a cabeça */
.bot-av[data-mood="sad"] .m-smile { opacity: 0; }
.bot-av[data-mood="sad"] .m-frown { opacity: 1; }
.bot-av[data-mood="sad"] .m-pupils { transform: translate(0, 1.3px); }
.bot-av[data-mood="sad"] .m-body { animation: m-shake .9s ease-in-out 1, m-droop 3s ease-in-out .9s infinite; }
@keyframes m-shake { 20%, 60% { transform: rotate(-8deg); } 40%, 80% { transform: rotate(8deg); } }
@keyframes m-droop { 50% { transform: translateY(1px) scale(1.02, .97); } }

/* oi / obrigado / tchau: acena */
.bot-av[data-mood="wave"] .m-arm { opacity: 1; animation: m-wave .5s ease-in-out 4 alternate; }
.bot-av[data-mood="wave"] .m-body { animation: m-breathe 1s ease-in-out 2; }
@keyframes m-wave { from { transform: rotate(-18deg); } to { transform: rotate(22deg); } }

/* xingamento: sem graça, gota de suor */
.bot-av[data-mood="oops"] .m-drop { animation: m-drop 1.6s ease-in 2; }
.bot-av[data-mood="oops"] .m-pupils { transform: translate(-1.4px, 0); }
.bot-av[data-mood="oops"] .m-smile { transform: scaleX(.6); }
@keyframes m-drop { 0% { opacity: 0; transform: translateY(-2px); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(8px); } }

/* 👍: corações */
.bot-av[data-mood="love"] .m-body { animation: m-hop .7s cubic-bezier(.3, 1.6, .5, 1) 1; }
.bot-av[data-mood="love"] .m-heart { animation: m-heart 1.4s ease-out 2; }
.bot-av[data-mood="love"] .m-heart2 { animation-delay: .35s; }
@keyframes m-heart { 0% { opacity: 0; transform: translateY(4px) scale(.5); } 25% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(-10px) scale(.9); } }

/* mensagens antigas: parado */
.bot-av[data-mood="still"] * { animation: none !important; }

@media (prefers-reduced-motion: reduce) { .mascot * { animation: none !important; transition: none !important; } }
.msg.bot .bot-av:has(.mascot) { position: sticky; top: 2px; } /* o mascote acompanha respostas longas */
/* 👎: a mensagem some e volta com a nova resposta */
.bubble.swap-out { animation: swap-out .22s var(--ease) forwards; }
@keyframes swap-out { to { opacity: 0; transform: scale(.97); } }
.alt-tag { display: inline-block; margin-bottom: 8px; padding: 2px 8px; border-radius: 6px; background: var(--primary-soft); color: var(--link); font-size: 11.5px; font-weight: 600; }


/* Mascote B (views/_mascot_b.php): headset e antena */
.mascot-b .b-band, .mascot-b .b-mic { fill: none; stroke: #2d3142; stroke-width: 1.8; stroke-linecap: round; }
.mascot-b .b-cup, .mascot-b .b-mic-tip { fill: #2d3142; }
.mascot-b .b-ant { stroke: #c2570c; stroke-width: 1.6; stroke-linecap: round; }
.mascot-b .b-ant-ball { fill: #fdba74; transform-origin: 50% 100%; }
.mascot-b .b-belly { fill: none; stroke: #fff; stroke-opacity: .28; stroke-width: 1.3; stroke-linecap: round; }
.bot-av[data-mood="think"] .mascot-b .b-ant-ball { animation: b-blink .9s ease-in-out infinite; }
.bot-av[data-mood="write"] .mascot-b .b-ant-ball { animation: b-bob .45s ease-in-out infinite; }
.bot-av:is([data-mood="happy"], [data-mood="love"]) .mascot-b .b-ant-ball { fill: #fde68a; }
@keyframes b-blink { 50% { fill: #fef3c7; transform: scale(1.35); } }
@keyframes b-bob { 50% { transform: translateY(-1px) scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .mascot-b .b-ant-ball { animation: none !important; } }

/* ---- Mascotes C–G (views/_mascot_c..g.php) ---- */
.mascot-c .m-shape { fill: #6170f2; } .mascot-c .m-arm { stroke: #6170f2; }
.mascot-c .c-visor { fill: #1c2036; } .mascot-c .c-bolt, .mascot-c .c-feet { fill: #434fc4; }
.mascot-c .c-ant { stroke: #434fc4; stroke-width: 1.6; stroke-linecap: round; } .mascot-c .c-ant-ball { fill: #fb7185; }
.mascot-c .m-white { fill: #7de3ff; } .mascot-c .m-pupils { fill: #0e1a2e; } .mascot-c .m-cheek { fill: #c7cdff; }
.bot-av[data-mood="think"] .mascot-c .c-ant-ball { animation: b-blink .9s ease-in-out infinite; }
.mascot-d .m-shape { fill: #fb923c; } .mascot-d .m-arm { stroke: #fb923c; }
.mascot-d .d-ear, .mascot-d .d-nose { fill: #fda4af; } .mascot-d .d-stripe { fill: none; stroke: #ea6a1a; stroke-width: 1.4; stroke-linecap: round; }
.mascot-d .d-whisk { fill: none; stroke: #fff; stroke-opacity: .7; stroke-width: 1; stroke-linecap: round; }
.mascot-e .m-shape { fill: #ece8ff; } .mascot-e .m-arm { stroke: #ece8ff; }
.mascot-e .m-white { fill: #2a2540; } .mascot-e .m-pupils { fill: #fff; } .mascot-e .m-cheek { fill: #f9a8d4; opacity: .8; }
.mascot-e :is(.m-happy, .m-smile, .m-frown) { stroke: #2a2540; } .mascot-e .m-talk { fill: #2a2540; stroke: none; }
.bot-av[data-mood="idle"] .mascot-e .m-body { animation: e-float 3.2s ease-in-out infinite; }
@keyframes e-float { 50% { transform: translateY(-1.6px); } }
.mascot-f .m-shape { fill: #a8612f; } .mascot-f .m-arm { stroke: #a8612f; }
.mascot-f .f-belly { fill: #f6dcb8; } .mascot-f .f-disc { fill: #f3c98f; } .mascot-f .f-beak { fill: #f59e0b; }
.mascot-f .f-wing, .mascot-f .f-scal { fill: none; stroke: #7c4520; stroke-width: 1.3; stroke-linecap: round; }
.mascot-f .f-scal { stroke: #c99a6a; }
.mascot-f :is(.m-happy, .m-smile, .m-frown) { stroke: #5b3416; } .mascot-f .m-talk { fill: #5b3416; stroke: none; }
.mascot-g .m-shape { fill: #cfe4ff; } .mascot-g .m-arm { stroke: #cfe4ff; }
.mascot-g .m-pupils { fill: #1e3a5f; } .mascot-g .m-white { fill: #fff; } .mascot-g .m-cheek { fill: #fbb6ce; opacity: .8; }
.mascot-g :is(.m-happy, .m-smile, .m-frown) { stroke: #1e3a5f; } .mascot-g .m-talk { fill: #1e3a5f; stroke: none; }
.mascot-g .g-shine { fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; opacity: .85; }
@media (prefers-reduced-motion: reduce) { .mascot .m-body, .mascot [class*="-ant-ball"] { animation: none !important; } }

/* ---- Escolher o assistente: clique no mascote ---- */
.hero .bot-av { cursor: pointer; border-radius: 12px; transition: transform .2s var(--ease); }
.hero .bot-av:hover { transform: scale(1.08) rotate(-3deg); }
.hero .bot-av:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
.m-pick { position: fixed; z-index: 500; width: 372px; max-width: calc(100vw - 16px); padding: 14px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--panel); box-shadow: 0 18px 50px rgba(0, 0, 0, .35); transform-origin: top left; animation: m-pick-in .22s cubic-bezier(.2, .9, .2, 1.15); }
.m-pick.closing { animation: m-pick-out .14s var(--ease) both; }
@keyframes m-pick-in { from { opacity: 0; transform: scale(.88) translateY(-6px); } }
@keyframes m-pick-out { to { opacity: 0; transform: scale(.94) translateY(-4px); } }
.m-pick h3 { margin: 0 0 2px; font-size: 14px; font-weight: 650; }
.m-pick p { margin: 0 0 12px; font-size: 12.5px; color: var(--muted); }
.m-pick-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.m-pick-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 2px 8px; border: 1px solid transparent; border-radius: 11px;
  background: none; color: var(--text-2); font: 500 11.5px var(--font); cursor: pointer; transition: background .15s, border-color .15s; }
.m-pick-opt:hover { background: var(--hover); color: var(--text); }
.m-pick-opt:focus-visible { outline: 2px solid var(--link); outline-offset: 1px; }
.m-pick-opt.cur { border-color: var(--link); background: var(--primary-soft); color: var(--text); }
.m-pick-opt .bot-av { width: 46px; height: 46px; cursor: inherit; }
.m-pick-opt .bot-av:hover { transform: none; }
@media (prefers-reduced-motion: reduce) { .m-pick, .m-pick.closing { animation: none; } }
/* Coruja: sem boca, só o bico. Ao falar, a parte de baixo do bico abre e fecha. */
.mascot-f .f-beak-low { fill: #d97706; opacity: 0; transform-origin: 50% 0; }
.bot-av[data-mood="write"] .mascot-f .f-beak-low { opacity: 1; animation: f-beak .28s ease-in-out infinite alternate; }
@keyframes f-beak { from { transform: translateY(-1.2px) scaleY(.4); } to { transform: translateY(.4px); } }
.bot-av[data-mood="sad"] .mascot-f .f-beak { transform: translateY(.6px); }

/* =======================================================
 * Cada mascote tem o seu jeito de se mexer (sobrepõe as animações padrão do Balão).
 * M(x) = .bot-av[data-mood=x]
 * ======================================================= */

/* ---- B Atendente: curte a música no fone, segura o fone para ouvir, fala no microfone, dá uma voltinha ---- */
.bot-av[data-mood="idle"] .mascot-b .m-body { animation: b-groove 1.3s ease-in-out infinite; }
.bot-av[data-mood="think"] .mascot-b .m-body { animation: b-listen 2.4s ease-in-out infinite; }
.bot-av[data-mood="write"] .mascot-b .m-body { animation: b-nod .32s ease-in-out infinite alternate; }
.bot-av[data-mood="write"] .mascot-b .b-mic-tip { animation: b-bob .32s ease-in-out infinite alternate; }
.bot-av[data-mood="happy"] .mascot-b .m-body { animation: b-spin .9s cubic-bezier(.5, 0, .3, 1.3) 1; }
@keyframes b-groove { 0%, 100% { transform: translateX(-.6px) rotate(-4deg); } 50% { transform: translateX(.6px) rotate(4deg); } }
@keyframes b-listen { 0%, 100% { transform: rotate(0); } 30%, 70% { transform: rotate(-11deg) translateY(.5px); } }
@keyframes b-nod { from { transform: rotate(-1.5deg) translateY(0); } to { transform: rotate(1.5deg) translateY(-1px); } }
@keyframes b-spin { 0% { transform: rotate(0) scale(1); } 40% { transform: rotate(-20deg) scale(.95); } 100% { transform: rotate(360deg) scale(1); } }

/* ---- C Robô: flutua em passos, escaneia com o visor, vibra ao digitar, desliga quando triste ---- */
.bot-av[data-mood="idle"] .mascot-c .m-body { animation: c-hover 2.4s steps(4) infinite; }
.bot-av[data-mood="think"] .mascot-c .m-body { animation: none; }
.bot-av[data-mood="think"] .mascot-c .m-pupils { animation: c-scan 1.1s linear infinite alternate; }
.bot-av[data-mood="think"] .mascot-c .m-white { animation: c-flick 1.4s steps(2) infinite; }
.bot-av[data-mood="write"] .mascot-c .m-body { animation: c-jitter .12s linear infinite; }
.bot-av[data-mood="happy"] .mascot-c .m-body { animation: c-jump .8s steps(6) 2; }
.bot-av[data-mood="happy"] .mascot-c .c-ant-ball { animation: c-rgb .5s steps(3) 3; }
.bot-av[data-mood="sad"] .mascot-c .m-body { animation: c-off 1.2s ease-out forwards; }
.bot-av[data-mood="sad"] .mascot-c .m-white { fill: #3b6b80; }
@keyframes c-hover { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.5px); } }
@keyframes c-scan { from { transform: translateX(-2.2px); } to { transform: translateX(2.2px); } }
@keyframes c-flick { 50% { opacity: .75; } }
@keyframes c-jitter { 0% { transform: translate(.3px, 0); } 25% { transform: translate(-.3px, .2px); } 50% { transform: translate(.2px, -.3px); } 75% { transform: translate(-.2px, .1px); } }
@keyframes c-jump { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes c-rgb { 0% { fill: #fb7185; } 33% { fill: #4ade80; } 66% { fill: #60a5fa; } }
@keyframes c-off { to { transform: translateY(1.5px) scale(1, .96); } }

/* ---- D Gatinho: mexe as orelhas e o rabo, inclina curioso, ronrona quando feliz, orelhas baixas quando triste ---- */
.mascot-d .d-tail { fill: none; stroke: #fb923c; stroke-width: 3; stroke-linecap: round; transform-origin: 0% 100%; }
.mascot-d .d-earL { transform-origin: 80% 100%; } .mascot-d .d-earR { transform-origin: 20% 100%; }
.bot-av[data-mood="idle"] .mascot-d .m-body { animation: none; }
.bot-av[data-mood="idle"] .mascot-d .d-earR { animation: d-twitch 3.6s ease-in-out infinite; }
.bot-av[data-mood="idle"] .mascot-d .d-tail { animation: d-tail 2.4s ease-in-out infinite; }
.bot-av[data-mood="think"] .mascot-d .m-body { animation: d-tilt 2.6s ease-in-out infinite; }
.bot-av[data-mood="think"] .mascot-d .d-tail { animation: d-tail 1.6s ease-in-out infinite; }
.bot-av[data-mood="write"] .mascot-d .m-body { animation: none; }
.bot-av[data-mood="write"] .mascot-d .d-earL { animation: d-twitch .6s ease-in-out infinite; }
.bot-av[data-mood="write"] .mascot-d .d-earR { animation: d-twitch .6s ease-in-out .3s infinite; }
.bot-av[data-mood="write"] .mascot-d .d-tail { animation: d-tail .5s ease-in-out infinite; }
.bot-av[data-mood="happy"] .mascot-d .m-body { animation: d-purr .08s linear 18; }
.bot-av[data-mood="happy"] .mascot-d .d-tail { animation: d-tail-up .6s ease-out forwards; }
.bot-av[data-mood="sad"] .mascot-d .d-earL { transform: rotate(-28deg); } .bot-av[data-mood="sad"] .mascot-d .d-earR { transform: rotate(28deg); }
.bot-av[data-mood="sad"] .mascot-d .m-body { animation: none; }
.mascot-d :is(.d-earL, .d-earR) { transition: transform .4s var(--ease); }
@keyframes d-twitch { 0%, 86%, 100% { transform: rotate(0); } 90% { transform: rotate(14deg); } 95% { transform: rotate(-4deg); } }
@keyframes d-tail { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(16deg); } }
@keyframes d-tail-up { to { transform: rotate(-38deg); } }
@keyframes d-tilt { 0%, 100% { transform: rotate(0); } 35%, 65% { transform: rotate(13deg); } }
@keyframes d-purr { 0% { transform: translateX(-.35px); } 50% { transform: translateX(.35px); } }

/* ---- E Fantasminha: flutua e balança, fica transparente pensando, ondula falando, dá um looping feliz ---- */
.bot-av[data-mood="idle"] .mascot-e .m-body { animation: e-float 3.2s ease-in-out infinite; }
.bot-av[data-mood="think"] .mascot-e .m-body { animation: e-fade 2s ease-in-out infinite; }
.bot-av[data-mood="write"] .mascot-e .m-body { animation: e-wobble .5s ease-in-out infinite alternate; }
.bot-av[data-mood="happy"] .mascot-e .m-body { animation: e-loop 1.1s cubic-bezier(.4, 0, .3, 1) 1; transform-origin: 50% 50%; }
.bot-av[data-mood="sad"] .mascot-e .m-body { animation: e-sink 1.4s ease-out forwards; }
@keyframes e-float { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-2.4px) rotate(3deg); } }
@keyframes e-fade { 0%, 100% { opacity: 1; transform: translateY(0); } 50% { opacity: .45; transform: translateY(-1.5px); } }
@keyframes e-wobble { from { transform: skewX(-5deg) translateY(0); } to { transform: skewX(5deg) translateY(-1px); } }
@keyframes e-loop { 0% { transform: translateY(0) rotate(0); } 45% { transform: translateY(-7px) rotate(200deg) scale(.9); } 100% { transform: translateY(0) rotate(360deg); } }
@keyframes e-sink { to { opacity: .7; transform: translateY(2px) scale(.96); } }

/* ---- F Coruja: pisca um olho de cada vez, gira a cabeça pensando, bate as asas feliz ---- */
.mascot-f .f-wing { transform-origin: 50% 0; }
.bot-av[data-mood="idle"] .mascot-f .m-body { animation: none; }
.bot-av[data-mood="idle"] .mascot-f .m-eyes { animation: none; }
.bot-av[data-mood="idle"] .mascot-f .m-white:first-child, .bot-av[data-mood="idle"] .mascot-f .m-pupils circle:first-child { animation: f-wink 5s infinite; }
.bot-av[data-mood="think"] .mascot-f .m-body { animation: f-swivel 3s ease-in-out infinite; transform-origin: 50% 60%; }
.bot-av[data-mood="think"] .mascot-f .m-pupils { animation: none; transform: translate(0, -1.2px); }
.bot-av[data-mood="write"] .mascot-f .m-body { animation: f-bob .56s ease-in-out infinite; }
.bot-av[data-mood="happy"] .mascot-f .m-body, .bot-av[data-mood="love"] .mascot-f .m-body { animation: f-bob .3s ease-in-out 4; }
.bot-av:is([data-mood="happy"], [data-mood="love"]) .mascot-f .f-wing { animation: f-flap .15s ease-in-out 8 alternate; }
.bot-av[data-mood="sad"] .mascot-f .m-body { animation: f-droop 1.2s ease-out forwards; }
@keyframes f-wink { 0%, 90%, 100% { transform: scaleY(1); } 94% { transform: scaleY(.1); } }
@keyframes f-swivel { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-16deg); } 65% { transform: rotate(14deg); } }
@keyframes f-bob { 50% { transform: translateY(-1.4px); } }
@keyframes f-flap { from { transform: rotate(0); } to { transform: scaleX(1.3) rotate(-10deg); } }
@keyframes f-droop { to { transform: scale(1.03, .95); } }

/* ---- G Nuvem: infla devagar, chove pensando, deriva falando, brilha feliz, chuva triste ---- */
.mascot-g .g-rain { fill: none; stroke: #7dd3fc; stroke-width: 1.4; stroke-linecap: round; opacity: 0; }
.bot-av[data-mood="idle"] .mascot-g .m-body { animation: g-puff 3.6s ease-in-out infinite; }
.bot-av[data-mood="think"] .mascot-g .m-body { animation: g-drift 2.4s ease-in-out infinite; }
.bot-av:is([data-mood="think"], [data-mood="sad"]) .mascot-g .g-rain { animation: g-rain .8s linear infinite; }
.bot-av[data-mood="write"] .mascot-g .m-body { animation: g-drift .9s ease-in-out infinite; }
.bot-av[data-mood="happy"] .mascot-g .m-body { animation: g-boing .8s cubic-bezier(.3, 1.8, .5, 1) 1; }
.bot-av[data-mood="happy"] .mascot-g .g-shine { animation: g-shine .6s ease-in-out 3 alternate; }
.bot-av[data-mood="sad"] .mascot-g .m-shape { fill: #9fb4cc; transition: fill .6s; }
.bot-av[data-mood="sad"] .mascot-g .m-body { animation: none; }
@keyframes g-puff { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05, 1.03); } }
@keyframes g-drift { 0%, 100% { transform: translateX(-1.2px); } 50% { transform: translateX(1.2px) translateY(-.6px); } }
@keyframes g-rain { 0% { opacity: 0; transform: translateY(-2px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(3px); } }
@keyframes g-boing { 0% { transform: scale(1); } 30% { transform: scale(1.14, .86); } 60% { transform: scale(.94, 1.08); } 100% { transform: scale(1); } }
@keyframes g-shine { to { opacity: .2; } }

/* ---- H Livrinho: fechado (com rosto) quando parado; ABRE sem rosto e solta conhecimento e interrogações pensando,
 *      solta letras enquanto escreve, FECHA e o rosto volta ao terminar ---- */
.mascot-h .m-shape { fill: #14a38f; } .mascot-h .m-arm { stroke: #14a38f; }
.mascot-h .h-spine { fill: #0d7f70; } .mascot-h .h-pages { fill: #f4efe4; }
.mascot-h .h-lines { fill: none; stroke: #d6cdb8; stroke-width: .7; } .mascot-h .h-ribbon { fill: #f43f5e; transform-origin: 50% 0; }
.mascot-h .m-cheek { fill: #ffc9b0; }
.mascot-h .h-back { fill: #14a38f; }
.mascot-h .h-page { fill: #f7f2e7; stroke: #e2d8c3; stroke-width: .5; }
.mascot-h .h-text { fill: none; stroke: #d3c8b0; stroke-width: 1; stroke-linecap: round; }
.mascot-h .h-turn { fill: #fffdf8; stroke: #d6cdb8; stroke-width: .5; transform-origin: 0% 50%; opacity: 0; }
.mascot-h .h-k { opacity: 0; font: 800 8.2px var(--font); transform-origin: 50% 50%; }
.mascot-h .h-q { fill: #f59e0b; } .mascot-h text.h-k:nth-of-type(2) { fill: #818cf8; } .mascot-h text.h-k:nth-of-type(4) { fill: #2dd4bf; } .mascot-h text.h-k:nth-of-type(6) { fill: #fb7185; }
.mascot-h .h-line { fill: none; stroke: #e7e0cf; stroke-width: 1.2; stroke-linecap: round; }

/* Fechar (estado normal): as metades dobram para o meio, depois o livro fechado volta com um quique e o rosto aparece */
.mascot-h .h-left { transform-origin: 100% 50%; } .mascot-h .h-right { transform-origin: 0% 50%; }
.mascot-h .h-half { transform: scaleX(0); opacity: 0; transition: transform .22s cubic-bezier(.6, 0, .9, .5), opacity .05s .2s; }
.mascot-h .h-closed { transform-origin: 50% 60%; transition: transform .42s cubic-bezier(.3, 1.6, .5, 1) .2s, opacity .1s .2s; }
.mascot-h :is(.m-eyes, .m-cheek, .m-happy, .m-smile, .m-frown, .m-talk) { transition: opacity .2s .55s; }
/* Abrir: o rosto some, o livro fechado se encolhe para o meio e as duas metades abrem a partir da lombada */
.bot-av:is([data-mood="think"], [data-mood="write"]) .mascot-h :is(.m-eyes, .m-cheek, .m-happy, .m-smile, .m-frown, .m-talk) { opacity: 0 !important; transition: opacity .12s; }
.bot-av:is([data-mood="think"], [data-mood="write"]) .mascot-h .h-closed { transform: scale(.12, .9); opacity: 0; transition: transform .2s cubic-bezier(.6, 0, .9, .6) .08s, opacity .06s .24s; }
.bot-av:is([data-mood="think"], [data-mood="write"]) .mascot-h .h-half { transform: none; opacity: 1; transition: transform .5s cubic-bezier(.25, 1.5, .45, 1) .26s, opacity .05s .26s; }
.bot-av:is([data-mood="think"], [data-mood="write"]) .mascot-h .m-body { animation: h-pop .7s ease-out .2s 1; }
.bot-av[data-mood="think"] .mascot-h .m-dots { opacity: 0; }
/* Folhear */
.bot-av[data-mood="think"] .mascot-h .h-turn { animation: h-page .8s cubic-bezier(.45, 0, .35, 1) .8s infinite; }
.bot-av[data-mood="think"] .mascot-h .h-turn2 { animation-delay: 1.2s; }
.bot-av[data-mood="write"] .mascot-h .h-turn { animation: h-page 2.4s cubic-bezier(.45, 0, .35, 1) .8s infinite; }
.bot-av[data-mood="write"] .mascot-h .h-turn2 { animation: none; }
/* Conhecimento saindo do livro: pensando = letras + interrogações; escrevendo = letras e linhas de texto */
.bot-av[data-mood="think"] .mascot-h .h-k { animation: h-float 2.1s ease-out calc(.7s + var(--d)) infinite; }
.bot-av[data-mood="write"] .mascot-h .h-k:not(.h-q) { animation: h-float 3s ease-out calc(.7s + var(--d)) infinite; }
/* Terminou */
.bot-av[data-mood="happy"] .mascot-h .m-body { animation: h-spin .8s ease-in-out .6s 1; transform-origin: 50% 50%; }
.bot-av[data-mood="sad"] .mascot-h .m-body { animation: h-shrink 1s ease-out .5s forwards; }
.bot-av[data-mood="sad"] .mascot-h .h-ribbon { transform: rotate(18deg); transition: transform .6s .6s; }
@keyframes h-pop { 0% { transform: translateY(0); } 40% { transform: translateY(-2.5px); } 70% { transform: translateY(.5px); } 100% { transform: none; } }
@keyframes h-page { 0% { transform: scaleX(1); opacity: 1; } 60% { transform: scaleX(-1); opacity: 1; } 85%, 100% { transform: scaleX(-1); opacity: 0; } }
@keyframes h-float { 0% { opacity: 0; transform: translate(0, 6px) scale(.4) rotate(0); } 20% { opacity: 1; } 70% { opacity: .9; } 100% { opacity: 0; transform: translate(var(--dx), -11px) scale(1.1) rotate(calc(var(--dx) * 3deg / 1px)); } }
@keyframes h-spin { 0% { transform: scaleX(1); } 50% { transform: scaleX(-1) translateY(-4px); } 100% { transform: scaleX(1); } }
@keyframes h-shrink { to { transform: scale(.96, .97) translateY(.8px); } }
@media (prefers-reduced-motion: reduce) { .mascot-h * { transition: none !important; } }

/* ---- I Lâmpada: balança pendurada, pisca pensando, brilha ao falar, acende forte quando acha a resposta ---- */
.mascot-i .m-shape { fill: #fcd34d; } .mascot-i .m-arm { stroke: #fcd34d; }
.mascot-i .i-glow { fill: #fde047; opacity: 0; }
.mascot-i .i-rays { fill: none; stroke: #fde047; stroke-width: 1.6; stroke-linecap: round; opacity: 0; }
.mascot-i .i-base { fill: #94a3b8; } .mascot-i .i-tip { fill: #64748b; }
.mascot-i .i-shine { fill: none; stroke: #fff; stroke-width: 1.5; stroke-linecap: round; opacity: .8; }
.mascot-i .m-pupils { fill: #3f2a06; } .mascot-i .m-cheek { fill: #fb923c; opacity: .45; }
.mascot-i :is(.m-happy, .m-smile, .m-frown) { stroke: #713f12; } .mascot-i .m-talk { fill: #713f12; stroke: none; }
.bot-av[data-mood="idle"] .mascot-i .m-body { animation: i-sway 3s ease-in-out infinite; transform-origin: 50% 0; }
.bot-av[data-mood="think"] .mascot-i .m-body { animation: none; }
.bot-av[data-mood="think"] .mascot-i .m-shape { animation: i-flicker 1.6s steps(1) infinite; }
.bot-av[data-mood="write"] .mascot-i .m-body { animation: none; }
.bot-av[data-mood="write"] .mascot-i .i-glow { animation: i-pulse .5s ease-in-out infinite alternate; }
.bot-av:is([data-mood="happy"], [data-mood="love"]) .mascot-i .i-glow { animation: i-on 1.8s ease-out 1; }
.bot-av:is([data-mood="happy"], [data-mood="love"]) .mascot-i .i-rays { animation: i-rays 1.8s ease-out 1; }
.bot-av[data-mood="happy"] .mascot-i .m-body { animation: none; }
.bot-av[data-mood="sad"] .mascot-i .m-shape { fill: #c9a94a; transition: fill .6s; }
.bot-av[data-mood="sad"] .mascot-i .m-body { animation: none; }
@keyframes i-sway { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
@keyframes i-flicker { 0%, 100% { fill: #fcd34d; } 20% { fill: #b89b45; } 25% { fill: #fcd34d; } 60% { fill: #c7a94c; } 64% { fill: #fde68a; } }
@keyframes i-pulse { from { opacity: .08; } to { opacity: .28; } }
@keyframes i-on { 0% { opacity: 0; transform: scale(.6); } 25% { opacity: .5; transform: scale(1); } 100% { opacity: 0; transform: scale(1.1); } }
@keyframes i-rays { 0% { opacity: 0; transform: scale(.7); } 25% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.15); } }

/* ---- J Café: vapor subindo parado, gira o café pensando, borbulha falando, transborda de vapor feliz, esfria triste ---- */
.mascot-j .m-shape { fill: #ef6461; } .mascot-j .m-arm { stroke: #ef6461; transform-origin: 100% 100%; }
.mascot-j .j-handle { fill: none; stroke: #ef6461; stroke-width: 3.2; }
.mascot-j .j-coffee { fill: #6b3a1e; } .mascot-j .j-band { stroke: #fff; stroke-opacity: .35; stroke-width: 1.4; }
.mascot-j .j-steam { fill: none; stroke: #cbd5e1; stroke-width: 1.5; stroke-linecap: round; opacity: 0; }
.mascot-j .m-cheek { fill: #ffd0c4; }
.bot-av[data-mood="idle"] .mascot-j .m-body { animation: none; }
.bot-av:is([data-mood="idle"], [data-mood="write"], [data-mood="happy"], [data-mood="love"], [data-mood="wave"]) .mascot-j .j-steam { animation: j-steam 2.4s ease-out infinite; }
.bot-av .mascot-j .j-s2 { animation-delay: .8s !important; } .bot-av .mascot-j .j-s3 { animation-delay: 1.6s !important; }
.bot-av[data-mood="think"] .mascot-j .m-body { animation: j-sip 2.4s ease-in-out infinite; }
.bot-av[data-mood="think"] .mascot-j .j-coffee { animation: j-swirl 1.2s linear infinite; }
.bot-av[data-mood="write"] .mascot-j .m-body { animation: j-bubble .35s ease-in-out infinite alternate; }
.bot-av[data-mood="write"] .mascot-j .j-steam { animation-duration: 1s; }
.bot-av[data-mood="happy"] .mascot-j .j-steam { animation-duration: .9s; stroke: #fda4af; }
.bot-av[data-mood="sad"] .mascot-j .j-steam { opacity: 0; animation: none; }
.bot-av[data-mood="sad"] .mascot-j .m-shape { fill: #c56a68; transition: fill .6s; }
@keyframes j-steam { 0% { opacity: 0; transform: translateY(2px) scaleX(1); } 30% { opacity: .9; } 100% { opacity: 0; transform: translateY(-4px) scaleX(-1); } }
@keyframes j-sip { 0%, 100% { transform: rotate(0); } 40%, 60% { transform: rotate(-9deg); } }
@keyframes j-swirl { 0% { transform: scaleX(1); } 50% { transform: scaleX(.85); } 100% { transform: scaleX(1); } }
@keyframes j-bubble { from { transform: translateY(0) scale(1); } to { transform: translateY(-1px) scale(1.02, .98); } }

/* =======================================================
 * Painel do assistente (views/painel.php)
 * ======================================================= */
.painel { max-width: 960px; }
.pn-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 0; overflow: hidden; }
.pn-stat { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-left: 1px solid var(--border); }
.pn-stat:first-child { border-left: 0; }
.pn-stat b { font-size: 22px; font-weight: 650; letter-spacing: -.4px; line-height: 1.1; }
.pn-stat b small { font-size: 14px; }
.pn-stat span { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.pn-stat.is-warn b { color: var(--amber); } .pn-stat.is-bad b { color: var(--red); }
.pn-note { font-size: 12.5px; }
.pn-empty { margin: 0; color: var(--muted); font-size: 14px; }
.pn-list { list-style: none; margin: 0; padding: 0; }
.pn-item { display: flex; gap: 16px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--border); }
.pn-item:first-child { border-top: 0; padding-top: 4px; }
.pn-main { flex: 1; min-width: 0; }
.pn-q { margin: 0 0 6px; font-size: 15px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.pn-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0; font-size: 12.5px; color: var(--muted); }
.pn-tag { padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 500; }
.pn-tag.is-bad { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.pn-tag.is-warn { background: var(--amber-bg); color: var(--amber); }
.pn-tag.is-down { background: var(--hover); color: var(--text-2); }
.pn-sub { margin: 6px 0 0; font-size: 13px; color: var(--text-2); line-height: 1.5; }
.pn-sub q { color: var(--text); } .pn-sub q::before { content: '“'; } .pn-sub q::after { content: '”'; }
.pn-sub a { color: var(--link); }
.pn-actions { display: flex; gap: 6px; flex: none; }
.pn-actions form { margin: 0; }
.pn-actions .btn { height: 32px; font-size: 13px; }
.pn-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pn-table th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); padding: 0 8px 8px 0; border-bottom: 1px solid var(--border); }
.pn-table td { padding: 9px 8px 9px 0; border-bottom: 1px solid var(--border); vertical-align: middle; }
.pn-table tr:last-child td { border-bottom: 0; }
.pn-table .num { text-align: right; width: 76px; font-variant-numeric: tabular-nums; }
.pn-table td.is-down { color: var(--red); font-weight: 600; }
.pn-table a { color: var(--text); } .pn-table a:hover { color: var(--link); }
.pn-bar { display: block; height: 3px; margin-top: 6px; width: var(--w); max-width: 100%; border-radius: 2px; background: color-mix(in srgb, var(--link) 45%, transparent); }
.pn-bk { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pn-bk li { display: flex; gap: 8px; align-items: baseline; padding: 5px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.pn-bk small { color: var(--muted); font-size: 11.5px; }
.painel code { font-size: 12px; padding: 1px 5px; border-radius: 5px; background: var(--code-bg); }
@media (max-width: 760px) {
  .pn-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pn-stat { border-left: 0; border-top: 1px solid var(--border); }
  .pn-stat:nth-child(-n+2) { border-top: 0; } .pn-stat:nth-child(even) { border-left: 1px solid var(--border); }
  .pn-stat:last-child { grid-column: 1 / -1; border-left: 0; }
  .pn-item { flex-direction: column; gap: 10px; }
  .card-head { flex-wrap: wrap; }
}

/* Resposta com abertura do modelo: o trecho da wiki já aparece; a abertura é escrita em cima */
.llm-intro { min-height: 22px; }
.llm-intro .typing { padding: 2px 0 0; }
.bubble.llm-wait .llm-intro ~ * { animation: fade .35s var(--ease) both; }
.bk-steps { margin: 0; padding-left: 20px; font-size: 13.5px; line-height: 1.7; color: var(--text-2); }
.painel code { white-space: nowrap; }



/* Dashboard do mapa de cliques (views/cliques.php) */
.admin.dash { max-width: 1160px; }
.dash .admin-head .seg-btn { display: inline-flex; align-items: center; }
.dash-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dash-kpis .pn-stat b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-kpis em { display: block; font-style: normal; font-size: 12px; margin-top: 2px; }
.dash-kpis em.up { color: var(--green); } .dash-kpis em.down { color: var(--red); }
.dash-bars { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); align-items: end; gap: 3px; height: 150px; padding-bottom: 18px; }
.dash-bar { position: relative; height: 100%; display: flex; align-items: flex-end; }
.dash-bar i { display: block; width: 100%; border-radius: 3px 3px 0 0; background: color-mix(in srgb, var(--link) 70%, transparent); transition: background .15s; }
.dash-bar:hover i { background: var(--link); }
.dash-bar small { position: absolute; top: calc(100% + 4px); left: 0; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.dash-legend { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.dash-legend i { width: 12px; height: 12px; border-radius: 3px; margin-left: 6px; }
.lg-zero { border: 1.5px dashed var(--muted); } .lg-cold { background: hsl(210 85% 55%); } .lg-hot { background: hsl(0 85% 55%); }
.dash-screens { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 18px; }
.dash-screen.is-wide { grid-column: 1 / -1; }
@media (max-width: 900px) { .dash-screens { grid-template-columns: 1fr; } }
.dash-screen { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.dash-screen figcaption { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; }
.dash-screen figcaption span { color: var(--muted); font-size: 12.5px; }
.wire { display: grid; gap: 4px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--canvas); }
.wire-r { position: relative; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; align-content: center; gap: 0 6px; min-width: 0; padding: 2px 4px;
  border: 1.5px solid transparent; border-radius: 6px; text-align: center; overflow: hidden; }
.wire-r span { font-size: 12px; line-height: 1.2; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.wire-r b { font-size: 14px; font-variant-numeric: tabular-nums; }
.wire-r.is-zero { border: 1.5px dashed color-mix(in srgb, var(--muted) 60%, transparent); }
.wire-r.is-zero b { color: var(--muted); font-weight: 500; }
.wire-r.is-thin span { display: none; }
.wire-r.is-thin { padding: 2px 0; } .wire-r.is-thin b { font-size: 10.5px; }
.wire-more { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.wire-more b { color: var(--text-2); font-weight: 600; }
.dash-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.dash-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-cols > .doc { width: 100%; max-width: none; margin: 0; }
.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); }
.dash-list li:first-child { border-top: 0; }
.dash-list li > span { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dash-list strong { font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-list small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-list .pn-bar { margin-top: 4px; }
.dash-list b { font-variant-numeric: tabular-nums; font-size: 13.5px; }
.dash-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.dash-tags a { display: inline-block; padding: 4px 10px; border: 1px dashed var(--border); border-radius: 8px; font-size: 13px; color: var(--text-2); }
.dash-tags a:hover { border-color: var(--link); color: var(--text); }
@media (max-width: 1000px) { .dash-cols { grid-template-columns: 1fr; } .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.dash-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.dash-actions form { margin: 0; }
.dash-reset { height: 32px; font-size: 13px; }
.dash-reset:hover { color: var(--red); }
/* API de busca: exemplos */
.api-ex { display: flex; flex-direction: column; gap: 18px; }
.api-ex-item { padding-top: 14px; border-top: 1px solid var(--border); }
.api-ex-item:first-child { padding-top: 0; border-top: 0; }
.api-ex-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.api-ex-head h3, .api-sub { margin: 0; font-size: 14px; font-weight: 600; }
.api-ex-head .btn { height: 28px; font-size: 12.5px; }
.api-ex-item > p { margin: 4px 0 10px; font-size: 13.5px; color: var(--text-2); }
.api-ex-item .code-block, .form-card > .code-block { margin: 0; }
.api-sub { margin-top: 4px; }
.api-params code, .form-card .prose td code { white-space: nowrap; }

/* Painel do assistente em formato de dashboard (views/painel.php) */
.painel .is-ok { --c: var(--green); } .painel .is-warn { --c: var(--amber); } .painel .is-bad { --c: var(--red); }
.pn-export { height: 32px; font-size: 13px; }
.pn-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.pn-kpi { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 16px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); }
.pn-kpi-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.pn-kpi-label svg { color: var(--icon); opacity: .8; }
.pn-kpi > b { font-size: 28px; font-weight: 650; letter-spacing: -.6px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.pn-kpi > b.is-warn, .pn-kpi > b.is-bad { color: var(--c); }
.pn-kpi small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.pn-kpi em { font-style: normal; font-weight: 600; }
.pn-kpi em.up { color: var(--green); } .pn-kpi em.down { color: var(--red); }
.pn-meter { display: block; height: 6px; margin-top: 4px; border-radius: 99px; background: var(--hover); overflow: hidden; }
.pn-meter i { display: block; height: 100%; border-radius: 99px; background: var(--c); }

.pn-row { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 14px; }
.pn-row > .doc, .painel .dash-cols > .doc { width: 100%; max-width: none; margin: 0; }
.pn-legend { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 12px; color: var(--muted); }
.pn-legend i { width: 10px; height: 10px; border-radius: 3px; margin-left: 8px; background: var(--c); }
.pn-chart { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); align-items: end; gap: 3px; height: 190px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.pn-col { position: relative; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.pn-col:hover { background: linear-gradient(var(--hover), var(--hover)) bottom / 100% 100% no-repeat; border-radius: 4px 4px 0 0; }
.pn-stack { display: flex; flex-direction: column; gap: 2px; width: 100%; max-width: 26px; margin: 0 auto; }
.pn-stack i { display: block; min-height: 3px; background: var(--c); opacity: .85; }
.pn-stack i:first-child { border-radius: 4px 4px 0 0; }
.pn-col:hover .pn-stack i { opacity: 1; }
.pn-col small { position: absolute; top: calc(100% + 6px); left: 0; font-size: 10.5px; color: var(--muted); white-space: nowrap; }

.pn-donut-wrap { display: flex; align-items: center; gap: 22px; margin: 6px 0 18px; }
.pn-donut { flex: none; position: relative; width: 120px; height: 120px; border-radius: 50%;
  background: conic-gradient(var(--green) 0 var(--a), var(--amber) 0 var(--b), var(--red) 0 100%); }
.pn-donut::after { content: ''; position: absolute; inset: 14px; border-radius: 50%; background: var(--card); }
.pn-donut span { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pn-donut b { font-size: 22px; font-weight: 650; letter-spacing: -.4px; line-height: 1; }
.pn-donut small { font-size: 11px; color: var(--muted); margin-top: 3px; }
.pn-split { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.pn-split li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.pn-split i { flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.pn-split span { flex: 1; color: var(--text-2); }
.pn-split b { font-variant-numeric: tabular-nums; }
.pn-split small { width: 38px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.pn-sat { padding-top: 14px; border-top: 1px solid var(--border); }
.pn-sat-head, .pn-sat-foot { display: flex; justify-content: space-between; font-size: 12.5px; }
.pn-sat-head span:first-child { font-weight: 600; }
.pn-sat-bar { display: flex; gap: 2px; height: 8px; margin: 8px 0 6px; border-radius: 99px; overflow: hidden; background: var(--hover); }
.pn-sat-bar i { display: block; background: var(--c); }
.pn-sat-foot { color: var(--muted); font-variant-numeric: tabular-nums; }

.pn-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; background: color-mix(in srgb, var(--red) 16%, transparent); color: var(--red); vertical-align: 2px; }
.pn-zero { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 10px; background: var(--green-bg); color: var(--green); }
.pn-zero p { margin: 0; font-size: 13.5px; color: var(--text-2); }
.painel .pn-list { display: flex; flex-direction: column; gap: 10px; }
.painel .pn-item { position: relative; align-items: center; padding: 14px 16px 14px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--canvas); overflow: hidden; }
.painel .pn-item:first-child { padding-top: 14px; border-top: 1px solid var(--border); }
.painel .pn-item::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c, var(--muted)); }
.painel .pn-item.is-down { --c: var(--muted); }
.pn-times { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 10px;
  background: color-mix(in srgb, var(--c, var(--muted)) 14%, transparent); }
.pn-times b { font-size: 18px; line-height: 1; color: var(--c, var(--text)); font-variant-numeric: tabular-nums; }
.pn-times small { font-size: 10.5px; color: var(--muted); margin-top: 2px; }

.pn-rank, .pn-recent { list-style: none; margin: 0; padding: 0; }
.pn-rank li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.pn-rank li:first-child { border-top: 0; }
.pn-rank-n { flex: none; width: 22px; height: 22px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--hover); }
.pn-rank li:nth-child(-n+3) .pn-rank-n { color: var(--link); background: var(--primary-soft); }
.pn-rank-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pn-rank-main a { color: var(--text); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-rank-main a:hover { color: var(--link); }
.pn-rank-main .pn-bar { height: 4px; margin-top: 5px; background: color-mix(in srgb, var(--link) 55%, transparent); }
.pn-rank-votes { display: flex; gap: 8px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pn-rank-votes .down { color: var(--red); font-weight: 600; }
.pn-rank b { width: 28px; text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; }
.pn-link { color: var(--link); }
.pn-recent li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.pn-recent li:first-child { border-top: 0; }
.pn-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--muted)); }
.pn-recent-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pn-recent-main strong { font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-recent-main small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1100px) { .pn-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .pn-row { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .pn-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pn-kpi > b { font-size: 24px; }
  .painel .pn-item { flex-direction: row; flex-wrap: wrap; }
  .painel .pn-item .pn-main { flex-basis: calc(100% - 70px); }
  .painel .pn-actions { width: 100%; }
}

/* Menu lateral: seções que abrem e fecham e artigos da categoria aberta */
.side-group { display: flex; flex-direction: column; gap: 1px; }
.side-toggle { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; border-radius: 6px; font-weight: 500; letter-spacing: .2px; cursor: pointer; }
.side-toggle:hover { color: var(--text); }
.side-toggle .ic { transition: transform .2s var(--ease); opacity: .7; }
.side-group.is-closed .side-toggle .ic { transform: rotate(-90deg); }
.side-group-body { display: flex; flex-direction: column; gap: 1px; }
.side-group.is-closed .side-group-body { display: none; }
.side-arts { list-style: none; margin: 2px 0 6px 18px; padding: 0 0 0 10px; border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 1px; }
.side-arts a { display: block; padding: 5px 10px; border-radius: 6px; font-size: 13px; line-height: 1.35; color: var(--muted); overflow-wrap: anywhere; }
.side-arts a:hover { background: var(--hover); color: var(--text); }
.side-arts a.active { color: var(--text); font-weight: 500; background: var(--hover); box-shadow: inset 2px 0 0 var(--link); }
.side-arts .side-arts-more { color: var(--link); font-size: 12.5px; }

/* Ícone da categoria clicável (quem pode editar): troca no lugar; sem ícone, espaço tracejado para adicionar */
.side-cat-ic { position: absolute; left: 4px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center;
  color: var(--icon); background: transparent; border: 1px solid transparent; cursor: pointer; }
.side-cat-ic:hover, .side-cat-ic.open { background: var(--border); border-color: var(--border); color: var(--text); }
.side-cat-ic.is-empty { width: 20px; height: 20px; left: 8px; border: 1px dashed color-mix(in srgb, var(--muted) 70%, transparent); color: var(--muted); }
.side-cat-ic.is-empty:hover, .side-cat-ic.is-empty.open { border-style: solid; border-color: var(--link); color: var(--link); background: transparent; }

/* Tela de login personalizável (views/_login_tela.php) */
.lgx { --lg-c1: #3A2FC1; --lg-c2: #1E1870; --lg-btn: #3A2FC1; --lg-dark: .45;
  flex: 1; width: 100%; min-height: 100%; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(400px, 1fr); grid-template-areas: 'side main';
  background: var(--card); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-lg); }
.lgx-bg-gradiente { --lg-paint: radial-gradient(circle at 12% 8%, color-mix(in srgb, var(--lg-c1) 65%, #fff) 0%, transparent 42%), radial-gradient(circle at 90% 100%, color-mix(in srgb, var(--lg-c2) 70%, #000) 0%, transparent 55%), linear-gradient(155deg, var(--lg-c1) 0%, var(--lg-c2) 100%); }
.lgx-bg-solido { --lg-paint: var(--lg-c1); }
.lgx-bg-imagem { --lg-paint: linear-gradient(rgb(0 0 0 / var(--lg-dark)), rgb(0 0 0 / var(--lg-dark))), var(--lg-img) center / cover no-repeat; }
.lgx-direita { grid-template-columns: minmax(400px, 1fr) minmax(0, 1.25fr); grid-template-areas: 'main side'; }
.lgx-side { grid-area: side; position: relative; overflow: hidden; padding: clamp(32px, 5vw, 72px); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; color: #fff; background: var(--lg-paint); }
.lgx.has-dots .lgx-side::after, .lgx-centro.has-dots::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .45;
  background-image: radial-gradient(1.2px 1.2px at 20px 30px, #fff 50%, transparent 51%), radial-gradient(1px 1px at 120px 90px, #fff 50%, transparent 51%), radial-gradient(1px 1px at 70px 150px, #fff 50%, transparent 51%); background-size: 170px 170px; }
.lgx-side > * { position: relative; z-index: 1; }
.lgx-logo { display: block; height: 48px; width: auto; max-width: 220px; object-fit: contain; object-position: left; margin-bottom: clamp(28px, 6vh, 64px); }
.lgx-side h2 { font-size: clamp(30px, 3.2vw, 52px); line-height: 1.12; letter-spacing: -.8px; font-weight: 400; margin: 0 0 16px; text-wrap: balance; }
.lgx-side h2 b { display: block; font-weight: 700; }
.lgx-side p { margin: 0; max-width: 560px; color: rgba(255,255,255,.86); font-size: clamp(14.5px, 1.1vw, 17px); line-height: 1.6; }
.lgx-feats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; max-width: 900px; }
.lgx-feats li { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(6px);
  font-size: 13.5px; line-height: 1.45; color: rgba(255,255,255,.86); }
.lgx-feats li:empty { display: none; }
.lgx-feat-ic { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.16); color: #fff; }
.lgx-feats b { display: block; font-weight: 600; font-size: 14px; color: #fff; margin-bottom: 1px; }
.lgx-main { grid-area: main; display: flex; align-items: center; justify-content: center; padding: 44px clamp(28px, 5vw, 88px); }
.lgx-form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 14px; }
.lgx-form-logo { display: none; height: 36px; width: auto; max-width: 200px; object-fit: contain; object-position: left; margin-bottom: 8px; }
.lgx-head h1 { font-size: clamp(24px, 1.8vw, 30px); font-weight: 650; margin: 0; letter-spacing: -.4px; }
.lgx-head p { margin: 6px 0 8px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.lgx-head p:empty { display: none; }
.lgx .float input:focus { border-color: var(--lg-btn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lg-btn) 25%, transparent); }
.lgx .auth2-row input { accent-color: var(--lg-btn); }
.lgx-submit { height: 48px; margin-top: 4px; border: 0; border-radius: 11px; background: var(--lg-btn); color: #fff; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--lg-btn) 35%, transparent); transition: filter .15s, transform .15s; }
.lgx-submit:hover { filter: brightness(1.1); } .lgx-submit:active { transform: translateY(1px); }
.lgx-sso { display: flex; flex-direction: column; gap: 14px; }
.lgx-sso[hidden], .lgx-remember[hidden], .lgx-foot[hidden] { display: none; }
.lgx-foot { margin: 6px 0 0; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); text-align: center; line-height: 1.5; }
.lgx.no-logo .lgx-logo, .lgx.no-logo .lgx-form-logo { display: none !important; }
/* Centralizado: o fundo ocupa tudo e o formulário vira um cartão */
.lgx-centro { position: relative; display: flex; align-items: center; justify-content: center; background: var(--lg-paint); }
.lgx-centro .lgx-side { display: none; }
.lgx-centro .lgx-main { position: relative; z-index: 1; padding: 24px; width: 100%; }
.lgx-centro .lgx-form { max-width: 420px; padding: 36px 34px; border-radius: 18px; background: var(--card); border: 1px solid var(--border); box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.lgx-centro .lgx-form-logo { display: block; }
/* Tela cheia (sem o menu da wiki) */
.login-full .rail, .login-full .sidebar { display: none; }
.login-full .app { grid-template-columns: minmax(0, 1fr); }
.login-full .canvas-login { padding: 0; }
.login-full .lgx { border: 0; border-radius: 0; box-shadow: none; }
.lgx-back { position: fixed; top: 14px; right: 16px; z-index: 5; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 99px; font-size: 13px;
  color: var(--text-2); background: color-mix(in srgb, var(--card) 85%, transparent); border: 1px solid var(--border); backdrop-filter: blur(8px); }
.lgx-back:hover { color: var(--text); }
@media (max-width: 860px) {
  .lgx, .lgx-direita { grid-template-columns: 1fr; grid-template-areas: 'main'; min-height: 0; }
  .lgx-side { display: none; }
  .lgx-form-logo { display: block; }
  .lgx-main { padding: 56px 24px 32px; }
}

/* Aparência (views/aparencia.php) */
.admin.ap { max-width: 1320px; }
.ap-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
.ap-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ap-col > .doc { width: 100%; max-width: none; margin: 0; padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
.ap-col .card-title { margin: 0; }
.ap .field textarea { padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--input); color: var(--text); font: inherit; resize: vertical; outline: 0; }
.ap .field textarea:focus { border-color: var(--primary); }
.ap .field small { font-size: 12px; }
.ap-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ap-two[hidden], [data-ap-only][hidden] { display: none; }
.ap-label { font-size: 13px; color: var(--muted); margin-bottom: -6px; }
.ap-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); cursor: pointer; flex-wrap: wrap; }
.ap-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.ap-check small { font-size: 12px; }
.ap-logo-row { display: flex; gap: 14px; align-items: center; }
.ap-logo-box { flex: none; width: 64px; height: 64px; border-radius: 14px; display: grid; place-items: center; padding: 8px; border: 1px dashed var(--border); background: var(--canvas); }
.ap-logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ap-logo-sm .ap-logo-box { width: 52px; height: 52px; border-radius: 12px; }
.ap-logo-act { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.ap-logo-act small { font-size: 12px; line-height: 1.45; }
.ap-file { position: relative; height: 32px; font-size: 13px; cursor: pointer; }
.ap-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.ap-file.has-file { border-color: var(--green); color: var(--green); }
.ap-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ap-choice { position: relative; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.ap-choice input { position: absolute; opacity: 0; }
.ap-choice small { font-size: 12px; color: var(--muted); text-align: center; }
.ap-mini { display: flex; gap: 4px; height: 64px; padding: 5px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--canvas); transition: border-color .15s; }
.ap-mini i { flex: 1.2; border-radius: 5px; background: linear-gradient(155deg, var(--primary), color-mix(in srgb, var(--primary) 50%, #000)); }
.ap-mini b { flex: 1; border-radius: 5px; background: var(--card); border: 1px solid var(--border); }
.ap-mini.lt-right { flex-direction: row-reverse; }
.ap-mini.lt-center { align-items: center; justify-content: center; background: linear-gradient(155deg, var(--primary), color-mix(in srgb, var(--primary) 50%, #000)); }
.ap-mini.lt-center i { display: none; } .ap-mini.lt-center b { flex: none; width: 40%; height: 70%; }
.ap-choice input:checked + .ap-mini { border-color: var(--link); box-shadow: 0 0 0 3px color-mix(in srgb, var(--link) 22%, transparent); }
.ap-choice input:checked ~ small { color: var(--text); font-weight: 500; }
.ap-choice input:focus-visible + .ap-mini { outline: 2px solid var(--link); outline-offset: 2px; }
.ap-seg { max-width: 360px; }
.ap-colors { display: flex; flex-wrap: wrap; gap: 10px; }
.ap-color { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.ap-color input { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 7px; background: none; cursor: pointer; }
.ap-color input::-webkit-color-swatch-wrapper { padding: 0; } .ap-color input::-webkit-color-swatch { border: 1px solid rgba(0,0,0,.15); border-radius: 7px; }
.ap-img { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.ap-img .field { width: 100%; }
.ap-img input[type=range] { height: auto; padding: 0; border: 0; accent-color: var(--primary); }
.is-muted { opacity: .55; }
.ap-items { display: flex; flex-direction: column; gap: 8px; }
.ap-item { display: grid; grid-template-columns: auto minmax(0, .8fr) minmax(0, 1.4fr); gap: 8px; align-items: center; }
.ap-item > input { height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--input); color: var(--text); font: inherit; font-size: 13.5px; outline: 0; min-width: 0; }
.ap-item > input:focus { border-color: var(--primary); }
.ap-icon-pick { position: relative; }
.ap-icon-pick summary { list-style: none; display: flex; align-items: center; gap: 4px; height: 38px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; color: var(--icon); }
.ap-icon-pick summary::-webkit-details-marker { display: none; }
.ap-icon-pick summary:hover, .ap-icon-pick[open] summary { border-color: var(--link); color: var(--text); }
.ap-icon-pick summary > span { display: grid; }
.ap-icon-grid { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: 300px; max-height: 240px; overflow: auto; padding: 8px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); }
.ap-icon-grid label { position: relative; display: grid; place-items: center; height: 32px; border-radius: 7px; cursor: pointer; color: var(--icon); }
.ap-icon-grid label:hover { background: var(--hover); color: var(--text); }
.ap-icon-grid input { position: absolute; opacity: 0; pointer-events: none; }
.ap-icon-grid label:has(input:checked) { background: var(--primary-soft); color: var(--link); }
.ap-foot { display: flex; gap: 8px; flex-wrap: wrap; }
.ap-preview-col { position: sticky; top: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ap-preview-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-2); }
.ap-preview-head span { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.ap-preview-head small { font-size: 12px; }
.ap-preview { position: relative; overflow: hidden; border-radius: 14px; border: 1px solid var(--border); box-shadow: var(--shadow-lg); background: var(--card); }
.ap-preview-stage { position: absolute; top: 0; left: 0; transform-origin: 0 0; display: flex; pointer-events: none; }
.ap-preview-stage .lgx { border: 0; border-radius: 0; box-shadow: none; min-height: 100%; }
.ap-preview-note { margin: 0; font-size: 12.5px; }
@media (max-width: 1100px) { .ap-grid { grid-template-columns: 1fr; } .ap-preview-col { position: static; order: -1; } }
@media (max-width: 640px) { .ap-two, .ap-choices { grid-template-columns: 1fr; } .ap-item { grid-template-columns: auto 1fr; } .ap-item > input:last-child { grid-column: 1 / -1; } }
/* A página nunca rola como um todo (cada área rola por dentro); evita a tela "subir" ao focar um campo. */
html { overflow: hidden; height: 100%; }

/* Backup (views/backup.php) */
.admin.bk { max-width: 1080px; }
.bk-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bk-kpis .pn-kpi > b { font-size: 20px; letter-spacing: -.3px; }
.bk-kpis small { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bk-empty { display: flex; gap: 16px; align-items: center; }
.bk-empty .card-title { margin: 0 0 4px; }
.bk-empty p { margin: 0; font-size: 13.5px; }
.bk-empty-ic { flex: none; width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--link); }
.bk-form { display: flex; flex-direction: column; gap: 14px; }
.bk-form > .doc, .bk-cols > .doc { width: 100%; max-width: none; margin: 0; }
.bk-dests { display: flex; flex-direction: column; gap: 10px; }
.bk-dest { border: 1px solid var(--border); border-radius: 12px; background: var(--canvas); overflow: hidden; transition: border-color .15s; }
.bk-dest[open] { border-color: color-mix(in srgb, var(--link) 50%, var(--border)); }
.bk-dest.is-active { border-left: 3px solid var(--green); }
.bk-dest summary { list-style: none; display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer; }
.bk-dest summary::-webkit-details-marker { display: none; }
.bk-dest summary:hover { background: var(--hover); }
.bk-dest-ic { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--card); border: 1px solid var(--border); color: var(--icon); }
.bk-dest.is-active .bk-dest-ic { color: var(--green); background: var(--green-bg); border-color: transparent; }
.bk-dest-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.bk-dest-txt strong { font-size: 14.5px; font-weight: 600; }
.bk-dest-txt small { font-size: 12.5px; color: var(--muted); }
.bk-chev { color: var(--muted); transition: transform .2s; }
.bk-dest[open] .bk-chev { transform: rotate(180deg); }
.bk-chip { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--hover); color: var(--muted); }
.bk-chip.is-on { background: var(--primary-soft); color: var(--link); }
.bk-chip.is-ok { background: var(--green-bg); color: var(--green); }
.bk-chip.is-warn { background: var(--amber-bg); color: var(--amber); }
.bk-chip.is-bad { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); }
.bk-dest-body { display: flex; flex-direction: column; gap: 14px; padding: 6px 16px 18px 70px; }
.bk-dest-body .field input, .bk-dest-body .field select, .bk-cols .field input, .bk-cols .field select { width: 100%; color: var(--text); font: inherit; font-size: 13.5px; }
.bk-dest-body .field select, .bk-cols .field select { height: 38px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--input); }
.bk-dest-body .field small, .bk-cols .field small { font-size: 12px; line-height: 1.45; }
.bk-dest-body code, .bk .pn-note code { font-size: 11.5px; padding: 1px 5px; border-radius: 5px; background: var(--code-bg); }
.bk-three { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 12px; }
.bk-narrow { max-width: 260px; }
.bk-forget { margin-top: 2px; font-size: 12.5px; }
.bk-dest-act { display: flex; gap: 8px; flex-wrap: wrap; }
.bk-dest-act .btn, .bk-save .btn { height: 34px; font-size: 13px; }
.bk-switch { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; cursor: pointer; align-self: flex-start; }
.bk-switch input { position: absolute; opacity: 0; }
.bk-switch { position: relative; }
.bk-switch span { position: relative; width: 36px; height: 20px; border-radius: 99px; background: var(--border); transition: background .15s; }
.bk-switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.bk-switch input:checked + span { background: var(--green); }
.bk-switch input:checked + span::after { transform: translateX(16px); }
.bk-switch input:focus-visible + span { outline: 2px solid var(--link); outline-offset: 2px; }
.bk-note { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 12px; border-radius: 9px; font-size: 13px; line-height: 1.5; background: var(--hover); color: var(--text-2); }
.bk-note .ic { flex: none; margin-top: 2px; }
.bk-note.is-ok { background: var(--green-bg); } .bk-note.is-ok .ic { color: var(--green); }
.bk-note.is-bad { background: color-mix(in srgb, var(--red) 12%, transparent); } .bk-note.is-bad .ic { color: var(--red); }
.bk-hint { margin: 2px 0 0; font-size: 12.5px; line-height: 1.5; }
.bk-cols .doc { display: flex; flex-direction: column; gap: 14px; }
.bk-cols .card-title { margin: 0; }
.bk-items { display: flex; flex-direction: column; gap: 8px; }
.bk-item { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: border-color .15s, background .15s; }
.bk-item input { position: absolute; opacity: 0; }
.bk-item > span:nth-of-type(2) { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.bk-item strong { font-size: 13.5px; font-weight: 600; } .bk-item small { font-size: 12px; color: var(--muted); }
.bk-item-ic { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--hover); color: var(--icon); }
.bk-tick { flex: none; width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; border: 1.5px solid var(--border); color: transparent; }
.bk-item:has(input:checked) { border-color: color-mix(in srgb, var(--link) 55%, var(--border)); background: color-mix(in srgb, var(--link) 6%, transparent); }
.bk-item:has(input:checked) .bk-tick { background: var(--link); border-color: var(--link); color: #fff; }
.bk-item:has(input:checked) .bk-item-ic { color: var(--link); background: var(--primary-soft); }
.bk-item:has(input:focus-visible) { outline: 2px solid var(--link); outline-offset: 2px; }
.bk-modes span { font-size: 12.5px; }
.bk-days { display: flex; gap: 6px; flex-wrap: wrap; }
.bk-days label { position: relative; cursor: pointer; }
.bk-days input { position: absolute; opacity: 0; }
.bk-days span { display: grid; place-items: center; width: 44px; height: 34px; border-radius: 8px; border: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.bk-days input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.bk-days input:focus-visible + span { outline: 2px solid var(--link); outline-offset: 2px; }
[data-bk-show][hidden], [data-s3-endpoint][hidden] { display: none; }
.bk-more summary { cursor: pointer; font-size: 13px; color: var(--link); }
.bk-more p { font-size: 12.5px; line-height: 1.5; margin: 8px 0; }
.bk-cron { display: block; padding: 10px 12px; border-radius: 8px; background: var(--code-bg); font-size: 12px; overflow-x: auto; white-space: nowrap; }
.bk-save { display: flex; justify-content: flex-end; }
.bk-dl { height: 28px; width: 32px; padding: 0; justify-content: center; }
@media (max-width: 760px) { .bk-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bk-dest-body { padding-left: 16px; } .bk-dest summary .bk-dest-txt small { display: none; } }

/* Backup › Google Drive */
.bk-narrow-lg { max-width: 380px; }
.bk-gd-ok { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 10px; background: var(--green-bg); }
.bk-gd-ok .ic { flex: none; width: 26px; height: 26px; }
.bk-gd-ok strong { display: block; font-size: 13.5px; }
.bk-gd-ok small { font-size: 12.5px; color: var(--text-2); }
.bk-tut { border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.bk-tut > summary { display: flex; align-items: center; gap: 8px; padding: 11px 14px; cursor: pointer; font-size: 13.5px; font-weight: 600; list-style: none; }
.bk-tut > summary::-webkit-details-marker { display: none; }
.bk-tut > summary small { font-weight: 400; font-size: 12px; }
.bk-tut > summary .ic { color: var(--link); }
.bk-tut-steps { padding: 4px 18px 16px 36px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; line-height: 1.6; }
.bk-tut-steps li::marker { color: var(--link); font-weight: 700; }
.bk-tut-steps ul { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.bk-tut-steps a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.bk-tut-steps code { font-size: 12px; padding: 1px 5px; border-radius: 5px; background: var(--code-bg); }
.bk-tut-steps .muted { font-size: 12.5px; }
.bk-uri { margin: 8px 0 4px; }
.bk-uri pre { margin: 0; padding: 10px 12px; white-space: pre-wrap; word-break: break-all; }
.bk-uri code { background: none; padding: 0; font-size: 12.5px; }
.bk-google { gap: 8px; border: 1px solid var(--border); background: var(--card); }
.bk-google .ic { width: 16px; height: 16px; }
.bk-danger:hover { color: var(--red); }
.bk-uri .code-copy { opacity: 1; top: 50%; transform: translateY(-50%); }
.bk-uri pre { padding-right: 96px; }

/* Tela inicial com só uma das seções (categorias ou atualizados) */
.home.is-single { grid-template-columns: minmax(0, 1fr); max-width: 760px; }

/* Aparência: abas */
.ap-tabs { display: flex; gap: 4px; margin-top: 14px; border-bottom: 1px solid var(--border); }
.ap-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; font-size: 13.5px; color: var(--muted); }
.ap-tabs a:hover { color: var(--text); }
.ap-tabs a.active { color: var(--text); font-weight: 500; border-bottom-color: var(--link); }
.ap-tabs a.active .ic { color: var(--link); }

/* Aparência › Tela inicial */
.hp-mascots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.hp-mascot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 8px; border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.hp-mascot input { position: absolute; opacity: 0; }
.hp-mascot .bot-av { width: 44px; height: 44px; }
.hp-mascot .bot-av svg { width: 100%; height: 100%; }
.hp-mascot small { font-size: 11.5px; color: var(--muted); }
.hp-mascot:hover { background: var(--hover); }
.hp-mascot:has(input:checked) { border-color: var(--link); background: color-mix(in srgb, var(--link) 8%, transparent); }
.hp-mascot:has(input:checked) small { color: var(--text); font-weight: 500; }
.hp-mascot:has(input:focus-visible) { outline: 2px solid var(--link); outline-offset: 2px; }
.hp-vars { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 12.5px; line-height: 1.8; color: var(--muted); }
.hp-vars .ic { flex: none; margin-top: 4px; }
.hp-vars button { padding: 1px 6px; border-radius: 6px; border: 1px solid var(--border); background: var(--card); font-family: var(--mono); font-size: 11.5px; color: var(--link); cursor: pointer; }
.hp-vars button:hover { border-color: var(--link); }
.hp-hint { margin: 0; font-size: 12.5px; line-height: 1.5; }
.hp-sug { display: flex; flex-direction: column; gap: 6px; }
.hp-sug input { height: 36px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--input); color: var(--text); font: inherit; font-size: 13.5px; outline: 0; }
.hp-sug input:focus { border-color: var(--primary); }
.hp-sug small { font-size: 12px; }
[data-hp-show][hidden] { display: none; }
.hp-blocks { display: flex; flex-direction: column; gap: 10px; }
.hp-block { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--canvas); }
.hp-block small { font-size: 12px; }
.hp-block:has(.bk-switch input:not(:checked)) > :not(.bk-switch) { display: none; }
/* prévia */
.hp-prev { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--canvas); box-shadow: var(--shadow-lg); font-size: 12px; }
.hp-top { display: grid; grid-template-columns: minmax(0, 1fr) 150px; grid-template-areas: 'greet resume' 'ask resume'; gap: 12px 16px; padding: 18px; border-bottom: 1px solid var(--border); }
.hp-top:has(.hp-resume[hidden]) { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'greet' 'ask'; }
.hp-greet { grid-area: greet; display: flex; gap: 10px; min-width: 0; }
.hp-av { flex: none; width: 34px; height: 34px; }
.hp-av svg { width: 100%; height: 100%; }
.hp-greet-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.hp-who { margin: 0; font-size: 10.5px; color: var(--muted); }
.hp-bubble { padding: 10px 12px; border: 1px solid var(--border); border-radius: 4px 12px 12px 12px; background: var(--card); }
.hp-bubble h3 { margin: 0 0 3px; font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.hp-bubble p { margin: 0; font-size: 11.5px; line-height: 1.5; color: var(--text-2); white-space: pre-line; overflow-wrap: anywhere; }
.hp-bubble p:empty { display: none; }
.hp-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.hp-chips[hidden] { display: none; }
.hp-chips span { padding: 3px 9px; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--link) 45%, transparent); color: var(--link); font-size: 10.5px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp-ask { grid-area: ask; display: flex; align-items: center; gap: 8px; padding: 5px 5px 5px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--muted); }
.hp-ask span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.hp-ask b { padding: 6px 10px; border-radius: 7px; background: var(--primary); color: #fff; font-size: 11px; white-space: nowrap; }
.hp-resume { grid-area: resume; display: flex; flex-direction: column; gap: 7px; }
.hp-resume[hidden], .hp-sec[hidden], .hp-bottom[hidden] { display: none; }
.hp-resume b, .hp-sec b { font-size: 11px; font-weight: 600; }
.hp-resume i, .hp-sec > i { display: block; height: 18px; border-radius: 5px; background: var(--hover); }
.hp-bottom { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; padding: 16px 18px 18px; }
.hp-bottom.is-single { grid-template-columns: minmax(0, 1fr); }
.hp-sec { display: flex; flex-direction: column; gap: 7px; }
.hp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.hp-grid i { display: block; height: 18px; border-radius: 5px; background: var(--hover); }
@media (max-width: 640px) { .hp-mascots { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Tela inicial: visual escolhido em Aparência › Tela inicial (classes hp-* em .canvas-home e na prévia .hp-prev) */
.canvas-home, .hp-prev { --o-text: var(--text); --o-text-2: var(--text-2); --o-muted: var(--muted); --o-border: var(--border); --o-link: var(--link); --o-icon: var(--icon); }
.canvas-home.has-accent, .hp-prev.has-accent { --primary: var(--hp-accent); --link: var(--hp-accent); --o-link: var(--hp-accent);
  --primary-hover: color-mix(in srgb, var(--hp-accent) 82%, #000); --primary-soft: color-mix(in srgb, var(--hp-accent) 16%, transparent); }
/* fundo do topo */
.hp-bg-suave .hero:not(.chatting), .hp-prev.hp-bg-suave .hp-top { background: color-mix(in srgb, var(--link) 9%, transparent); }
.hp-bg-gradiente { --hp-paint: radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--hp-c1) 65%, #fff) 0%, transparent 45%), linear-gradient(150deg, var(--hp-c1), var(--hp-c2)); }
.hp-bg-imagem { --hp-paint: linear-gradient(rgb(0 0 0 / var(--hp-dark)), rgb(0 0 0 / var(--hp-dark))), var(--hp-img) center / cover no-repeat; }
.hp-painted .hero:not(.chatting), .hp-prev.hp-painted .hp-top { background: var(--hp-paint);
  --text: #fff; --text-2: rgba(255,255,255,.86); --muted: rgba(255,255,255,.72); --border: rgba(255,255,255,.22); --link: #fff; --icon: rgba(255,255,255,.85); }
.hp-painted .hero:not(.chatting) :is(.greet-bubble, .ask, .live), .hp-prev.hp-painted :is(.hp-bubble, .hp-ask) {
  --text: var(--o-text); --text-2: var(--o-text-2); --muted: var(--o-muted); --border: var(--o-border); --link: var(--o-link); --icon: var(--o-icon); }
.hp-painted .hero:not(.chatting) .quick-btn, .hp-prev.hp-painted .hp-chips span { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.35); color: #fff; }
.hp-painted .hero:not(.chatting) .quick-btn:hover { background: rgba(255,255,255,.22); }
.hp-painted .hero:not(.chatting) .greet-bubble, .hp-painted .hero:not(.chatting) .ask { box-shadow: 0 10px 30px rgba(0,0,0,.25); }
/* estilo da mensagem */
.hp-bal-cartao .greet-bubble, .hp-prev.hp-bal-cartao .hp-bubble { border-radius: 16px; }
.hp-bal-limpo .greet-bubble, .hp-prev.hp-bal-limpo .hp-bubble { background: none; border: 0; padding: 0; box-shadow: none !important; }
.hp-painted.hp-bal-limpo .hero:not(.chatting) .greet-bubble, .hp-prev.hp-painted.hp-bal-limpo .hp-top .hp-bubble { --text: #fff; --text-2: rgba(255,255,255,.86); }
.hp-bal-limpo .greet-bubble h1 { font-size: 26px; }
/* tamanhos */
.hp-sz-p .greet-bubble h1 { font-size: 17px; } .hp-sz-g .greet-bubble h1 { font-size: 30px; letter-spacing: -.6px; }
.hp-bal-limpo.hp-sz-g .greet-bubble h1 { font-size: 36px; }
.hp-prev.hp-sz-p .hp-bubble h3 { font-size: 12px; } .hp-prev.hp-sz-g .hp-bubble h3 { font-size: 19px; }
.hp-msz-p .greet-av:has(.mascot) { width: 34px; height: 34px; } .hp-msz-g .greet-av:has(.mascot) { width: 68px; height: 68px; margin-top: 4px; }
.hp-msz-g .ask { margin-left: 80px; } .hp-msz-p .ask { margin-left: 46px; }
.hp-prev.hp-msz-p .hp-av { width: 26px; height: 26px; } .hp-prev.hp-msz-g .hp-av { width: 50px; height: 50px; }
/* centralizado */
.hp-al-centro .greet { flex-direction: column; align-items: center; text-align: center; }
.hp-al-centro .greet-av { margin-top: 0; }
.hp-al-centro .greet-body { width: 100%; display: flex; flex-direction: column; align-items: center; }
.hp-al-centro .greet-bubble { margin: 0 auto; }
.hp-al-centro.hp-bal-balao .greet-bubble { border-radius: 16px; }
.hp-al-centro .quick { justify-content: center; }
.hp-al-centro .hero:not(.chatting) .ask { margin-left: auto; margin-right: auto; max-width: 680px; }
.hp-prev.hp-al-centro .hp-greet { flex-direction: column; align-items: center; text-align: center; }
.hp-prev.hp-al-centro .hp-greet-body { align-items: center; width: 100%; }
.hp-prev.hp-al-centro .hp-chips { justify-content: center; }
.hp-prev.hp-al-centro.hp-bal-balao .hp-bubble { border-radius: 12px; }
/* sugestões */
.hp-chip-preenchido .quick-btn, .hp-prev.hp-chip-preenchido .hp-chips span { background: var(--primary-soft); border-color: transparent; }
.hp-chip-discreto .quick-btn, .hp-prev.hp-chip-discreto .hp-chips span { background: var(--hover); border-color: transparent; color: var(--text-2); }
/* cantos */
.hp-rad-retos .greet-bubble { border-radius: 4px; } .hp-rad-retos .ask { border-radius: 6px; } .hp-rad-retos .ask-go { border-radius: 4px; } .hp-rad-retos .quick-btn { border-radius: 5px; }
.hp-rad-redondos .greet-bubble { border-radius: 8px 24px 24px 24px; } .hp-rad-redondos.hp-bal-cartao .greet-bubble, .hp-rad-redondos.hp-al-centro .greet-bubble { border-radius: 24px; }
.hp-rad-redondos .ask { border-radius: 99px; padding-left: 18px; } .hp-rad-redondos .ask-go { border-radius: 99px; } .hp-rad-redondos .quick-btn { border-radius: 99px; }
.hp-prev.hp-rad-retos :is(.hp-bubble, .hp-ask, .hp-ask b, .hp-chips span) { border-radius: 4px; }
.hp-prev.hp-rad-redondos .hp-bubble { border-radius: 6px 18px 18px 18px; } .hp-prev.hp-rad-redondos :is(.hp-ask, .hp-ask b, .hp-chips span) { border-radius: 99px; }
/* categorias */
.canvas-home .idx-list { grid-template-columns: repeat(var(--hp-cols, 2), minmax(0, 1fr)); }
.hp-noicons .idx-ic { display: none; }
.hp-prev .hp-grid { grid-template-columns: repeat(var(--hp-cols, 2), minmax(0, 1fr)); }
@media (max-width: 640px) { .canvas-home .idx-list { grid-template-columns: 1fr; } .hp-msz-g .ask, .hp-msz-p .ask { margin-left: 0; } }
.hp-prev .hp-grid i { display: flex; align-items: center; padding-left: 6px; color: var(--muted); }
.hp-prev.hp-noicons .hp-grid i svg { display: none; }
[data-hp-only][hidden], [data-hp-cor-pick][hidden] { display: none; }
.hp-icons-chk { align-self: end; padding-bottom: 8px; }
.hp-prev .hp-top { transition: background .2s; }

/* Primeira instalação (views/instalar.php) */
.view-instalar { overflow: auto; }
.inst { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 50%), var(--canvas); }
.inst-card { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 18px; padding: 32px; border-radius: 18px; background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow-lg); }
.inst-head { display: flex; gap: 14px; align-items: flex-start; }
.inst-head h1 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.3px; }
.inst-head p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text-2); }
.inst-ic { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--link); }
.inst-card fieldset { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 12px; }
.inst-card legend { padding: 0 0 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.inst-card .field input { width: 100%; color: var(--text); font: inherit; font-size: 14px; }
.inst-card small { font-size: 12px; }
.inst-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inst-err { display: flex; gap: 8px; align-items: center; margin: 0; padding: 10px 12px; border-radius: 9px; font-size: 13.5px; background: color-mix(in srgb, var(--red) 13%, transparent); color: var(--red); }
.inst-go { height: 44px; justify-content: center; font-size: 14.5px; }
@media (max-width: 520px) { .inst-two { grid-template-columns: 1fr; } .inst-card { padding: 24px 20px; } }
.home-empty { display: flex; gap: 16px; max-width: 1080px; margin: 30px auto 0; padding: 22px 24px; border: 1px dashed var(--border); border-radius: 14px; background: var(--card); }
.home-empty-ic { flex: none; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--link); }
.home-empty h2 { margin: 0 0 8px; font-size: 16px; }
.home-empty ol { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.8; color: var(--text-2); }
.home-empty a { color: var(--link); }
