/* Design system for the app shell — ported from the Sistema.dc.html design doc.
   The slide artwork under templates/slides/ has its own styling and is not
   affected by anything here: that CSS ends up inside the exported PNG. */

/* ---------- Tipografia ----------
   Seis tamanhos, três pesos, duas entrelinhas -- nada escrito à mão.
     12 xs  rótulo, legenda, selo, cabeçalho de tabela
     13 sm  texto secundário, ajuda, botão pequeno
     14 md  texto base, campo, linha de tabela, botão
     16 lg  título de cartão
     20 xl  título de página
     28 2xl número grande, título de tela de entrada
   Peso: 400 texto, 600 realce (nome, rótulo, botão), 700 título.
   Entrelinha: justa (títulos, uma linha) e normal (parágrafo). */
:root {
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 28px;
  --lh-tight: 1.25;
  --lh-base: 1.5;
}

/* ---------- Espaço, raio e sombra ----------
   Espaço (gap, padding, margin) em seis passos, o número é o px: 4 entre
   ícone e texto, 8 entre itens juntos, 12 dentro de um controle, 16 entre
   blocos e dentro de cartão, 24 entre seções, 32 em volta de uma tela.
   Raio: 6 (selo), 8 (controle pequeno, chip), 12 (cartão, campo, botão,
   modal) e o redondo. Sombra: leve (cartão no hover, botão) e flutuante (menu,
   aviso, modal); --ring marca o que está escolhido. */
:root {
  --s-4: 4px;
  --s-8: 8px;
  --s-12: 12px;
  --s-16: 16px;
  --s-24: 24px;
  --s-32: 32px;

  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-full: 999px;

  --shadow-sm: 0 6px 20px -12px rgba(14, 14, 17, .25);
  --shadow-lg: 0 24px 60px -12px rgba(14, 14, 17, .3);
  --ring: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}
[data-theme="dark"] {
  --shadow-sm: 0 6px 20px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .7);
}

/* ---------- Cores ----------
   A paleta inteira: neutros (texto, fundo, linha), a marca e quatro estados.
   Cada cor de estado vem em trio -- a cor, -ink (texto sobre o -wash, mais
   escuro para ler bem) e -wash (fundo clarinho) -- e é só disso que selos,
   alertas e chips são feitos. Canais (--ch-*) são as únicas outras cores, e
   só para o logo de cada um. Cor nova? Primeiro veja se uma destas serve. */
:root {
  /* Texto: principal, secundário e apagado. */
  --ink: #0E0E11;
  --muted: #6B6B7B;
  --faint: #A5A5B3;
  /* Fundos: página, cartões e campos, e o cinza das áreas recuadas. */
  --bg: #F7F7FA;
  --surface: #FBFBFD;
  --canvas: #EFEFF4;
  /* Linhas: toda borda e divisória; a forte para hover e destaque. */
  --line: #DEDEE6;
  --line-strong: #C2C2CE;
  /* "Botão preto": preto no claro, branco no escuro (trocam de lugar). */
  --ink-invert: #0E0E11;
  --ink-invert-fg: #fff;

  /* Laranja Lobot. The logo's own orange is #F24B1F; the UI one is a shade
     deeper so white text on it (buttons) and it as text on the page both
     pass 4.5:1. */
  --brand: #D03D17;
  --brand-ink: #A8300C;
  --brand-wash: #FDF0EB;

  /* Estados. info é neutro de propósito: aviso que não pede ação não
     precisa de mais uma cor na tela. */
  --ok: #16A34A;
  --ok-ink: #116B36;
  --ok-wash: #E9F8EF;
  --warn: #B4650E;
  --warn-ink: #8A4D06;
  --warn-wash: #FEF3E7;
  --danger: #DC2626;
  --danger-ink: #991B1B;
  --danger-wash: #FDECEC;
  --info: #52525E;
  --info-ink: #0E0E11;
  --info-wash: #F0F0F5;
  /* Destaque: menção (@você) e IA. */
  --pink: #E8318A;
  --pink-wash: #FDECF4;

  /* Canais: a cor do logo de cada um (o WhatsApp oficial usa a mesma do
     WhatsApp -- o ícone é que os diferencia). */
  --ch-whatsapp: #128C4A;
  --ch-whatsapp-wash: #E4F6EA;
  --ch-telegram: #1786BC;
  --ch-telegram-wash: #E5F3FB;
  --ch-instagram: #D62976;
  --ch-instagram-wash: #FCE7F0;
  --ig-gradient: linear-gradient(93deg, #F0913B, #E8318A 48%, #7B3FE4);
}

/* Tema escuro -- pedido ao vivo, toggle no menu de conta (accountMenu,
   layout.templ) em cima de "Sair". [data-theme=dark] fica no <html> (ver
   themeToggleScript/ShellCustomTopbar), mesmo seletor que o próprio Tucano
   já usa (tucano.min.css já tem [data-theme=dark] pronto) -- então os dois
   viram juntos com UM atributo só. Tudo aqui é a versão escura do mesmo
   token do :root -- --ink-invert/-fg literalmente TROCAM de lugar (ver o
   comentário deles acima), o resto só ajusta o tom. */
[data-theme="dark"] {
  --ink: #F2F2F5;
  --muted: #9494A3;
  --faint: #6C6C78;
  --bg: #101014;
  --surface: #1A1A20;
  --canvas: #16161B;
  --line: #2F2F39;
  --line-strong: #45454F;
  --ink-invert: #FFFFFF;
  --ink-invert-fg: #0E0E11;

  --brand: #F05A2E;
  --brand-ink: #FF9A78;
  --brand-wash: #331A12;

  --ok: #4ADE80;
  --ok-ink: #7BE8A4;
  --ok-wash: #123420;
  --warn: #FBBF24;
  --warn-ink: #FCD34D;
  --warn-wash: #3A2A0E;
  --danger: #F87171;
  --danger-ink: #FCA5A5;
  --danger-wash: #3A1616;
  --info: #A1A1AE;
  --info-ink: #F2F2F5;
  --info-wash: #232329;
  --pink: #F472B6;
  --pink-wash: #3A1830;

  --ch-whatsapp: #34D399;
  --ch-whatsapp-wash: #10301F;
  --ch-telegram: #5AC0EE;
  --ch-telegram-wash: #16303D;
  --ch-instagram: #F472B6;
  --ch-instagram-wash: #3A1830;
}

/* Punhado de cores soltas (não passam por um token do :root) comuns o
   bastante pra valer a pena uma versão escura própria -- o resto de cor
   solta que sobrar (~20 casos raros, tipo um gradiente específico) fica
   pra um ajuste fino depois, se aparecer torto na prática. */

/* color-scheme diz pro navegador usar widgets nativos escuros (scrollbar,
   <select>, checkbox/radio não customizados, o "revelar senha" nativo...)
   sozinho -- sem isso, mesmo com o resto da página escuro, essas peças
   nativas continuam claras (reportado ao vivo: "faltou as cores dark das
   rolagens"). O ::-webkit-scrollbar/scrollbar-color abaixo é só o polimento
   fino por cima (cor combinando com os tokens do app), pro Chrome/Safari
   que preferem isso a deixar 100% a cargo do color-scheme. */
:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: var(--r-sm); }
*::-webkit-scrollbar-thumb:hover { background: var(--muted); }

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-ink); }
input::placeholder, textarea::placeholder { color: var(--faint); }

h1, h2, h3, p { margin: 0; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-8);
  height: 42px; padding: 0 var(--s-16);
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink);
  font-family: inherit; font-size: var(--fs-md); font-weight: 700;
  cursor: pointer; white-space: nowrap;
  -webkit-appearance: none; appearance: none;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }

.btn[disabled], .btn.is-disabled { opacity: .45; cursor: not-allowed; }

/* Square icon button, e.g. the calendar's ‹ › and the card overflow menu. */
.icon-btn {
  /* Also the "voltar" of every detail page and of the contact/group panel
     (detailsPanelHead) -- one back button, one size. */
  width: 36px; height: 36px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--muted);
  font-family: inherit; font-size: var(--fs-md); cursor: pointer;
}
.icon-btn:hover { background: var(--surface); color: var(--ink); }
 /* bigger than the (now 36px) base -- unused today, kept sized above it */
/* Clicks belong to the button, never to the glyph inside it — otherwise event
   delegation that looks at the target misses the button entirely. 18px, the
   back links' flowIcon("back") SVG included. */
.icon-btn svg { pointer-events: none; width: 18px; height: 18px; }

/* ---------- Surfaces ---------- */

/* .card é o .k-card (kit.css) com padding próprio, das telas do admin. */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--s-24);
}
.card-lg { padding: var(--s-24); }


.stack { display: flex; flex-direction: column; }
/* flex-direction is explicit (not just the flex default) because a later,
   unscoped `form { flex-direction: column }` rule (meant only for the
   login page's split-screen, see "Auth (login)" below) would otherwise win
   on any .row that happens to be a <form> itself, like the inbox reply
   bar -- .row's higher specificity already beats that rule for every OTHER
   property, this just closes the one gap. */
.row { display: flex; flex-direction: row; align-items: center; }
.spacer { flex: 1; }

/* ---------- Chips, pills, badges ---------- */

.chip {
  display: inline-flex; align-items: center; gap: var(--s-8);
  padding: var(--s-8) var(--s-16); border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line);
  color: var(--muted); font-family: inherit; font-size: var(--fs-sm); font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }

/* Rounded answer buttons in the onboarding dialogue. */
.pill {
  display: inline-flex; align-items: center;
  padding: var(--s-12) var(--s-16); border-radius: var(--r-full);
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); font-family: inherit; font-size: var(--fs-md); font-weight: 600;
  cursor: pointer;
}
.pill:hover { border-color: var(--line-strong); color: var(--ink); }

/* Selo: um desenho só, o do tuc-badge do Tucano (pílula de 12px). .badge
   e .badge-* são o mesmo selo com outro nome, de telas mais antigas -- use
   tuc-badge (is-success/is-warning/is-danger/is-info) no que for novo. */
.badge {
  display: inline-flex; align-items: center; gap: var(--s-8);
  padding: var(--s-4) var(--s-8); border-radius: var(--r-xs);
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  font-size: var(--fs-xs); font-weight: 600; line-height: var(--lh-base); white-space: nowrap;
}
.badge-ok { background: var(--ok-wash); color: var(--ok-ink); border-color: transparent; }
.badge-warn { background: var(--warn-wash); color: var(--warn-ink); border-color: transparent; }
.badge-brand { background: var(--brand-wash); color: var(--brand-ink); border-color: transparent; }
.badge-pink { background: var(--pink-wash); color: var(--pink); border-color: transparent; }

/* ---------- Type helpers ---------- */

/* Papéis de texto: todo texto do painel é um destes, e as classes de
   componente (cartão, linha, balão) cuidam só do layout. Para uma tela
   nova: título t-title, título de cartão t-heading, texto t-body, nome ou
   item t-strong, rótulo de campo t-label, apoio t-sm, legenda t-xs,
   rótulo de seção t-eyebrow, código t-mono; cor com t-brand/t-ok/t-danger.
   t-strong também serve de modificador: "t-sm t-strong" é apoio em
   negrito (por isso o tamanho dele vem antes de t-sm/t-xs, e o peso e a
   cor depois). */
.t-body { font-size: var(--fs-md); line-height: var(--lh-base); color: var(--ink); }
.t-strong { font-size: var(--fs-md); }
.t-title { font-size: var(--fs-xl); font-weight: 700; line-height: var(--lh-tight); letter-spacing: -.02em; color: var(--ink); }
.t-heading { font-size: var(--fs-lg); font-weight: 700; line-height: var(--lh-tight); color: var(--ink); }
.t-label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.t-sm { font-size: var(--fs-sm); line-height: var(--lh-base); color: var(--muted); }
.t-xs { font-size: var(--fs-xs); line-height: var(--lh-base); color: var(--muted); }
.t-eyebrow { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.t-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--fs-xs); }
.t-strong { font-weight: 600; color: var(--ink); }
.t-brand { color: var(--brand); }
.t-ok { color: var(--ok-ink); }
.t-danger { color: var(--danger); }

.clamp-2 {
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Form controls ---------- */

.field { display: flex; flex-direction: column; gap: var(--s-8); }
/* Rótulo e dica de campo com a mesma cara do tuc-label/tuc-hint do Tucano:
   um rótulo só no painel, escrito de um jeito ou de outro. */
.field > label, .field > .t-label, .tuc-label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }

.input, .textarea, .select {
  width: 100%;
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 0 var(--s-16); height: 46px;
  background: var(--surface); color: var(--ink);
  font-family: inherit; font-size: var(--fs-md);
  outline: none;
}
.textarea { height: 76px; padding: var(--s-12) var(--s-16); resize: none; line-height: var(--lh-base); }
.input:focus, .textarea:focus, .select:focus { border-color: var(--brand); background: var(--surface); }
.input-sm { height: 40px; border-radius: var(--r-md); font-size: var(--fs-sm); padding: 0 var(--s-12); }

.hint, .tuc-hint { font-size: var(--fs-xs); line-height: var(--lh-base); color: var(--muted); }

/* Toggle — presentational; add .toggle-on for the active state. */
.toggle {
  width: 38px; height: 22px; flex-shrink: 0;
  border-radius: var(--r-full); background: var(--line);
  display: flex; align-items: center; padding: var(--s-4);
  border: none; cursor: pointer;
  transition: background .15s;
}
.toggle span { width: 16px; height: 16px; border-radius: 50%; background: var(--surface); transition: transform .15s; }

/* Segmented control (Mês / Semana / Lista). */
.seg {
  display: flex; gap: var(--s-4); padding: var(--s-4);
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
}
.seg > * {
  padding: var(--s-8) var(--s-16); border-radius: var(--r-sm); border: none; background: transparent;
  font-family: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--muted);
  cursor: pointer;
}
.seg > .is-on {
  background: var(--surface); color: var(--ink); font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.seg > [disabled] { opacity: .5; cursor: not-allowed; }

/* Radio card — the two "how posts go out" options in Automação. */
.pick {
  flex: 1; display: flex; flex-direction: column; gap: var(--s-8);
  border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-16);
  background: var(--surface); cursor: pointer;
}

.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick:has(input:checked) { border: 2px solid var(--brand); padding: var(--s-16); background: var(--brand-wash); }

/* ---------- App shell ---------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px; flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: var(--s-24);
  padding: var(--s-24) var(--s-16);
  position: sticky; top: 0; height: 100vh;
}
.sidebar .logo {
  display: flex; align-items: center; gap: var(--s-8); padding: 0 var(--s-8);
  font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.03em; color: var(--ink);
}
.sidebar .logo { min-height: 32px; }
.sidebar .logo .brand-logo { height: 24px; }
/* The logotype (brand.templ): each spot sets only its height, the width
   follows the drawing. Dark letters on light, white on dark, and .is-white
   always white. */
.brand-logo { display: inline-flex; flex: none; }
.brand-logo img { height: 100%; width: auto; display: block; }
.brand-logo .brand-logo-white { display: none; }
[data-theme="dark"] .brand-logo .brand-logo-ink, .brand-logo.is-white .brand-logo-ink { display: none; }
[data-theme="dark"] .brand-logo .brand-logo-white, .brand-logo.is-white .brand-logo-white { display: block; }
.sidebar .nav { display: flex; flex-direction: column; gap: var(--s-4); }
.sidebar .nav:not(.nav-foot) { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -4px; padding: 0 var(--s-4); }
/* Conexões, no pé da barra (layout.templ sidebar). */
.sidebar .nav-foot { padding-top: var(--s-12); border-top: 1px solid var(--line); }
/* Rótulo de grupo da lateral: separa "Fluxos" de "Postagens automáticas".
   O primeiro não leva margem em cima porque já vem colado no botão de criar. */
.sidebar .nav-group {
  margin: var(--s-16) 0 var(--s-8); padding: 0 var(--s-12);
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--faint);
}
.sidebar .nav-group:first-child { margin-top: 0; }
.sidebar .nav a {
  display: flex; align-items: center; gap: var(--s-12);
  height: 38px; padding: 0 var(--s-12); border-radius: var(--r-sm); flex-shrink: 0;
  font-size: var(--fs-md); font-weight: 600; color: var(--muted);
}
/* O hover era a mesma cor do item aberto, e com o mouse em cima de outro
   pareciam dois abertos ao mesmo tempo -- agora o hover é só um tom neutro;
   a cor da marca fica pro item da página aberta. */
.sidebar .nav a:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink); }
.sidebar .nav a.is-on { background: var(--brand-wash); color: var(--brand-ink); font-weight: 700; }
/* An area the company's plan doesn't include (layout.templ navItemPlan). */
.sidebar .nav a.nav-locked { color: var(--muted); }
.sidebar .nav a.nav-locked .nav-lock { display: inline-flex; }
.sidebar .nav a.nav-locked .nav-lock svg { width: 14px; height: 14px; }
.sidebar .nav .count {
  min-width: 20px; height: 20px; padding: 0 var(--s-8); border-radius: var(--r-full);
  background: var(--pink); color: var(--ink-invert-fg); font-size: var(--fs-xs); font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

.sidebar .account {
  display: flex; align-items: center; gap: var(--s-8);
  padding: var(--s-8); border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--surface); width: 100%; font-family: inherit; text-align: left; cursor: pointer;
}
.sidebar .account:hover { background: var(--surface); }
/* Avatar: quadrado arredondado, como todo ladrilho do painel. Sem foto,
   as iniciais no tom da marca. Com o canal (channelAvatar, inbox.templ),
   um ladrilho pequeno com o logo do canal no canto de baixo. */
.avatar {
  width: 32px; height: 32px; border-radius: var(--r-sm); flex-shrink: 0;
  background: var(--brand-wash); color: var(--brand-ink);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-xs); font-weight: 700;
}
.avatar-lg { width: 40px; height: 40px; font-size: var(--fs-sm); }
.avatar-xl { width: 64px; height: 64px; border-radius: var(--r-md); font-size: var(--fs-xl); }
.avatar-square { border-radius: var(--r-sm); }
.av { position: relative; display: inline-flex; flex: none; align-self: flex-start; height: max-content; }
.av-ch {
  position: absolute; right: -4px; bottom: -4px; display: flex;
  width: 16px; height: 16px; border-radius: 5px; overflow: hidden;
  box-shadow: 0 0 0 2px var(--surface);
}
.av-ch .n-chip { width: 100%; height: 100%; border-radius: inherit; }
.av-ch .n-chip > svg { width: 10px; height: 10px; }
.av-ch .chip-badge { display: none; }
.av:has(.avatar-lg) .av-ch { width: 18px; height: 18px; }
.av:has(.avatar-lg) .av-ch .n-chip > svg { width: 11px; height: 11px; }
.av:has(.avatar-xl) .av-ch { width: 24px; height: 24px; border-radius: 7px; right: -5px; bottom: -5px; }
.av:has(.avatar-xl) .av-ch .n-chip > svg { width: 14px; height: 14px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 72px; flex-shrink: 0;
  background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: var(--s-16); padding: 0 var(--s-32);
  position: sticky; top: 0; z-index: 5;
}
.content { flex: 1; padding: var(--s-24) var(--s-32); display: flex; flex-direction: column; gap: var(--s-16); min-width: 0; }

/* Hambúrguer (abre o sidebar off-canvas) e o fundo escuro atrás dele --
   os dois só existem no celular (≤860px abaixo); no desktop o sidebar já
   fica sempre visível do lado, sem os dois nem precisarem renderizar. */
.sidebar-toggle-btn { display: none; }
.sidebar-backdrop { display: none; }

.messages { display: flex; flex-direction: column; gap: var(--s-8); }
.msg { padding: var(--s-12) var(--s-16); border-radius: var(--r-md); font-size: var(--fs-md); border: 1px solid transparent; }
.msg.success { background: var(--ok-wash); border-color: transparent; color: var(--ok-ink); }
.msg.error { background: var(--danger-wash); border-color: transparent; color: var(--danger-ink); }
.msg.warning { background: var(--warn-wash); border-color: transparent; color: var(--warn-ink); }
.msg.info { background: var(--info-wash); border-color: transparent; color: var(--info-ink); }

.stat { display: flex; flex-direction: column; gap: var(--s-8); }

.stat .delta { padding: var(--s-4) var(--s-8); border-radius: var(--r-sm); font-size: var(--fs-xs); font-weight: 700; }

/* Weekly reach bars. The height is definite, not flexed: the bars size
   themselves as a percentage of it, and percentages need something to measure
   against. */
.bars { height: 150px; display: flex; align-items: flex-end; gap: var(--s-16); padding-bottom: var(--s-24); position: relative; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.bars .bar i { display: block; width: 100%; max-width: 54px; border-radius: var(--r-sm) var(--r-sm) var(--r-sm) var(--r-sm); background: var(--brand-wash); }
.bars .bar.is-on i { background: var(--brand); }
.bars .bar span { position: absolute; bottom: 0; font-size: var(--fs-xs); color: var(--faint); }

.legend { display: flex; align-items: center; gap: var(--s-8); font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.legend i { width: 9px; height: 9px; border-radius: var(--r-sm); display: block; }

.dot { width: 9px; height: 9px; border-radius: var(--r-sm); flex-shrink: 0; display: block; }

/* ---------- Slide previews ----------
   Slides render at 1080x1350 inside an iframe and are scaled down to fit. */

.frame { position: relative; overflow: hidden; border-radius: var(--r-md); background: #000; flex: none; }
.frame iframe { border: 0; width: 1080px; height: 1350px; transform-origin: 0 0; display: block; pointer-events: none; }

.frame.thumb { width: 104px; height: 130px; }
.frame.thumb iframe { transform: scale(.09630); }

.frame.preview { width: 392px; height: 490px; border-radius: var(--r-md); box-shadow: var(--shadow-lg); }
.frame.preview iframe { transform: scale(.36296); }

.empty {
  flex: 1; border: 1px dashed var(--line); border-radius: var(--r-md);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--s-8); padding: var(--s-32); text-align: center; min-height: 180px;
}

/* Dressed-up first-run empty state: icon badge + heading + CTA, for a list
   that's empty because nothing was created yet (not "no results match"). */
.empty-hero {
  border: 1px dashed var(--line); border-radius: var(--r-md); background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--s-8); padding: 56px var(--s-32); text-align: center; min-height: 260px;
}
.empty-hero .empty-icon {
  width: 56px; height: 56px; border-radius: var(--r-md);
  background: var(--surface); color: var(--faint);
  display: flex; align-items: center; justify-content: center;
}
.empty-hero .empty-icon svg { width: 26px; height: 26px; }
.empty-hero .t-strong { font-size: var(--fs-lg); }
.empty-hero .t-sm { color: var(--muted); max-width: 42ch; }

.check {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: var(--brand-wash); color: var(--brand);
  font-size: var(--fs-xs); font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* AI dialogue bubbles. */
.say { display: flex; gap: var(--s-16); align-items: flex-start; }
.say .who {
  width: 34px; height: 34px; border-radius: var(--r-md); flex-shrink: 0;
  background: var(--brand-wash); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: var(--fs-lg);
}
.say .bubble {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); border-top-left-radius: 6px;
  padding: var(--s-16) var(--s-24); font-size: var(--fs-lg); line-height: var(--lh-base); color: var(--ink);
  text-wrap: pretty;
}

.swatch {
  flex: 1; display: flex; align-items: center; gap: var(--s-8);
  border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-8) var(--s-12);
  background: var(--surface); cursor: pointer;
}
.swatch i { width: 26px; height: 26px; border-radius: var(--r-sm); display: block; border: 1px solid var(--line); }

.swatch input[type="color"] { position: absolute; opacity: 0; width: 0; height: 0; }

/* ---------- Editor (screen 07) ---------- */

.ed { height: 100vh; display: flex; flex-direction: column; background: var(--bg); }

/* Overflow menu on a card. */
.menu { position: relative; }
.menu-pop {
  position: absolute; right: 0; top: 36px; z-index: 20; min-width: 168px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: var(--s-8); display: none; flex-direction: column;
}
.menu[open] .menu-pop, .menu.is-open .menu-pop { display: flex; }
.menu-pop button, .menu-pop a {
  display: block; width: 100%; text-align: left;
  padding: var(--s-8) var(--s-8); border: none; border-radius: var(--r-sm); background: none;
  font-family: inherit; font-size: var(--fs-sm); font-weight: 600; color: var(--ink); cursor: pointer;
}
.menu-pop button:hover, .menu-pop a:hover { background: var(--surface); color: var(--ink); }
.menu-pop .is-danger { color: var(--danger); }
.menu-pop .is-danger:hover { background: var(--danger-wash); }

/* ---------- Colour picker ----------
   Replaces the OS dialog, which cannot be styled. Driven by
   static/js/color-picker.js; the <input type="color"> stays the source of
   truth. */

.cp {
  position: fixed; z-index: 200; width: 236px;
  display: flex; flex-direction: column; gap: var(--s-12); padding: var(--s-12);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
}
.cp[hidden] { display: none; }

.cp-presets { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--s-8); }

/* ---------- Narrow screens ----------
   The design is drawn at 1440x900. Below that the shell keeps working: the
   sidebar collapses to icons and the widest grids drop to fewer columns. */

@media (max-width: 1080px) {
  
  .split { grid-template-columns: 1fr !important; }
}
@media (max-width: 860px) {
  /* Off-canvas: escondido fora da tela à esquerda por padrão, desliza por
     cima do conteúdo quando .is-open (sidebar-toggle-btn, layout.templ) --
     pedido explícito do usuário ("faz ele como o off-canvas", com um
     ícone de menu do lado oposto ao avatar da conta). position:fixed tira
     o sidebar do fluxo do .shell (flex), então .main já ocupa a largura
     toda sozinho sem precisar de nenhum ajuste nele -- e como é um overlay
     com espaço de sobra, mostra os rótulos por extenso de novo em vez do
     rail só-ícone que tinha antes aqui. */
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; width: 264px;
    z-index: 200; transform: translateX(-100%);
    transition: transform .22s cubic-bezier(.16, 1, .3, 1);
    box-shadow: 0 0 0 1px var(--line);
  }
  .sidebar.is-open { transform: translateX(0); }
  .sidebar-toggle-btn { display: inline-flex; }
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; z-index: 190;
    background: rgba(14, 14, 17, .4); opacity: 0; pointer-events: none;
    transition: opacity .22s ease;
  }
  .sidebar-backdrop.is-open { opacity: 1; pointer-events: auto; }
  .topbar { padding: 0 var(--s-16); }
  .content { padding: var(--s-16) var(--s-16); }
  
}

/* Celular de verdade (~360-430px), não só "janela estreita": o rail de
   72px do sidebar já sobra pouco espaço pro conteúdo (~280-320px numa tela
   de 390px). .flow-grid/.conn-grid/.channel-grid (flows.css) têm o mesmo
   problema e a mesma solução, mas moram lá -- juntar as duas media queries
   aqui não funcionaria: flows.css carrega DEPOIS deste arquivo (seu <link>
   fica dentro do <main>, não no <head>), então uma regra daqui perderia
   pra base delas por ordem, não por especificidade (achei isso ao vivo). */
@media (max-width: 640px) {
  
  /* Hambúrguer + título + avatar da conta ficam numa linha só (o spacer do
     título, flex:1, sozinho já empurra o avatar pra ponta -- não precisa de
     justify-content pra isso). O botão "Novo X" (flows/boards/campaigns/
     templates -- sempre filho direto de .topbar, do lado do spacer) ganha
     sua PRÓPRIA linha cheia embaixo dessa -- pedido ao vivo com print,
     comparando com o corte que tinha antes ("Novo fluxo" saindo da tela).
     order:10 tira ele do fluxo natural do DOM (ele vem ANTES do avatar no
     HTML) pra ele sempre desenhar depois do resto da primeira linha, e
     flex-basis:100% obriga a própria linha por ocupar 100% da largura
     sozinho -- ninguém mais cabe do lado de um item que pede 100%. */
  .topbar { height: auto; min-height: 72px; flex-wrap: wrap; row-gap: var(--s-8); padding: var(--s-16) var(--s-16); }
  /* .is-dark aqui de propósito, não .tuc-btn sozinho -- o editor de fluxo
     (flowsEditorTopbar) também põe vários tuc-btn direto no topbar
     (Editar fluxo/Ver execuções/Excluir/Publicar, todos is-outline ou
     is-danger/is-ok, nenhum is-dark) e essa regra pegava eles também,
     empilhando cada um numa linha cheia própria (achei ao vivo testando
     o editor -- só o botão "Novo X" das listas é is-dark, então isso
     já basta pra separar os dois casos). O tamanho padrão do Tucano
     (~46px, 1rem) pesa muito esticado 100% da largura -- lado a lado com
     o resto da tela (cards com título de 15px, tipo "Trabalhos") ele lia
     grande demais (pedido ao vivo, comparando print). Mesma altura do
     is-md (a variante própria do app pra isso, ver "Tucano button size:
     md" mais abaixo) e fonte reduzida pra 15px, igualando o peso visual
     do resto da tela em vez do 1rem base. */
  .topbar > .tuc-btn.is-dark { order: 10; flex-basis: 100%; width: 100%; justify-content: center; height: 2.5rem; font-size: var(--fs-lg); }
}

/* ---------- Auth (login) split-screen -- ported from publicapost's account/base.html inline styles ---------- */
  body { margin: 0; }
  /* Fixed to the viewport, not min-height: each column scrolls on its own
     when its content is taller than the screen, instead of the whole page
     scrolling and dragging the decorative right panel along with it. */
  .auth-shell { display: grid; grid-template-columns: 1fr 1fr; height: 100vh; background: var(--surface); }

  /* One centered block, not three independently-positioned pieces: the logo,
     the form and the legal footer all live inside .auth-inner and share its
     width, so they share its edges too. .auth-left just centers that block,
     both axes — on both a tall screen and a very wide one, it reads as one
     composed unit instead of bits pinned to different edges. */
  .auth-left { height: 100%; overflow-y: auto; display: flex; align-items: center; justify-content: center; padding: 48px var(--s-24); }

  /* The "transition between screens": since these are full page loads, not an
     SPA, this plays on every load instead — only on the inputs side, never
     on the decorative right panel. */
  @keyframes authSlideUp {
    from { opacity: 0; transform: translateY(28px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .auth-inner {
    width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: var(--s-32);
    animation: authSlideUp .5s cubic-bezier(.16, 1, .3, 1);
  }

  .auth-brand { display: flex; align-items: center; gap: var(--s-8); color: var(--ink); }
  .auth-brand .brand-logo { height: 28px; }

  

  

  .auth-form-wrap { display: flex; flex-direction: column; gap: var(--s-32); }
  .auth-form-wrap h1 { margin: 0; font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.035em; color: var(--ink); line-height: 1.1; }
  .auth-form-wrap .sub { margin: 0; font-size: var(--fs-lg); color: var(--muted); line-height: var(--lh-base); }

  {{/* These used to be bare `form`/`form button[type=submit]` selectors
       with no scope at all -- copied from a Django/allauth project (see the
       comments below) where the only forms on the page happened to be auth
       forms, so it never mattered there. In this app EVERY page's forms
       matched them too: found live when the flow editor's Publicar/Pausar
       button (a <button type="submit"> like any other form here) rendered
       with no border and invisible white-on-white text -- this rule's
       `border:none`/`color:#fff` were winning that fight against
       .tuc-btn/.tuc-btn.is-outline on specificity for those two specific
       properties, even though .is-outline's own (more specific)
       `background` rule won and looked normal. Scoping to .auth-shell (the
       login page's own wrapper, the only page that uses these bare
       selectors) keeps the login page exactly as it was without leaking
       into every other form in the app. */}}
  /* allauth renders its form as <p> blocks — style those directly. */
  .auth-shell form { display: flex; flex-direction: column; gap: var(--s-16); }
  /* O seletor de idioma também é um <form>: sem isto ele virava coluna da
     largura toda, com PT, EN e ES um embaixo do outro. */
  .auth-shell form.tuc-btn-group { display: inline-flex; flex-direction: row; gap: 2px; }
  .auth-shell form p { margin: 0; display: flex; flex-direction: column; gap: var(--s-8); }
  .auth-shell form label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
  .auth-shell form input[type=text], .auth-shell form input[type=email], .auth-shell form input[type=password] {
    height: 48px; padding: 0 var(--s-16);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
    color: var(--ink); font-family: inherit; font-size: var(--fs-lg); outline: none;
  }
  .auth-shell form input:focus { border-color: var(--brand); background: var(--surface); box-shadow: var(--ring); }

  .btn { width: 100%; height: 52px; border-radius: var(--r-md); font-size: var(--fs-lg); }
  /* allauth's own account pages (password reset, email confirm…) render a
     bare <button>, with no class of ours to hook — style it to match .btn-dark. */
  .auth-shell form button[type=submit] {
    width: 100%; height: 52px; border: none; border-radius: var(--r-md);
    display: inline-flex; align-items: center; justify-content: center; gap: var(--s-8);
    background: var(--tuc-accent); color: var(--tuc-accent-fg);
    font-family: inherit; font-size: var(--fs-lg); font-weight: 700; cursor: pointer;
  }
  .auth-shell form button[type=submit]:hover { filter: brightness(.85); }

  .divider { display: flex; align-items: center; gap: var(--s-12); font-size: var(--fs-xs); font-weight: 600; color: var(--faint); letter-spacing: .04em; text-transform: uppercase; }
  .divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

  .alt { margin: 0; font-size: var(--fs-md); color: var(--muted); text-align: center; }
  .alt a { font-weight: 700; }
  
  
  

  /* Right panel: the brand art (authArtPanel, login.templ) on a dark panel.
     Fixo, NUNCA inverte com o tema (diferente de --ink-invert): é arte de marca,
     não um botão -- testado ao vivo nos dois temas, escuro sempre ficou certo. */
  .auth-right {
    height: 100%; position: relative; overflow: hidden; background: #0E0E11;
    display: flex; flex-direction: column; justify-content: flex-end; padding: 56px; gap: var(--s-32);
  }
  .auth-copy { position: relative; display: flex; flex-direction: column; gap: var(--s-16); max-width: 460px; }
  .auth-copy h2 { margin: 0; font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.03em; color: #fff; line-height: var(--lh-tight); }
  .auth-copy p { margin: 0; font-size: var(--fs-lg); line-height: var(--lh-base); color: rgba(255, 255, 255, .6); }

  /* Login: the brand art (static/brand/login-art.webp) with the copy right
     under it, the pair centered in the panel. The art's edges aren't one flat
     color, so they fade into the panel's own dark. */
  .auth-right.is-art { background: #070709; justify-content: center; align-items: center; gap: var(--s-4); padding: var(--s-32) 48px; }
  .auth-art { width: 100%; max-width: 680px; }
  .auth-art img {
    display: block; width: 100%; height: auto; max-height: calc(100vh - 260px); object-fit: contain;
    --fade: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent), linear-gradient(to bottom, transparent, #000 6%, #000 85%, transparent);
    -webkit-mask-image: var(--fade); -webkit-mask-composite: source-in;
    mask-image: var(--fade); mask-composite: intersect;
  }
  .auth-right.is-art .auth-copy { width: 100%; max-width: 680px; padding: 0 var(--s-32); gap: var(--s-12); text-align: left; }
  .auth-right.is-art .auth-copy h2 { font-size: var(--fs-2xl); line-height: var(--lh-tight); max-width: 440px; text-wrap: balance; }
  .auth-right.is-art .auth-copy p { max-width: 440px; font-size: var(--fs-lg); color: rgba(255, 255, 255, .62); text-wrap: pretty; }

  

  

  
  

  @media (max-width: 900px) {
    /* No second column to protect from the scroll below — let the page
       scroll normally instead of nesting a nested-scroll region. */
    .auth-shell { grid-template-columns: 1fr; height: auto; min-height: 100vh; }
    .auth-right { display: none; }
    .auth-left { height: auto; overflow: visible; padding: var(--s-32) var(--s-24); }
  }

/* ---------- Tucano theme override ----------
   Tucano (internal/web/static/tucano.min.css/.js) owns interactive-component
   behavior (validation, toast, reveal, dropdowns...) -- this project owns
   the look. Per Tucano's own docs: never style its internal .tuc-*__*
   classes directly, override its --tuc-* tokens instead. Mapped from the
   publicapost palette above, not new colors. */
:root {
  --tuc-accent: var(--brand);
  --tuc-accent-hover: var(--brand-ink);
  --tuc-accent-fg: #fff;
  --tuc-accent-text: var(--brand);
  --tuc-accent-soft: var(--brand-wash);
  --tuc-danger: var(--danger);
  --tuc-danger-soft: var(--danger-wash);
  --tuc-danger-fill: var(--danger);
  --tuc-success: var(--ok);
  --tuc-success-soft: var(--ok-wash);
  --tuc-warning: var(--warn);
  --tuc-warning-soft: var(--warn-wash);
  --tuc-info: var(--info);
  --tuc-info-soft: var(--info-wash);
  --tuc-bg: var(--surface);
  --tuc-fg: var(--ink);
  --tuc-muted: var(--muted);
  --tuc-border: var(--line);
  /* Os tons de apoio do Tucano também, senão o escuro dele (cinzas neutros,
     fora da paleta) aparece no hover de menu, no cabeçalho de tabela e no
     texto apagado. */
  --tuc-subtle: var(--faint);
  --tuc-hover: var(--canvas);
  --tuc-elevated: var(--bg);
  --tuc-thumb: var(--surface);
  --tuc-radius: var(--r-md);
  --tuc-radius-md: var(--r-md);
  --tuc-control-height: 40px;
  --tuc-font: 'Plus Jakarta Sans', system-ui, sans-serif;
}
/* No escuro --canvas e --bg ficam abaixo de --surface (são as áreas
   recuadas), então o hover precisa de um passo mais claro que o cartão. */
[data-theme="dark"] {
  --tuc-hover: var(--line);
  --tuc-elevated: var(--canvas);
}

/* ---------- Tucano button variant: dark ----------
   Tucano ships is-primary/is-outline/is-ghost/is-danger/is-link -- no dark
   variant. publicapost's own login used a black button (.btn-dark) for the
   primary CTA specifically, distinct from the brand-purple accent used
   elsewhere. Adding this as a new modifier alongside .tuc-btn (not
   overriding Tucano's own classes) keeps Tucano's interactive behavior
   (hover, focus ring, aria-busy spinner) while getting this one color right. */
.tuc-btn.is-dark {
  background: var(--tuc-accent); border-color: var(--tuc-accent); color: var(--tuc-accent-fg);
}
.tuc-btn.is-dark:hover { background: var(--tuc-accent-hover); border-color: var(--tuc-accent-hover); color: var(--tuc-accent-fg); }

/* ---------- Tucano button variant: ok (green) ----------
   Same reasoning as is-dark above: Tucano has is-danger (red) built in, no
   green counterpart. Used on the flow editor's Publicar/Pausar button
   (flows_editor.templ) -- Publicar in green (is-ok), Pausar in Tucano's own
   red is-danger, so the colour itself says which way the button goes,
   not just the word. */
.tuc-btn.is-ok {
  background: var(--ok); border-color: var(--ok); color: var(--ink-invert-fg);
}
.tuc-btn.is-ok:hover { background: var(--ok-ink); border-color: var(--ok-ink); color: var(--ink-invert-fg); }
/* Tucano writes white on its red button; in the dark theme --danger is a
   light red (it has to read as text on the page), and white on it doesn't
   read -- the "botão preto" text pair flips with the theme instead. */
.tuc-btn.is-danger { color: var(--ink-invert-fg); }

/* ---------- Escolha única com tuc-check ----------
   O painel usa a caixa (tuc-check) também para escolher um entre vários
   (rádio), sem o tuc-radio. Mas um grupo de rádios sem nada marcado conta
   como :indeterminate no navegador, e o Tucano desenha o traço de "meio
   marcado" em todos. Aqui ele volta a parecer vazio até alguém escolher. */
input[type="radio"].tuc-check:indeterminate:not(:checked) { background: var(--tuc-bg); border-color: var(--tuc-border); }
input[type="radio"].tuc-check:indeterminate:not(:checked)::after { display: none; }
input[type="radio"].tuc-check:hover:not(:checked):not(:disabled) { border-color: var(--tuc-subtle); }

/* ---------- Utilitários ----------
   Os poucos ajustes de layout que as telas repetem: espaço entre itens
   (gap-*) e acima (mt-*) nos passos da escala, ocupar o resto da linha
   (grow), deixar encolher texto longo (min-0), sem margem (m-0),
   alinhamento e não quebrar linha. Fora destes, o lugar é uma classe do
   kit -- não um style="" na tela. */
.gap-4 { gap: var(--s-4); }
.gap-8 { gap: var(--s-8); }
.gap-12 { gap: var(--s-12); }
.gap-16 { gap: var(--s-16); }
.gap-24 { gap: var(--s-24); }
.mt-4 { margin-top: var(--s-4); }
.mt-8 { margin-top: var(--s-8); }
.mt-12 { margin-top: var(--s-12); }
.mt-16 { margin-top: var(--s-16); }
.mt-24 { margin-top: var(--s-24); }
.grow { flex: 1; }
.min-0 { min-width: 0; }
.m-0 { margin: 0; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.t-muted { color: var(--muted); }

/* O texto de exemplo do editor do Tucano (Novo disparo, Quadros, Templates)
   é um ::before absoluto, mas a área do editor não era posicionada: ele se
   prendia ao modal e ficava parado na tela ao rolar. */
.tuc-editor__area { position: relative; }

/* ---------- Hover de lista ----------
   Linha de tabela e conversa do Inbox acendem e apagam na hora: com a cor
   esmaecendo (o Tucano anima o fundo da linha), passar o mouse rápido
   deixava um rastro de linhas apagando atrás dele, como uma sombra. */
.tuc-table tbody tr, .tuc-table tbody td, .conv-item { transition: none; }

/* ---------- Selo ----------
   Todo selo de status (tuc-badge, .badge) é um retângulo de cantos pouco
   arredondados, como os outros ladrilhos do painel -- não a pílula do
   Tucano. */
.tuc-badge { border-radius: var(--r-xs); }

/* ---------- Controle segmentado ----------
   Um desenho só para as abas (tuc-tabs is-segmented) e os filtros
   (tuc-btn-group is-segmented): o trilho branco com borda do Tucano e a
   opção escolhida na cor da marca -- o mesmo de Métricas. */
/* Sem a transição do Tucano: ao clicar, a opção passava 0,16 s pelo cinza
   do hover antes de ficar laranja (e a página já recarregava no meio). */
.tuc-btn-group.is-segmented > .tuc-btn, .tuc-tabs.is-segmented .tuc-tabs__tab { transition: none; }
.tuc-tabs.is-segmented .tuc-tabs__tab[aria-selected=true] { background: var(--brand); color: #fff; box-shadow: none; }
.tuc-tabs.is-segmented .tuc-tabs__tab[aria-selected=true], .tuc-btn-group.is-segmented > .tuc-btn:has(> .tuc-btn__input:checked) { font-weight: 600; }

/* O <select> que o Tucano esconde atrás da seleção dele tem a classe
   tuc-input, cujo width:100% vencia o 1px do Tucano: escondido e
   absoluto, ele media a largura da página e dava rolagem para o lado em
   qualquer tela com seleção (já tinha sido remendado tela a tela). */
select.tuc-input.tuc-select-native { width: 1px; height: 1px; }

/* ---------- Tamanhos de botão e campo ----------
   Botão, campo e seleção andam juntos: três alturas, com o mesmo nome nos
   três, para que um botão fique sempre do tamanho do campo ao lado.
     (padrão) 40px  o médio: use sempre que der
     is-sm 32px  só onde o médio não cabe -- botão só de ícone (fechar,
                 menu), ação dentro de linha de tabela, link no meio de
                 um texto
     is-lg 48px  a ação única de uma tela de entrada
   O Tucano tira a altura dos três de --tuc-control-height, então o tamanho
   é só essa variável. A seleção do Tucano é desenhada logo depois do
   <select>, por isso o "select.is-sm + .tuc-select". */
.tuc-btn.is-sm, .tuc-input.is-sm, select.is-sm + .tuc-select { --tuc-control-height: 32px; font-size: var(--fs-sm); }
.tuc-btn.is-lg, .tuc-input.is-lg, select.is-lg + .tuc-select { --tuc-control-height: 48px; }
.tuc-btn { font-size: var(--fs-md); }
.tuc-btn.is-sm { height: var(--tuc-control-height); padding-inline: var(--s-12); border-radius: var(--r-sm); }
.tuc-btn.is-lg { height: var(--tuc-control-height); padding-inline: var(--s-16); }
.tuc-btn.is-md { height: var(--tuc-control-height); }

/* ---------- Account chip (topbar, right corner) ----------
   Moved out of the sidebar footer. margin-left:auto keeps it on the right
   even on pages whose custom topbar has no .spacer of its own. */
.user-menu { margin-left: auto; flex-shrink: 0; }
/* 16px = the avatar's own 9px radius + this padding's 6px -- concentric with
   .avatar-square instead of a full pill wrapped around a square corner
   (reported live: the two radii didn't match). */
.user-chip {
  display: flex; align-items: center; gap: var(--s-8);
  padding: var(--s-8) var(--s-12) var(--s-8) var(--s-8); border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--surface); font-family: inherit; text-align: left; cursor: pointer;
}
.user-chip:hover { background: var(--surface); }
.user-chip .uc-who { display: flex; flex-direction: column; min-width: 0; max-width: 160px; }
.user-chip .uc-name { font-size: var(--fs-sm); font-weight: 700; color: var(--ink); line-height: var(--lh-tight); }

.user-chip .uc-caret { color: var(--faint); font-size: var(--fs-xs); }
@media (max-width: 640px) { .user-chip .uc-who, .user-chip .uc-caret { display: none; } .user-chip { padding: var(--s-4); } }

/* The subscription line over every page (layout.templ planBanner). */
.plan-banner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-12); padding: var(--s-8) var(--s-16); margin-bottom: var(--s-16); border-radius: var(--r-md); font-size: var(--fs-sm); font-weight: 600; }
.plan-banner.is-brand { background: var(--brand-wash); color: var(--brand-ink); }
.plan-banner.is-warn { background: var(--warn-wash); color: var(--warn); }
.plan-banner.is-danger { background: var(--danger-wash); color: var(--danger-ink); }

/* A <form> between a Tucano modal's panel and its header/body/footer (the
   panel also holds a second, separate form): it takes the panel's column
   layout, so the body scrolls inside the panel's max height instead of the
   content running off the bottom of the screen. */
.tuc-modal__form { display: flex; flex-direction: column; gap: calc(var(--spacing, .25rem) * 4); flex: 1 1 auto; min-height: 0; }

/* Account menu (layout.templ accountMenu). Tucano draws the panel and the
   items; this is only the layout of what isn't an item: the header, the
   plan block and the switch rows. --acct-inset is Tucano's own item
   padding and icon gap, so the switch rows line up with the items. */
.acct-pop {
  --acct-inset: calc(var(--spacing, .25rem) * 2.5);
  width: calc(var(--s-32) * 9); max-width: calc(100vw - var(--s-32));
}
.acct-head { display: flex; align-items: center; gap: var(--s-12); padding: var(--s-8) var(--acct-inset); }
.acct-plan {
  display: flex; flex-direction: column; gap: var(--s-8);
  margin: var(--s-4); padding: var(--s-12); border-radius: var(--r-sm);
  background: var(--canvas); color: var(--ink); text-decoration: none;
}
.acct-plan.is-link:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.acct-plan .k-progress { background: var(--line); }
.acct-plan-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-8); min-width: 0; }
.acct-plan-row .tuc-badge { max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-group { margin: 0; padding: var(--s-8) var(--acct-inset) var(--s-4); }
.acct-pref { display: flex; flex-direction: column; gap: var(--s-4); padding-bottom: var(--s-4); }
.acct-pref-main {
  display: flex; align-items: center; gap: var(--acct-inset);
  padding: var(--s-8) var(--acct-inset); border-radius: var(--r-sm); cursor: pointer;
}
.acct-pref-main:hover { background: var(--canvas); }
/* The hint and the button start under the label, past the icon. */
img.avatar { object-fit: cover; }

/* Suaviza navegacoes de pagina inteira: o conteudo novo sobe poucos pixels,
   enquanto a barra lateral fica no lugar. Trocas htmx nao participam. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }

  .shell > .main > .content { view-transition-name: lobot-content; }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation-duration: 140ms;
    animation-timing-function: ease-in-out;
  }

  ::view-transition-old(lobot-content) {
    animation: 100ms ease-in both lobot-content-out;
  }

  ::view-transition-new(lobot-content) {
    animation: 180ms cubic-bezier(.2, .8, .2, 1) both lobot-content-in;
  }

  /* No Inbox, mantem apenas o fade usado antes do movimento vertical. */
  html:has(.shell.is-inbox)::view-transition-new(lobot-content) {
    animation: 180ms ease-in-out both lobot-content-fade-in;
  }

  @keyframes lobot-content-out {
    to { opacity: 0; }
  }

  @keyframes lobot-content-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }

  @keyframes lobot-content-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

/* Error page (error_page.templ): one centered card, the code big in the
   brand color, plain words and a way out. */
.err-shell { min-height: 100vh; display: grid; place-items: center; padding: var(--s-32) var(--s-16); background: var(--bg); }
.err-card { width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: var(--s-12); }
.err-brand { display: inline-flex; align-items: center; gap: var(--s-8); margin-bottom: var(--s-32); font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.03em; color: var(--ink); }
.err-brand .brand-logo { height: 26px; }
.err-code { margin: 0; font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.05em; line-height: 1; color: var(--brand); }
.err-card h1 { margin: 0; font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.err-text { margin: 0; font-size: var(--fs-lg); line-height: var(--lh-base); color: var(--muted); }
.err-detail { margin: 0; padding: var(--s-8) var(--s-16); border-radius: var(--r-sm); background: var(--brand-wash); color: var(--brand-ink); font-size: var(--fs-md); line-height: var(--lh-base); }
.err-actions { display: flex; gap: var(--s-8); flex-wrap: wrap; margin-top: var(--s-12); }
/* Meu perfil (profile.templ): a foto e os botões descem de linha no celular. */
.profile-photo, .profile-photo-actions { flex-wrap: wrap; }
