/* Tok Home: a página inicial (inicio.html) e a tela de entrar, no guia da família (design/tokens.css e as pranchas
   02-app-mobile e 03-paineis-desktop): fundo creme, verde-pinho como cor da marca, cartão principal de 28 px, interno
   de 18 px, botões em cápsula, alvo de toque de 44 px, Bricolage Grotesque nos títulos e Inter no texto (com o
   fallback do sistema). Tudo com o prefixo th-, para não esbarrar nas folhas das telas antigas. Desenhado a partir de
   393 px (celular) e 1440 px (desktop). */
:root{--th-suave:#6c665c;--th-ok:#2f7d5b;--th-ok-fundo:#e3f1e9;--th-atencao:#9a5b12;--th-atencao-fundo:#fbecd6;--th-sombra:0 1px 2px #211e1a0d,0 8px 24px #211e1a0f;
  --th-ambar:#f4ba66;color:var(--tok-text);font-family:var(--tok-font-body);font-size:16px;line-height:1.5}
*{box-sizing:border-box}
body{margin:0;background:var(--tok-bg)}
h1,h2,h3,h4,p{margin:0}
h1,h2,h3,.th-marca{font-family:var(--tok-font-display);letter-spacing:-.02em}
.th-principal a{color:var(--tok-brand)}  /* só no conteúdo do Tok Home: a casca da família tem as cores dela */
button,input{font:inherit;color:inherit}
button{cursor:pointer}
button:disabled{cursor:not-allowed;opacity:.55}
:focus-visible{outline:3px solid var(--tok-brand);outline-offset:3px;border-radius:12px}
[hidden]{display:none!important}
svg{display:block;flex:none}
.th-suave{color:var(--th-suave)}
.th-pular{position:fixed;left:12px;top:-80px;z-index:50;padding:12px 18px;border-radius:var(--tok-button-radius);background:var(--tok-brand);color:#fff}
.th-pular:focus{top:12px}

/* ------------------------------------------------------------------------------------------------ peças comuns */
.th-cartao{background:var(--tok-surface);border:1px solid var(--tok-border);border-radius:var(--tok-card-radius);padding:24px;box-shadow:var(--th-sombra)}
.th-botao{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:var(--tok-touch-target);padding:10px 20px;border-radius:var(--tok-button-radius);
  border:1.5px solid var(--tok-brand);background:transparent;color:var(--tok-brand);font-weight:600;text-decoration:none;transition:background var(--tok-motion)}
.th-botao:hover{background:var(--tok-brand-soft)}
.th-botao-primario{background:var(--tok-brand);color:#fff}
.th-botao-primario:hover{background:var(--tok-brand-dark)}
.th-capsula{min-height:var(--tok-touch-target);padding:8px 18px;border-radius:var(--tok-button-radius);border:1.5px solid var(--tok-border);background:var(--tok-surface);font-weight:600;font-size:14px}
.th-capsula.th-ligado{background:var(--tok-brand);border-color:var(--tok-brand);color:#fff}
.th-redondo{display:grid;place-items:center;width:var(--tok-touch-target);height:var(--tok-touch-target);border-radius:50%;border:1.5px solid var(--tok-border);background:var(--tok-surface)}
.th-redondo svg{width:20px;height:20px}
.th-pilula{display:inline-flex;align-items:center;gap:6px;padding:6px 14px;border-radius:var(--tok-button-radius);font-size:14px;font-weight:600}
.th-pilula::before{content:"";width:8px;height:8px;border-radius:50%;background:currentColor}
.th-ok{background:var(--th-ok-fundo);color:var(--th-ok)}
.th-atencao{background:var(--th-atencao-fundo);color:var(--th-atencao)}
.th-aviso{display:flex;gap:12px;align-items:flex-start;padding:18px;border-radius:var(--tok-inner-radius);background:var(--th-atencao-fundo);color:var(--th-atencao)}
.th-aviso svg{width:22px;height:22px}
.th-link{font-weight:600;text-decoration:none;min-height:var(--tok-touch-target);display:inline-flex;align-items:center}
.th-link:hover{text-decoration:underline}
.th-carregando{color:var(--th-suave)}
.th-vazio{color:var(--th-suave)}

/* ------------------------------------------------------------------------------------------------- cabeçalho */
.th-cabecalho{position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:16px;padding:12px 32px;background:color-mix(in srgb,var(--tok-bg) 88%,transparent);
  backdrop-filter:blur(10px);border-bottom:1px solid var(--tok-border)}
.th-marca{display:flex;align-items:center;gap:12px;font-size:24px;font-weight:700;color:var(--tok-brand);text-decoration:none;margin-right:16px}
.th-abas{display:flex;gap:6px;flex:1}
.th-aba{display:inline-flex;align-items:center;gap:8px;min-height:var(--tok-touch-target);padding:8px 16px;border-radius:var(--tok-button-radius);color:var(--tok-text);text-decoration:none;font-weight:600;font-size:15px}
.th-aba svg{width:20px;height:20px}
.th-aba:hover{background:var(--tok-brand-soft)}
.th-aba.th-atual{background:var(--tok-brand-soft);color:var(--tok-brand)}
.th-so-celular{display:none}
.th-modulos,.th-conta{position:relative}
.th-modulos summary,.th-conta summary{list-style:none;display:grid;place-items:center;width:var(--tok-touch-target);height:var(--tok-touch-target);border-radius:50%;cursor:pointer}
.th-modulos summary::-webkit-details-marker,.th-conta summary::-webkit-details-marker{display:none}
.th-modulos summary:hover{background:var(--tok-brand-soft)}
.th-modulos summary svg{width:22px;height:22px}
.th-avatar{display:grid;place-items:center;width:40px;height:40px;border-radius:50%;background:var(--tok-brand);color:#fff;font-weight:700}
.th-modulos-lista,.th-conta-caixa{position:absolute;right:0;top:52px;min-width:260px;margin:0;padding:8px;list-style:none;background:var(--tok-surface);border:1px solid var(--tok-border);border-radius:var(--tok-inner-radius);box-shadow:var(--th-sombra)}
.th-conta-caixa{display:grid;gap:12px;padding:16px}
.th-modulo{display:flex;align-items:center;gap:12px;min-height:52px;padding:8px 10px;border-radius:14px;color:var(--tok-text);text-decoration:none}
.th-modulo:hover,.th-modulo.th-atual{background:var(--tok-brand-soft)}
.th-modulo span{display:grid}
.th-modulo small{color:var(--th-suave);font-size:13px}

/* ---------------------------------------------------------------------------------------------- moldura e lateral */
.th-moldura{display:grid;grid-template-columns:240px minmax(0,1fr);gap:32px;max-width:1440px;margin:0 auto;padding:28px 32px 48px}
.th-lateral{position:sticky;top:92px;align-self:start;display:grid;gap:12px}
.th-lateral-titulo{font-size:14px;font-family:var(--tok-font-body);font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--th-suave)}
/* Os ambientes, em cápsulas que levam ao cartão de cada um (a lateral da casca é da família: menu e produtos). */
.th-lista-ambientes{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.th-lista-ambientes:empty{display:none}
.th-lista-ambientes a{display:inline-flex;gap:8px;align-items:center;min-height:var(--tok-touch-target);padding:8px 16px;border-radius:var(--tok-button-radius);border:1.5px solid var(--tok-border);background:var(--tok-surface);color:var(--tok-text);text-decoration:none;font-weight:600}
.th-lista-ambientes a:hover{background:var(--tok-brand-soft)}
.th-lista-ambientes a span{font-size:13px;color:var(--th-suave)}
.th-lateral-acao{justify-self:start}
.th-principal{display:grid;gap:28px;min-width:0;align-content:start}
.th-principal:focus{outline:none}

/* ------------------------------------------------------------------------------------------------------ destaque */
.th-destaque{display:flex;justify-content:space-between;align-items:flex-end;gap:24px;flex-wrap:wrap;padding:32px;background:var(--tok-brand);color:#fff;border:0;
  background-image:radial-gradient(circle at 92% 20%,#2c6b58 0,transparent 42%),radial-gradient(circle at 70% 130%,#1d5546 0,transparent 50%)}
.th-destaque .th-suave{color:var(--tok-brand-soft)}
.th-sobretitulo{font-size:14px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--th-ambar)}
.th-destaque h1,.th-destaque h2{font-size:44px;line-height:1.1;margin:4px 0 6px;color:#fff}
.th-resumo{display:flex;gap:8px;flex-wrap:wrap}
.th-destaque .th-pilula{background:#ffffff1f;color:#fff}
.th-destaque .th-pilula.th-ok::before{background:#7fd6a8}
.th-destaque .th-pilula.th-atencao::before{background:var(--th-ambar)}

/* --------------------------------------------------------------------------------------------------- favoritos */
.th-secao-titulo{font-size:24px;line-height:1.25}
.th-favoritos{display:grid;gap:14px}
.th-favoritos-lista{display:flex;gap:12px;flex-wrap:wrap}
.th-favorito{display:flex;align-items:center;gap:12px;min-height:56px;padding:8px 20px 8px 14px;border-radius:var(--tok-button-radius);border:1.5px solid var(--tok-border);background:var(--tok-surface);text-align:left}
.th-favorito svg{width:22px;height:22px;color:var(--tok-brand)}
.th-favorito span{display:grid;line-height:1.25}
.th-favorito small{color:var(--th-suave);font-size:13px}
.th-favorito.th-ligado{background:var(--tok-brand);border-color:var(--tok-brand);color:#fff}
.th-favorito.th-ligado svg{color:var(--th-ambar)}
.th-favorito.th-ligado small{color:var(--tok-brand-soft)}

/* --------------------------------------------------------------------------------------------------- ambientes */
.th-bloco{display:grid;gap:14px}
.th-bloco-topo{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
.th-ambientes{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,520px),1fr));gap:20px;align-items:start}
.th-ambiente{display:grid;gap:16px;align-content:start;scroll-margin-top:96px}
.th-cartao-topo{display:flex;justify-content:space-between;align-items:baseline;gap:12px}
.th-cartao-topo h3{font-size:22px}
.th-contagem{font-size:14px;color:var(--th-suave)}
.th-controles{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:12px;align-items:start}
.th-controle{border-radius:var(--tok-inner-radius);background:var(--tok-bg);border:1px solid var(--tok-border);min-width:0}
.th-controle h4,.th-controle strong{font-size:16px;font-weight:600;font-family:var(--tok-font-body);overflow-wrap:anywhere}
.th-controle-icone{display:grid;place-items:center;width:44px;height:44px;border-radius:14px;background:var(--tok-surface);color:var(--tok-brand)}
.th-controle-icone svg{width:22px;height:22px}
.th-estado{display:block;font-size:14px;color:var(--th-suave)}
.th-controle-botao{display:flex;align-items:center;gap:12px;width:100%;min-height:76px;padding:14px;border:0;border-radius:inherit;background:none;text-align:left}
.th-controle-texto{flex:1;min-width:0;display:grid}
.th-chave{width:48px;height:28px;border-radius:999px;background:var(--tok-border);padding:3px;transition:background var(--tok-motion)}
.th-chave i{display:block;width:22px;height:22px;border-radius:50%;background:#fff;box-shadow:0 1px 3px #0003;transition:transform var(--tok-motion)}
.th-ligado .th-chave{background:var(--tok-brand)}
.th-ligado .th-chave i{transform:translateX(20px)}
.th-alternar.th-ligado{background:var(--tok-brand-soft);border-color:#a9d2bf}
.th-alternar.th-ligado .th-controle-icone{background:var(--tok-brand);color:var(--th-ambar)}
.th-alternar.th-ligado .th-estado{color:var(--tok-brand);font-weight:600}
.th-controle-topo{display:flex;align-items:center;gap:12px;padding:14px}
.th-leitura .th-valor{font-size:20px;font-weight:700;font-family:var(--tok-font-display)}
.th-clima{grid-column:span 2}
.th-clima-corpo{display:flex;align-items:center;gap:20px;padding:0 16px 16px}
.th-anel-caixa{position:relative;width:108px;height:108px;flex:none}
.th-anel{width:100%;height:100%}
.th-anel-fundo{fill:none;stroke:var(--tok-border);stroke-width:6}
.th-anel-valor{fill:none;stroke:#3fa26f;stroke-width:6;stroke-linecap:round}
.th-desligado .th-anel-valor{stroke:#b8b0a2}
.th-anel-caixa strong{position:absolute;inset:0;display:grid;place-items:center;font-family:var(--tok-font-display);font-size:30px}
.th-clima-lado{display:grid;gap:10px;justify-items:start}
.th-clima-botoes{display:flex;gap:8px}
.th-fora{opacity:.7}
.th-vazio-cartao{display:grid;justify-items:center;text-align:center;gap:14px;padding:40px 24px}
.th-vazio-cartao svg{width:40px;height:40px;color:var(--tok-brand)}

/* ----------------------------------------------------------------------------------------------------- câmeras */
.th-cameras{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:16px}
.th-camera-link{display:grid;gap:10px;padding:10px;border-radius:var(--tok-card-radius);background:var(--tok-surface);border:1px solid var(--tok-border);color:var(--tok-text);text-decoration:none;box-shadow:var(--th-sombra)}
.th-camera-link:hover{border-color:var(--tok-brand)}
.th-camera-quadro{position:relative;display:block;aspect-ratio:16/9;border-radius:var(--tok-inner-radius);overflow:hidden;background:linear-gradient(135deg,#2a4a40,#143b32)}
.th-camera-quadro img{width:100%;height:100%;object-fit:cover;display:block}
.th-camera-selo{position:absolute;left:10px;top:10px;display:grid;place-items:center;width:36px;height:36px;border-radius:12px;background:#102821b3;color:#fff}
.th-camera-selo svg{width:20px;height:20px}
.th-camera-texto{display:grid;padding:0 6px 4px}
.th-camera.th-fora .th-camera-quadro{background:repeating-linear-gradient(135deg,#d9d2c4 0 12px,#e6e0d4 12px 24px)}
.th-camera.th-fora .th-estado{color:var(--th-atencao)}

/* --------------------------------------------------------------------------------------------------- avisos */
.th-avisos{position:fixed;right:20px;bottom:20px;z-index:40;display:grid;gap:8px}
.th-toast{padding:12px 18px;border-radius:var(--tok-inner-radius);background:var(--tok-text);color:#fff;box-shadow:var(--th-sombra)}

/* ------------------------------------------------------------------------------------------------- entrar (dev) */
.th-entrar{min-height:100vh;display:grid;place-items:center;padding:24px}
.th-entrar-cartao{display:grid;gap:16px;justify-items:center;text-align:center;max-width:420px}
.th-entrar-cartao form{display:grid;gap:10px;width:100%}

/* ------------------------------------------------------------------------------------------------------ celular */
@media (max-width:900px){
  /* Sem o desfoque: um elemento com backdrop-filter vira a referência dos fixos de dentro, e a barra de baixo subiria. */
  .th-cabecalho{padding:10px 16px;backdrop-filter:none;background:var(--tok-bg)}
  .th-marca{font-size:22px;margin-right:auto}
  .th-marca img{width:36px;height:36px}
  /* Os quatro destinos principais embaixo, como na prancha do celular. */
  .th-abas{position:fixed;left:12px;right:12px;bottom:max(12px,env(safe-area-inset-bottom));z-index:30;justify-content:space-around;padding:6px;
    background:var(--tok-surface);border:1px solid var(--tok-border);border-radius:var(--tok-card-radius);box-shadow:var(--th-sombra)}
  .th-aba{flex-direction:column;gap:2px;padding:6px 10px;font-size:12px;min-width:64px}
  .th-so-desktop{display:none}
  .th-so-celular{display:inline-flex}
  .th-moldura{display:block;padding:16px 16px 112px}
  .th-lateral{display:none}
  .th-principal{gap:22px}
  .th-destaque{padding:22px;align-items:flex-start}
  .th-destaque h1,.th-destaque h2{font-size:32px}
  .th-destaque .th-suave{display:none}
  .th-favoritos-lista{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;margin:0 -16px;padding:0 16px 4px}
  .th-favorito{flex:none}
  .th-secao-titulo{font-size:22px}
  .th-ambiente{padding:18px}
  .th-controles{grid-template-columns:repeat(2,minmax(0,1fr))}
  .th-clima{grid-column:1/-1}
  .th-controle-botao{flex-wrap:wrap;min-height:96px;align-content:flex-start}
  .th-controle-texto{flex-basis:100%;order:3}
  .th-chave{margin-left:auto}
  /* Câmeras em lista no celular (o guia: grade no desktop, lista no celular). */
  .th-cameras{grid-template-columns:1fr;gap:10px}
  .th-camera-link{grid-template-columns:120px minmax(0,1fr);align-items:center;border-radius:var(--tok-inner-radius);box-shadow:none}
  .th-camera-quadro{border-radius:12px}
  .th-camera-selo{left:6px;top:6px;width:28px;height:28px;border-radius:9px}
  .th-camera-selo svg{width:16px;height:16px}
  .th-avisos{left:16px;right:16px;bottom:100px}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}

/* ------------------------------------------------------------------------------------------------- tema escuro */
/* A casca da família liga o tema escuro (data-tok-theme="dark", pela escolha da pessoa ou do sistema): o verde-pinho
   escuro some no fundo escuro, então textos, ícones e o estado "ligado" passam para o verde-claro da marca. */
[data-tok-theme="dark"] .th-link,[data-tok-theme="dark"] .th-principal a:not(.th-botao):not(.th-camera-link){color:var(--tok-brand-soft)}
[data-tok-theme="dark"] .th-controle-icone,[data-tok-theme="dark"] .th-favorito svg{color:var(--tok-brand-soft)}
[data-tok-theme="dark"] .th-alternar.th-ligado{background:#1d4a3e;border-color:#2f6a57}
[data-tok-theme="dark"] .th-alternar.th-ligado .th-controle-texto strong{color:#fff}
[data-tok-theme="dark"] .th-alternar.th-ligado .th-estado{color:var(--tok-brand-soft)}
[data-tok-theme="dark"] .th-chave{background:#55504f}
[data-tok-theme="dark"] .th-ligado .th-chave{background:var(--tok-brand-soft)}
[data-tok-theme="dark"] .th-ligado .th-chave i{background:var(--tok-brand-dark)}
[data-tok-theme="dark"] .th-camera.th-fora .th-camera-quadro{background:repeating-linear-gradient(135deg,#3a3634 0 12px,#45403d 12px 24px)}
