/* Flowbix Sentrya — painel do cliente.
   Design: sidebar escura + conteúdo claro, acento Action Blue #0066cc, Inter +
   JetBrains Mono. Sem sombras pesadas; elevação por superfície + raio 18px.
   As classes de componente (card, modal, btn, field, badge, kpi, hg, code)
   são consumidas pelo admin.js — preservadas; só o chrome (sidebar) mudou. */

:root {
  --primary: #0066cc;
  --primary-focus: #0071e3;
  --ink: #1d1d1f;
  --body: #1d1d1f;
  --ink-80: #333333;
  --ink-48: #86868b;
  --hairline: #e6e6eb;
  --divider-soft: #f0f0f0;
  --canvas: #ffffff;
  --parchment: #f5f5f7;
  --pearl: #fafafc;
  --black: #1d1d1f;
  --on-dark: #ffffff;
  --danger: #d70015;
  --danger-soft: #fce8ec;
  --ok: #1e8a4c;
  --ok-soft: #e7f6ec;
  --sidebar: #1d1d1f;
  --accent-soft: #eaf2fd;

  --r-sm: 8px;
  --r-md: 11px;
  --r-lg: 18px;
  --r-pill: 9999px;

  --sp-xs: 8px;
  --sp-sm: 12px;
  --sp-md: 17px;
  --sp-lg: 24px;
  --sp-xl: 32px;

  --sidebar-w: 260px;
  --sidebar-w-collapsed: 76px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
/* [hidden] tem que vencer qualquer display de classe (ex.: .auth-form form é
   display:flex; sem isto, marcar hidden no JS não esconderia o formulário). */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.47;
  letter-spacing: -0.2px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Teto de tamanho para QUALQUER ícone inline (evita <svg> gigante quando o
   contexto não define dimensão). Contextos próprios sobrescrevem abaixo. */
svg { width: 18px; height: 18px; flex: none; vertical-align: middle; }

/* animações */
@keyframes barGrow { from { transform: scaleY(0.15); } to { transform: scaleY(1); } }
@keyframes viewIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes heroIn { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } to { opacity: 1; transform: translateY(0); filter: blur(0); } }

/* scrollbar discreta */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d2d2d7; border-radius: var(--r-pill); border: 3px solid var(--parchment); }

/* ===================== SHELL (sidebar + main) ===================== */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  background: var(--sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 26px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

/* topo: marca + botão de recolher */
.side-top { display: flex; align-items: center; gap: 6px; }
.side-top .brand-mark { flex: 1; min-width: 0; }
.side-collapse {
  flex: none; width: 30px; height: 30px; padding: 6px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; cursor: pointer;
  color: var(--ink-48); border-radius: var(--r-md);
  transition: color .15s, background .15s;
}
.side-collapse:hover { color: #fff; background: rgba(255,255,255,0.08); }
.side-collapse svg { width: 18px; height: 18px; }

/* marca: barras animadas + wordmark */
.brand-mark { display: flex; align-items: center; gap: 13px; padding: 0 10px 8px; min-width: 0; }
.brand-bars { display: flex; align-items: flex-end; gap: 4px; height: 26px; }
.brand-bars i { width: 5px; background: #fff; transform-origin: bottom; animation: barGrow .7s ease both; display: block; border-radius: 1px; }
.brand-bars i:nth-child(1) { height: 42%; background: #2997ff; animation-delay: .05s; }
.brand-bars i:nth-child(2) { height: 72%; animation-delay: .12s; }
.brand-bars i:nth-child(3) { height: 54%; animation-delay: .19s; }
.brand-bars i:nth-child(4) { height: 100%; animation-delay: .26s; }
.brand-word { line-height: 1; }
.brand-word .b-top { font-size: 8px; font-weight: 600; letter-spacing: 1.4px; color: var(--ink-48); }
.brand-word .b-main { font-size: 16px; font-weight: 600; letter-spacing: 2.5px; }

.side-div { height: 1px; background: rgba(255,255,255,0.08); margin: 18px 4px; }

.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: var(--r-md);
  font-size: 14px; font-weight: 500; color: var(--ink-48);
  transition: background .15s, color .15s;
}
.side-nav a:hover { text-decoration: none; color: #fff; background: rgba(255,255,255,0.06); }
.side-nav a.active { background: rgba(255,255,255,0.12); color: #fff; }
.side-nav a svg { width: 18px; height: 18px; flex: none; }

.side-spacer { flex: 1; }

/* bloco do usuário: botão que abre o popover com detalhes da empresa */
.side-profile { position: relative; }
.side-user {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 12px 10px; border-radius: var(--r-md);
  background: rgba(255,255,255,0.04);
  border: none; cursor: pointer; text-align: left;
  font-family: inherit; color: #fff;
  transition: background .15s;
}
.side-user:hover { background: rgba(255,255,255,0.09); }
.side-user .ava {
  width: 36px; height: 36px; border-radius: var(--r-pill);
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 600; flex: 0 0 36px;
  overflow: hidden;
}
.side-user .ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.side-user .who { line-height: 1.3; overflow: hidden; flex: 1; min-width: 0; }
.side-user .who .nm { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-caret { flex: none; color: var(--ink-48); display: flex; transition: transform .18s; }
.side-user-caret svg { width: 16px; height: 16px; }
.side-user[aria-expanded="true"] .side-user-caret { transform: rotate(180deg); }

/* popover de detalhes da empresa (abre acima do bloco de perfil) */
.side-user-pop {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 8px);
  background: var(--canvas); color: var(--ink);
  border-radius: var(--r-lg); padding: 6px;
  box-shadow: rgba(0,0,0,0.28) 0 8px 30px 0;
  z-index: 90;
  animation: viewIn .18s cubic-bezier(.22,1,.36,1) both;
}
.side-user-pop[hidden] { display: none; }
.sup-org { display: flex; align-items: center; gap: 11px; padding: 12px 12px 12px; }
.sup-ava {
  width: 40px; height: 40px; border-radius: var(--r-pill);
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 600; flex: 0 0 40px; overflow: hidden;
}
.sup-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sup-org-txt { min-width: 0; }
.sup-org-name { display: block; font-size: 15px; font-weight: 600; letter-spacing: -0.2px; word-break: break-word; }
.sup-org-sub { display: block; font-size: 12px; color: var(--ink-48); margin-top: 2px; }
.sup-rows { border-top: 1px solid var(--divider-soft); padding: 8px 12px; }
.sup-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13px; }
.sup-k { color: var(--ink-48); flex: none; }
.sup-v { color: var(--ink); text-align: right; word-break: break-word; }
.sup-link, .sup-logout {
  display: block; padding: 10px 12px; border-radius: var(--r-md);
  font-size: 13px; font-weight: 500; color: var(--ink);
  border-top: 1px solid var(--divider-soft);
  transition: background .12s;
}
.sup-link:hover, .sup-logout:hover { background: var(--parchment); text-decoration: none; }
.sup-logout { color: var(--danger); }
.side-logout {
  margin-top: 8px; width: 100%; height: 38px;
  background: transparent; color: var(--ink-48);
  border: none; font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; border-radius: var(--r-md);
  transition: color .15s, background .15s;
  display: flex; align-items: center; justify-content: center;
}
.side-logout:hover { color: #fff; background: rgba(255,255,255,0.06); text-decoration: none; }

/* ===== Sidebar recolhida (só desktop; no mobile a sidebar já é drawer) =====
   O usuário recolhe a barra p/ ganhar área útil; a preferência fica em
   localStorage (ver layout-nav.js). Recolhida, some texto e sobra só o ícone. */
@media (min-width: 901px) {
  .sidebar-collapsed .sidebar { flex-basis: var(--sidebar-w-collapsed); width: var(--sidebar-w-collapsed); padding-left: 12px; padding-right: 12px; }
  .sidebar-collapsed .sidebar { transition: flex-basis .2s ease, width .2s ease; }
  .sidebar-collapsed .brand-word,
  .sidebar-collapsed .side-nav a span:not(.side-badge),
  .sidebar-collapsed .side-user .who,
  .sidebar-collapsed .side-user-caret,
  .sidebar-collapsed .side-logout { display: none; }
  .sidebar-collapsed .brand-mark { justify-content: center; padding: 0 0 8px; gap: 0; }
  .sidebar-collapsed .side-top { flex-direction: column; gap: 10px; }
  .sidebar-collapsed .side-nav a { justify-content: center; padding: 11px 0; position: relative; }
  .sidebar-collapsed .side-user { justify-content: center; padding: 10px 0; gap: 0; }
  /* recolhida o popover não cabe na coluna estreita: solta ao lado */
  .sidebar-collapsed .side-user-pop { left: 0; right: auto; width: 250px; }
  /* badge de avisos vira um ponto no canto do ícone */
  .sidebar-collapsed .side-nav a .side-badge { position: absolute; top: 6px; right: 12px; }
  /* seta do botão de recolher aponta para o outro lado quando já recolhido */
  .sidebar-collapsed .side-collapse svg { transform: scaleX(-1); }
}

/* ===== Barra superior + drawer (só aparecem no mobile; ver @media abaixo) ===== */
.topbar { display: none; }
.nav-scrim { display: none; }
.topbar-brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.topbar-brand:hover { text-decoration: none; }
.topbar-brand .brand-bars { height: 22px; }
.topbar-brand .brand-bars i { width: 4px; }
.topbar-brand .b-main { font-size: 15px; font-weight: 600; letter-spacing: 2.5px; color: #fff; }
.nav-toggle {
  display: flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; padding: 10px;
  background: transparent; border: none; cursor: pointer; border-radius: var(--r-md);
  flex: none; -webkit-tap-highlight-color: transparent;
}
.nav-toggle span { display: block; height: 2px; width: 100%; background: #fff; border-radius: 2px; transition: transform .2s, opacity .2s; }

/* área principal */
.main { flex: 1; overflow-y: auto; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 44px 48px 80px; }

/* --- Header de página (com animação de entrada) --- */
.page-head, .hero { animation: viewIn .45s cubic-bezier(.22,1,.36,1) both; margin-bottom: 34px; }
.page-head h1, .hero h1 { font-size: 40px; font-weight: 600; line-height: 1.05; letter-spacing: -1.2px; margin: 0; }
.page-head p, .hero p { color: var(--ink-48); font-size: 17px; letter-spacing: -0.37px; margin: 8px 0 0; }
/* o hero antigo tinha ícone — escondemos o ícone, mantendo o título grande */
.hero { display: block; }
.hero .hero-icon { display: none; }

/* corpo da página entra logo depois do header */
.page-body { animation: viewIn .5s cubic-bezier(.22,1,.36,1) .04s both; }

/* --- Card / tabela --- */
.card {
  background: var(--canvas);
  border-radius: var(--r-lg);
  padding: 28px;
  border: none;
}
.card + .card { margin-top: var(--sp-md); }
.card h2 { font-size: 21px; font-weight: 600; margin: 0 0 var(--sp-md); letter-spacing: -0.4px; }
.card-dark { background: var(--sidebar); color: #fff; }
.card-dark h2, .card-dark .card-head h2 { color: #fff; }

table { width: 100%; border-collapse: collapse; }
/* Rolagem horizontal em QUALQUER largura: o JS injeta <table> direto no .card,
   então é o PRÓPRIO .card que vira o contêiner rolável — a tabela mantém
   display:table (senão thead/tbody perdem a grade de colunas compartilhada e
   desalinham, como no display:block antigo). No mobile o bloco @media adiciona
   o nowrap para não quebrar célula em telas estreitas. */
.card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
th {
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-48);
  padding: 0 12px 12px;
  border-bottom: 1px solid var(--divider-soft);
  letter-spacing: -0.1px;
}
td { padding: 18px 12px; border-bottom: 1px solid var(--divider-soft); font-size: 15px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }

/* Rodapé de paginação (tabela de usuários): navegação + posição atual. */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 14px 12px 2px; flex-wrap: wrap; }
.pager-info { font-size: 13px; color: var(--ink-48); letter-spacing: -0.1px; }
.pager .btn[disabled] { opacity: .45; cursor: not-allowed; }
.muted { color: var(--ink-48); }
.mono { font-family: var(--mono); font-size: 13px; }

/* --- Badges de papel/status --- */
.badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.1px;
}
.badge-admin { background: var(--accent-soft); color: var(--primary); }
.badge-operador { background: var(--ok-soft); color: var(--ok); }
.badge-visualizador { background: var(--parchment); color: var(--ink-80); }
.badge-disabled { background: var(--divider-soft); color: var(--ink-48); }
.badge-active { background: var(--ok-soft); color: var(--ok); }
/* estado "pausado/desativado" — reversível (âmbar), distinto de revogado (cinza). */
.badge-warn { background: #fff4e6; color: #b25a00; }

/* --- Botões --- */
.btn {
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  border: none;
  border-radius: var(--r-pill);
  padding: 11px 20px;
  cursor: pointer;
  letter-spacing: -0.2px;
  transition: transform 0.12s ease, background 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  line-height: 1;
  vertical-align: middle;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-sm svg { width: 14px; height: 14px; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: var(--on-dark); }
.btn-primary:hover { background: var(--primary-focus); text-decoration: none; }
.btn-primary:focus-visible { outline: 2px solid var(--primary-focus); outline-offset: 2px; }
.btn-ghost { background: var(--canvas); color: var(--primary); border: 1px solid var(--primary); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid var(--danger); }
.btn-sm { font-size: 14px; padding: 8px 16px; }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn-link { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 14px; padding: 4px; }
.btn-link.danger { color: var(--danger); }

/* Ações da linha: célula de tabela NORMAL (não flex — display:flex num <td>
   tira a célula do fluxo da tabela e desalinha as colunas). Alinhada à direita,
   botões em linha sem quebrar, com respiro entre eles. */
.row-actions { text-align: right; white-space: nowrap; }
.row-actions .btn-link { margin-left: var(--sp-md); }
.row-actions .btn-link:first-child { margin-left: 0; }
.toolbar { display: flex; align-items: center; margin-bottom: var(--sp-md); }
.toolbar .spacer { flex: 1; }

/* --- Inputs --- */
label { display: block; font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 9px; letter-spacing: -0.22px; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], select {
  width: 100%;
  font-family: var(--font);
  font-size: 16px;
  color: var(--ink);
  background: var(--parchment);
  border: 1px solid var(--parchment);
  border-radius: var(--r-md);
  padding: 13px 16px;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
/* Campo de busca com ícone de lupa à esquerda (usado em "Usuários do Zabbix" e
   onde mais houver .search-field). O ícone é um SVG data-URI (CSP img-src 'self'
   data: permite), então não depende de asset externo nem de <script>. */
input[type="search"] {
  padding-left: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2386868b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
}
input[type="search"]:focus { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%230071e3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E"); }
/* some com a cruzinha nativa do WebKit (fica desalinhada com o resto do tema) */
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
input::placeholder { color: #b0b0b5; }
input:focus, select:focus {
  outline: none;
  border-color: var(--primary-focus);
  background: var(--canvas);
  box-shadow: 0 0 0 4px rgba(0,113,227,0.12);
}
.field { margin-bottom: var(--sp-md); }
.field-row { display: flex; gap: var(--sp-md); }
.field-row .field { flex: 1; }

/* --- Toggle / switch (login por Zabbix etc.) --- */
.switch { position: relative; display: inline-block; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; cursor: pointer;
  background: #d2d2d7; border-radius: var(--r-pill);
  transition: background .2s;
}
.switch .track::before {
  content: ""; position: absolute; left: 3px; top: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .2s;
}
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::before { transform: translateX(18px); }
.switch input:disabled + .track { opacity: .45; cursor: not-allowed; }

/* --- Modal --- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: none;
  align-items: center; justify-content: center;
  z-index: 100;
  padding: var(--sp-lg);
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--canvas);
  border-radius: var(--r-lg);
  padding: var(--sp-xl);
  width: 100%;
  max-width: 460px;
  box-shadow: rgba(0, 0, 0, 0.22) 3px 5px 30px 0;
  animation: viewIn .3s cubic-bezier(.22,1,.36,1) both;
  /* Altura fixa GLOBAL: nenhum modal do /admin passa da tela. Conteúdo alto
     (listas de host groups, usuários do Zabbix, etc.) rola DENTRO do modal em vez
     de escapar do viewport. O backdrop centraliza e o padding dele (--sp-lg) dá a
     folga nas bordas. Abordagem simples de propósito (o modal inteiro rola, sem
     header fixo) — vale para TODOS os modais sem precisar tocar em cada um. */
  max-height: calc(100vh - 2 * var(--sp-lg));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal h3 { font-size: 24px; font-weight: 600; margin: 0 0 var(--sp-md); letter-spacing: -0.3px; }
.modal .actions { display: flex; gap: var(--sp-sm); justify-content: flex-end; margin-top: var(--sp-lg); }

.modal-devices {
  max-width: 1100px;
}

/* senha provisória revelada (uma vez) */
.cred-box {
  background: var(--parchment);
  border-radius: var(--r-md);
  padding: var(--sp-md);
  margin-top: var(--sp-md);
}
.cred-box .pw { font-family: var(--mono); font-size: 20px; letter-spacing: 1px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cred-box .hint { color: var(--ink-48); font-size: 13px; margin-top: 6px; }

/* --- grupos visíveis por usuário (autorização por host group) --- */
.modal-wide { max-width: 720px; }
/* tabela de dispositivos: rola na horizontal se um valor longo escapar. */
.dev-table { overflow-x: auto; }
.note {
  background: var(--accent-soft);
  border: 1px solid #cfe0fb;
  color: var(--ink-80);
  border-radius: var(--r-md);
  padding: var(--sp-sm) var(--sp-md);
  font-size: 13px;
  margin-bottom: var(--sp-md);
}
/* Listas longas dentro de modal (grupos visíveis, usuários do Zabbix): NÃO
   fixamos mais uma altura em vh aqui — o próprio .modal já tem max-height + scroll
   global (uma rolagem só, sem scroll aninhado que confunde). Só mantemos o
   cabeçalho da tabela grudado no topo enquanto a lista rola dentro do modal. */
#hgBody { margin: var(--sp-xs) 0; }
#zuBody thead th { position: sticky; top: 0; background: var(--canvas); z-index: 1; }
.hg-server { margin-bottom: var(--sp-md); }
.hg-server-head {
  font-size: 13px; font-weight: 600; color: var(--ink-48);
  text-transform: uppercase; letter-spacing: 0.4px;
  padding: 6px 0; border-bottom: 1px solid var(--divider-soft); margin-bottom: 6px;
}
.hg-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 4px; cursor: pointer; border-radius: var(--r-sm);
}
.hg-row:hover { background: var(--parchment); }
.hg-row input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.hg-err { color: var(--danger); font-size: 13px; padding: 8px 0; }
.scope-hint {
  border-radius: var(--r-md); padding: var(--sp-sm) var(--sp-md);
  font-size: 13px; margin-top: var(--sp-sm);
}
.scope-hint.warn { background: var(--danger-soft); color: var(--danger); }
.scope-hint.ok { background: var(--ok-soft); color: var(--ok); }

/* --- KPIs (linha de estatísticas) --- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi {
  background: var(--canvas);
  border-radius: var(--r-lg);
  padding: 22px;
  border: none;
}
.kpi .kpi-label { color: var(--ink-48); font-size: 14px; letter-spacing: -0.1px; margin-bottom: 14px; }
.kpi .kpi-value { font-size: 34px; font-weight: 600; letter-spacing: -1px; line-height: 1.05; }
.kpi .kpi-value .unit { font-size: 18px; color: var(--ink-48); font-weight: 400; letter-spacing: -0.1px; }
.kpi.accent .kpi-value { color: var(--primary); }

/* --- Card header com ícone --- */
.card-head { display: flex; align-items: center; gap: 10px; margin: 0 0 var(--sp-md); }
.card-head .ch-icon { color: var(--primary); display: flex; }
.card-head .ch-icon svg { width: 19px; height: 19px; }
.card-head h2 { margin: 0; font-size: 21px; font-weight: 600; letter-spacing: -0.4px; }
.card-head .spacer { flex: 1; }

/* status com bolinha */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot-ok { background: #30d158; }
.dot-err { background: var(--danger); }
.dot-idle { background: var(--ink-48); }

/* estado vazio caprichado */
.empty-rich { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 64px 20px; }
.empty-rich .e-icon {
  width: 64px; height: 64px; border-radius: 16px; background: var(--parchment);
  display: flex; align-items: center; justify-content: center; color: var(--ink-48); margin-bottom: 20px;
}
.empty-rich .e-icon svg { width: 28px; height: 28px; }
.empty-rich .e-title { font-size: 19px; font-weight: 600; color: var(--ink); letter-spacing: -0.3px; }
.empty-rich .e-sub { color: var(--ink-48); font-size: 15px; margin-top: 6px; max-width: 360px; }

/* abas de código (snippets) */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tab {
  border: 1px solid #e0e0e0;
  background: var(--canvas);
  color: var(--ink);
  font: inherit; font-size: 13px; font-weight: 500;
  padding: 8px 16px; border-radius: var(--r-pill); cursor: pointer;
  transition: all .15s;
}
.tab.active { background: var(--primary); color: var(--on-dark); border-color: var(--primary); }
.code-block {
  position: relative;
  background: var(--sidebar);
  color: #e6e6e6;
  border-radius: var(--r-md);
  padding: 18px;
  overflow-x: auto;
}
.code-block pre { margin: 0; font-family: var(--mono); font-size: 12.5px; line-height: 1.65; white-space: pre; }
.tok-key { color: #ff7ab2; }
.tok-str { color: #9ae6a4; }
.tok-num { color: #f0a868; }
.tok-prop { color: #7ec4ff; }
.tok-fn { color: #82d2ce; }
.tok-punc { color: #a0a0a8; }
.tok-comment { color: #7a7a7a; font-style: italic; }
.tok-var { color: #e0a0ff; }
.tok-url { color: #f0a868; }
.code-block .copy {
  position: absolute; top: 10px; right: 10px;
  background: rgba(255,255,255,0.1); color: #f5f5f7;
  border: none; border-radius: var(--r-sm); padding: 5px 10px;
  font: inherit; font-size: 12px; cursor: pointer;
}
.code-block .copy:hover { background: rgba(255,255,255,0.18); }
.snippet { display: none; }
.snippet.active { display: block; }
.field-inline { display: flex; gap: 8px; align-items: stretch; }
.field-inline input { font-family: var(--mono); font-size: 13px; }

/* detalhe expansível da fonte */
.hook-detail { border-top: 1px solid var(--divider-soft); margin-top: var(--sp-md); padding-top: var(--sp-md); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 16px; font-size: 14px; margin-bottom: var(--sp-md); }
.kv dt { color: var(--ink-48); }
.kv dd { margin: 0; }
.label-sm { font-size: 13px; font-weight: 600; color: var(--ink-80); margin: var(--sp-md) 0 6px; }

/* --- Logo da empresa --- */
.logo-row { display: flex; align-items: center; gap: var(--sp-lg); margin-top: var(--sp-sm); }
.logo-preview {
  width: 84px; height: 84px;
  border-radius: 16px;
  background: var(--parchment);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex: none;
  font-size: 13px; color: var(--ink-48);
}
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* --- Estados --- */
.empty { text-align: center; color: var(--ink-48); padding: var(--sp-xl); }
.alert { padding: 12px 16px; border-radius: var(--r-md); font-size: 14px; margin-bottom: var(--sp-md); }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.spinner { color: var(--ink-48); padding: var(--sp-lg); text-align: center; }

/* --- Login: painel único com hero deslizante (login <-> cadastro) ---
   Espelha o mock de inspiração: hero escuro ocupa metade da tela e desliza
   horizontalmente; os dois forms ficam empilhados em z-index, fade/slide
   sincronizado com o hero. Estado controlado por [data-mode] no .auth.
   NADA aqui depende de JS para o submit — cada <form> mantém seu action. */
.auth {
  position: relative; height: 100vh; width: 100%;
  background: #fff; overflow: hidden;
}

/* hero deslizante */
.auth-hero {
  position: absolute; top: 0; bottom: 0; left: 0; width: 50%;
  background: var(--sidebar); color: #fff;
  padding: 56px 64px;
  display: flex; flex-direction: column; justify-content: space-between;
  overflow: hidden; z-index: 3; will-change: transform;
  transform: translateX(0);
  transition: transform .9s cubic-bezier(.76,0,.24,1);
}
.auth[data-mode="signup"] .auth-hero { transform: translateX(100%); }

.auth-hero .glow-a {
  position: absolute; width: 600px; height: 560px; border-radius: 50%;
  background: radial-gradient(circle, rgba(41,151,255,0.22) 0%, rgba(41,151,255,0) 70%);
  left: 200px; bottom: -180px; z-index: 1;
}
.auth-hero .glow-b {
  position: absolute; left: -120px; top: -120px; width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0) 70%); z-index: 1;
}
.auth-hero .brand-mark, .auth-hero .auth-legal, .auth-hero .hero-copy { position: relative; z-index: 2; }
.auth-hero .brand-bars { height: 34px; }
.auth-hero .brand-bars i { width: 7px; }
.auth-hero .brand-word .b-top { font-size: 10px; letter-spacing: 1.5px; }
.auth-hero .brand-word .b-main { font-size: 21px; letter-spacing: 3px; }

/* o hero troca a manchete conforme o modo: duas cópias empilhadas, só uma visível */
.auth-hero .hero-copy { max-width: 520px; position: relative; }
.auth-hero .hero-headline { position: absolute; top: 0; left: 0; right: 0; opacity: 0; pointer-events: none; transition: opacity .5s ease; }
.auth-hero .hero-headline.is-on { position: relative; opacity: 1; pointer-events: auto; }
.auth-head h1 { font-size: 56px; font-weight: 600; line-height: 1.05; letter-spacing: -1.4px; margin: 0; animation: heroIn .8s cubic-bezier(.22,1,.36,1) .05s both; }
.auth-head h1 .l2 { display: block; color: var(--ink-48); animation: heroIn .8s cubic-bezier(.22,1,.36,1) .16s both; }
.auth-head p { font-size: 21px; font-weight: 300; line-height: 1.4; letter-spacing: -0.2px; color: #cccccc; margin: 24px 0 0; max-width: 440px; animation: heroIn .8s cubic-bezier(.22,1,.36,1) .28s both; }
.auth-legal { font-size: 12px; color: #6e6e73; letter-spacing: -0.1px; }

/* os dois forms ocupam metade da tela cada, sob o hero */
.auth-panel {
  position: absolute; top: 0; bottom: 0; width: 50%;
  display: flex; align-items: center; justify-content: center;
  padding: 48px; background: #fff; z-index: 1;
  transition: opacity .5s ease, transform .7s cubic-bezier(.76,0,.24,1);
}
.auth-panel-login  { right: 0; }
.auth-panel-signup { left: 0; }

/* modo login: form de login visível à direita, signup escondido à esquerda */
.auth[data-mode="login"]  .auth-panel-login  { opacity: 1; transform: translateX(0);     pointer-events: auto; transition-delay: .35s, .3s; }
.auth[data-mode="login"]  .auth-panel-signup { opacity: 0; transform: translateX(-40px); pointer-events: none; }
/* modo signup: form de cadastro visível à esquerda, login escondido à direita */
.auth[data-mode="signup"] .auth-panel-signup { opacity: 1; transform: translateX(0);     pointer-events: auto; transition-delay: .4s, .35s; }
.auth[data-mode="signup"] .auth-panel-login  { opacity: 0; transform: translateX(40px);  pointer-events: none; }

/* página de verificação de email: hero à esquerda + form à direita (sem o
   slider de login/cadastro). Reusa o posicionamento do .auth-panel. */
.auth-form-side {
  position: absolute; top: 0; bottom: 0; right: 0; width: 50%;
  display: flex; align-items: center; justify-content: center;
  padding: 48px; background: #fff; z-index: 1;
}

.auth-form { width: 100%; max-width: 400px; }
.auth-form h2 { font-size: 40px; font-weight: 600; letter-spacing: -1px; color: var(--ink); margin: 0 0 8px; }
.auth-form .sub { font-size: 17px; color: var(--ink-48); letter-spacing: -0.37px; margin: 0 0 36px; }
.auth-form form { display: flex; flex-direction: column; gap: 18px; }
.auth-form .btn-primary { height: 52px; margin-top: 6px; font-size: 17px; font-weight: 400; }
.auth-form .foot { font-size: 15px; color: var(--ink-48); text-align: center; margin: 28px 0 0; }
.auth-form .forgot { float: right; font-size: 14px; font-weight: 400; }

/* =====================================================================
   RESPONSIVO
   Breakpoint principal em 900px: abaixo dele a sidebar vira drawer
   (off-canvas) acionado pela barra superior, e o conteúdo respira em
   coluna única. Um segundo passo em 560px afina tipografia/paddings
   para celulares de verdade.
   ===================================================================== */

/* --- Tablet e mobile: sidebar como drawer deslizante --- */
@media (max-width: 900px) {
  .shell { flex-direction: column; }

  /* barra superior fixa */
  .topbar {
    display: flex; align-items: center; gap: 8px;
    position: sticky; top: 0; z-index: 60;
    background: var(--sidebar); color: #fff;
    padding: 10px 12px;
    padding-top: max(10px, env(safe-area-inset-top));
  }

  /* a sidebar sai do fluxo e vira painel que desliza da esquerda */
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0;
    width: 82vw; max-width: 320px; height: 100%;
    flex: none; padding: 22px 18px;
    z-index: 80;
    transform: translateX(-100%);
    transition: transform .28s cubic-bezier(.4,0,.2,1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 4px 0 24px rgba(0,0,0,.18);
  }
  body.nav-open .sidebar { transform: translateX(0); }

  /* dentro do drawer a navegação volta a ser vertical e tudo reaparece */
  .side-nav { flex-direction: column; overflow: visible; }
  .side-nav a { font-size: 15px; padding: 13px 14px; }
  .side-div, .side-spacer, .side-user, .side-logout { display: block; }
  .side-user { display: flex; }
  /* recolher é só de desktop; no drawer não faz sentido */
  .side-collapse { display: none; }
  .side-top { display: block; }

  /* véu sobre o conteúdo quando o drawer abre */
  .nav-scrim {
    display: block; position: fixed; inset: 0;
    background: rgba(0,0,0,.42); z-index: 70;
    opacity: 0; transition: opacity .28s ease;
  }
  .nav-scrim[hidden] { display: none; }
  body.nav-open .nav-scrim { opacity: 1; }
  body.nav-open { overflow: hidden; }

  /* o "X" do hambúrguer quando aberto */
  body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .main { overflow-y: visible; }
  .wrap { padding: 28px 22px 72px; }

  /* títulos menores fora do desktop */
  .page-head, .hero { margin-bottom: 26px; }
  .page-head h1, .hero h1 { font-size: 32px; letter-spacing: -0.9px; }
  .page-head p, .hero p { font-size: 16px; }

  .card { padding: 22px; }
  .kpis { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }

  /* tabelas: a rolagem horizontal já é global (regra .card acima); no
     mobile só reforçamos nowrap para as células não quebrarem em telas estreitas. */
  .card table { white-space: nowrap; width: 100%; }
  td, th { padding-left: 8px; padding-right: 8px; }
  td { padding-top: 14px; padding-bottom: 14px; }

  /* login: sem hero deslizante; o painel ativo ocupa a tela inteira */
  .auth-hero { display: none; }
  .auth-form-side { position: absolute; inset: 0; width: 100%; }
  .auth-panel { position: absolute; inset: 0; width: 100%; transform: none !important; transition: opacity .3s ease; }
  .auth[data-mode="login"]  .auth-panel-login,
  .auth[data-mode="signup"] .auth-panel-signup { opacity: 1; pointer-events: auto; z-index: 2; }
  .auth[data-mode="login"]  .auth-panel-signup,
  .auth[data-mode="signup"] .auth-panel-login  { opacity: 0; pointer-events: none; z-index: 1; }
}

/* --- Celular: afina tudo p/ uma coluna estreita --- */
@media (max-width: 560px) {
  .wrap { padding: 20px 16px 64px; }

  .page-head h1, .hero h1 { font-size: 27px; letter-spacing: -0.6px; }
  .page-head p, .hero p { font-size: 15px; }

  .card { padding: 18px 16px; border-radius: 14px; }
  .card h2, .card-head h2 { font-size: 19px; }

  /* card-head e toolbar empilham quando o botão de ação não cabe ao lado */
  .card-head { flex-wrap: wrap; }
  .card-head .spacer { flex-basis: 100%; height: 0; }
  .card-head .btn { width: 100%; }
  .toolbar { flex-wrap: wrap; gap: 10px; }
  .toolbar input[type="text"] { max-width: none !important; width: 100%; }
  .toolbar .spacer { display: none; }
  .toolbar .btn { width: 100%; }

  /* KPIs em 2 colunas no celular (1 quando muito estreito) */
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi { padding: 18px; }
  .kpi .kpi-value { font-size: 28px; }

  /* botões em ações de linha continuam compactos, mas com alvo de toque maior */
  .row-actions .btn-link { margin-left: 10px; }
  .btn-link { padding: 8px 4px; }

  /* modal cola nas bordas e pode rolar */
  .modal-backdrop { padding: 12px; align-items: flex-end; }
  .modal { padding: 22px 18px; max-height: 92vh; overflow-y: auto; border-radius: 18px 18px 14px 14px; }
  .modal h3 { font-size: 21px; }
  .modal .actions { flex-direction: column-reverse; }
  .modal .actions .btn { width: 100%; }

  /* campos lado-a-lado empilham */
  .field-row { flex-direction: column; gap: 0; }

  /* o grid de definições (kv) vira uma coluna */
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { margin-top: 8px; }

  .logo-row { gap: 16px; }

  /* impede que inputs disparem zoom no iOS (precisa >=16px; já está, reforço) */
  input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], select { font-size: 16px; }

  /* login: menos respiro lateral e título proporcional ao celular */
  .auth-panel, .auth-form-side { padding: 28px 22px; }
  .auth-form h2 { font-size: 32px; letter-spacing: -0.7px; }
  .auth-form .sub { font-size: 15px; margin-bottom: 28px; }
}

/* very small phones: KPIs em coluna única */
@media (max-width: 380px) {
  .kpis { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .page-head, .hero, .page-body, .modal, .brand-bars i,
  .auth-head h1, .auth-head h1 .l2, .auth-head p { animation: none !important; }
  .auth-hero, .auth-panel, .sidebar, .nav-scrim { transition: none !important; }
}

/* --- Avisos da plataforma: cor por tipo (compartilhada por toast e painel) --- */
:root {
  --warn: #b25a00;
  --warn-soft: #fff4e6;
  --warn-line: #f3d9b3;
}

/* --- Balões flutuantes (toasts) de aviso ---------------------------------- */
/* Empilham no canto inferior direito, não empurram o conteúdo (fixed), são
   dispensáveis e entram com um leve slide-up. Substituíram a faixa engessada. */
.fbx-toasts {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 60;
  display: flex; flex-direction: column; gap: 12px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none; /* só os cards capturam clique */
}
.fbx-toast {
  pointer-events: auto;
  position: relative;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--ink-48);
  border-radius: var(--r-md);
  padding: 14px 38px 14px 16px;
  box-shadow: 0 10px 30px rgba(29,29,31,0.14), 0 2px 8px rgba(29,29,31,0.06);
  animation: fbxToastIn .32s cubic-bezier(.22,1,.36,1) both;
}
.fbx-toast.leaving { animation: fbxToastOut .2s ease forwards; }
@keyframes fbxToastIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fbxToastOut { to { opacity: 0; transform: translateX(16px); } }
.fbx-toast.info { border-left-color: var(--primary); }
.fbx-toast.maintenance_scheduled { border-left-color: var(--warn); }
.fbx-toast.maintenance_mode,
.fbx-toast.critical { border-left-color: var(--danger); }
.fbx-toast.urgent { box-shadow: 0 10px 30px rgba(215,0,21,0.18), 0 2px 8px rgba(215,0,21,0.08); }
.fbx-toast-kind {
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-48);
}
.fbx-toast.info .fbx-toast-kind { color: var(--primary); }
.fbx-toast.maintenance_scheduled .fbx-toast-kind { color: var(--warn); }
.fbx-toast.maintenance_mode .fbx-toast-kind,
.fbx-toast.critical .fbx-toast-kind { color: var(--danger); }
.fbx-toast-title { font-weight: 600; font-size: 14.5px; margin-top: 3px; color: var(--ink); }
.fbx-toast-body { font-size: 13.5px; color: var(--ink-80); margin-top: 3px; line-height: 1.45; }
.fbx-toast-more { display: inline-block; margin-top: 9px; font-size: 13px; font-weight: 500; }
.fbx-toast-x {
  position: absolute; top: 8px; right: 8px;
  width: 24px; height: 24px; border: 0; border-radius: 6px;
  background: transparent; color: var(--ink-48); cursor: pointer;
  font-size: 20px; line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.fbx-toast-x:hover { background: var(--divider-soft); color: var(--ink); }

/* badge de contagem no item "Avisos" da sidebar */
.side-badge {
  margin-left: auto;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--primary); color: #fff;
  font-size: 11px; font-weight: 600; line-height: 18px; text-align: center;
}

/* --- Painel /admin/avisos: lista de avisos + cards de artigo --------------- */
.ann-list { display: grid; gap: 12px; }
#annPinned { display: grid; gap: 12px; margin-bottom: 18px; }
#annPinned:empty { display: none; }
.ann-item {
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--ink-48);
  border-radius: var(--r-md);
  padding: 16px 18px;
  background: var(--pearl);
  transition: box-shadow .15s, transform .15s, border-color .15s;
}
.ann-item.info { border-left-color: var(--primary); }
.ann-item.maintenance_scheduled { border-left-color: var(--warn); }
.ann-item.maintenance_mode,
.ann-item.critical { border-left-color: var(--danger); }
/* avisos-artigo (tipo site) são clicáveis */
.ann-item.is-article { cursor: pointer; }
.ann-item.is-article:hover { box-shadow: 0 6px 20px rgba(29,29,31,0.08); transform: translateY(-1px); border-color: var(--primary); }
.ann-item.is-article:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ann-item-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ann-tag {
  font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 9px; border-radius: var(--r-pill);
  background: var(--divider-soft); color: var(--ink-48);
}
.ann-tag.info { background: var(--accent-soft); color: var(--primary); }
.ann-tag.maintenance_scheduled { background: var(--warn-soft); color: var(--warn); }
.ann-tag.maintenance_mode,
.ann-tag.critical { background: var(--danger-soft); color: var(--danger); }
.ann-chip {
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: var(--r-pill);
  border: 1px solid var(--hairline); color: var(--ink-48);
}
.ann-date { font-size: 12.5px; color: var(--ink-48); margin-left: auto; font-family: var(--mono); }
.ann-title { font-size: 17px; font-weight: 600; color: var(--ink); margin: 10px 0 0; letter-spacing: -0.3px; }
.ann-body { font-size: 14.5px; color: var(--ink-80); margin: 5px 0 0; line-height: 1.5; }
.ann-more { display: inline-block; margin-top: 10px; font-size: 13.5px; font-weight: 500; color: var(--primary); }

/* --- Leitor deslizante do aviso-artigo (painel lateral direito) ----------- */
.reader-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(29,29,31,0.42);
  opacity: 0; transition: opacity .22s ease;
}
.reader-backdrop.open { opacity: 1; }
.reader {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 81;
  width: min(760px, 100vw);
  background: var(--canvas);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .24s cubic-bezier(.22,1,.36,1);
  box-shadow: -18px 0 50px rgba(29,29,31,0.16);
}
.reader.open { transform: none; }
body.reader-open { overflow: hidden; }
.reader-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 22px; border-bottom: 1px solid var(--hairline);
  flex: none;
}
.reader-x {
  width: 34px; height: 34px; border: 0; border-radius: var(--r-md);
  background: var(--parchment); color: var(--ink); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.reader-x:hover { background: var(--divider-soft); }
.reader-eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-48);
}
.reader-scroll { overflow-y: auto; flex: 1; }
.reader-content { max-width: 680px; margin: 0 auto; padding: 40px 40px 72px; }
.reader-content h1 { font-size: 30px; font-weight: 600; letter-spacing: -0.6px; line-height: 1.12; margin: 0; color: var(--ink); }
.reader-summary { font-size: 17px; color: var(--ink-48); margin: 12px 0 26px; line-height: 1.5; }
.reader-permalink { display: inline-block; margin-top: 28px; font-size: 14px; font-weight: 500; }

/* corpo rico sanitizado (classes rt-* geradas pelo editor do /flowbix) */
.article-body { font-size: 16px; color: var(--ink-80); line-height: 1.6; }
.article-body > *:first-child { margin-top: 0; }
.article-body p { margin: 0 0 18px; }
.article-body h1, .article-body h2, .article-body h3 { color: var(--ink); font-weight: 600; letter-spacing: -0.3px; margin: 30px 0 12px; line-height: 1.2; }
.article-body h1 { font-size: 24px; }
.article-body h2 { font-size: 20px; }
.article-body h3 { font-size: 17px; }
.article-body ul, .article-body ol { margin: 0 0 18px; padding-left: 22px; }
.article-body li { margin: 6px 0; }
.article-body a { color: var(--primary); text-decoration: underline; }
.article-body strong { color: var(--ink); font-weight: 600; }
.article-body img { max-width: 100%; height: auto; border-radius: var(--r-md); }
.article-body .rt-img-sm { max-width: 320px; }
.article-body .rt-img-md { max-width: 520px; }
.article-body .rt-img-lg { max-width: 100%; }
.article-body .rt-img-full { width: 100%; }
.article-body .rt-img-left { float: left; margin: 4px 20px 12px 0; }
.article-body .rt-img-right { float: right; margin: 4px 0 12px 20px; }
.article-body .rt-img-center { display: block; margin: 20px auto; }
.article-body .rt-lead { font-size: 18px; color: var(--ink); font-weight: 500; margin-bottom: 22px; }
.article-body blockquote {
  margin: 22px 0; padding: 4px 18px; border-left: 3px solid var(--primary);
  color: var(--ink-80); font-style: italic;
}
.article-body .rt-note {
  margin: 22px 0; padding: 14px 16px; border-radius: var(--r-md);
  background: var(--accent-soft); color: var(--ink-80); border: 1px solid #d6e6fb;
}
.article-body .rt-steps { list-style: none; counter-reset: step; padding-left: 0; }
.article-body .rt-steps > li { counter-increment: step; position: relative; padding-left: 40px; margin: 16px 0; }
.article-body .rt-steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: var(--r-pill);
  background: var(--primary); color: #fff; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.article-body .rt-step-title { display: block; font-weight: 600; color: var(--ink); }
.article-body pre, .article-body .rt-code {
  background: var(--black); color: #f5f5f7; border-radius: var(--r-md);
  padding: 16px 18px; overflow-x: auto; font-family: var(--mono); font-size: 13.5px;
  margin: 20px 0; line-height: 1.5;
}
.article-body code { font-family: var(--mono); font-size: 0.92em; }
.article-body :not(pre) > code { background: var(--divider-soft); padding: 2px 6px; border-radius: 6px; }
.article-body .rt-c { color: #8a8a91; }
.article-body .rt-k { color: #7fb2ff; }

@media (max-width: 640px) {
  .fbx-toasts { right: 12px; left: 12px; bottom: 12px; width: auto; }
  .reader-content { padding: 28px 20px 56px; }
  .reader-content h1 { font-size: 25px; }
}
