* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: #0f1115; color: #e6e7eb; }
/* Sem scroll/slide horizontal — só vertical. overflow-x: clip trava o vazamento
   lateral (sidebar off-screen, tabelas, texto longo) SEM virar scroll-container
   — 'hidden' viraria, e isso QUEBRA o position:sticky da topbar/period-bar no iOS
   PWA. 'hidden' fica de fallback p/ browsers sem 'clip'. overscroll-behavior-x:
   none mata o "rubber-band"/slide horizontal do PWA. */
html, body { overflow-x: hidden; overflow-x: clip; overscroll-behavior-x: none; }
/* overscroll-y contain: mata o pull-to-refresh NATIVO do Chrome Android (que
   recarregaria a página inteira) — quem responde ao gesto é o nosso, em
   app-1-core.js (initPullToRefresh), com sync leve em vez de reload. */
html, body { overscroll-behavior-y: contain; }
main { min-width: 0; }  /* permite o grid item encolher em vez de empurrar a página */

/* Pull-to-refresh: pill que desce do topo conforme a puxada (--ptr 0..1). */
.ptr-pill { position: fixed; left: 50%; z-index: 300; pointer-events: none;
  top: calc(6px + env(safe-area-inset-top));
  transform: translateX(-50%) translateY(calc(-48px + var(--ptr, 0) * 56px));
  opacity: var(--ptr, 0); transition: transform 0.08s linear, opacity 0.08s linear;
  background: #1f2937; border: 1px solid #2a2f3a; border-radius: 999px;
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  color: #9ca3af; box-shadow: 0 2px 10px #00000066; }
.ptr-pill.is-armed { color: #60a5fa; border-color: #2563eb; }
.ptr-pill.is-loading svg { animation: spin 0.9s linear infinite; }

/* ---------- App layout (grid) ---------- */
body {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main";
  min-height: 100vh;
}
/* min-width: 0 é essencial: a topbar divide a coluna 1fr do grid com o main no
   mobile. Sem isso, o min-content dela (back + título + os ícones do user-bar:
   voz/ChopChop/sync/avatar) estoura o track 1fr, alarga o main e empurra TODO o
   conteúdo pra direita (toggles/botões cortados na borda). Mesmo motivo da regra
   do main lá em cima. */
/* padding-top soma o safe-area-inset: no PWA standalone do iOS (black-translucent +
   viewport-fit=cover) o conteúdo desenha ATRÁS da status bar — sem o inset, os ícones
   da topbar sobrepunham o relógio/bateria do sistema. No desktop/Android o env() é 0. */
.topbar { grid-area: topbar; min-width: 0; display: flex; align-items: center; gap: 14px; padding: 12px 24px; padding-top: calc(12px + env(safe-area-inset-top)); background: #14171f; border-bottom: 1px solid #20242e; position: sticky; top: 0; z-index: 10; }
.topbar .topbar-title { min-width: 0; }  /* deixa o título encolher (ellipsis) antes de espremer os ícones */
.topbar .user-bar { margin-left: auto; }
.topbar-burger { display: none; background: transparent; border: 1px solid #2a2f3a; border-radius: 6px; color: #cbd5e1; padding: 6px 10px; cursor: pointer; }
.topbar-burger:hover { background: #1f2937; }
.topbar-back { display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 1px solid #2a2f3a; border-radius: 8px; color: #cbd5e1; padding: 5px 8px; cursor: pointer; }
.topbar-back:hover { background: #1f2937; color: #fff; }
.topbar-back svg { display: block; }
.topbar-title { font-size: 1.05rem; font-weight: 650; color: #e6e7eb; letter-spacing: 0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-burger::before { content: ""; display: inline-block; width: 16px; height: 12px; background:
  linear-gradient(currentColor, currentColor) center/100% 2px no-repeat,
  linear-gradient(currentColor, currentColor) top/100% 2px no-repeat,
  linear-gradient(currentColor, currentColor) bottom/100% 2px no-repeat; }
main { grid-area: main; padding: 20px 24px 40px; max-width: 1400px; margin: 0 auto; width: 100%; }

/* ---------- Sidebar ---------- */
.sidebar { grid-area: sidebar; background: #0a0c10; border-right: 1px solid #20242e; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 20; padding-top: env(safe-area-inset-top); }
.sidebar-brand { display: flex; align-items: center; gap: 8px; padding: 16px 18px; border-bottom: 1px solid #20242e; }
.sidebar-brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 6px; background: linear-gradient(135deg, #2563eb, #60a5fa); color: #fff; font-weight: 800; font-size: 0.78rem; letter-spacing: 0.3px; flex-shrink: 0; }
.sidebar-brand-logo { width: 42px; height: auto; flex-shrink: 0; display: block; }
.sidebar-brand-word { height: 22px; width: auto; display: block; }
.sidebar-brand-name { color: #e6e7eb; font-weight: 700; font-size: 0.95rem; letter-spacing: -0.2px; }
.auth-logo { display: block; width: 190px; max-width: 72%; height: auto; margin: 6px auto 20px; }
.sidebar-nav { display: flex; flex-direction: column; padding: 10px 8px; gap: 2px; flex: 1; }
.sidebar-group { display: flex; flex-direction: column; gap: 2px; }
.sidebar-group + .sidebar-group { margin-top: 14px; padding-top: 10px; border-top: 1px solid #20242e; }
.sidebar-group-bottom { margin-top: auto; padding-top: 10px; border-top: 1px solid #20242e; }
.sidebar-group-label { color: #6b7280; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.8px; padding: 6px 10px 4px; font-weight: 600; }
.sidebar-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; background: transparent; border: 0; color: #9ca3af; cursor: pointer; font-size: 0.88rem; font-family: inherit; text-align: left; width: 100%; transition: background 0.12s, color 0.12s; }
.sidebar-item:hover { background: #1a1e28; color: #e6e7eb; }
.sidebar-item.active { background: #1e3a8a40; color: #fff; border-left: 2px solid #2563eb; padding-left: 8px; }
.sidebar-item .icon { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-item .sidebar-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-item .sidebar-badge { background: #1f2937; color: #6b7280; font-size: 0.66rem; padding: 1px 6px; border-radius: 9999px; min-width: 18px; text-align: center; }
.sidebar-item.active .sidebar-badge { background: #2563eb; color: #fff; }
.sidebar-item .sidebar-badge .icon { width: 10px; height: 10px; vertical-align: -1px; color: inherit; }

/* Accordion "Saúde e Bem-Estar": cabeçalho (reaproveita o visual de .sidebar-item) + chevron. */
.sidebar-group-header { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px; background: transparent; border: 0; color: #9ca3af; cursor: pointer; font-size: 0.88rem; font-family: inherit; text-align: left; width: 100%; transition: background 0.12s, color 0.12s; }
.sidebar-group-header:hover { background: #1a1e28; color: #e6e7eb; }
.sidebar-group-header .icon { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-group-header .sidebar-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-group-header .sidebar-chevron { display: flex; flex-shrink: 0; transition: transform 0.15s; }
.sidebar-group-header .sidebar-chevron .icon { width: 14px; height: 14px; }
.sidebar-group-header[aria-expanded="true"] .sidebar-chevron { transform: rotate(180deg); }
/* Recolhido com a aba ativa dentro: marca o cabeçalho para não "sumir" onde o usuário está. */
.sidebar-group-header.has-active { color: #fff; }
.sidebar-group-header.has-active .sidebar-chevron { color: #2563eb; }
/* Sub-itens aninhados: leve indentação + filete à esquerda. */
.sidebar-subgroup { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 2px 18px; padding-left: 8px; border-left: 1px solid #20242e; }
.sidebar-subgroup[hidden] { display: none; }
.sidebar-item.sidebar-subitem { font-size: 0.84rem; padding-top: 7px; padding-bottom: 7px; }

/* ---------- Bottom nav (PWA / mobile) ---------- */
.bottom-nav { display: none; }
.bottom-nav[hidden] { display: none; }
.bn-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; background: transparent; border: 0; color: #9ca3af; cursor: pointer;
  padding: 8px 4px; font: inherit; min-width: 0;
}
/* svg.icon (não só `.bn-item svg`) pra vencer o `button svg.icon { 13px }` global por especificidade. Tamanho = ícone do ChopChop na topbar (#cc-btn svg, 28px). */
.bn-item svg.icon { width: 28px; height: 28px; display: block; }
/* 0.62rem (era 0.66): "Entretenimento" (rótulo mais longo da barra) cabe até 360px sem
   vazar do item — o flex distribui o espaço e o rótulo não pode ser clipado (sem ellipsis feia). */
.bn-item .bn-label { font-size: 0.62rem; line-height: 1; white-space: nowrap; }
.bn-item.active { color: #60a5fa; }

/* ---------- Mobile / narrow ---------- */
@media (max-width: 768px) {
  body { grid-template-columns: 1fr; grid-template-areas: "topbar" "main"; }
  .sidebar { position: fixed; top: 0; left: -240px; width: 240px; transition: left 0.2s ease; }
  .sidebar.open { left: 0; box-shadow: 0 0 30px rgba(0,0,0,0.6); }
  .topbar-burger { display: inline-flex; align-items: center; }
  /* fixed, não sticky: a topbar é item do grid do body e a linha dela tem a altura
     exata do elemento, então não sobra curso pro sticky grudar — ela rolava junto
     com a página no app nativo (no Android o usuário esperava fixa, como no
     desktop). Com fixed ela sai do fluxo, a linha do grid colapsa e o main
     compensa com padding-top. Os 56px são a altura da topbar (12px de padding
     em cima e embaixo + 32px de controle), o mesmo número já usado pela
     .period-bar logo abaixo. */
  .topbar { position: fixed; top: 0; left: 0; right: 0; padding-left: 16px; padding-right: 16px; gap: 8px; }  /* mais folga p/ os ícones em telas estreitas */
  .sidebar-backdrop { display: none; }
  .sidebar.open + .topbar::before, body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 15; }
  main { padding: calc(72px + env(safe-area-inset-top)) 18px calc(64px + env(safe-area-inset-bottom)); }
  .bottom-nav:not([hidden]) {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: #14171f; border-top: 1px solid #20242e;
    padding-bottom: env(safe-area-inset-bottom);
  }
}
.hidden { display: none !important; }

/* ---------- Gaveta "Mais" (bottom sheet de ações rápidas) ---------- */
.fab-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 40; }
.fab-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  background: #14171f; border-top: 1px solid #20242e; border-radius: 18px 18px 0 0;
  padding: 0 16px calc(18px + env(safe-area-inset-bottom));
  transform: translateY(110%); transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  max-height: 72vh; overflow-y: auto; box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
}
.fab-sheet.open { transform: translateY(0); }
.fab-sheet-handle { width: 42px; height: 4px; border-radius: 2px; background: #2a2f3a; margin: 10px auto 16px; }
.fab-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 420px; margin: 0 auto; }
.fab-action {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: #1a1e27; border: 1px solid #20242e; border-radius: 16px;
  padding: 20px 8px; color: #cbd5e1; cursor: pointer; font: inherit; font-size: 0.78rem;
  line-height: 1.15; text-align: center;
}
.fab-action:hover, .fab-action:active { background: #1f2530; color: #fff; border-color: #2a3340; }
.fab-action svg { width: 30px; height: 30px; }

.muted { color: #6b7280; font-size: 0.85rem; }
.error { color: #f87171; min-height: 1.2em; font-size: 0.9rem; }

/* ---------- Login ---------- */
.card { background: #14171f; border: 1px solid #20242e; border-radius: 8px; padding: 24px; max-width: 420px; margin: 40px auto; }
.card h2 { margin-top: 0; }
.form label { display: block; margin: 12px 0; font-size: 0.9rem; }
.form input { width: 100%; padding: 10px 12px; background: #0f1115; color: #e6e7eb; border: 1px solid #2a2f3a; border-radius: 6px; font-size: 16px; margin-top: 4px; }
.form button { width: 100%; padding: 10px; background: #2563eb; color: #fff; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; margin-top: 8px; }
.form button:hover { background: #1d4ed8; }
.user-bar { display: flex; gap: 12px; align-items: center; font-size: 0.9rem; }
.user-bar button { background: transparent; color: #9ca3af; border: 1px solid #2a2f3a; border-radius: 6px; padding: 6px 10px; cursor: pointer; }
.user-bar button:hover { color: #fff; border-color: #3a4150; }
/* ---------- Botão de reload da barra superior ---------- */
.user-bar .topbar-reload { background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 7px; color: #9ca3af; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.user-bar .topbar-reload:hover { background: #1f2530; border-color: #2a2f3a; color: #fff; }
.user-bar .topbar-reload svg { width: 17px; height: 17px; display: block; }
.user-bar .topbar-reload.spinning { pointer-events: none; opacity: 0.7; }
.user-bar .topbar-reload.spinning svg { animation: spin 0.7s linear infinite; }

/* ---------- Menu do usuário (avatar + dropdown) ---------- */
.user-bar .user-menu { position: relative; }
.user-bar .user-menu-btn { display: inline-flex; align-items: center; gap: 8px; background: transparent; border: 1px solid transparent; border-radius: 9999px; padding: 3px 8px 3px 3px; cursor: pointer; color: #cbd5e1; }
.user-bar .user-menu-btn:hover { background: #1f2530; border-color: #2a2f3a; color: #fff; }
.user-bar .user-menu-btn .avatar-img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: #0a0c10; flex-shrink: 0; }
.user-bar .user-menu-btn .avatar-fallback { width: 30px; height: 30px; border-radius: 50%; background: #1f2937; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.user-bar .user-menu-btn .avatar-fallback svg { width: 18px; height: 18px; color: #93c5fd; }
.user-bar .user-menu-btn > svg { width: 15px; height: 15px; color: #6b7280; transition: transform 0.18s ease; }
.user-bar .user-menu-btn[aria-expanded="true"] > svg { transform: rotate(180deg); }
.user-bar .user-menu-dropdown { position: absolute; right: 0; top: calc(100% + 8px); min-width: 190px; background: #14171f; border: 1px solid #2a2f3a; border-radius: 10px; padding: 6px; box-shadow: 0 10px 30px rgba(0,0,0,0.45); z-index: 30; }
.user-bar .user-menu-dropdown[hidden] { display: none; }
.user-bar .user-menu-header { padding: 8px 12px 10px; margin-bottom: 4px; border-bottom: 1px solid #20242e; color: #e6e7eb; font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-bar .user-menu-header small { display: block; font-weight: 400; font-size: 0.72rem; color: #9ca3af; margin-top: 2px; }
/* Botão "Criar conta / Já tenho conta" no card de auth — estilo link discreto. */
.link-btn { background: transparent; border: none; color: #93c5fd; cursor: pointer; font-size: 0.85rem; padding: 8px 4px; margin-top: 4px; }
.link-btn:hover { color: #bfdbfe; text-decoration: underline; }
/* Cadastro é a conversão principal do card, mas o #authToggle é um botão de 3 estados:
   só "Criar conta" (classe .cta, via setAuthToggleLabel) ganha destaque de botão; nos
   estados de volta ele continua link discreto pra não competir com o submit visível.
   A visibilidade do bloco é do wrapper (#authCta), não do botão — com o cadastro
   fechado o botão some mas a explicação fica no lugar dele. */
.auth-cta { margin-top: 18px; text-align: center; }
.auth-cta:has(> #authToggle.cta) { padding-top: 16px; border-top: 1px solid #20242e; }
.auth-cta-label { display: block; color: #9ca3af; font-size: 0.85rem; margin-bottom: 10px; }
.auth-cta:has(> #authToggle:not(.cta)) .auth-cta-label { display: none; }
#authToggle.cta { display: block; width: 100%; margin-top: 0; padding: 11px 14px;
  font-size: 0.95rem; font-weight: 600; font-family: inherit; color: #93c5fd;
  background: transparent; border: 1px solid #2563eb; border-radius: 6px; }
#authToggle.cta:hover { background: #2563eb; color: #fff; text-decoration: none; }
/* Cadastro fechado: antes o botão simplesmente sumia e o usuário não tinha como saber
   por que não dava pra criar conta — virava "não recebi o e-mail". */
.auth-cta-closed { display: none; margin: 0; color: #9ca3af; font-size: 0.85rem; line-height: 1.5; }
.auth-cta.closed { padding-top: 16px; border-top: 1px solid #20242e; }
.auth-cta.closed #authToggle { display: none; }
.auth-cta.closed .auth-cta-label { display: block; }
.auth-cta.closed .auth-cta-closed { display: block; }
.auth-verification { margin-top: 4px; }
.auth-verification h2 { margin: 0 0 8px; font-size: 1.15rem; }
.auth-verification .form { margin-top: 14px; }
.auth-verification .muted { line-height: 1.45; }
.auth-channel-options { display: grid; gap: 10px; margin-top: 16px; }
.auth-channel-options button {
  width: 100%; min-height: 44px; padding: 11px 14px; border-radius: 8px;
  border: 1px solid #31527d; background: #15233a; color: #dbeafe;
  cursor: pointer; font: inherit; font-size: 1rem; text-align: left;
}
.auth-channel-options button:hover { background: #1b3152; border-color: #4f7eb8; }
.auth-channel-options button:focus-visible {
  outline: 3px solid #60a5fa; outline-offset: 2px;
}
.auth-channel-options button:disabled { cursor: wait; opacity: 0.58; }
.user-bar .user-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; background: transparent; border: none; border-radius: 7px; padding: 9px 12px; color: #cbd5e1; font-size: 0.88rem; text-align: left; cursor: pointer; }
.user-bar .user-menu-item:hover { background: #1f2530; color: #fff; border-color: transparent; }
.user-bar .user-menu-item svg { width: 16px; height: 16px; flex-shrink: 0; color: #9ca3af; }
.user-bar .user-menu-item.danger { color: #f87171; }
.user-bar .user-menu-item.danger svg { color: #f87171; }
.user-bar .user-menu-item.danger:hover { background: #3b1d1d; color: #fca5a5; }
.user-bar .user-menu-version { margin-top: 4px; padding: 6px 12px 2px; border-top: 1px solid #20242e; color: #6b7280; font-size: 0.7rem; text-align: center; letter-spacing: 0.3px; }

/* ---------- Tabs (legacy — escondido, usa sidebar agora) ---------- */
.tabs { display: none; }
.tabs-x { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid #20242e; margin-bottom: 14px; }
.tab-btn { background: transparent; border: none; color: #9ca3af; padding: 10px 14px; cursor: pointer; font-size: 0.92rem; border-bottom: 2px solid transparent; display: flex; gap: 6px; align-items: center; }
.tab-btn .badge { background: #1e293b; color: #9ca3af; font-size: 0.7rem; padding: 2px 6px; border-radius: 9999px; }
.tab-btn.active { color: #fff; border-bottom-color: #2563eb; }
.tab-btn.active .badge { background: #2563eb; color: #fff; }
.tab-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.tab-toolbar input[type=search] { background: #0f1115; color: #e6e7eb; border: 1px solid #2a2f3a; border-radius: 6px; padding: 8px 12px; flex: 1; max-width: 360px; }

/* ---------- Method list (accordion) ---------- */
.methods { display: flex; flex-direction: column; gap: 8px; }
/* Feed: pintura num buffer escondido + spinner; revela tudo de uma vez quando o
   conteúdo principal chega (evita o efeito de "desenhar a tela na frente"). */
.painel-body { display: flex; flex-direction: column; gap: 8px; transition: opacity 0.25s ease; }
.painel-body.is-loading { opacity: 0; pointer-events: none; }
.painel-loading { position: fixed; left: 0; right: 0; top: 42%; display: flex; justify-content: center; pointer-events: none; z-index: 5; }
.painel-loading svg { width: 30px; height: 30px; color: #60a5fa; animation: spin 0.8s linear infinite; }
.method { background: #14171f; border: 1px solid #20242e; border-radius: 8px; overflow: hidden; }
.method-header { display: flex; gap: 12px; align-items: center; padding: 12px 16px; cursor: pointer; }
.method-header:hover { background: #181c25; }
.method-header .name { font-weight: 600; color: #e6e7eb; }
.method-header .doc { color: #9ca3af; font-size: 0.85rem; }
.method-header .api { color: #6b7280; font-size: 0.75rem; font-family: ui-monospace, monospace; margin-left: auto; }
.method.open .method-header .chevron { transform: rotate(90deg); }
.chevron { transition: transform 0.15s; display: inline-block; color: #6b7280; }
.method-body { display: none; padding: 12px 16px 16px; border-top: 1px solid #20242e; }
.method.open .method-body { display: block; }

/* ---------- Form ---------- */
.form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 12px; }
.form-row label { display: flex; flex-direction: column; font-size: 0.78rem; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.5px; }
.form-row label.req::after { content: " *"; color: #f87171; }
.form-row input, .form-row select { padding: 8px 10px; background: #0f1115; color: #e6e7eb; border: 1px solid #2a2f3a; border-radius: 6px; margin-top: 4px; font-size: 0.9rem; min-width: 160px; }
.form-row input[type=checkbox] { min-width: auto; }
.form-row .actions { display: flex; gap: 6px; margin-left: auto; }
.btn { padding: 8px 14px; background: #2563eb; color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 0.85rem; }
.btn:hover { background: #1d4ed8; }
.btn:disabled { opacity: 0.7; cursor: default; }
/* Campo de senha com toggle "olho" (revelar/ocultar) — mobile-friendly. */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 40px; }
/* Especificidade reforçada (.pw-wrap .pw-toggle) pra vencer ".form button" que é
   azul/largura-cheia e senão pintaria o botão do olho. */
.pw-wrap .pw-toggle { position: absolute; top: 0; right: 0; bottom: 0; left: auto; height: auto; width: 38px; margin: 0; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: none; color: #9ca3af; cursor: pointer; padding: 0; font-size: inherit; }
.pw-wrap .pw-toggle:hover { background: transparent; color: #cbd5e1; }
.pw-wrap .pw-toggle svg { width: 17px; height: 17px; }
/* Botão em estado "ocupado" (login/conexão): spinner + texto, sem clique. */
.btn.btn-busy { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.btn.btn-busy svg { width: 14px; height: 14px; animation: spin 0.7s linear infinite; }
/* Nota de progresso abaixo do form de conexão (login Garmin pode demorar). */
.conn-hint { margin: 10px 0 0; font-size: 0.8rem; }
.conn-hint:not(:empty)::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #fbbf24; animation: pulse-dot 1.2s ease-in-out infinite; vertical-align: middle; }
@keyframes pulse-dot { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
.btn.secondary { background: #1f2937; color: #cbd5e1; }
.btn.secondary:hover { background: #2a3445; }
.btn.danger { background: #991b1b; }
.btn.danger:hover { background: #b91c1c; }

/* ---------- Result ---------- */
.result-meta { display: flex; gap: 10px; align-items: center; font-size: 0.78rem; color: #9ca3af; margin-bottom: 8px; }
.tag { padding: 2px 8px; border-radius: 9999px; background: #1e293b; color: #cbd5e1; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; }
.tag.hit { background: #064e3b; color: #6ee7b7; }
.tag.miss { background: #4338ca; color: #c7d2fe; }
.tag.err { background: #7f1d1d; color: #fecaca; }
.json { background: #0a0c10; border: 1px solid #20242e; border-radius: 6px; padding: 12px; overflow: auto; font-size: 0.78rem; color: #cbd5e1; max-height: 500px; white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, monospace; }
.table-wrap { overflow-x: auto; border: 1px solid #20242e; border-radius: 6px; max-height: 500px; }
.table { width: 100%; border-collapse: collapse; background: #14171f; font-size: 0.82rem; }
.table th, .table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #20242e; white-space: nowrap; }
.table th { background: #1a1e28; color: #9ca3af; font-weight: 500; position: sticky; top: 0; }
.table tr:hover td { background: #181c25; }
.empty { padding: 16px; text-align: center; color: #6b7280; font-style: italic; }
.view-toggle { display: inline-flex; gap: 0; margin-left: auto; }
.view-toggle button { background: #1f2937; color: #9ca3af; border: 1px solid #2a2f3a; padding: 4px 10px; cursor: pointer; font-size: 0.75rem; }
.view-toggle button:first-child { border-radius: 6px 0 0 6px; }
.view-toggle button:last-child { border-radius: 0 6px 6px 0; border-left: none; }
.view-toggle button.active { background: #2563eb; color: #fff; border-color: #2563eb; }

/* ---------- Dashboard "Hoje" ---------- */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 22px; }
/* dash-grid-2: força 2 colunas (cards menores, lado a lado) — ex.: Composição física */
.dash-grid-2 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
.dash-grid-2 .dash-card { padding: 12px 14px; }
.dash-grid-2 .dash-card .v { font-size: 1.3rem; }
/* Chips de atalho de hidratação (abaixo do indicador de Hidratação no Feed) */
.hydrate-chips { display: flex; gap: 8px; padding: 8px 0 2px; }
/* Atalhos de água sob o mini card de Hidratação: colados nele (o card tem margin 18px). */
.habits-hero-card-wrap .hydrate-chips { padding: 0; margin: -10px 0 18px; }
.hydrate-chip { flex: 1; padding: 9px 6px; border: 1px solid #2a3950; background: #16202e; color: #93c5fd; border-radius: 9px; font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: background 0.12s, transform 0.06s; }
.hydrate-chip:hover { background: #1d2c40; }
/* Atalhos de refeição (café/almoço/janta) sob o card de Alimentação — tema âmbar. */
.meal-chip { flex: 1; padding: 9px 6px; border: 1px solid #92400e; background: #78350f30; color: #fde68a; border-radius: 9px; font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: background 0.12s, transform 0.06s; }
.meal-chip:hover { background: #78350f55; }
.meal-chip:active { transform: scale(0.96); }
.hydrate-chip:active { transform: scale(0.96); }
/* Lista de pesagens manuais (Composição física) */
.bw-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.bw-row { display: flex; align-items: center; gap: 10px; background: #14171f; border: 1px solid #20242e; border-radius: 9px; padding: 10px 12px; }
.bw-row-info { flex: 1; min-width: 0; }
.bw-row-main { color: #e6e7eb; font-size: 0.9rem; }
.bw-row-sub { color: #6b7280; font-size: 0.75rem; margin-top: 2px; }

/* ============================================================
   Social — Desafios + Amigos
   ============================================================ */
.btn.sm { padding: 6px 12px; font-size: 0.82rem; }
/* Avatares circulares (foto recortada + anel sutil) em todo contexto social. */
.avatar-img { border-radius: 50%; object-fit: cover; background: #0a0c10;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.10); vertical-align: middle; }
.avatar-fallback { border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.10); vertical-align: middle; }
.avatar-initials { color: #fff; font-weight: 700; font-size: 0.78rem; letter-spacing: 0.3px; }
.le-avatar.avatar-initials { font-size: 0.92rem; }
.btn-link { background: transparent; border: none; color: #93c5fd; cursor: pointer; font-size: 0.85rem; padding: 6px 0; display: inline-flex; align-items: center; gap: 4px; }
.btn-link svg { width: 16px; height: 16px; transform: rotate(180deg); }
.ch-list-head { margin: 4px 0 12px; }

.challenge-card { background: #14171f; border: 1px solid #20242e; border-radius: 11px; border-left: 4px solid #2563eb; padding: 14px 16px; margin-bottom: 10px; cursor: pointer; transition: background 0.12s; }
.challenge-card[role="button"]:hover { background: #181c26; }
.cc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cc-title { font-weight: 600; color: #e6e7eb; font-size: 1rem; }
.cc-when { font-size: 0.72rem; color: #9ca3af; white-space: nowrap; padding: 2px 8px; border-radius: 9999px; background: #1f2937; }
.cc-when.finished { color: #6ee7b7; background: #064e3b55; }
.cc-when.canceled { color: #f3a; background: #3a1f2a; }
.cc-meta { color: #9ca3af; font-size: 0.8rem; margin-top: 5px; }
.cc-go { font-size: 0.78rem; margin-top: 8px; display: inline-flex; align-items: center; gap: 3px; }
.cc-go svg { width: 14px; height: 14px; }
.cc-invite-actions, .cc-detail-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.cc-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 2px; }
.cc-detail-head h3 { margin: 0; }
.cc-winner { margin: 10px 0; padding: 10px 12px; border-radius: 9px; background: linear-gradient(135deg, #78350f33, #14171f); border: 1px solid #b4530e; color: #fbbf24; font-weight: 600; }
.cc-pending { font-size: 0.78rem; margin-top: 8px; }

.leaderboard { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.leaderboard-entry { display: flex; align-items: center; gap: 10px; background: #14171f; border: 1px solid #20242e; border-radius: 10px; padding: 9px 12px; }
.leaderboard-entry.is-self { border-color: #2563eb; background: #131a2a; }
.le-rank { width: 28px; text-align: center; font-size: 1.05rem; flex-shrink: 0; }
.le-avatar { width: 34px; height: 34px; }
.le-main { flex: 1; min-width: 0; }
.le-name { color: #e6e7eb; font-size: 0.88rem; margin-bottom: 2px; }
.le-sub { font-size: 0.72rem; margin-bottom: 5px; }
.le-today { flex-shrink: 0; text-align: right; min-width: 64px; }
.le-today-val { color: #fff; font-size: 1.5rem; font-weight: 800; line-height: 1.05; letter-spacing: -0.5px; }
.le-today-val.met { color: #34d399; }
.le-today-lbl { color: #8a93a6; font-size: 0.66rem; margin-top: 1px; }
.le-value { color: #cbd5e1; font-size: 0.85rem; font-weight: 600; white-space: nowrap; }

.friend-add { display: flex; gap: 8px; margin-bottom: 8px; }
.friend-add input { flex: 1; background: #0f1115; color: #e6e7eb; border: 1px solid #2a2f3a; border-radius: 8px; padding: 9px 11px; font-size: 0.95rem; font-family: inherit; }
.friend-add input:focus { outline: none; border-color: #2563eb; }
.friend-row { display: flex; align-items: center; gap: 10px; background: #14171f; border: 1px solid #20242e; border-radius: 10px; padding: 9px 12px; margin-bottom: 8px; }
/* Sem isto o avatar cai no tamanho intrínseco da foto (120px no Garmin) e estoura a
   linha; as iniciais, que dimensionam pelo conteúdo, ficavam bem menores que a foto. */
.friend-row .avatar-img, .friend-row .avatar-fallback { width: 30px; height: 30px; flex-shrink: 0; }
.fr-info { flex: 1; min-width: 0; }
.fr-name { color: #e6e7eb; font-size: 0.9rem; }
.fr-handle { font-size: 0.76rem; }
.fr-actions { display: flex; gap: 6px; }
.friend-results { margin-bottom: 6px; }
.friend-row.search { border-style: dashed; border-color: #2a3344; }
.fr-noresults { padding: 8px 4px; }

/* Mini-card de convites no Feed */
.invites-hero { margin-bottom: 16px; }
.challenges-hero { margin-bottom: 16px; }
.ch-hero-card { position: relative; background: linear-gradient(135deg, #78350f22, #14171f); border: 1px solid #b45309; border-radius: 12px; padding: 14px 16px; }
/* padding-right reserva o canto do botão de compartilhar INCLUINDO a área de toque
   ampliada dele (48px), pra o título não ficar por baixo do alvo do dedo. */
.ch-hero-head { display: flex; align-items: center; gap: 8px; font-weight: 700; color: #fbbf24; margin-bottom: 10px; padding-right: 52px; cursor: pointer; }
.ch-hero-head:not([data-ch-open-tab]) { cursor: default; }
.ch-hero-head svg { width: 18px; height: 18px; }

/* Botão "compartilhar como imagem" dos mini-cards: SEMPRE no canto superior
   direito, isolado do conteúdo (posição absoluta sobre o card). */
.card-share-btn { position: absolute; top: 10px; right: 10px; z-index: 3;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 30px; height: 30px; padding: 0; border-radius: 8px; background: #0f1115; border: 1px solid #2a2f3a;
  color: #fcd34d; cursor: pointer; transition: filter .15s ease, background .15s ease; }
.card-share-btn:hover { background: #1a1f2b; filter: brightness(1.15); }
.card-share-btn svg { width: 16px; height: 16px; }
/* Área de toque de 48x48 (mínimo do Material) sem inchar os 30x30 do desenho: o
   pseudo-elemento só amplia o alvo do dedo, não ocupa espaço no layout. */
.card-share-btn::after { content: ""; position: absolute; inset: -9px; }
/* Cards que têm elementos à direita (controles play/stop, chevron): viram âncora do
   botão e mandam esses elementos pro rodapé, liberando o canto sup. direito. */
#hydHeroCard .hh-cal { padding-right: 34px; }
.now-card { position: relative; }
.act-card-v2 { position: relative; }
.act-card-v2 .acv-chevron { align-self: flex-end; }
.rh-card-wrap { position: relative; }
.rh-card-wrap .rh-card { padding-right: 42px; }
.ch-hero-block { padding: 10px 0 4px; cursor: pointer; border-top: 1px solid #ffffff12; }
.ch-hero-block:first-of-type { border-top: none; padding-top: 2px; }
.chh-block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.chh-title { color: #e6e7eb; font-size: 0.92rem; font-weight: 700; }
.chh-left { font-size: 0.72rem; flex-shrink: 0; }
.chh-ranklist { display: flex; flex-direction: column; }
.chh-rank { display: flex; align-items: center; gap: 9px; padding: 5px 0; }
.chh-rank.is-self { background: #ffffff08; border-radius: 8px; margin: 0 -6px; padding: 5px 6px; }
.chh-medal { width: 22px; text-align: center; font-size: 0.82rem; color: #cbd5e1; flex-shrink: 0; }
.chh-avatar.avatar-img, .chh-avatar.avatar-fallback { width: 28px; height: 28px; flex-shrink: 0; }
.chh-rk-main { flex: 1; min-width: 0; }
.chh-rk-name { color: #e6e7eb; font-size: 0.84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chh-rk-sub { font-size: 0.7rem; }
.chh-bar { height: 5px; margin: 5px 0 1px; }
.chh-today { flex-shrink: 0; text-align: right; min-width: 58px; }
.chh-today-val { color: #fff; font-size: 1.3rem; font-weight: 800; line-height: 1.05; letter-spacing: -0.5px; }
.chh-today-val.met { color: #34d399; }
.chh-today-lbl { color: #8a93a6; font-size: 0.62rem; margin-top: 1px; }

/* Recap do desafio encerrado: mesmo card, tom de conclusão (verde) em vez do âmbar
   de "em andamento" — o card vive 1 dia e não deve ser confundido com o ativo. */
.ch-recap { background: linear-gradient(135deg, #064e3b33, #14171f); border-color: #059669; }
.ch-recap .ch-hero-head { color: #34d399; }
.ch-recap .card-share-btn { color: #34d399; }
.chr-verdict { color: #e6e7eb; font-size: 0.82rem; margin: 0 0 8px; }
.chr-verdict.is-win { color: #34d399; font-weight: 700; }
/* Sem coluna "hoje" no recap: o desafio acabou, o que vale é o acumulado. */
.chr-rank { padding: 4px 0; }

/* Evolução do desafio: 2ª página do bloco (ranking ⇄ gráfico de linhas).
   Scroll-snap em contêiner FILHO — a página em si nunca rola lateralmente (ver o
   overflow-x: clip no topo deste arquivo). O swipe sai de graça daqui; a seta
   cobre mouse e teclado. Mesmo padrão do .chh-carousel logo abaixo. */
.chh-pages { display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.chh-pages::-webkit-scrollbar { height: 0; }
.chh-page { flex: 0 0 100%; min-width: 100%; scroll-snap-align: start; }
/* A altura inclui a faixa do eixo X: fixá-la só na área de plotagem deixa os
   rótulos dos dias de fora e o card ganha um scroll vertical minúsculo. */
.chh-evo-box { height: 158px; position: relative; }
.ev-d .chh-evo-box { height: 230px; }
.chh-evo-msg { font-size: 0.72rem; text-align: center; padding: 4px 0 2px; }
.chh-closed-head { color: #cbd5e1; font-size: 0.74rem; font-weight: 700;
  letter-spacing: 0.02em; padding: 3px 0 6px; }
.chh-rank-closed { min-height: 38px; }
.chh-pager { display: flex; align-items: center; justify-content: center; gap: 6px; padding-top: 4px; }
.chh-nav { background: none; border: none; padding: 2px 6px; color: #8a93a6; cursor: pointer;
  display: inline-flex; align-items: center; border-radius: 6px; transition: opacity 0.2s, color 0.2s; }
.chh-nav:hover { color: #e6e7eb; background: #ffffff0d; }
/* Uma seta de voltar não precisa de ícone novo: é a mesma chevron girada. */
.chh-nav.is-prev > svg { transform: rotate(180deg); }
.chh-nav:disabled { opacity: 0.25; cursor: default; }
.chh-nav:disabled:hover { color: #8a93a6; background: none; }
.chh-dot { width: 5px; height: 5px; border-radius: 50%; background: #3a4152; transition: background 0.2s; }
.chh-dot.is-on { background: #cbd5e1; }

/* Carrossel de fotos do dia (Feed) */
.chh-photos-head { font-size: 0.72rem; margin: 12px 0 6px; }
.chh-carousel { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.chh-carousel::-webkit-scrollbar { height: 0; }
.chh-photo { position: relative; flex: 0 0 auto; width: 150px; height: 150px; border-radius: 12px;
  overflow: hidden; scroll-snap-align: start; cursor: pointer; background: #0f1115; border: 1px solid #20242e; }
.chh-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.chh-photo-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 6px;
  font-size: 0.68rem; color: #f3f4f6; line-height: 1.25;
  background: linear-gradient(transparent, rgba(0,0,0,0.78)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chh-photo-cap b { color: #fff; }

/* Feed de fotos do desafio (detalhe) */
.ch-photos { margin-top: 18px; border-top: 1px solid #20242e; padding-top: 14px; }
.ph-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ph-section-head h4 { margin: 0; font-size: 0.95rem; color: #e6e7eb; }
.ph-composer { background: #0f1115; border: 1px solid #20242e; border-radius: 12px; padding: 10px; margin-bottom: 12px; }
.ph-crop-stage { position: relative; overflow: hidden; border-radius: 12px; background: #000; margin: 0 auto;
  touch-action: none; cursor: grab; user-select: none; }
.ph-crop-stage:active { cursor: grabbing; }
.ph-crop-img { position: absolute; top: 0; left: 0; max-width: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.ph-crop-zoom { display: flex; align-items: center; gap: 10px; margin: 10px 2px 0; font-size: 0.78rem; }
.ph-crop-zoom input { flex: 1; accent-color: #2563eb; }
.ph-caption-in { width: 100%; margin-top: 8px; background: #14171f; border: 1px solid #20242e; border-radius: 8px;
  color: #e6e7eb; padding: 8px 10px; font-family: inherit; font-size: 0.88rem; resize: vertical; }
.ph-composer-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.ph-feed { display: flex; flex-direction: column; gap: 14px; }
.ph-card { background: #14171f; border: 1px solid #20242e; border-radius: 12px; overflow: hidden; }
.ph-head { display: flex; align-items: center; gap: 9px; padding: 10px 12px; }
.ph-avatar.avatar-img, .ph-avatar.avatar-fallback { width: 32px; height: 32px; flex-shrink: 0; }
.ph-who { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 0; }
.ph-who b { color: #e6e7eb; font-size: 0.86rem; }
.ph-who span { font-size: 0.7rem; }
.ph-del { background: none; border: none; color: #6b7280; cursor: pointer; padding: 4px; flex-shrink: 0; }
.ph-del:hover { color: #f87171; }
.ph-del svg { width: 16px; height: 16px; }
.ph-img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: #000; }
.ph-caption { padding: 10px 12px 4px; font-size: 0.88rem; color: #d8dae0; line-height: 1.4; }
.ph-cmts { padding: 6px 12px; display: flex; flex-direction: column; gap: 5px; }
.ph-cmt { font-size: 0.82rem; color: #cbd5e1; line-height: 1.35; }
.ph-cmt b { color: #e6e7eb; }
.ph-cmt-del { background: none; border: none; color: #6b7280; cursor: pointer; font-size: 0.95rem; padding: 0 4px; }
.ph-cmt-del:hover { color: #f87171; }
.ph-cmt-add { display: flex; gap: 6px; padding: 8px 12px 12px; }
.ph-cmt-add input { flex: 1; min-width: 0; background: #0f1115; border: 1px solid #20242e; border-radius: 8px;
  color: #e6e7eb; padding: 7px 10px; font-size: 0.84rem; }
.ph-cmt-add input::placeholder { color: #5c6373; }
.invites-card { background: linear-gradient(135deg, #1e3a8a22, #14171f); border: 1px solid #2563eb; border-radius: 12px; padding: 14px 16px; }
.invites-head { display: flex; align-items: center; gap: 8px; font-weight: 700; color: #93c5fd; margin-bottom: 10px; }
.invites-head svg { width: 18px; height: 18px; }
.invites-badge { background: #2563eb; color: #fff; border-radius: 9999px; font-size: 0.72rem; padding: 1px 8px; }
.invites-list { display: flex; flex-direction: column; gap: 9px; }
.invite-row { display: flex; align-items: center; gap: 10px; }
.invite-row .avatar-img, .invite-row .avatar-fallback { width: 30px; height: 30px; flex-shrink: 0; }
.invite-row.accepted .invite-txt svg { width: 13px; height: 13px; color: #34d399; vertical-align: -2px; }
.invite-ic { width: 30px; height: 30px; flex-shrink: 0; border-radius: 50%; background: #78350f33; color: #fbbf24; display: inline-flex; align-items: center; justify-content: center; }
.invite-ic svg { width: 17px; height: 17px; }
.invite-txt { flex: 1; min-width: 0; color: #e6e7eb; font-size: 0.86rem; }
.invite-acts { display: flex; gap: 6px; flex-shrink: 0; }

/* Admin · usuários */
.admin-count { margin-bottom: 10px; }
.admin-users { display: flex; flex-direction: column; gap: 8px; }
.admin-user { display: flex; align-items: center; gap: 10px; background: #14171f; border: 1px solid #20242e; border-radius: 10px; padding: 10px 12px; }
.au-main { flex: 1; min-width: 0; }
.au-name { color: #e6e7eb; font-size: 0.9rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.au-sub { font-size: 0.76rem; margin-top: 2px; word-break: break-all; }
.au-meta { font-size: 0.72rem; margin-top: 3px; }
.au-acts { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.admin-search { margin-bottom: 12px; }
.admin-search input { width: 100%; background: #14171f; border: 1px solid #20242e; border-radius: 10px; padding: 9px 12px; color: #e6e7eb; font-size: 0.85rem; }
.admin-search input::placeholder { color: #5c6373; }
.au-badge { font-size: 0.66rem; padding: 1px 7px; border-radius: 9999px; font-weight: 700; }
.au-badge.admin { background: #2563eb; color: #fff; }
.au-badge.off { background: #3a1f2a; color: #fda4af; }
.adm-chk { display: flex !important; align-items: center; gap: 8px; flex-direction: row !important; }
.adm-chk input[type=checkbox] { width: auto; margin-top: 0; }
.adm-pw { margin-top: 14px; padding-top: 12px; border-top: 1px solid #20242e; }
.adm-pw-row { display: flex; gap: 8px; margin-top: 6px; }
.adm-pw-row input { flex: 1; background: #0f1115; color: #e6e7eb; border: 1px solid #2a2f3a; border-radius: 8px; padding: 9px 11px; font-size: 0.9rem; }

.username-edit { display: inline-flex; align-items: center; border: 1px solid #2a3344; border-radius: 8px; background: #0f1115; overflow: hidden; }
.username-edit .at { padding: 0 2px 0 9px; color: #6b7280; }
.username-edit input { border: none; background: transparent; padding: 7px 9px 7px 2px; color: #e6e7eb; width: 130px; }

.ch-hint { font-size: 0.78rem; margin: 4px 0 2px; }
.cc-lobby { margin: 10px 0; }
.lobby-row { display: flex; align-items: center; gap: 10px; padding: 7px 4px; color: #e6e7eb; font-size: 0.88rem; }
.lobby-row .le-avatar, .lobby-row .avatar-img, .lobby-row .avatar-fallback { width: 30px; height: 30px; flex-shrink: 0; }
.cc-when.draft { background: #2a2f3a; color: #cbd5e1; }
.btn.syncing { pointer-events: none; opacity: 0.75; }
.btn.syncing svg { animation: spin 0.7s linear infinite; }
.update-banner { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 9999; display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 24px);
  background: #1b2030; border: 1px solid #303746; border-radius: 12px;
  padding: 10px 12px 10px 16px; box-shadow: 0 8px 28px rgba(0,0,0,0.45); color: #e6e7eb; font-size: 0.88rem; }
.update-banner .ub-close { background: transparent; border: none; color: #8a93a6; font-size: 1.2rem;
  line-height: 1; cursor: pointer; padding: 0 4px; }
.update-banner .ub-close:hover { color: #fff; }
.ch-friends-pick { margin: 10px 0; max-height: 180px; overflow-y: auto; }
.ch-friend-pick { display: flex; align-items: center; gap: 8px; padding: 6px 4px; cursor: pointer; }
.ch-friend-pick input { width: auto; }
.ch-friend-pick .avatar-img, .ch-friend-pick .avatar-fallback { width: 26px; height: 26px; }
.modal-err { color: #f87171; font-size: 0.82rem; min-height: 1em; margin: 6px 0; }
/* Cards de visão rápida no topo do painel: menores, lado a lado (1 fileira em telas largas) */
.today-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.today-title { color: #cbd5e1; font-size: 0.92rem; text-transform: uppercase; letter-spacing: 0.6px; margin: 0; font-weight: 500; }
.today-cards { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 10px; margin-bottom: 22px; }
.today-cards .dash-card { padding: 12px 14px; }
.today-cards .dash-card .v { font-size: 1.35rem; }
.today-updated { font-size: 0.72rem; color: #6b7280; white-space: nowrap; }
.dash-card { background: #14171f; border: 1px solid #20242e; border-radius: 10px; padding: 16px; position: relative; }
.card-help { position: absolute; top: 8px; right: 8px; background: transparent; border: 0; color: #6b7280; cursor: help; padding: 3px; border-radius: 50%; opacity: 0.5; transition: opacity 0.15s, color 0.15s, background 0.15s; line-height: 0; z-index: 2; }
.card-help:hover, .card-help:focus { opacity: 1; color: #93c5fd; background: #1e3a8a20; outline: none; }
.card-help svg { width: 14px; height: 14px; }
/* Ajuda inline nas linhas do resumo (mesmo tooltip, ancorado à esquerda do "?"). */
.dash-row .dr-label .dr-help { position: relative; display: inline-flex; vertical-align: middle; align-items: center; margin-left: 5px; padding: 0; background: transparent; border: 0; color: #4b5563; cursor: help; }
.dash-row .dr-label .dr-help:hover, .dash-row .dr-label .dr-help:focus { color: #93c5fd; outline: none; }
.dash-row .dr-label .dr-help svg { width: 13px; height: 13px; }
/* Selo de proveniência: número ESTIMADO pelo vaigo (modelo próprio), não medido pelo
   aparelho. Ver docs/indicadores-derivados.md. */
.prov-badge {
  display: inline-block; vertical-align: middle; margin-left: 6px;
  padding: 1px 6px; border-radius: 999px;
  font-size: 10px; font-weight: 600; letter-spacing: .02em; line-height: 1.5;
  color: #fbbf24; background: rgba(251, 191, 36, .12); border: 1px solid rgba(251, 191, 36, .3);
}
.card-help::after, .dr-help::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #1a1e28;
  color: #e6e7eb;
  padding: 10px 12px;
  border: 1px solid #2a2f3a;
  border-radius: 6px;
  font-size: 0.78rem;
  line-height: 1.5;
  width: 260px;
  white-space: normal;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  font-weight: 400;
}
.dr-help::after { right: auto; left: 0; }
.card-help:hover::after, .card-help:focus::after,
.dr-help:hover::after, .dr-help:focus::after { opacity: 1; transform: translateY(0); }
/* Mobile: o tooltip de 260px ancorado à direita vazava pra fora da tela em cards
   estreitos. Vira um banner fixo na largura do viewport (sem overflow). */
@media (max-width: 560px) {
  .card-help::after, .dr-help::after {
    position: fixed;
    left: 12px; right: 12px; bottom: 16px;
    top: auto; width: auto;
    transform: translateY(8px);
  }
  .card-help:hover::after, .card-help:focus::after,
  .dr-help:hover::after, .dr-help:focus::after { transform: translateY(0); }
}
.dash-card .k { padding-right: 22px; }
.dash-card .k { color: #6b7280; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.dash-card .v { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.dash-card .v small { font-size: 0.75rem; font-weight: 400; color: #9ca3af; margin-left: 4px; }
.dash-card .sub { font-size: 0.78rem; color: #9ca3af; margin-top: 6px; min-height: 1em; line-height: 1.5; }
.dash-card .sub .card-avg { display: block; margin-top: 4px; padding-top: 4px; border-top: 1px dashed #20242e; color: #6b7280; font-size: 0.74rem; }
.dash-card .sub .card-avg b { color: #cbd5e1; font-weight: 600; }
.dash-card.accent-blue   .v { color: #60a5fa; }
.dash-card.accent-red    .v { color: #f87171; }
.dash-card.accent-green  .v { color: #34d399; }
.dash-card.accent-purple .v { color: #a78bfa; }
.dash-card.accent-orange .v { color: #fbbf24; }
.bar { background: #1e293b; height: 6px; border-radius: 3px; margin-top: 10px; overflow: hidden; }
.bar .fill { background: linear-gradient(90deg, #2563eb, #60a5fa); height: 100%; transition: width 0.5s; }
/* Zona de tendência do período — fundo levemente distinto pra deixar claro que
   estes widgets são de OUTRO período (não repetição do "hoje"). Bem discreto. */
.period-zone { background: #181b23; border: 1px solid #262b36; border-radius: 12px; padding: 4px 16px 12px; margin-top: 24px; }
.period-zone-label { color: #6b7280; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600; padding: 14px 2px 4px; }
.dash-section { margin: 20px 0; }
.dash-section h3 { color: #cbd5e1; font-size: 0.92rem; text-transform: uppercase; letter-spacing: 0.6px; margin: 0 0 10px; font-weight: 500; }

/* ---------- Resumo diário compacto (lista) ---------- */
.dash-summary-list { background: #14171f; border: 1px solid #20242e; border-radius: 8px; overflow: hidden; margin-bottom: 18px; }
.dash-subhead { color: #6b7280; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; margin: 4px 2px 8px; }
/* Divisor interno discreto dentro de um quadro (ex: "Fatores da prontidão" dentro
   do quadro Prontidão & recuperação) — separa subgrupos sem virar outro quadro. */
.dash-subdivider { padding: 7px 16px; font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.7px; font-weight: 600; color: #6b7280; background: #11141b; border-bottom: 1px solid #20242e; }
/* Recomendação de sono (Sleep Coach) */
.sleep-need { display: flex; align-items: center; gap: 8px; padding: 10px 14px; margin-bottom: 12px; background: #1e293b40; border: 1px solid #334155; border-left: 3px solid #a78bfa; border-radius: 8px; color: #cbd5e1; font-size: 0.84rem; line-height: 1.4; }
.sleep-need svg { width: 16px; height: 16px; color: #a78bfa; flex-shrink: 0; }
.sleep-need b { color: #e6e7eb; }
.dash-row { display: grid; grid-template-columns: 26px 1fr auto minmax(64px, auto) 14px; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid #20242e; }
.dash-row:last-child { border-bottom: none; }
.dash-row.expandable { cursor: pointer; }
.dash-row:hover { background: #181c25; }
.dash-row .dr-chevron { display: inline-flex; align-items: center; justify-content: center; color: #4b5563; transition: transform 0.18s ease; }
.dash-row .dr-chevron svg { width: 14px; height: 14px; }
.dash-row.expanded { background: #181c25; }
.dash-row.expanded .dr-chevron { transform: rotate(90deg); color: #9ca3af; }
/* Toggle dos "Fatores da prontidão" (mesma affordance das linhas expansíveis). */
.dash-row.readiness-toggle { cursor: pointer; }
.dash-row.readiness-toggle.open .dr-chevron { transform: rotate(90deg); color: #9ca3af; }
/* Fatores aninhados sob "Prontidão para treinar": fundo levemente recuado, fonte
   menor e indentação à esquerda pra comunicar hierarquia. */
.readiness-factors { background: #0d0f14; border-left: 2px solid #2a2f3a; }
.readiness-factors .dash-row { padding-top: 8px; padding-bottom: 8px; padding-left: 34px; }
.readiness-factors .dash-row .dr-icon svg { width: 14px; height: 14px; }
.readiness-factors .dash-row .dr-label { font-size: 0.8rem; color: #9ca3af; }
.readiness-factors .dash-row .dr-value { font-size: 0.9rem; }
.readiness-factors .dash-row .dr-value small { font-size: 0.62rem; }
.dash-row-chart { padding: 10px 16px 16px; border-bottom: 1px solid #20242e; background: #11141b; }
.dash-row-chart:last-child { border-bottom: none; }
.dash-row-chart canvas { max-height: 200px; }
.dash-row-chart.empty { color: #6b7280; font-size: 0.82rem; padding: 14px 16px; }
.dash-row .dr-icon { display: inline-flex; align-items: center; justify-content: center; color: #6b7280; }
.dash-row .dr-icon svg { width: 17px; height: 17px; }
.dash-row .dr-label { color: #cbd5e1; font-size: 0.9rem; }
.dash-row .dr-value { font-weight: 700; font-size: 1.05rem; text-align: right; white-space: nowrap; color: #e6e7eb; }
.dash-row .dr-value small { font-size: 0.68rem; font-weight: 400; color: #9ca3af; margin-left: 3px; }
.dash-row .dr-ctx { color: #6b7280; font-size: 0.76rem; text-align: right; white-space: nowrap; }
.dash-row.accent-red    .dr-icon { color: #f87171; }
.dash-row.accent-blue   .dr-icon { color: #60a5fa; }
.dash-row.accent-green  .dr-icon { color: #34d399; }
.dash-row.accent-purple .dr-icon { color: #a78bfa; }
.dash-row.accent-orange .dr-icon { color: #fbbf24; }
/* Mobile: contexto longo (ruim · hora de recarregar · recup. … · pronto …) trunca
   na coluna estreita. Pra linhas com contexto, joga o dr-ctx pra uma 2ª linha
   de largura cheia (alinhada sob o rótulo), podendo quebrar o texto. */
@media (max-width: 560px) {
  .dash-row.has-ctx {
    grid-template-columns: 26px 1fr auto 14px;
    grid-template-areas: "ic lb vl ch" "ct ct ct ct";
    row-gap: 3px;
  }
  .dash-row.has-ctx .dr-icon    { grid-area: ic; }
  .dash-row.has-ctx .dr-label   { grid-area: lb; }
  .dash-row.has-ctx .dr-value   { grid-area: vl; }
  .dash-row.has-ctx .dr-chevron { grid-area: ch; }
  .dash-row.has-ctx .dr-ctx {
    grid-area: ct; text-align: left; white-space: normal;
    padding-left: 38px; line-height: 1.4;
  }
}
/* subgrid de composição/performance: cards menores que o grid principal */
.dash-grid-sub { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

/* ---------- Chart wrapper ---------- */
.chart-wrap { background: #14171f; border: 1px solid #20242e; border-radius: 8px; padding: 14px; margin-bottom: 14px; position: relative; }
.chart-wrap .title { font-size: 0.85rem; color: #cbd5e1; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: baseline; }
.chart-wrap .title .legend { font-size: 0.72rem; color: #9ca3af; }
.chart-wrap canvas { width: 100% !important; max-height: 240px; }

/* ---------- Sleep stages ---------- */
/* Interpretação do sono (topo da aba Sono) — manchete colorida + nota contextual. */
.sleep-insight { border-left: 3px solid #2a2f3a; padding: 10px 14px; background: #11141b; border-radius: 8px; }
.sleep-insight .si-headline { font-size: 1.05rem; font-weight: 600; line-height: 1.3; }
.sleep-insight .si-note { color: #9aa3b2; font-size: 0.85rem; margin-top: 4px; line-height: 1.4; }
/* Interpretação rica (LLM) */
.sleep-insight .si-text p { margin: 0 0 10px; line-height: 1.55; font-size: 0.92rem; color: #d7dbe2; }
.sleep-insight .si-text p:last-child { margin-bottom: 0; }
.sleep-insight .si-tip { margin-top: 10px; padding: 9px 12px; background: #0f1722; border-radius: 7px; font-size: 0.88rem; line-height: 1.45; color: #cfe3ff; display: flex; gap: 7px; }
.sleep-insight .si-tip svg.icon { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 2px; color: #60a5fa; }
.sleep-insight .si-resp { margin-top: 10px; padding: 9px 12px; border-radius: 7px; background: #10161d; border: 1px solid #20242e; }
.sleep-insight .si-resp.att { background: #1e1410; border-color: #5a3320; }
.sleep-insight .si-resp-h { font-weight: 600; font-size: 0.85rem; display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.sleep-insight .si-resp-h svg.icon { width: 14px; height: 14px; }
.sleep-insight .si-resp p { margin: 0; font-size: 0.86rem; line-height: 1.45; color: #c3cad4; }
.sleep-insight .si-att { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: #fb923c; background: #3a2415; padding: 2px 7px; border-radius: 10px; }
.sleep-insight .si-disclaimer { margin-top: 10px; font-size: 0.76rem; color: #8b93a1; line-height: 1.4; display: flex; gap: 6px; align-items: flex-start; }
.sleep-insight .si-disclaimer svg.icon { width: 13px; height: 13px; flex: 0 0 auto; margin-top: 2px; }
.sleep-insight .si-loading { padding: 4px 0; }
/* Alinhamento do sono */
.al-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.al-cell { border-top: 1px solid #20242e; padding-top: 8px; }
.al-v { font-size: 1.35rem; font-weight: 600; line-height: 1.1; }
.al-sub { font-size: 0.76rem; color: #8b93a1; margin-top: 2px; }

.sleep-stages { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-bottom: 12px; }
.stage-pill { padding: 8px 10px; border-radius: 6px; font-size: 0.78rem; }
.stage-deep    { background: #1d4ed840; border-left: 3px solid #1d4ed8; }
.stage-light   { background: #38bdf840; border-left: 3px solid #38bdf8; }
.stage-rem     { background: #db277740; border-left: 3px solid #db2777; }
.stage-awake   { background: #f472b640; border-left: 3px solid #f472b6; }
.stage-unspecified { background: #818cf840; border-left: 3px solid #818cf8; }
.sleep-legend { display: flex; justify-content: center; gap: 18px; margin-top: 10px; flex-wrap: wrap; font-size: 0.82rem; color: #cbd5e1; }
.sleep-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.sleep-legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.sleep-dist { margin-top: 12px; }
.sleep-dist .sleep-legend strong { color: #f1f5f9; font-weight: 600; }
.sleep-chips { display: flex; justify-content: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.sleep-chips .chip { font-size: 0.78rem; padding: 5px 14px; }
.stage-pill .k { color: #9ca3af; font-size: 0.7rem; text-transform: uppercase; }
.stage-pill .v { font-weight: 600; color: #e6e7eb; }

/* ---------- Map ---------- */
.map-wrap { height: 360px; border-radius: 8px; overflow: hidden; border: 1px solid #20242e; margin-bottom: 14px; }
.leaflet-container { background: #0a0c10 !important; }
.leaflet-tile-pane { filter: invert(0.92) hue-rotate(180deg) saturate(0.7); }

/* ---------- Period bar (sticky abaixo do topbar) ---------- */
/* Compacta: datas ao lado do label (linha de cima), chips embaixo — economiza altura. */
.period-bar { display: flex; flex-direction: column; gap: 6px; padding: 7px 12px; background: #14171f; border: 1px solid #20242e; border-radius: 8px; margin-bottom: 12px; position: sticky; top: calc(60px + env(safe-area-inset-top)); z-index: 9; box-shadow: 0 4px 14px rgba(15, 17, 21, 0.4); }
@media (max-width: 768px) { .period-bar { top: calc(56px + env(safe-area-inset-top)); } }
.period-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.period-head #periodRange { font-size: 0.78rem; }
.period-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.7px; color: #9ca3af; }
.period-buttons { display: inline-flex; gap: 0; }
.period-buttons button { background: #0f1115; color: #9ca3af; border: 1px solid #2a2f3a; padding: 6px 12px; cursor: pointer; font-size: 0.82rem; border-right: none; }
.period-buttons button:first-child { border-radius: 6px 0 0 6px; }
.period-buttons button:last-child { border-radius: 0 6px 6px 0; border-right: 1px solid #2a2f3a; }
.period-buttons button.active { background: #2563eb; color: #fff; border-color: #2563eb; }
.btn-refresh { background: #1f2937; color: #cbd5e1; border: 1px solid #2a2f3a; border-radius: 6px; padding: 6px 12px; cursor: pointer; font-size: 0.82rem; margin-left: auto; }
.btn-refresh:hover { background: #2a3445; border-color: #3a4150; }
.btn-refresh:disabled { opacity: 0.5; cursor: wait; }
.btn-refresh.spinning::before { content: ""; display: inline-block; width: 10px; height: 10px; border: 2px solid #60a5fa; border-top-color: transparent; border-radius: 50%; margin-right: 6px; animation: spin 0.7s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }
/* Botão "reestimar com IA" no canto direito do campo de descrição da refeição (edição).
   Especificidade .le-desc-wrap .le-reanalyze pra vencer o `.form button` (que é
   largura-total/azul). Transparente, pequeno, centrado — como no ChopChop. */
.le-desc-wrap { position: relative; display: block; margin-top: 4px; }
/* reserva a coluna direita pro botão (vence .modal-card .form textarea por especificidade) */
.modal-card .form .le-desc-wrap input, .modal-card .form .le-desc-wrap textarea { width: 100%; margin-top: 0; padding-right: 40px; box-sizing: border-box; }
.le-desc-wrap .le-reanalyze { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; min-width: 0; margin: 0; padding: 0; display: flex; align-items: center; justify-content: center; background: transparent; border: none; border-radius: 6px; color: #cbd5e1; cursor: pointer; }
.le-desc-wrap .le-reanalyze:hover { background: #1f2530; color: #fff; }
.le-desc-wrap .le-reanalyze:disabled { opacity: 0.6; cursor: default; }
.le-desc-wrap .le-reanalyze svg { width: 16px; height: 16px; }
.le-desc-wrap .le-reanalyze.loading svg { animation: spin 0.7s linear infinite; }
#syncStatus { display: inline-flex; align-items: center; gap: 10px; font-size: 0.78rem; }
#syncStatus .sync-last { color: #cbd5e1; }
#syncStatus .sync-last small { font-size: 0.72rem; }
#syncStatus .sync-auto { color: #9ca3af; }
#syncStatus #syncNowBtn { background: transparent; border: 1px solid #2a2f3a; color: #93c5fd; border-radius: 4px; padding: 3px 10px; cursor: pointer; font-size: 0.72rem; }
#syncStatus #syncNowBtn:hover { background: #1e3a8a40; border-color: #2563eb; }

/* ---------- Activity list ---------- */
.activity-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin-bottom: 18px; }
.activity-card { background: #14171f; border: 1px solid #20242e; border-radius: 8px; padding: 12px 14px; cursor: pointer; transition: border-color 0.15s; }
.activity-card:hover { border-color: #3a4150; }
.activity-card.open { border-color: #2563eb; }
.activity-card .title-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.activity-card .name { font-weight: 600; color: #e6e7eb; }
.activity-card .date { font-size: 0.75rem; color: #9ca3af; }
.activity-card .stats { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.78rem; color: #9ca3af; margin-top: 6px; }
.activity-card .stats span { display: inline-flex; gap: 4px; }
.activity-card .stats b { color: #cbd5e1; font-weight: 500; }
/* Totalizadores do período (3 cards quadrados no topo da aba Atividades). */
.act-totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 4px 0 16px; max-width: 460px; }
.act-totals .at-card { aspect-ratio: 1 / 1; background: #14171f; border: 1px solid #20242e; border-radius: 10px; padding: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.act-totals .at-k { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.6px; color: #6b7280; font-weight: 600; }
.act-totals .at-val { font-size: 1.5rem; font-weight: 700; color: #e6e7eb; line-height: 1.1; margin: 4px 0 2px; }
.act-totals .at-val small { font-size: 0.62rem; font-weight: 400; color: #9ca3af; margin-left: 2px; }
.act-totals .at-sub { font-size: 0.68rem; color: #9ca3af; }
@media (max-width: 420px) { .act-totals .at-val { font-size: 1.25rem; } }
/* Trabalho: 4 totalizadores COMPACTOS, sempre numa linha só (sem cards quadrados). */
.act-totals.work-totals { grid-template-columns: repeat(4, 1fr); max-width: 520px; gap: 8px; }
.act-totals.work-totals .at-card { aspect-ratio: auto; padding: 8px 6px; border-radius: 8px; }
.act-totals.work-totals .at-k { font-size: 0.56rem; letter-spacing: 0.4px; }
.act-totals.work-totals .at-val { font-size: 1.05rem; margin: 2px 0 1px; }

/* "Histórico do período" no final do detalhe da atividade: linhas com distância · pace · FC. */
.act-hist-sect { margin-top: 18px; }
.act-hist-head { margin: 0 0 8px; color: #cbd5e1; font-size: 0.92rem; text-transform: uppercase; letter-spacing: 0.6px; }
.act-hist { display: flex; flex-direction: column; gap: 6px; }
.ah-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left;
  background: #0f1218; border: 1px solid #20242e; border-radius: 9px; padding: 9px 12px; color: #cbd5e1; font: inherit; }
button.ah-row { cursor: pointer; transition: background 0.12s, border-color 0.12s; }
button.ah-row:hover { border-color: #334155; background: #14171f; }
.ah-row.is-current { border-color: #34a98e; background: #0e1a17; }
.ah-name { font-weight: 600; color: #e6e7eb; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ah-name small { color: #6b7280; font-weight: 400; margin-left: 6px; }
.ah-stats { flex-shrink: 0; font-size: 0.85rem; color: #9ca3af; white-space: nowrap; }
.ah-stats b { color: #cbd5e1; font-weight: 600; }
.act-totals.work-totals .at-val small { font-size: 0.56rem; }
.act-totals.work-totals .at-sub { font-size: 0.58rem; }

/* Card padronizado (mesmo visual do card de atividade do painel). */
.activity-list { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.act-card-v2 { display: flex; align-items: center; gap: 14px; padding: 12px 14px; }
.act-card-v2 .acv-visual { flex-shrink: 0; width: 64px; height: 64px; border-radius: 10px; background: #0f1115; border: 1px solid #20242e; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.act-card-v2 .acv-visual .route-thumb { width: 100%; height: 100%; }
.act-card-v2 .acv-ph { color: #34d399; }
.act-card-v2 .acv-ph svg { width: 26px; height: 26px; }
.act-card-v2 .acv-body { flex: 1; min-width: 0; }
.act-card-v2 .acv-name { font-weight: 600; color: #e6e7eb; font-size: 0.95rem; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-card-v2 .acv-name .muted { font-size: 0.78rem; font-weight: 400; }
.act-card-v2 .acv-stats { font-size: 0.82rem; color: #9ca3af; line-height: 1.5; }
.act-card-v2 .acv-stats b { color: #cbd5e1; font-weight: 600; }
.act-card-v2 .acv-chevron { flex-shrink: 0; color: #4b5563; display: flex; align-items: center; }
.act-card-v2 .acv-chevron svg { width: 18px; height: 18px; }
.act-card-v2:hover .acv-chevron { color: #9ca3af; }
.activity-detail { background: #14171f; border: 1px solid #2563eb; border-radius: 8px; padding: 14px; margin-bottom: 18px; }

/* ---------- Activity extras (métricas de treino, clima, FC por zona) ---------- */
.act-extra-grid { margin-bottom: 14px; }
.act-weather { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; background: #0f1115; border: 1px solid #20242e; border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 0.82rem; color: #9ca3af; }
.act-weather .aw-desc { font-weight: 600; color: #93c5fd; }
.act-weather span { display: inline-flex; gap: 4px; align-items: baseline; }
.act-weather b { color: #e6e7eb; font-weight: 600; }
.act-weather small { color: #6b7280; }
.act-hrz { margin-bottom: 14px; }
.act-hrz-title { font-size: 0.92rem; text-transform: uppercase; letter-spacing: 0.6px; color: #cbd5e1; margin: 0 0 8px; }
.hrz-row { display: grid; grid-template-columns: 92px 1fr 90px; gap: 10px; align-items: center; margin-bottom: 6px; }
.hrz-label { font-size: 0.78rem; color: #cbd5e1; font-weight: 600; }
.hrz-label small { color: #6b7280; font-weight: 400; display: block; font-size: 0.66rem; }
.hrz-bar { background: #0f1115; border-radius: 4px; height: 14px; overflow: hidden; }
.hrz-fill { height: 100%; border-radius: 4px; min-width: 2px; transition: width 0.3s; }
.hrz-time { font-size: 0.78rem; color: #cbd5e1; text-align: right; }
.hrz-time small { color: #6b7280; }

/* ---------- Splits table ---------- */
.splits-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.splits-table th, .splits-table td { padding: 6px 10px; text-align: right; border-bottom: 1px solid #20242e; }
.splits-table th { background: #1a1e28; color: #9ca3af; font-weight: 500; text-align: right; position: sticky; top: 0; }
.splits-table th:first-child, .splits-table td:first-child { text-align: left; }
.splits-table tbody tr:hover td { background: #181c25; }

/* ---------- HRV status pill ---------- */
.hrv-status { display: inline-block; padding: 2px 8px; border-radius: 9999px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; }
.hrv-status.balanced { background: #064e3b; color: #6ee7b7; }
.hrv-status.unbalanced { background: #7c2d12; color: #fdba74; }
.hrv-status.low { background: #7f1d1d; color: #fecaca; }
.hrv-status.poor { background: #7f1d1d; color: #fecaca; }

/* ---------- Aba Hábitos ---------- */
/* O wrapper herda .dash-section (margin: 20px 0), que somado ao padding do main deixava um
   vão grande acima das sub-abas. Zera o topo: o padding do main já dá o respiro. */
.habits-root { margin-top: 0; }
.habits-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.habits-datenav { display: inline-flex; align-items: center; gap: 8px; }
.habits-datenav[hidden] { display: none; }  /* o atributo hidden vence o display:inline-flex */
.habits-date { min-width: 64px; text-align: center; color: #cbd5e1; font-size: 0.85rem; }
.habits-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 12px 0 18px; }
.habit-card { background: #14171f; border: 1px solid #20242e; border-radius: 10px; padding: 12px 14px; }
.habit-card.done { border-color: #065f46; }
/* Refeição com foto: conteúdo à esquerda, miniatura à direita. */
.habit-card.has-thumb { display: flex; align-items: flex-start; gap: 12px; }
.habit-card.has-thumb .hab-main { flex: 1; min-width: 0; }
.habit-card .meal-thumb { flex-shrink: 0; width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid #2a2f3a; }
.habit-card .hab-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.habit-card .hab-label { font-weight: 600; color: #e6e7eb; font-size: 0.92rem; flex: 1; min-width: 0; }
.habit-card .hab-garmin { font-size: 0.85rem; }
.habit-card .hab-value { color: #6ee7b7; font-weight: 600; font-size: 0.85rem; }
.habit-card .hab-delcustom { background: transparent; border: none; color: #6b7280; cursor: pointer; padding: 0; display: inline-flex; }
.habit-card .hab-delcustom svg { width: 14px; height: 14px; }
.habit-card .hab-delcustom:hover { color: #f87171; }
.habit-card .hab-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.habit-card .hab-logs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #20242e; }
.hab-logchip { display: inline-flex; align-items: center; gap: 4px; background: #0f1115; border: 1px solid #2a2f3a; border-radius: 9999px; padding: 2px 4px 2px 10px; font-size: 0.72rem; color: #cbd5e1; }
.hab-logchip button { background: transparent; border: none; color: #6b7280; cursor: pointer; font-size: 0.9rem; line-height: 1; padding: 0 4px; }
.hab-logchip button:hover { color: #f87171; }
.habits-custom-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.6px; color: #6b7280; font-weight: 600; }

/* Seção "Refeições": uma div maior agrupando os cards de refeição. */
.habits-meals { background: #101218; border: 1px solid #20242e; border-radius: 12px; padding: 14px; margin: 12px 0 18px; }
.habits-meals-title { display: flex; align-items: center; gap: 8px; color: #cbd5e1; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; margin-bottom: 12px; }
.habits-meals-title svg { width: 16px; height: 16px; color: #f59e0b; }
.habits-meals-grid { margin: 0; }
/* Chip de período (manhã/tarde/noite) deduzido da hora — dentro do logchip da cafeína. */
.hab-period { background: #1f2937; color: #93c5fd; border-radius: 9999px; padding: 1px 7px; font-size: 0.66rem; text-transform: lowercase; }

/* ---------- Habits hero (card de hábitos no painel — âmbar) ---------- */
.habits-hero-card { position: relative; display: flex; align-items: flex-start; gap: 14px; background: linear-gradient(135deg, #78350f25, #14171f); border: 1px solid #92400e; border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; cursor: pointer; }
.habits-hero-card:hover { filter: brightness(1.06); }
.habits-hero-card .hh-chevron { align-self: center; }
/* reserva espaço no topo pro botão de compartilhar (canto sup. direito) não cobrir o "faltam X kcal" */
#habHeroCard .hh-cal { padding-right: 34px; }
.habits-hero-card .hh-icon { flex-shrink: 0; width: 44px; height: 44px; border-radius: 10px; background: #0f1115; border: 1px solid #20242e; display: flex; align-items: center; justify-content: center; color: #fbbf24; }
.habits-hero-card .hh-icon svg { width: 22px; height: 22px; }
.habits-hero-card .hh-body { flex: 1; min-width: 0; }
.habits-hero-card .hh-label { display: inline-flex; align-items: center; gap: 6px; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.6px; color: #fcd34d; margin-bottom: 5px; }
.habits-hero-card .hh-label svg { width: 13px; height: 13px; }
.habits-hero-card .hh-cal { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.habits-hero-card .hh-cal-num { font-size: 1.1rem; color: #e6e7eb; }
.habits-hero-card .hh-cal-num b { font-weight: 700; }
.habits-hero-card .hh-cal-rem { font-size: 0.8rem; color: #cbd5e1; }
.habits-hero-card .bar { width: 100%; margin-top: 8px; }
.habits-hero-card .hh-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.habits-hero-card .hh-macro { display: inline-flex; align-items: center; gap: 6px; background: #78350f50; border: 1px solid #92400e; border-radius: 9999px; padding: 3px 10px; font-size: 0.76rem; color: #fde68a; }
.habits-hero-card .hh-macro i { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.habits-hero-card .hh-macro b { color: #fff; font-weight: 600; }
.habits-hero-card .hh-chip { background: #78350f50; border: 1px solid #92400e; border-radius: 9999px; padding: 2px 10px; font-size: 0.76rem; color: #fde68a; }
.habits-hero-card .hh-quick { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.habits-hero-card .hh-quick .chip { white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.habits-hero-card .hh-quick .chip svg.icon { width: 13px; height: 13px; }
/* Variante Hidratação (azul) — mesmo layout do hero de Alimentação, tema água. */
.habits-hero-card.hyd { background: linear-gradient(135deg, #1e3a8a25, #14171f); border-color: #1e40af; }
.habits-hero-card.hyd .hh-icon { color: #60a5fa; }
.habits-hero-card.hyd .hh-label { color: #93c5fd; }
/* ---------- Card de previsão do tempo (Painel) ---------- */
.weather-card { position: relative; background: linear-gradient(135deg, #0c4a6e2a, #14171f); border: 1px solid #0e7490; border-radius: 12px; padding: 12px 14px 14px; margin-bottom: 18px; }
/* Reload bem discreto, centralizado no topo do card. */
.wx-reload { position: absolute; top: 5px; left: 50%; transform: translateX(-50%); background: transparent; border: none; color: #7dd3fc; opacity: 0.4; cursor: pointer; padding: 3px; line-height: 0; transition: opacity 0.15s; }
.wx-reload:hover { opacity: 0.9; }
.wx-reload svg { width: 13px; height: 13px; }
.wx-reload.spinning { opacity: 0.9; }
.wx-reload.spinning svg { animation: spin 0.7s linear infinite; }
.wx-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wx-title { display: inline-flex; align-items: center; gap: 7px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.6px; color: #7dd3fc; font-weight: 600; }
.wx-title svg { width: 16px; height: 16px; }
.wx-loc { color: #93c5fd; text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: 4px; }
.wx-maxmin { display: inline-flex; align-items: baseline; gap: 10px; }
.wx-max { color: #fca5a5; font-weight: 700; font-size: 1rem; }
.wx-max::before { content: "↑"; font-size: 0.72rem; opacity: 0.85; margin-right: 1px; }
.wx-min { color: #93c5fd; font-weight: 700; font-size: 1rem; }
.wx-min::before { content: "↓"; font-size: 0.72rem; opacity: 0.85; margin-right: 1px; }
.wx-now { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.wx-now-main { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; }
.wx-now-tag { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.8px; color: #fcd34d; font-weight: 600; }
.wx-now-temp { font-size: 2rem; font-weight: 800; color: #fbbf24; }
.wx-now-meta { display: flex; flex-direction: column; gap: 3px; }
.wx-now-cond { font-size: 0.84rem; color: #e6e7eb; text-transform: capitalize; }
.wx-now-sub { font-size: 0.74rem; color: #9ca3af; display: inline-flex; align-items: center; gap: 5px; }
.wx-now-sub svg { width: 12px; height: 12px; opacity: 0.85; flex-shrink: 0; }
.wx-loc-line { display: inline-flex; align-items: center; gap: 4px; font-size: 0.78rem; color: #93c5fd; margin-top: 6px; }
.wx-loc-line svg { width: 13px; height: 13px; opacity: 0.9; }
.wx-spark { display: block; width: 100%; height: auto; margin: 8px 0 4px; }
.wx-periods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wx-period { border-top: 1px solid #1c3a4a; padding-top: 8px; text-align: center; }
.wx-per-lbl { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; color: #9ca3af; }
.wx-per-icon { display: flex; justify-content: center; margin: 4px 0 2px; color: #bae6fd; }
.wx-per-icon svg { width: 22px; height: 22px; }
.wx-per-temp { font-size: 1.2rem; font-weight: 700; color: #e6e7eb; margin: 1px 0 5px; }
.wx-per-row { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 0.74rem; color: #cbd5e1; margin-top: 2px; }
.wx-per-row svg { width: 12px; height: 12px; opacity: 0.8; flex-shrink: 0; }
.wx-per-row.rainy { color: #7dd3fc; }
.habits-hero-card .hh-chevron { flex-shrink: 0; color: #fcd34d; display: flex; align-items: center; }
.habits-hero-card .hh-chevron svg { width: 18px; height: 18px; }
@media (max-width: 560px) {
  .habits-hero-card { flex-wrap: wrap; }
  .habits-hero-card .hh-quick { flex-direction: row; flex-basis: 100%; }
}

/* ---------- Jejum intermitente (card na aba Hábitos — índigo) ---------- */
.fasting-card-wrap { margin-bottom: 18px; }
.fasting-card { background: linear-gradient(135deg, #312e8125, #14171f); border: 1px solid #4338ca; border-radius: 12px; padding: 16px 18px; }
.fasting-card.active { border-color: #6366f1; }
.fasting-card .fc-head { display: inline-flex; align-items: center; gap: 6px; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.6px; color: #a5b4fc; margin-bottom: 12px; }
.fasting-card .fc-head svg { width: 13px; height: 13px; }
.fasting-card .fc-tag { background: #4338ca40; border: 1px solid #4338ca; border-radius: 9999px; padding: 1px 8px; font-size: 0.62rem; color: #c7d2fe; letter-spacing: 0.4px; }
/* Pílulas no histórico de jejum (fora do .fasting-card): protocolo + tag "auto". */
.wk-period-when .fc-proto { background: #14532d40; border: 1px solid #15803d; border-radius: 9999px; padding: 1px 8px; font-size: 0.62rem; color: #86efac; letter-spacing: 0.4px; }
.wk-period-when .fc-tag { background: #4338ca40; border: 1px solid #4338ca; border-radius: 9999px; padding: 1px 8px; font-size: 0.62rem; color: #c7d2fe; letter-spacing: 0.4px; }
.fasting-card .fc-empty { font-size: 0.88rem; margin-bottom: 12px; }
.fc-main { position: relative; width: 128px; height: 128px; margin: 4px auto 10px; }
.fc-ring { display: block; }
.fc-ring-bg { fill: none; stroke: #20242e; stroke-width: 10; }
.fc-ring-fg { fill: none; stroke: #6366f1; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; }
.fc-ring-fg.done { stroke: #34d399; }
.fc-ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.fc-elapsed { font-size: 1.5rem; font-weight: 700; color: #e6e7eb; line-height: 1; }
.fc-target { font-size: 0.72rem; margin-top: 3px; }
.fc-phase { text-align: center; display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.fc-phase-now { font-size: 0.95rem; font-weight: 600; color: #c7d2fe; }
.fc-phase-desc { font-size: 0.78rem; }
.fc-phase-next { font-size: 0.74rem; }
.fc-meta { text-align: center; font-size: 0.82rem; color: #cbd5e1; margin-bottom: 8px; }
.fc-meta b { color: #f1f5f9; font-weight: 700; }
.fc-disclaimer { display: flex; align-items: center; gap: 5px; justify-content: center; font-size: 0.7rem; margin-bottom: 12px; }
.fc-disclaimer svg { width: 12px; height: 12px; flex-shrink: 0; }
.fc-actions { display: flex; justify-content: center; margin-bottom: 6px; }
.fc-actions .btn, .fc-start .btn { display: inline-flex; align-items: center; gap: 6px; }
.fc-actions .btn svg, .fc-start .btn svg { width: 14px; height: 14px; }
.fc-start { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.fc-select { background: #0f1115; color: #e6e7eb; border: 1px solid #2a2f3a; border-radius: 6px; padding: 8px 10px; font-size: 0.85rem; }
.fc-hist-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.fc-trend { margin-top: 10px; border-top: 1px solid #20242e; padding-top: 10px; }
.fc-trend-canvas { position: relative; height: 130px; }
.fc-plan { margin-top: 6px; border-top: 1px solid #20242e; padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.fc-plan-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fc-plan-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px; color: #6b7280; min-width: 110px; }
.fc-days { display: flex; gap: 4px; flex-wrap: wrap; }
.fc-day { background: #0f1115; color: #9ca3af; border: 1px solid #2a2f3a; border-radius: 9999px; padding: 3px 9px; font-size: 0.74rem; cursor: pointer; transition: all 0.12s; }
.fc-day:hover { border-color: #4338ca; }
.fc-day.on { background: #4338ca; color: #fff; border-color: #6366f1; }
.fc-push-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; font-size: 0.8rem; }
.fc-push-btn svg { width: 14px; height: 14px; }

/* ---------- Meditação: card de presets + player de fases ---------- */
.med-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 12px 0; }
.med-preset { position: relative; text-align: left; background: #14171f; border: 1px solid #20242e; border-radius: 10px; padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; color: #e6e7eb; transition: border-color 0.12s; }
.med-preset:hover { border-color: #6366f1; }
.med-preset-label { font-weight: 600; font-size: 0.86rem; }
.med-preset-desc { font-size: 0.7rem; line-height: 1.3; }
.med-preset .bp-del { position: absolute; top: 6px; right: 6px; }

/* Player em tela cheia (overlay) */
.med-player { position: fixed; inset: 0; z-index: 1000; background: #0b0d12f2; display: flex; align-items: center; justify-content: center; padding: 20px; }
.med-player.hidden { display: none; }
.med-screen { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center; }
.med-setup-title { font-size: 1.05rem; font-weight: 700; color: #e6e7eb; }
.med-setup-desc { font-size: 0.78rem; line-height: 1.4; }
.med-opts { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.med-opt { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.med-opt > span { font-size: 0.82rem; color: #9ca3af; }
.med-optchk { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: #cbd5e1; align-self: flex-start; }
.med-setup-actions { display: flex; gap: 10px; justify-content: center; margin-top: 6px; flex-wrap: wrap; }
/* Tocando */
.med-playing { gap: 18px; }
.med-phase-label { font-size: 0.95rem; color: #a5b4fc; text-transform: uppercase; letter-spacing: 1px; }
.med-count { font-size: 3.4rem; font-weight: 200; color: #f1f5f9; font-variant-numeric: tabular-nums; }
.med-breath { font-size: 1.6rem; color: #6ee7b7; min-height: 2rem; transition: transform 1s ease-in-out; }
.med-progress { width: 100%; height: 4px; background: #20242e; border-radius: 2px; overflow: hidden; }
.med-progress-bar { height: 100%; background: #6366f1; width: 0; transition: width 0.3s linear; }
.med-controls { display: flex; gap: 12px; }
.med-silent-note { font-size: 0.72rem; }
/* Check-in */
.med-done { font-size: 1.1rem; font-weight: 700; color: #34d399; display: flex; align-items: center; gap: 8px; }
.med-checkin-q { font-size: 0.9rem; color: #cbd5e1; }
.med-moods { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.med-mood { cursor: pointer; }
.med-safety { font-size: 0.7rem; line-height: 1.4; max-width: 340px; }
.med-build-hint { font-size: 0.74rem; line-height: 1.35; margin: 2px 0 8px; }
.med-build-phases { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.med-build-row { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: #9ca3af; }
.med-cancel { background: none; border: none; color: #9ca3af; font-size: 0.78rem; cursor: pointer; margin-top: 4px; text-decoration: underline; }
.med-cancel:hover { color: #f87171; }
/* Biometria por sessão (FC/estresse/bateria antes→depois) no histórico */
.med-period { flex-direction: column; align-items: stretch; gap: 4px; }
.med-period-top { display: flex; align-items: center; gap: 8px; }
.med-period-top .wk-period-when { flex: 1; }
.med-bio { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.74rem; padding-left: 2px; }
.med-bio-m { color: #9ca3af; white-space: nowrap; }
.med-bio-m b { font-weight: 700; }
.med-bio-good { color: #34d399; }
.med-bio-bad { color: #fbbf24; }
.med-bio-wait { font-style: italic; opacity: 0.85; }
.med-bio-day { padding-left: 10px; border-left: 1px solid #20242e; }  /* contexto: separa do efeito antes→depois */
/* Biometria colapsável: resumo clicável + gráfico do intervalo (FC vermelho · estresse laranja). */
.bio-exp { margin-top: 2px; }
.bio-exp-sum { cursor: pointer; align-items: center; list-style: none; }
.bio-exp-sum::-webkit-details-marker { display: none; }
.bio-exp-chev { margin-left: auto; color: #6b7280; display: inline-flex; transition: transform 0.18s ease; }
.bio-exp-chev svg { width: 13px; height: 13px; }
.bio-exp[open] .bio-exp-chev { transform: rotate(90deg); color: #9ca3af; }
.bio-exp-chart { height: 170px; margin-top: 8px; }
.bio-exp-chart canvas { max-height: 170px; }


/* ---------- Detalhe da atividade (overlay) ---------- */
.act-detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.act-back { display: inline-flex; align-items: center; gap: 6px; background: #1f2937; color: #cbd5e1; border: 1px solid #2a2f3a; border-radius: 8px; padding: 7px 12px; font: inherit; font-size: 0.85rem; cursor: pointer; }
.act-back:hover { background: #2a3445; color: #fff; }
.act-back svg { width: 16px; height: 16px; }
.act-detail-title { flex: 1; min-width: 0; font-size: 1rem; font-weight: 600; color: #e6e7eb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-detail-head .act-back { flex-shrink: 0; }
.act-inline-panel { margin: 10px 0 16px; }
/* Mini-análise LLM no topo do detalhe expandido. */
.act-analysis { background: linear-gradient(135deg, #064e3b25, #14171f); border: 1px solid #065f46; border-left: 3px solid #34d399; border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; }
.act-analysis .aa-headline { display: flex; align-items: center; gap: 6px; font-weight: 600; color: #6ee7b7; font-size: 0.92rem; margin-bottom: 5px; }
.act-analysis .aa-headline svg { width: 15px; height: 15px; flex-shrink: 0; }
.act-analysis .aa-text { color: #e6e7eb; font-size: 0.9rem; line-height: 1.55; }

/* ---------- Coach hero ---------- */
.coach-hero { background: linear-gradient(135deg, #1e3a8a20, #14171f); border: 1px solid #1e3a8a; border-radius: 12px; padding: 18px 22px; margin-bottom: 18px; position: relative; }
/* "Coach pensando…" — heartbeat: ícone girando + reticências pulsando */
.coach-thinking { display: flex; align-items: center; gap: 6px; }
.coach-thinking svg { animation: spin 0.9s linear infinite; }
.coach-thinking .dots { display: inline-flex; }
.coach-thinking .dots i { font-style: normal; animation: coach-dot 1.2s infinite; opacity: 0.2; }
.coach-thinking .dots i:nth-child(2) { animation-delay: 0.2s; }
.coach-thinking .dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes coach-dot { 0%, 60%, 100% { opacity: 0.2; } 30% { opacity: 1; } }
.coach-hero .ch-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; gap: 12px; flex-wrap: wrap; }
.coach-hero .ch-greeting { font-size: 1.2rem; font-weight: 600; color: #e6e7eb; }
.coach-hero .ch-status { font-size: 0.72rem; color: #9ca3af; }
.coach-hero .ch-status button { background: transparent; border: 1px solid #2a2f3a; color: #93c5fd; border-radius: 4px; padding: 4px 10px; font-size: 0.74rem; cursor: pointer; margin-left: 8px; }
.coach-hero .ch-status button:hover { background: #1e3a8a40; }
.coach-hero .ch-summary { color: #e6e7eb; font-size: 0.95rem; line-height: 1.55; margin-bottom: 10px; white-space: pre-wrap; }
.coach-hero .ch-baseline { font-size: 0.85rem; color: #93c5fd; background: #1e3a8a30; padding: 10px 12px; border-radius: 6px; margin-bottom: 12px; }
.coach-hero .ch-baseline .ch-baseline-head { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.6px; color: #6ee7b7; margin-bottom: 6px; }
.coach-hero .ch-baseline ul { margin: 0; padding-left: 16px; list-style: none; }
.coach-hero .ch-baseline li { position: relative; line-height: 1.5; margin-bottom: 3px; padding-left: 2px; }
.coach-hero .ch-baseline li::before { content: "•"; position: absolute; left: -12px; color: #60a5fa; }
.coach-hero .ch-focus { font-size: 0.95rem; color: #fbbf24; font-weight: 500; margin: 12px 0; padding: 8px 12px; background: #78350f30; border-radius: 6px; border-left: 3px solid #fbbf24; }
.coach-hero .ch-recos { margin: 12px 0 8px; }
.coach-hero .ch-recos h4 { margin: 0 0 6px; font-size: 0.75rem; color: #6ee7b7; text-transform: uppercase; letter-spacing: 0.6px; }
.coach-hero .ch-recos ul { margin: 0; padding-left: 18px; color: #e6e7eb; font-size: 0.88rem; }
.coach-hero .ch-recos li { margin-bottom: 4px; line-height: 1.4; }
.coach-hero .ch-goals { margin-top: 12px; padding-top: 10px; border-top: 1px solid #1e3a8a; }
.coach-hero .ch-goal-row { display: flex; gap: 10px; align-items: center; font-size: 0.82rem; margin-bottom: 4px; }
.coach-hero .ch-goal-row .gs-status { padding: 1px 6px; border-radius: 4px; font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.4px; flex-shrink: 0; min-width: 70px; text-align: center; }
.coach-hero .ch-goal-row .gs-status.on_track { background: #064e3b; color: #6ee7b7; }
.coach-hero .ch-goal-row .gs-status.behind { background: #7f1d1d; color: #fecaca; }
.coach-hero .ch-goal-row .gs-status.ahead { background: #1e3a8a; color: #93c5fd; }
.coach-hero .ch-goal-row .gs-status.done { background: #064e3b; color: #6ee7b7; }
.coach-hero .ch-goal-row .gs-title { color: #cbd5e1; font-weight: 500; flex-shrink: 0; }
.coach-hero .ch-goal-row .gs-comment { color: #9ca3af; font-size: 0.8rem; }
.coach-hero .ch-tokens { font-size: 0.68rem; color: #6b7280; margin-top: 10px; }

/* ---------- Goal trajectory chart ---------- */
.goal-card-tab .gt-trajectory { margin-bottom: 14px; padding-top: 8px; border-top: 1px dashed #20242e; position: relative; }
.goal-card-tab .gt-trajectory-label { font-size: 0.72rem; color: #6b7280; margin-bottom: 6px; }
.goal-card-tab .gt-trajectory canvas { display: block; width: 100% !important; height: 44px !important; }
.goal-card-tab .gt-sparkline { position: relative; }
.goal-card-tab .gt-sparkline canvas { display: block; width: 100% !important; height: 56px !important; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal.hidden { display: none; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.65); backdrop-filter: blur(4px); }
.modal-card { position: relative; background: #14171f; border: 1px solid #20242e; border-radius: 12px; padding: 22px 26px; width: 100%; max-width: 580px; max-height: 90vh; overflow-y: auto; box-shadow: 0 16px 48px rgba(0,0,0,0.5); }
.modal-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
/* Guia "sync automático" — passos por SO/relógio. */
.sync-help-body { display: flex; flex-direction: column; gap: 16px; margin-top: 10px; }
.sync-os h3 { font-size: 0.82rem; color: #cbd5e1; margin: 0 0 7px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
.sync-os ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.sync-os li { font-size: 0.88rem; line-height: 1.45; color: #d2d6de; }
.sync-os b { color: #e6e7eb; font-weight: 600; }
.sync-os p.muted { margin: 0 0 8px; }
/* Guia de ativação do Health Connect: passos por marca, com botão que abre o app. */
.sync-os .btn.secondary { width: auto; margin-top: 10px; padding: 8px 14px; font-size: 0.84rem; }
.companion-origins { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; font-size: 0.86rem; color: #6ee7b7; }
.companion-origins svg { width: 15px; height: 15px; flex-shrink: 0; }
.companion-origins b { color: #a7f3d0; }
/* Botões do guia caem em várias linhas no celular (até 4 ações). */
.companion-help-actions { flex-wrap: wrap; }
.modal-head h2 { margin: 0; font-size: 1.15rem; }
.modal-head .tag { background: #1e293b; color: #93c5fd; }
.modal-card .form label { margin: 10px 0; }
.modal-card .form textarea { width: 100%; padding: 10px 12px; background: #0f1115; color: #e6e7eb; border: 1px solid #2a2f3a; border-radius: 6px; font-size: 0.9rem; margin-top: 4px; font-family: inherit; resize: vertical; }
.modal-card .form select { width: 100%; padding: 10px 12px; background: #0f1115; color: #e6e7eb; border: 1px solid #2a2f3a; border-radius: 6px; font-size: 0.9rem; margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid label { margin: 6px 0; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.modal-actions .btn { width: auto; padding: 10px 18px; }

/* ---------- Modal de refeição (calorias + macros) ---------- */
.meal-input { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; margin-bottom: 6px; border-bottom: 1px solid #20242e; }
.meal-input #mealEstimateBtn { width: auto; align-self: flex-start; padding: 8px 16px; }
.meal-photo { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.meal-photo .chip { cursor: pointer; }
.meal-photo-prev { position: relative; display: inline-block; }
.meal-photo-prev.hidden { display: none; }
.meal-photo-prev img { max-width: 120px; max-height: 120px; border-radius: 8px; border: 1px solid #2a2f3a; display: block; }
.meal-photo-prev button { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%; border: none; background: #7f1d1d; color: #fecaca; cursor: pointer; font-size: 0.85rem; line-height: 1; }
#mealEstimateHint { font-size: 0.8rem; line-height: 1.4; }
.meal-macros label { margin: 6px 0; font-size: 0.85rem; color: #9aa3b2; display: flex; flex-direction: column; gap: 4px; }
.meal-macros input { width: 100%; padding: 9px 12px; background: #0f1115; color: #e6e7eb; border: 1px solid #2a2f3a; border-radius: 6px; font-size: 0.95rem; }

/* ---------- Toast ---------- */
/* Âncora ÚNICA de todo aviso do app: topo, centralizado, abaixo da safe area. No
   rodapé (onde ficava) o toast sumia atrás da barra de navegação do sistema no
   Android — o usuário não via nem sucesso nem erro. Todo toast/snackbar herda esta
   posição; não posicione toast por conta própria em CSS de tela. */
.toast { position: fixed; top: calc(14px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  max-width: min(92vw, 460px); background: #064e3b; color: #6ee7b7; padding: 12px 18px; border-radius: 8px; z-index: 200; box-shadow: 0 8px 24px rgba(0,0,0,0.4); font-size: 0.9rem; display: inline-flex; align-items: center; gap: 8px; }
.toast.hidden { display: none; }
.toast.err { background: #7f1d1d; color: #fecaca; }
.toast svg { flex-shrink: 0; }

/* Snackbar de ação não-bloqueante (confirmToast/promptToast) — substitui confirm()/prompt()
   nativos. Mesma âncora do toast, porém neutro, com botões/entrada. NÃO some sozinho.
   No topo o campo do promptToast também não fica mais atrás do teclado virtual. */
.toast-action { flex-direction: column; align-items: stretch; gap: 11px; max-width: min(92vw, 380px);
  background: #14171f; color: #e6e7eb; border: 1px solid #2a2f3a; padding: 14px 16px;
  z-index: 300; }
.toast-action.danger { border-color: #7f1d1d; }
.toast-action .ta-msg { font-size: 0.88rem; line-height: 1.4; white-space: pre-line; }
.toast-action .ta-actions { display: flex; justify-content: flex-end; gap: 8px; }
.toast-action .ta-btn { padding: 7px 14px; border-radius: 6px; border: 1px solid #2a2f3a; background: #20242e;
  color: #e6e7eb; font-size: 0.85rem; font-family: inherit; cursor: pointer; transition: background 0.12s; }
.toast-action .ta-btn:hover { background: #2a2f3a; }
.toast-action .ta-ok { background: #2563eb; border-color: #2563eb; color: #fff; }
.toast-action.danger .ta-ok { background: #b91c1c; border-color: #b91c1c; }
.toast-action .ta-input { width: 100%; padding: 8px 10px; background: #0f1115; color: #e6e7eb;
  border: 1px solid #2a2f3a; border-radius: 6px; font-size: 0.88rem; box-sizing: border-box; }
.toast-action .ta-input:focus { outline: none; border-color: #2563eb; }

/* ---------- SVG icons inline ---------- */
.icon { display: inline-block; vertical-align: -2px; flex-shrink: 0; }
h3 .icon, h4 .icon { vertical-align: -3px; margin-right: 4px; }
button .icon { vertical-align: -2px; margin-right: 4px; }
.section-h4 { color: #cbd5e1; margin: 18px 0 8px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.6px; display: flex; align-items: center; gap: 6px; }
.section-h4 .icon { vertical-align: -2px; }
.tab-btn .badge .icon { width: 11px; height: 11px; vertical-align: -1px; }
.tab-btn.active .badge svg { color: #fff; }
.with-icon { display: inline-flex; align-items: center; gap: 4px; }
.with-icon .icon { width: 12px; height: 12px; }
/* Loader rotating */
@keyframes spin-icon { from { transform: rotate(0); } to { transform: rotate(360deg); } }
.muted .icon[width="14"], .ch-greeting .icon { vertical-align: -2px; margin-right: 4px; }
button svg.icon { width: 13px; height: 13px; }
.chip svg.icon { width: 12px; height: 12px; }

/* ---------- "Criar meta" inline buttons ---------- */
.btn-create-goal { background: transparent; color: #93c5fd; border: 1px solid #1e3a8a; border-radius: 4px; padding: 4px 10px; cursor: pointer; font-size: 0.75rem; margin-top: 8px; transition: all 0.15s; }
.btn-create-goal:hover { background: #1e3a8a40; color: #fff; border-color: #2563eb; }

/* ---------- Goals tab ---------- */
.goals-header { margin-bottom: 14px; }
.goals-header-title { margin: 0 0 4px; font-size: 1.15rem; color: #e6e7eb; }
.goals-header-sub { font-size: 0.82rem; }
.goals-toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.chip { background: #1f2937; color: #cbd5e1; border: 1px solid #2a2f3a; border-radius: 9999px; padding: 4px 12px; cursor: pointer; font-size: 0.78rem; font-family: inherit; line-height: 1.4; transition: background 0.15s, border-color 0.15s; }
.chip:hover { background: #2a3445; border-color: #3a4150; }
.chip.active { background: #2563eb; color: #fff; border-color: #2563eb; }
.chip.active:hover { background: #1d4ed8; }
.chip small { color: inherit; opacity: 0.85; }
.chip[disabled] { opacity: 0.5; cursor: not-allowed; }
.chip.danger { color: #fca5a5; border-color: #3b1d1d; }
.chip.danger:hover { background: #3b1d1d; }

/* ---------- Conexões de device (fabricantes) ---------- */
.conn-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: #0f1115; border: 1px solid #20242e; border-radius: 8px; margin-bottom: 8px; }
.conn-info b { color: #e6e7eb; }
.conn-status { font-size: 0.72rem; margin-top: 3px; text-transform: uppercase; letter-spacing: 0.4px; color: #9ca3af; }
.conn-status.active { color: #6ee7b7; }
.conn-status.mfa_required { color: #fbbf24; }
.conn-status.error { color: #f87171; }
.conn-status.coming_soon { color: #6b7280; }
/* Fonte push viva porém vazia: aviso na própria linha da conexão. */
.conn-warning { display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 0.8rem; line-height: 1.35; color: #fbbf24; }
.conn-warning svg { width: 14px; height: 14px; flex-shrink: 0; }
.conn-actions { display: flex; gap: 6px; flex-shrink: 0; }
.mfg-picker { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mfg-picker .mfg-title { flex-basis: 100%; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.6px; color: #6b7280; margin-bottom: 2px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }
.goals-toolbar .counts { margin-left: auto; color: #9ca3af; font-size: 0.82rem; }
.goals-grid-tab { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.goal-card-tab { background: #14171f; border: 1px solid #20242e; border-radius: 10px; padding: 16px 18px; border-left: 4px solid #2563eb; }
.goal-card-tab.completed { border-left-color: #34d399; }
.goal-card-tab.archived  { border-left-color: #6b7280; background: #14171f; }
.goal-card-tab.archived .gt-title { color: #9ca3af; }
.goal-card-tab.paused    { border-left-color: #fbbf24; }
/* Meta do relógio: espelho read-only. Acento ciano + leve textura tracejada na borda
   esquerda pra ler como "vem de fora, não é do vaigo / não editável". */
.goal-card-tab.device { border-left-color: #22d3ee; background: linear-gradient(#14171f, #131a1d); }
.goal-card-tab .gt-device-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 9999px; font-size: 0.7rem; background: #0e749033; color: #67e8f9; border: 1px solid #0e749055; flex-shrink: 0; }
.goal-card-tab .gt-device-badge svg { width: 13px; height: 13px; }
.goal-card-tab .gt-readonly { font-size: 0.74rem; color: #6b7280; font-style: italic; }
.goal-card-tab .gt-device-note { font-size: 0.72rem; color: #6b7280; margin-top: 6px; }
.goal-card-tab .gt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.goal-card-tab .gt-title { font-weight: 600; color: #e6e7eb; font-size: 1.0rem; line-height: 1.3; }
.goal-card-tab .gt-status { padding: 2px 8px; border-radius: 9999px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; background: #1e293b; color: #cbd5e1; flex-shrink: 0; }
.goal-card-tab .gt-status.active { background: #1e40af40; color: #93c5fd; }
.goal-card-tab .gt-status.completed { background: #064e3b; color: #6ee7b7; }
.goal-card-tab .gt-metric { color: #9ca3af; font-size: 0.83rem; margin-bottom: 10px; }
.goal-card-tab .gt-metric b { color: #cbd5e1; font-weight: 500; }
.goal-progress { background: #0f1115; border-radius: 9999px; height: 8px; overflow: hidden; margin-bottom: 6px; }
.goal-progress .fill { height: 100%; transition: width 0.4s ease; }
.goal-progress .fill.green { background: linear-gradient(90deg, #059669, #34d399); }
.goal-progress .fill.yellow { background: linear-gradient(90deg, #d97706, #fbbf24); }
.goal-progress .fill.red { background: linear-gradient(90deg, #b91c1c, #f87171); }
.goal-card-tab .gt-numbers { display: flex; justify-content: space-between; font-size: 0.78rem; color: #9ca3af; margin-bottom: 10px; }
.goal-card-tab .gt-numbers b { color: #e6e7eb; }
.goal-card-tab .gt-sparkline { height: 60px; margin-bottom: 10px; }
.goal-card-tab .gt-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 0.74rem; color: #6b7280; margin-bottom: 10px; }
.goal-card-tab .gt-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.goal-card-tab .gt-actions button { background: #1f2937; color: #cbd5e1; border: 1px solid #2a2f3a; border-radius: 4px; padding: 5px 10px; cursor: pointer; font-size: 0.75rem; }
.goal-card-tab .gt-actions button:hover { background: #2a3445; border-color: #3a4150; }
.goal-card-tab .gt-actions button.success { color: #6ee7b7; border-color: #064e3b; }
.goal-card-tab .gt-actions button.danger { color: #fca5a5; border-color: #7f1d1d; }
.goal-card-tab .gt-context { font-size: 0.74rem; color: #6b7280; font-style: italic; margin-top: 6px; padding-top: 6px; border-top: 1px solid #20242e; }

@media (max-width: 600px) {
  /* Coach: comentário da meta vai pra linha de baixo (largura total) em vez de
     ficar espremido numa coluna estreita quebrando palavra por palavra. */
  .coach-hero .ch-goal-row { flex-wrap: wrap; align-items: baseline; row-gap: 2px; }
  .coach-hero .ch-goal-row .gs-comment { flex-basis: 100%; }
}

/* ---------- Insights ---------- */
.insights-section { margin-top: 28px; padding-top: 22px; border-top: 1px solid #20242e; }
.insights-section .head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.insights-section .head h3 { margin: 0; }
.insights-overview { background: #14171f; border: 1px solid #20242e; border-left: 4px solid #2563eb; border-radius: 8px; padding: 14px 18px; margin-bottom: 16px; font-size: 0.95rem; line-height: 1.55; color: #e6e7eb; white-space: pre-wrap; }
.insights-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin-bottom: 16px; }
.insight-block { background: #14171f; border: 1px solid #20242e; border-radius: 8px; padding: 14px 16px; }
.insight-block.highlights { border-left: 3px solid #34d399; }
.insight-block.concerns { border-left: 3px solid #fbbf24; }
.insight-block.recommendations { border-left: 3px solid #60a5fa; }
.insight-block h4 { margin: 0 0 10px; color: #cbd5e1; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 500; }
.insight-block ul { margin: 0; padding-left: 20px; color: #e6e7eb; font-size: 0.9rem; }
.insight-block ul li { margin-bottom: 6px; line-height: 1.5; }
.crossref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin-bottom: 16px; }
.crossref-card { background: #14171f; border: 1px solid #20242e; border-radius: 8px; padding: 12px 14px; border-top: 3px solid #a78bfa; }
.crossref-card .title { font-size: 0.78rem; color: #a78bfa; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; font-weight: 600; }
.crossref-card .insight { color: #e6e7eb; font-size: 0.9rem; line-height: 1.45; margin-bottom: 6px; }
.crossref-card .evidence { color: #9ca3af; font-size: 0.78rem; font-style: italic; }
.goals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.goal-card { background: #14171f; border: 1px solid #20242e; border-radius: 8px; padding: 12px 14px; border-top: 3px solid #2563eb; display: flex; flex-direction: column; }
.goal-card .label { font-size: 0.72rem; color: #60a5fa; text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 4px; }
.goal-card .goal { font-weight: 600; color: #e6e7eb; font-size: 0.95rem; margin-bottom: 8px; line-height: 1.35; }
.goal-card .meta { font-size: 0.78rem; color: #9ca3af; line-height: 1.55; }
.goal-card .meta b { color: #cbd5e1; }
.goal-card .btn-create-goal { margin-top: auto; margin-bottom: 0; align-self: center; padding: 6px 14px; }
.patterns-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; margin-bottom: 10px; }
.pattern { padding: 10px 12px; background: #14171f; border: 1px solid #20242e; border-radius: 6px; font-size: 0.85rem; color: #e6e7eb; }
.pattern.high { border-left: 3px solid #f87171; }
.pattern.medium { border-left: 3px solid #fbbf24; }
.pattern.low { border-left: 3px solid #9ca3af; }
.pattern.good { border-left: 3px solid #34d399; }
.pattern b { color: #cbd5e1; }
.pattern-title { margin-bottom: 4px; }
.pattern-fact { color: #e6e7eb; margin-bottom: 6px; }
.pattern-target { color: #6ee7b7; font-size: 0.83rem; margin-bottom: 4px; line-height: 1.4; }
.pattern-reco { color: #c7d2fe; font-size: 0.83rem; line-height: 1.4; }
.pattern-target b, .pattern-reco b { color: inherit; font-weight: 600; }
.rich-list { list-style: none; padding-left: 0; }
.rich-list li { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid #20242e; line-height: 1.5; }
.rich-list li:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.li-target, .li-why, .li-impact { font-size: 0.83rem; margin-top: 4px; line-height: 1.4; }
.li-target { color: #6ee7b7; }
.li-why { color: #9ca3af; font-style: italic; }
.li-impact { color: #93c5fd; }
.insights-llm-off { background: #1a1e28; border: 1px dashed #2a2f3a; border-radius: 6px; padding: 12px 14px; color: #9ca3af; font-size: 0.85rem; margin-top: 10px; }
.insights-llm-off code { background: #0a0c10; padding: 2px 6px; border-radius: 4px; color: #cbd5e1; }

/* ---------- Garmin Goals (read-only) ---------- */
.garmin-goals-toolbar { display: flex; gap: 6px; align-items: center; margin: 10px 0 12px; flex-wrap: wrap; }
.garmin-goals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin-bottom: 18px; }
.garmin-goal-card { background: #14171f; border: 1px solid #20242e; border-radius: 8px; padding: 12px 14px; border-top: 3px solid #6b7280; }
.garmin-goal-card .ggc-title { font-weight: 600; color: #e6e7eb; font-size: 0.95rem; margin-bottom: 4px; }
.garmin-goal-card .ggc-desc { color: #9ca3af; font-size: 0.82rem; margin-bottom: 8px; }
.garmin-goal-card .ggc-numbers { display: flex; justify-content: space-between; font-size: 0.78rem; color: #9ca3af; margin-bottom: 6px; }
.garmin-goal-card .ggc-numbers b { color: #e6e7eb; }
.garmin-goal-card .ggc-meta { font-size: 0.72rem; color: #6b7280; }

/* ---------- Profile ---------- */
.prof-hero { display: flex; gap: 18px; align-items: center; padding: 22px 24px; background: linear-gradient(135deg, #1e3a8a30, #14171f 60%); border: 1px solid #1e3a8a; border-radius: 12px; margin-bottom: 18px; }
.prof-avatar { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg, #2563eb, #60a5fa); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.6rem; letter-spacing: 1px; flex-shrink: 0; box-shadow: 0 4px 12px rgba(37,99,235,0.3); object-fit: cover; }
img.prof-avatar { background: #0a0c10; }
.prof-hero-body { flex: 1; min-width: 0; }
.prof-name { font-size: 1.35rem; font-weight: 700; color: #e6e7eb; margin-bottom: 4px; }
.prof-sub-line { font-size: 0.88rem; color: #9ca3af; margin-bottom: 8px; }
.prof-readonly { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; padding: 4px 10px; background: #78350f30; border: 1px solid #b45309; border-radius: 4px; color: #fbbf24; }
.prof-readonly .icon { width: 12px; height: 12px; }
.prof-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-bottom: 14px; }
.prof-tile { background: #14171f; border: 1px solid #20242e; border-radius: 8px; padding: 12px 14px; }
.prof-tile .prof-k { font-size: 0.72rem; color: #6b7280; text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 4px; }
.prof-tile .prof-v { font-size: 1.05rem; font-weight: 600; color: #e6e7eb; line-height: 1.25; }
.prof-tile .prof-v small { font-size: 0.7rem; color: #9ca3af; font-weight: 400; }
.prof-tile .prof-sub { font-size: 0.72rem; color: #6b7280; margin-top: 2px; }

/* ---------- Perfil editável (Sobre mim / Objetivos) ---------- */
.me-form { display: flex; flex-direction: column; gap: 16px; margin-bottom: 14px; }
.me-field { display: flex; flex-direction: column; gap: 5px; }
.me-label { font-size: 0.72rem; color: #6b7280; text-transform: uppercase; letter-spacing: 0.6px; }
.me-text { width: 100%; padding: 11px 13px; background: #0f1115; color: #e6e7eb; border: 1px solid #2a2f3a; border-radius: 8px; font-size: 0.9rem; font-family: inherit; line-height: 1.5; resize: vertical; }
.me-text:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 1px #2563eb inset; }
.me-text::placeholder { color: #4b5563; font-style: italic; opacity: 1; }
.me-hint { font-size: 0.74rem; color: #6b7280; }
.me-actions { display: flex; align-items: center; gap: 12px; }
.me-status { font-size: 0.78rem; }
.me-actions .btn { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.me-actions .btn .icon { width: 13px; height: 13px; }

/* ---------- Devices ---------- */
.devices-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-bottom: 18px; }
.device-card { background: #14171f; border: 1px solid #20242e; border-radius: 8px; padding: 14px; display: flex; gap: 12px; align-items: flex-start; transition: border-color 0.15s, box-shadow 0.15s; }
.device-card.selected { border-color: #2563eb; box-shadow: 0 0 0 1px #2563eb inset, 0 4px 16px rgba(37, 99, 235, 0.15); }
.device-card .dc-img { width: 64px; height: 96px; object-fit: contain; background: #0f1115; border-radius: 6px; padding: 4px; flex-shrink: 0; }
.device-card .dc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.device-card .dc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.device-card .dc-name { font-weight: 600; color: #e6e7eb; font-size: 0.95rem; line-height: 1.3; }
.device-card .dc-badge { font-size: 0.68rem; background: #1e40af40; color: #93c5fd; border: 1px solid #2563eb; border-radius: 9999px; padding: 1px 8px; display: inline-flex; align-items: center; gap: 4px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; flex-shrink: 0; }
.device-card .dc-badge svg { width: 11px; height: 11px; }
.device-card .dc-id { font-size: 0.78rem; margin-bottom: 4px; }
.device-card .dc-id code { background: #0a0c10; padding: 2px 6px; border-radius: 4px; font-family: ui-monospace, monospace; font-size: 0.74rem; color: #93c5fd; user-select: all; }
.device-card .dc-meta { display: flex; gap: 10px; font-size: 0.72rem; color: #9ca3af; margin-bottom: 10px; flex-wrap: wrap; }
.device-card .dc-meta b { color: #cbd5e1; font-weight: 500; }
.device-card .dc-meta .dc-active { color: #6ee7b7; font-weight: 500; }
.device-card .dc-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.device-card .dc-actions .chip { font-size: 0.72rem; padding: 4px 10px; display: inline-flex; align-items: center; gap: 5px; }
.device-card .dc-actions .chip:disabled { opacity: 0.65; cursor: default; background: #064e3b; color: #6ee7b7; border-color: #065f46; }
.device-card .dc-actions .chip:disabled:hover { background: #064e3b; border-color: #065f46; }
.form-row input.autofilled { border-color: #2563eb; background: #1e3a8a20; }

/* ---------- Activity summary cards ---------- */
.act-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-bottom: 12px; }
.act-summary .stat { background: #14171f; border: 1px solid #20242e; border-radius: 6px; padding: 8px 10px; }
.act-summary .k { color: #9ca3af; font-size: 0.7rem; text-transform: uppercase; }
.act-summary .v { font-weight: 600; font-size: 1.05rem; margin-top: 2px; }
.sleep-score-note { margin: -4px 0 12px; line-height: 1.4; }

/* ---------- Treinos (workouts) ---------- */
.workout-list { display: flex; flex-direction: column; gap: 8px; }
.workout-row { background: #14171f; border: 1px solid #20242e; border-radius: 10px; overflow: hidden; }
.workout-row.open { border-color: #2563eb; }
.workout-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; }
.workout-head:hover { background: #181c25; }
.workout-row.open .workout-head .chevron { transform: rotate(90deg); }
.workout-head .wk-emoji { font-size: 1.2rem; line-height: 1; }
.workout-head .wk-main { flex: 1; min-width: 0; }
.workout-head .wk-name { font-weight: 600; color: #e6e7eb; }
.workout-head .wk-sub { color: #9ca3af; font-size: 0.8rem; margin-top: 2px; }
.wk-del { background: transparent; border: 1px solid transparent; border-radius: 6px; color: #6b7280; cursor: pointer; padding: 6px; display: inline-flex; }
.wk-del:hover { background: #3b1d1d; color: #fca5a5; }
.workout-body { padding: 4px 16px 16px; border-top: 1px solid #20242e; }

/* fases (visualização) */
.wk-steps-inner { display: flex; flex-direction: column; gap: 5px; margin: 12px 0 6px; }
.wk-step { display: flex; align-items: center; gap: 10px; padding: 7px 12px; background: #0f1115; border: 1px solid #20242e; border-radius: 7px; border-left: 3px solid #6b7280; font-size: 0.82rem; }
/* cores por tipo de passo (esquema Garmin) */
.wk-step-warmup   { border-left-color: #ef4444; }
.wk-step-interval { border-left-color: #3b82f6; }
.wk-step-recovery { border-left-color: #14b8a6; }
.wk-step-cooldown { border-left-color: #22c55e; }
.wk-step-rest     { border-left-color: #9ca3af; }
.wk-card-warmup   .wk-card-bar { background: #ef4444; }
.wk-card-interval .wk-card-bar { background: #3b82f6; }
.wk-card-recovery .wk-card-bar { background: #14b8a6; }
.wk-card-cooldown .wk-card-bar { background: #22c55e; }
.wk-card-rest     .wk-card-bar { background: #9ca3af; }
.wk-card-repeat   .wk-card-bar { background: #a78bfa; }
.wk-step-kind { font-weight: 600; color: #cbd5e1; min-width: 110px; }
.wk-step-val { color: #e6e7eb; }
.wk-step-tgt { margin-left: auto; color: #93c5fd; font-size: 0.76rem; background: #1e3a8a30; border: 1px solid #1e3a8a; border-radius: 9999px; padding: 1px 9px; }
.wk-repeat { border: 1px dashed #2a3445; border-radius: 8px; padding: 8px 10px; margin: 5px 0; }
.wk-repeat-head { color: #a78bfa; font-size: 0.76rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.wk-repeat-steps { display: flex; flex-direction: column; gap: 5px; }

.wk-acts-head { color: #9ca3af; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.6px; margin: 14px 0 8px; }
.wk-edit-btn { background: transparent; border: 1px solid transparent; border-radius: 6px; color: #6b7280; cursor: pointer; padding: 6px; display: inline-flex; }
.wk-edit-btn:hover { background: #1f2937; color: #93c5fd; }

/* ---------- Editor de treino (tela cheia, estilo Garmin) ---------- */
.wk-modal { position: fixed; inset: 0; z-index: 120; display: flex; flex-direction: column; background: #0b0d12; }
.wk-modal.hidden { display: none !important; }
.wk-ed-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px calc(14px); padding-top: calc(14px + env(safe-area-inset-top)); background: #0b0d12; border-bottom: 1px solid #1b1f29; }
.wk-ed-close { background: transparent; border: none; color: #e6e7eb; font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 4px 6px; }
.wk-ed-title { flex: 1; min-width: 0; background: transparent; border: none; color: #fff; font-size: 1.15rem; font-weight: 600; padding: 6px 4px; outline: none; }
.wk-ed-title::placeholder { color: #4b5563; }
.wk-ed-title:focus { border-bottom: 1px solid #2563eb; }
.wk-ed-save { background: transparent; border: none; color: #60a5fa; font-weight: 700; letter-spacing: 0.6px; font-size: 0.9rem; cursor: pointer; padding: 6px 4px; }
.wk-ed-save:disabled { opacity: 0.5; cursor: wait; }
.wk-ed-body { flex: 1; overflow-y: auto; padding: 4px 16px 20px; max-width: 760px; width: 100%; margin: 0 auto; }
.wk-sect { padding: 16px 0 6px; border-bottom: 1px solid #1b1f29; }
.wk-sect:last-of-type { border-bottom: none; }
.wk-sect-label { color: #9ca3af; font-size: 0.92rem; margin-bottom: 8px; }
.wk-ov { padding: 16px 0; border-bottom: 1px solid #1b1f29; }
.wk-ov-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wk-ov-cell { border-top: 1px solid #2a2f3a; padding-top: 8px; }
.wk-ov-val { font-size: 2rem; font-weight: 600; color: #fff; line-height: 1.1; }
.wk-ov-sub { color: #9ca3af; font-size: 0.85rem; margin-top: 2px; }
.wk-sport-sel, #wkNotes { width: 100%; padding: 10px 12px; background: #14171f; color: #e6e7eb; border: 1px solid #2a2f3a; border-radius: 8px; font-size: 0.92rem; font-family: inherit; }
#wkNotes { resize: vertical; }

.wk-steps-edit { display: flex; flex-direction: column; gap: 8px; }
.wk-card { display: flex; background: #1a1d25; border: 1px solid #20242e; border-radius: 10px; overflow: hidden; }
.wk-card.dragging { opacity: 0.5; }
.wk-card.drop-over { border-color: #2563eb; box-shadow: 0 0 0 1px #2563eb inset; }
.wk-card-bar { width: 5px; flex-shrink: 0; background: #6b7280; }
.wk-card-main { flex: 1; min-width: 0; }
.wk-card-head { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; cursor: pointer; }
.wk-card-info { flex: 1; min-width: 0; }
.wk-card-name { font-weight: 600; color: #fff; font-size: 1.02rem; display: flex; align-items: center; gap: 8px; }
.wk-card-name svg { width: 16px; height: 16px; }
.wk-card-tgt { font-weight: 500; color: #93c5fd; font-size: 0.72rem; background: #1e3a8a30; border: 1px solid #1e3a8a; border-radius: 9999px; padding: 1px 8px; }
.wk-card-time { color: #cbd5e1; font-size: 0.92rem; margin-top: 2px; }
.wk-card-sub { color: #6b7280; font-size: 0.78rem; margin-top: 2px; }
.wk-card-drag { color: #6b7280; cursor: grab; display: inline-flex; padding: 4px; touch-action: none; }
.wk-card-drag svg { width: 18px; height: 18px; }
.wk-card-x { background: #2a2f3a; border: none; border-radius: 50%; color: #cbd5e1; width: 26px; height: 26px; cursor: pointer; font-size: 0.85rem; line-height: 1; flex-shrink: 0; }
.wk-card-x:hover { background: #3b1d1d; color: #fca5a5; }
.wk-card-edit { display: none; padding: 0 12px 12px 14px; flex-wrap: wrap; gap: 10px; }
.wk-card.open .wk-card-edit { display: flex; }
.wk-fld { display: flex; flex-direction: column; gap: 4px; font-size: 0.74rem; color: #9ca3af; }
.wk-fld select, .wk-fld input { padding: 7px 9px; background: #0f1115; color: #e6e7eb; border: 1px solid #2a2f3a; border-radius: 6px; font-size: 0.86rem; font-family: inherit; min-width: 96px; }
.wk-card-repeat { background: #181626; border-style: dashed; border-color: #3a2f55; }
.wk-card-repeat .wk-card-name svg { color: #a78bfa; }
.wk-rep-children { display: flex; flex-direction: column; gap: 6px; padding: 0 12px 10px 14px; }
.wk-rep-children .wk-card { background: #14171f; }
.wk-rep-add { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 12px 12px 14px; }
.wk-mini-btn { background: #1f2937; color: #cbd5e1; border: 1px solid #2a2f3a; border-radius: 9999px; padding: 4px 11px; font-size: 0.74rem; cursor: pointer; font-family: inherit; }
.wk-mini-btn:hover { background: #2a3445; border-color: #3a4150; }

.wk-ed-foot { display: flex; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: #0b0d12; border-top: 1px solid #1b1f29; }
.wk-foot-btn { flex: 1; background: #2563eb; color: #fff; border: none; border-radius: 8px; padding: 13px; font-size: 0.92rem; font-weight: 600; cursor: pointer; font-family: inherit; }
.wk-foot-btn:hover { background: #1d4ed8; }
@media (max-width: 600px) {
  .wk-step-kind { min-width: 80px; }
  .wk-fld select, .wk-fld input { min-width: 0; flex: 1; }
  .wk-fld { flex: 1 1 44%; }
}

/* ---------- Popup "Mais" (bottom nav / PWA) ---------- */
.more-menu { position: fixed; inset: 0; z-index: 40; }
.more-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); opacity: 0; transition: opacity 0.15s ease; }
.more-menu.open .more-overlay { opacity: 1; }
.more-sheet {
  position: absolute; left: 0; right: 0;
  bottom: calc(56px + env(safe-area-inset-bottom));
  background: #14171f; border-top: 1px solid #20242e; border-radius: 16px 16px 0 0;
  padding: 12px 12px 16px; box-shadow: 0 -10px 34px rgba(0,0,0,0.55);
  transform: translateY(110%); transition: transform 0.2s ease;
}
.more-menu.open .more-sheet { transform: translateY(0); }
.more-title { color: #9ca3af; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.7px; padding: 2px 6px 10px; }
.more-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.more-item {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 14px 6px; background: #0f1115; border: 1px solid #20242e; border-radius: 12px;
  color: #cbd5e1; cursor: pointer; font-size: 0.76rem; font-family: inherit; text-align: center;
}
.more-item:hover, .more-item:active { background: #1a1e28; border-color: #2563eb; color: #fff; }
.more-item.active { border-color: #2563eb; color: #fff; background: #1e3a8a30; }
.more-item svg { width: 21px; height: 21px; }
.more-item span { line-height: 1.1; }

/* ===================== Conquistas (badges) ===================== */
.badges-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0 18px; }
.badges-progress { font-size: 0.82rem; color: #9ca3af; min-width: 180px; }
.badges-progress b { color: #fbbf24; font-size: 1rem; }
.badges-progress-bar { height: 6px; background: #20242e; border-radius: 9999px; margin-top: 5px; overflow: hidden; }
.badges-progress-bar span { display: block; height: 100%; background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.badges-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.badge-card { background: #14171f; border: 1px solid #20242e; border-radius: 12px; padding: 14px 16px; scroll-margin-top: 80px; }
.badge-gallery-group { scroll-margin-top: 80px; }
.badge-focus { animation: badgeFocusPulse 2.2s ease-out; }
@keyframes badgeFocusPulse {
  0% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.0); border-color: #20242e; }
  15% { box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.55); border-color: #fbbf24; }
  100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.0); border-color: #20242e; }
}
.badge-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.badge-card-title { font-weight: 700; font-size: 0.95rem; color: #e5e7eb; }
.badge-card-cur { font-size: 0.78rem; color: #cbd5e1; }
.badge-record { color: #6b7280; }
.badge-card-desc { font-size: 0.76rem; color: #9ca3af; margin: -6px 0 12px; line-height: 1.4; }

.badge-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.badge-pill {
  display: flex; align-items: center; gap: 5px; padding: 4px 9px 4px 5px;
  border-radius: 9999px; border: 1px solid #2a2f3a; background: #0f1115;
  font-size: 0.72rem; color: #6b7280;
}
.badge-pill-tier {
  width: 16px; height: 16px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-size: 0.64rem; font-weight: 700;
  background: #2a2f3a; color: #9ca3af;
}
.badge-pill.earned { border-color: #f59e0b55; background: #2a210a; color: #fbbf24; }
.badge-pill.earned .badge-pill-tier { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #1a1206; }
.badge-pill.next { border-color: #2563eb; color: #93c5fd; }
.badge-pill.next .badge-pill-tier { background: #2563eb; color: #fff; }
.badge-pill.locked { opacity: 0.7; }
/* Arte do badge dentro do pill (escada); número fica de fallback atrás. */
.badge-pill-disc { position: relative; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.badge-pill-disc .badge-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.badge-pill.locked .badge-art { filter: grayscale(1) brightness(0.6); }

.badge-next { font-size: 0.75rem; color: #9ca3af; }
.badge-next b { color: #cbd5e1; }
.badge-next.done { color: #fbbf24; font-weight: 600; }
.badge-next-bar { height: 5px; background: #20242e; border-radius: 9999px; margin-top: 5px; overflow: hidden; }
.badge-next-bar span { display: block; height: 100%; background: #2563eb; }

/* Selos conquistados hoje — cards no Feed */
.badges-hero { background: #14171f; border: 1px solid #2a210a; border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; cursor: pointer; }
.badges-hero:hover { filter: brightness(1.07); }
.badges-hero-head { display: flex; align-items: center; gap: 7px; font-size: 0.86rem; color: #cbd5e1; margin-bottom: 12px; }
.badges-hero-head svg { width: 16px; height: 16px; color: #fbbf24; }
.badges-hero-head b { color: #fbbf24; font-size: 1rem; }
.badges-hero-link { margin-left: auto; background: none; border: none; color: #93c5fd; cursor: pointer; font-size: 0.78rem; font-family: inherit; }
.badges-hero-link:hover { text-decoration: underline; }
.badges-today-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.badge-today-card { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: #0f1115; border: 1px solid #20242e; }
.badge-today-art { position: relative; width: 53px; height: 53px; flex: none; display: flex; align-items: center; justify-content: center; }
.badge-today-art .badge-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.badge-today-tier { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.96rem; background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #1a1206; }
.badge-today-name { font-size: 0.84rem; font-weight: 700; color: #fde68a; line-height: 1.2; }
.badge-today-desc { font-size: 0.74rem; color: #9ca3af; line-height: 1.35; margin-top: 2px; }

/* Padrão ÚNICO dos cards "agora" no Feed (pressão, composição, jejum, trabalho):
   ícone grande à esquerda + corpo (título + indicadores alinhados). */
.now-card { display: flex; gap: 14px; align-items: center; background: #14171f; border: 1px solid #20242e; border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; cursor: pointer; }
.now-card:hover { filter: brightness(1.07); }
.now-card-icon { flex-shrink: 0; width: 44px; height: 44px; border-radius: 10px; background: #0f1115; border: 1px solid #20242e; display: flex; align-items: center; justify-content: center; }
.now-card-icon svg { width: 22px; height: 22px; }
.now-card-body { min-width: 0; flex: 1; }
.now-card-title { display: flex; align-items: center; gap: 8px; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; margin-bottom: 6px; }
.now-card-title small { text-transform: none; letter-spacing: 0; color: #6b7280; font-weight: 400; font-size: 0.74rem; }
.now-card-link { margin-left: auto; background: none; border: none; color: #93c5fd; cursor: pointer; font-size: 0.74rem; font-family: inherit; text-transform: none; letter-spacing: 0; }
.now-card-link:hover { text-decoration: underline; }
.now-card-metrics { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; font-size: 0.85rem; color: #9ca3af; line-height: 1.5; }
.now-card-metrics.stack { flex-direction: column; gap: 5px; }
.now-card-metrics b { color: #cbd5e1; font-weight: 600; }
.now-card-metrics .big { font-size: 1.5rem; color: #e6e7eb; font-weight: 700; line-height: 1; }
.now-card-metrics .right { margin-left: auto; }
.now-card-bar { height: 7px; background: #20242e; border-radius: 9999px; overflow: hidden; margin-top: 9px; }
.now-card-bar span { display: block; height: 100%; transition: width 0.3s ease; }
.now-card-sub { font-size: 0.78rem; color: #9ca3af; margin-top: 8px; line-height: 1.4; }
.now-card-good { color: #34d399; }
.now-card-bad { color: #fbbf24; }
.bp-prevnote { font-size: 0.7rem; opacity: 0.7; }
.bp-arrow { color: #cbd5e1; }
/* Card "em andamento" com lista de tarefas embaixo (ex.: Trabalho): vira coluna; o topo
   (ícone/corpo/ações) fica numa linha e a lista de tarefas embaixo, separada por um divisor. */
.now-card.has-tasks, .now-card.has-controls { flex-direction: column; align-items: stretch; }
.now-card .nc-top { display: flex; gap: 14px; align-items: center; }
/* Controles (Pausar/Retomar/Encerrar) embaixo do card, em chips — mesmo padrão dos
   botões de refeição embaixo do card de Alimentação. Libera a área de informação. */
.nc-controls { display: flex; gap: 8px; margin-top: 12px; }
.nc-ctrl { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 6px; border: 1px solid #2a3950; background: #16202e; color: #93c5fd; border-radius: 9px;
  font-size: 0.82rem; font-weight: 600; font-family: inherit; cursor: pointer; transition: background 0.12s, transform 0.06s; }
.nc-ctrl:hover { background: #1d2c40; }
.nc-ctrl:active { transform: scale(0.97); }
.nc-ctrl:disabled { opacity: 0.5; cursor: default; }
.nc-ctrl svg { width: 14px; height: 14px; }
.nc-ctrl.danger { border-color: #7f1d1d; background: #7f1d1d40; color: #fecaca; }
.nc-ctrl.danger:hover { background: #7f1d1d70; }
.nc-ctrl.cancel { border-color: #7f1d1d; background: transparent; color: #fca5a5; }
.nc-ctrl.cancel:hover { background: #7f1d1d40; }
.now-card .nc-tasklist { display: flex; flex-direction: column; gap: 2px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.09); cursor: default; }
.now-card-pill { font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 9999px; text-transform: none; letter-spacing: 0; }
.now-card-pill.active { background: #1e3a5f; color: #93c5fd; }
.now-card-pill.paused { background: #3a2f0f; color: #fcd34d; }
/* Acentos por card: fundo em gradiente + borda no tom da cor (igual ao card de
   Alimentação, que ficou o mais bonito) + ícone/título coloridos. */
.nc-bp   { background: linear-gradient(135deg, #7f1d1d28, #14171f); border-color: #7f1d1d; }
.nc-body { background: linear-gradient(135deg, #064e3b30, #14171f); border-color: #065f46; }
.nc-fast { background: linear-gradient(135deg, #4c1d9530, #14171f); border-color: #5b21b6; }
.nc-work { background: linear-gradient(135deg, #1e3a8a2e, #14171f); border-color: #1e40af; }
.nc-sleep { background: linear-gradient(135deg, #3730a330, #14171f); border-color: #3730a3; }
.nc-cro  { background: linear-gradient(135deg, #0e749030, #14171f); border-color: #155e75; }
.nc-bp   .now-card-icon svg, .nc-bp   .now-card-title { color: #f87171; }
.nc-body .now-card-icon svg, .nc-body .now-card-title { color: #34d399; }
.nc-fast .now-card-icon svg, .nc-fast .now-card-title { color: #a78bfa; }
.nc-work .now-card-icon svg, .nc-work .now-card-title { color: #60a5fa; }
.nc-sleep .now-card-icon svg, .nc-sleep .now-card-title { color: #818cf8; }
.nc-cro  .now-card-icon svg, .nc-cro  .now-card-title { color: #22d3ee; }
/* Score do sono em destaque no mini card (maior que o texto normal da métrica). */
.now-card-metrics .nc-score b { font-size: 1.25rem; }
.now-card-metrics .nc-score small { color: #6b7280; }
/* Controles no card (play/pause/encerrar) — botões circulares preenchidos, alinhados. */
.now-card-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; flex-shrink: 0; align-self: center; }
.nc-btn { width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; transition: background .15s, transform .08s; }
.nc-btn svg { width: 20px; height: 20px; display: block; margin: 0; vertical-align: middle; }
.nc-btn:active { transform: scale(0.93); }
.nc-btn:disabled { opacity: 0.45; cursor: default; }
.nc-btn-pause { border-color: #3a4150; background: #1f2530; color: #e5e7eb; }
.nc-btn-pause:hover { background: #2a3340; }
.nc-btn-play { border-color: #34d399; background: #064e3b; color: #6ee7b7; }
.nc-btn-play:hover { background: #065f46; color: #d1fae5; }
.nc-btn-stop { border-color: #ef4444; background: #7f1d1d; color: #fecaca; }
.nc-btn-stop:hover { background: #991b1b; color: #fee2e2; }

/* Sub-abas (Escadas / Todas) */
.badges-subtabs { display: flex; gap: 8px; margin: 4px 0 16px; }

/* Galeria "Todas" — catálogo completo, acesos vs apagados */
.badges-gallery { display: flex; flex-direction: column; gap: 18px; }
.badge-gallery-group { }
.badge-gallery-label { font-size: 0.8rem; font-weight: 700; color: #cbd5e1; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.badge-gallery-label small { color: #6b7280; font-weight: 600; margin-left: 6px; letter-spacing: 0; }
.badge-gallery-desc { font-size: 0.76rem; color: #9ca3af; margin: -6px 0 10px; line-height: 1.4; }
.badge-medals { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; }
.badge-medal { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 12px 6px; border-radius: 12px; border: 1px solid #20242e; background: #14171f; }
.badge-medal-disc {
  position: relative; width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center;
}
/* Arte do badge (PNG transparente). Cobre o número de fallback quando carrega. */
.badge-medal-disc .badge-art {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
}
/* Fallback: disco numérico atrás (aparece se a imagem faltar/erro). */
.badge-medal-disc .badge-disc-num {
  width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-weight: 800; font-size: 1.1rem;
}
.badge-medal-name { font-size: 0.74rem; font-weight: 600; line-height: 1.2; color: #cbd5e1; }
.badge-medal-sub { font-size: 0.66rem; color: #6b7280; }
/* Conquistado: aceso (dourado no fallback; arte em cor cheia) */
.badge-medal.earned { border-color: #f59e0b55; }
.badge-medal.earned .badge-disc-num { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #1a1206; box-shadow: 0 0 14px #f59e0b66; }
.badge-medal.earned .badge-medal-name { color: #fde68a; }
/* Não conquistado: apagado — dessatura a arte e cinza no fallback */
.badge-medal.locked { opacity: 0.6; }
.badge-medal.locked .badge-art { filter: grayscale(1) brightness(0.55); }
.badge-medal.locked .badge-disc-num { background: #20242e; color: #4b5563; border: 1px dashed #353b47; }

/* ===================== Pressão arterial ===================== */
.bp-form { background: #161a22; border: 1px solid #20242e; border-radius: 10px; padding: 14px 16px; }
.bp-fields { display: flex; flex-wrap: wrap; gap: 12px; }
.bp-form label { display: flex; flex-direction: column; gap: 5px; font-size: 0.74rem; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.5px; }
/* font-size ≥16px evita o auto-zoom do iOS no foco; padding maior = campo mais alto/legível. */
.bp-form input { background: #0f1218; border: 1px solid #2a2f3a; border-radius: 8px; color: #e5e7eb; padding: 11px 12px; font-size: 16px; }
.bp-form .bp-fields input { width: 110px; text-align: center; font-weight: 700; font-size: 1.5rem; padding: 12px 8px; }
.bp-form input:focus { outline: none; border-color: #2563eb; }
.bp-when { margin-top: 14px; }
.bp-when-lbl { display: block; font-size: 0.74rem; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.bp-when-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.bp-when-chips .chip { cursor: pointer; padding: 6px 12px; font-size: 0.82rem; background: #0f1218; color: #cbd5e1; border: 1px solid #2a2f3a; border-radius: 999px; }
.bp-when-chips .chip:hover { border-color: #3a4150; }
.bp-when-chips .chip.active { background: #1e3a5f; border-color: #2563eb; color: #e5e7eb; }
.bp-when #bpTakenAt { margin-top: 8px; }
.bp-note { margin-top: 14px; }
.bp-note input { width: 100%; }
.bp-form .actions { margin-top: 12px; display: flex; align-items: center; gap: 12px; }
.bp-form .btn { display: inline-flex; align-items: center; gap: 6px; }
.bp-form .btn svg { width: 14px; height: 14px; }

.bp-latest { background: #161a22; border: 1px solid #20242e; border-radius: 10px; padding: 16px 18px; }
.bp-big { display: flex; align-items: baseline; gap: 8px; }
.bp-val { font-size: 2.2rem; font-weight: 700; line-height: 1; }
.bp-unit { font-size: 0.85rem; color: #9ca3af; }
.bp-pulse { margin-left: auto; font-size: 0.85rem; color: #9ca3af; display: inline-flex; align-items: center; gap: 5px; }
.bp-pulse svg { width: 13px; height: 13px; }
.bp-class { font-weight: 600; margin-top: 4px; }
.bp-sub { font-size: 0.8rem; margin-top: 4px; }

.bp-legend { display: flex; gap: 16px; justify-content: center; margin-top: 8px; font-size: 0.78rem; color: #9ca3af; }
.bp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.bp-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }

.bp-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid #1c2129; font-size: 0.88rem; }
.bp-row:last-child { border-bottom: none; }
.bp-row-val { font-weight: 600; color: #e5e7eb; min-width: 78px; }
.bp-row-val small { font-size: 0.66rem; color: #6b7280; margin-left: 3px; }
.bp-row-pulse { min-width: 56px; font-size: 0.8rem; }
.bp-row-when { font-size: 0.8rem; display: inline-flex; align-items: center; gap: 4px; }
.bp-row-when svg, .bp-src svg { width: 12px; height: 12px; vertical-align: -1px; }
.bp-row-class { font-size: 0.78rem; font-weight: 600; }
.bp-row-note { flex: 1; font-size: 0.78rem; font-style: italic; }
.bp-del { margin-left: auto; background: none; border: none; color: #6b7280; cursor: pointer; padding: 4px; border-radius: 5px; }
.bp-del:hover { color: #f87171; background: #1f2937; }
.bp-del svg { width: 14px; height: 14px; display: block; }
.bp-disclaimer { display: flex; align-items: flex-start; gap: 9px; color: #cbb58a; font-size: 0.8rem; line-height: 1.45; margin-top: 18px; padding: 12px 14px; background: #2a210f; border: 1px solid #4d3d18; border-radius: 8px; }
.bp-disclaimer svg { width: 16px; height: 16px; flex: none; margin-top: 1px; color: #fbbf24; }
.bp-disclaimer b { color: #fde68a; }
@media (max-width: 480px) {
  /* 2 campos por linha, grandes e legíveis no PWA. */
  .bp-fields { gap: 10px; }
  .bp-form .bp-fields label { flex: 1 1 calc(50% - 5px); }
  .bp-form .bp-fields input { width: 100%; font-size: 1.7rem; }
  .bp-row-note { flex-basis: 100%; }
}

/* ===================== Configurações ===================== */
.set-group { margin-top: 18px; }
.set-group-title { color: #cbd5e1; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 8px; }
.set-rows { background: #161a22; border: 1px solid #20242e; border-radius: 10px; overflow: hidden; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #1c2129; cursor: pointer; }
.set-row:last-child { border-bottom: none; }
.set-row-link { color: inherit; text-decoration: none; }
.set-row-link > span:last-child { color: #6b7280; font-size: 1.35rem; line-height: 1; }
.set-label { display: flex; flex-direction: column; gap: 2px; color: #e5e7eb; font-size: 0.9rem; }
.set-label small { color: #6b7280; font-size: 0.74rem; }
/* Toggle switch (checkbox estilizado) */
.set-toggle { appearance: none; -webkit-appearance: none; flex: none; width: 40px; height: 22px; border-radius: 999px; background: #2a2f3a; position: relative; cursor: pointer; transition: background 0.15s; }
.set-toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #e5e7eb; transition: transform 0.15s; }
.set-toggle:checked { background: #2563eb; }
.set-toggle:checked::after { transform: translateX(18px); }
/* Card "Instalar o vaigo" — só aparece quando o PWA não está instalado. */
.install-card { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 14px 16px; border-radius: 12px; border: 1px solid #2b3550; background: linear-gradient(135deg, rgba(37, 99, 235, 0.14), rgba(139, 92, 246, 0.12)); }
.install-card-ico { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: #2563eb; color: #fff; }
.install-card-ico svg { width: 20px; height: 20px; }
.install-card-body { flex: 1; min-width: 0; }
.install-card-body h4 { margin: 0 0 2px; font-size: 0.95rem; color: #f1f5f9; }
.install-card-body p { margin: 0; font-size: 0.78rem; color: #9aa4b2; line-height: 1.35; }
.install-card .btn { flex: none; white-space: nowrap; }
/* Permissões do navegador (notificações/push, microfone, câmera) — estado é runtime,
   não dá pra revogar via JS, então mostramos badge de estado + botão "Permitir". */
.set-row[data-perm] { cursor: default; }
.perm-ctl { flex: none; display: flex; align-items: center; gap: 8px; }
.perm-state { display: inline-flex; align-items: center; gap: 4px; font-size: 0.78rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.perm-state svg { width: 13px; height: 13px; }
.perm-state.ok { color: #34d399; background: rgba(52, 211, 153, 0.12); }
.perm-state.no { color: #f87171; background: rgba(248, 113, 113, 0.12); cursor: help; }
.perm-state.muted { color: #6b7280; background: #1f2937; }

/* Notificações — escolha de canal por categoria. */
.notif-ch { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.notif-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 0.78rem; font-weight: 600; color: #cbd5e1; background: #1f2937; padding: 4px 10px; border-radius: 999px; cursor: pointer; user-select: none; }
.notif-pill input { margin: 0; cursor: pointer; }
.notif-pill:has(input:checked) { color: #34d399; background: rgba(52, 211, 153, 0.12); }
.notif-pill:has(input:disabled) { opacity: 0.45; cursor: not-allowed; }
.notif-pill:has(input:disabled) input { cursor: not-allowed; }

/* Confirmação do telefone WhatsApp dentro do card de Configurações. */
.wa-link { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.wa-link-fields { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.wa-link-fields input { min-width: 180px; flex: 1 1 180px; background: #0f1218; border: 1px solid #2a2f3a; border-radius: 7px; color: #e5e7eb; padding: 8px 10px; font-size: 16px; }
.wa-link-fields input:focus { outline: none; border-color: #2563eb; }
.wa-link-msg { min-height: 1.1em; font-size: 0.78rem; }

/* Biometria — evolução por período (FC/Estresse por Sono/Dia/Noite). */
.bio-period { margin-top: 18px; border-top: 1px solid #20242e; padding-top: 14px; }
.bioper-bar { margin: 8px 0 14px; }
.bioper-msg { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 0.82rem; }
.bioper-avgs { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 10px; font-size: 0.84rem; }
.bioper-avg b { font-weight: 700; }

/* Fluxo guiado de conexão do Telegram (in-app, sem pop-up nativo). */
.tg-connect { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.tg-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; color: #cbd5e1; font-size: 0.86rem; }
.tg-steps li { line-height: 1.45; }
.tg-steps code { background: #0f1420; border: 1px solid #20242e; border-radius: 6px; padding: 1px 6px; font-size: 0.82rem; color: #e5e7eb; }
.tg-wait { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: #9ca3af; }
.tg-wait .spin { width: 13px; height: 13px; border: 2px solid #2b3240; border-top-color: #34d399; border-radius: 50%; animation: tgspin 0.8s linear infinite; flex: none; }
@keyframes tgspin { to { transform: rotate(360deg); } }
.tg-connect-actions { display: flex; gap: 8px; }

/* ===================== Trabalho — períodos manuais ===================== */
.wk-periods { margin-top: 14px; border-top: 1px solid #20242e; padding-top: 12px; }
.wk-periods-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.wk-periods-head > span { font-size: 0.8rem; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.5px; }
.wk-log-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 10px; }
.wk-log-form[hidden] { display: none; }  /* o atributo hidden precisa vencer o display:flex */
.wk-log-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.74rem; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.5px; }
.wk-log-form input { background: #0f1218; border: 1px solid #2a2f3a; border-radius: 6px; color: #e5e7eb; padding: 7px 9px; font-size: 0.9rem; }
.wk-log-form input:focus { outline: none; border-color: #2563eb; }
.wk-log-form .actions { display: flex; align-items: center; gap: 10px; }
.wk-period { display: flex; align-items: center; gap: 10px; padding: 7px 2px; border-bottom: 1px solid #1c2129; font-size: 0.88rem; }
.wk-period:last-child { border-bottom: none; }
.wk-period-h { font-weight: 600; color: #e5e7eb; min-width: 56px; }
.wk-period-when { flex: 1; font-size: 0.82rem; display: inline-flex; align-items: center; gap: 6px; }

/* ===================== Hábitos — sub-abas + feed de lançamentos ===================== */
/* Controle segmentado suave (estilo iOS): trilho escuro, aba ativa num bloco elevado.
   Acento azul fino só no ícone ativo — sem preencher o botão inteiro. Huga o conteúdo e
   rola na horizontal quando não cabe (mobile com muitas sub-abas), sem quebrar o trilho. */
.habits-subtabs { display: inline-flex; gap: 2px; position: relative; min-width: 0; max-width: 100%; padding: 3px; background: #0f1115; border: 1px solid #20242e; border-radius: 10px; overflow-x: auto; scrollbar-width: none; }
.habits-subtabs::-webkit-scrollbar { display: none; }
.habits-subtabs .seg-btn { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; background: transparent; border: none; color: #9ca3af; font-family: inherit; font-size: 0.82rem; font-weight: 500; line-height: 1.4; padding: 6px 14px; border-radius: 7px; cursor: pointer; white-space: nowrap; transition: color 0.15s, background 0.15s; }
.habits-subtabs .seg-btn svg.icon { width: 14px; height: 14px; opacity: 0.85; transition: color 0.15s, opacity 0.15s; }
.habits-subtabs .seg-btn:hover { color: #cbd5e1; }
.habits-subtabs .seg-btn.active { background: #1f2937; color: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), inset 0 0 0 1px #2a2f3a; }
.habits-subtabs .seg-btn.active svg.icon { opacity: 1; color: #60a5fa; }
.hablog { margin-top: 18px; }
.hablog-head { color: #9ca3af; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.hablog-empty { padding: 10px 2px; }
.hablog-row { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid #1c2129; font-size: 0.88rem; }
.hablog-row:last-child { border-bottom: none; }
.hablog-time { min-width: 42px; font-variant-numeric: tabular-nums; }
.hablog-label { font-weight: 600; color: #e5e7eb; }
.hablog-detail { flex: 1; font-size: 0.82rem; }
.hablog-row .bp-del { margin-left: auto; }

/* Botão editar (lista de lançamentos), e agrupar editar+remover à direita */
.bp-edit { background: none; border: none; color: #6b7280; cursor: pointer; padding: 4px; border-radius: 5px; }
.bp-edit:hover { color: #60a5fa; background: #1f2937; }
.bp-edit svg { width: 14px; height: 14px; display: block; }
.hablog-row .bp-edit { margin-left: auto; }
.hablog-row .bp-del { margin-left: 0; }

/* ===================== Hábitos — cards de totalização do dia ===================== */
.totals-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.total-card { background: #161a22; border: 1px solid #20242e; border-radius: 10px; padding: 12px 14px; }
.total-card .total-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.total-card .total-label { font-size: 0.74rem; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.5px; }
.total-card .total-value { font-weight: 700; color: #e5e7eb; font-size: 1.05rem; white-space: nowrap; }
.total-card .total-value small { color: #6b7280; font-weight: 400; font-size: 0.72rem; }
.total-card .total-sub { font-size: 0.76rem; margin-top: 2px; }
.total-card .bar { margin-top: 8px; }

/* "Consumo do dia" (sub-aba Alimentação): linhas compactas com números alinhados em coluna.
   Número e unidade vão em sub-colunas fixas → dígitos e unidades alinham entre as linhas. */
.consumo-row { display: grid; grid-template-columns: 24px 1fr auto 14px; align-items: baseline; gap: 10px; padding: 10px 16px; border-bottom: 1px solid #20242e; }
.consumo-row:last-child { border-bottom: none; }
.consumo-toggle { cursor: pointer; }
.consumo-toggle:hover { background: #181c25; }
.consumo-row .cr-icon { display: inline-flex; align-items: center; align-self: center; }
.consumo-row .cr-icon svg { width: 16px; height: 16px; }
.consumo-row .cr-label { color: #cbd5e1; font-size: 0.92rem; }
.consumo-row .cr-ctx { color: #6b7280; font-size: 0.75rem; margin-left: 6px; }
.consumo-row .cr-val { display: grid; grid-template-columns: 1fr 28px; align-items: baseline; column-gap: 4px; min-width: 96px; }
.consumo-row .cr-num { text-align: right; font-weight: 700; color: #e6e7eb; font-variant-numeric: tabular-nums; }
.consumo-row .cr-unit { text-align: left; color: #9ca3af; font-size: 0.7rem; }
.consumo-row .cr-chev { display: inline-flex; align-items: center; justify-content: center; color: #4b5563; transition: transform 0.18s ease; align-self: center; }
.consumo-row .cr-chev svg { width: 14px; height: 14px; }
.consumo-toggle.open .cr-chev { transform: rotate(90deg); color: #9ca3af; }
.consumo-macros { background: #12151c; }
.consumo-macros .consumo-row { padding-top: 8px; padding-bottom: 8px; }
.consumo-macros .cr-label { padding-left: 6px; color: #9ca3af; font-size: 0.86rem; }

/* ===================== Acompanhamento Alimentar ===================== */
.linklike { background: none; border: none; color: #60a5fa; cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }
.linklike:hover { color: #93c5fd; }

.nutri-active-card { background: #161a22; border: 1px solid #20242e; border-radius: 10px; padding: 12px 14px; }
.nutri-active-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.nutri-active-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: #e5e7eb; }
.nutri-active-name svg { width: 16px; height: 16px; color: #34d399; }
.nutri-targets { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.nutri-target { display: flex; flex-direction: column; gap: 1px; }
.nutri-target b { font-size: 1.02rem; color: #e5e7eb; }
.nutri-target small { color: #6b7280; font-weight: 400; font-size: 0.7rem; margin-left: 2px; }
.nutri-target-lbl { font-size: 0.72rem; color: #9ca3af; }
.nutri-noplan { color: #9ca3af; }

.nutri-cta { font-size: 0.8rem; display: flex; align-items: center; gap: 6px; margin-top: 10px; }
.nutri-cta svg { width: 14px; height: 14px; }
.nutri-disclaimer { font-size: 0.74rem; line-height: 1.4; margin-top: 6px; opacity: 0.8; }

.nutri-plan-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid #20242e; }
.nutri-plan-row:last-child { border-bottom: none; }
.nutri-plan-name { font-weight: 600; color: #e5e7eb; }
.nutri-badge { font-size: 0.66rem; background: #064e3b; color: #34d399; border-radius: 9999px; padding: 1px 8px; text-transform: uppercase; letter-spacing: 0.4px; vertical-align: middle; }
.nutri-plan-sub { flex: 1; font-size: 0.78rem; }
.nutri-plan-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.np-preset-hint { font-size: 0.76rem; margin: 4px 0 0; }
.np-active-row { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; }
.np-active-row input { width: auto; }

/* Evolução da dieta (seção na sub-aba Nutrição) */
.nutri-evol-period { display: flex; gap: 6px; }
.nutri-chart-metric { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }
.nutri-chart-metric .chip { font-size: 0.74rem; padding: 3px 10px; }
.nutri-evol-sub, .nutri-evol-note { font-size: 0.78rem; margin: 4px 0 8px; }
.nutri-evol-adh { display: flex; gap: 18px; flex-wrap: wrap; margin: 4px 0 12px; }
.nutri-evol-adh .nev-stat { display: flex; flex-direction: column; }
.nutri-evol-adh .nev-val { font-weight: 700; font-size: 1.25rem; color: #e6e7eb; line-height: 1.1; }
.nutri-evol-adh .nev-lbl { font-size: 0.74rem; }
.nutri-cal { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 13px); grid-auto-columns: 13px; gap: 3px; margin: 12px 0 8px; }
.nutri-cal-cell { width: 13px; height: 13px; border-radius: 3px; }
.nutri-cal-cell.empty { background: transparent; }
.nutri-cal-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.72rem; }
.nutri-cal-legend span { display: inline-flex; align-items: center; gap: 4px; }
.nutri-cal-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* ============================================================
   Relatórios — cards de áudio (Relatório Matinal e futuros)
   ============================================================ */
.report-hero { margin-bottom: 18px; }
.reports-grid { display: flex; flex-direction: column; gap: 14px; }
.report-card { background: linear-gradient(135deg, #78350f22, #14171f); border: 1px solid #b4530e; border-radius: 12px; padding: 16px 18px; }
/* Some da timeline ao tocar o play (a altura é animada via inline max-height no JS; o
   <audio> dentro continua vivo/tocando, só fica oculto). */
.report-card--dismissed { padding-top: 0; padding-bottom: 0; margin: 0; border-width: 0; opacity: 0; overflow: hidden; transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.35s ease, border-width 0.35s ease, margin 0.35s ease; }
.report-card-loading { display: flex; align-items: center; }
.report-card-loading svg { animation: spin 0.9s linear infinite; margin-right: 6px; }
.report-card-head { display: flex; align-items: center; gap: 12px; }
.report-card-head > svg { width: 26px; height: 26px; color: #fbbf24; flex-shrink: 0; }
.report-card-titles { flex: 1; min-width: 0; }
.report-card-title { font-size: 1.05rem; font-weight: 600; color: #f3f4f6; }
.report-card-sub { font-size: 0.76rem; color: #d6a35c; margin-top: 2px; }
.report-play { flex-shrink: 0; width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #f59e0b, #d97706); color: #1a1208; display: flex; align-items: center; justify-content: center; }
.report-play:hover { filter: brightness(1.08); }
.report-play svg { width: 22px; height: 22px; }
.report-play.loading svg { animation: spin 0.9s linear infinite; }
/* Play do resumo do coach (TTS dos 2 primeiros parágrafos + "Pra hoje"). Verde, menor. */
.ch-greeting-wrap { display: flex; align-items: center; gap: 10px; min-width: 0; }
.coach-play { flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #34d399, #10b981); color: #07150f; display: flex; align-items: center; justify-content: center; }
.coach-play:hover { filter: brightness(1.08); }
.coach-play svg { width: 17px; height: 17px; }
.coach-play.loading svg { animation: spin 0.9s linear infinite; }
.report-transcript { margin-top: 12px; color: #e6e7eb; font-size: 0.92rem; line-height: 1.6; white-space: pre-wrap; }
.report-transcript.collapsed { display: none; }
.report-toggle { margin-top: 10px; background: transparent; border: none; color: #fbbf24; font-size: 0.8rem; cursor: pointer; padding: 0; }
.report-toggle:hover { text-decoration: underline; }

/* Falha da fonte de saúde ativa — primeiro card do Feed, com ação de recuperação. */
.health-connection-alert { display: flex; align-items: flex-start; gap: 14px; background: linear-gradient(135deg, #7f1d1d30, #14171f 68%); border: 1px solid #b91c1c; border-radius: 12px; padding: 16px 18px; margin-bottom: 10px; }
.health-connection-alert-icon { width: 42px; height: 42px; flex: 0 0 42px; display: flex; align-items: center; justify-content: center; color: #fca5a5; background: #7f1d1d55; border-radius: 50%; }
.health-connection-alert-icon svg { width: 21px; height: 21px; }
.health-connection-alert-body { min-width: 0; flex: 1; }
.health-connection-alert h3 { margin: 0 0 5px; color: #fecaca; font-size: 1rem; }
.health-connection-alert p { margin: 0 0 12px; color: #cbd5e1; font-size: 0.86rem; line-height: 1.45; }
.health-connection-alert-action { display: inline-flex; align-items: center; gap: 7px; background: #b91c1c; }
.health-connection-alert-action:hover { background: #dc2626; }
.health-connection-alert-action svg { width: 16px; height: 16px; }

/* Card-convite pra conectar dispositivo (Feed, contas sem device) */
.connect-invite { max-width: 460px; margin: 24px auto; text-align: center; background: linear-gradient(135deg, #1e3a8a20, #14171f); border: 1px solid #1e3a8a; border-radius: 14px; padding: 28px 24px; }
.connect-invite-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; background: #1e3a8a30; display: flex; align-items: center; justify-content: center; color: #93c5fd; }
.connect-invite-icon svg { width: 28px; height: 28px; }
.connect-invite-title { font-size: 1.15rem; font-weight: 600; color: #f3f4f6; margin-bottom: 8px; }
.connect-invite-text { color: #9ca3af; font-size: 0.9rem; line-height: 1.55; margin-bottom: 18px; }
.connect-invite-btn { display: inline-flex; align-items: center; gap: 8px; }
.connect-invite-btn svg { width: 18px; height: 18px; }
/* Variante inline: convite no rodapé do painel local (não é a tela inteira) — menos
   dominante que o convite de boas-vindas. */
.connect-invite--inline { max-width: none; margin: 18px 0 0; padding: 20px; text-align: left; }
.connect-invite--inline .connect-invite-icon { margin: 0 0 12px; }
.connect-invite--inline .connect-invite-title { font-size: 1.02rem; }

/* ===== Sub-aba Cronometrados (hábito cronometrado genérico) ===== */
.cro-live { text-align: center; margin-bottom: 12px; }
.cro-elapsed { font-size: 2rem; font-weight: 700; color: #e6e7eb; line-height: 1.1; }
.cro-phase { font-size: 0.82rem; margin-top: 6px; }
.cro-types-wrap { margin-top: 8px; }
.cro-types-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.cro-types-head h3 { margin: 0; }
.cro-types { display: flex; flex-direction: column; gap: 10px; }
.cro-type { border: 1px solid #2a2f3a; border-radius: 10px; padding: 12px 14px; background: #0f1218; }
.cro-type-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cro-type-name { font-weight: 600; color: #e5e7eb; font-size: 0.96rem; }
.cro-type-head .bp-del { margin-left: auto; }
.cro-type-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.cro-type-actions .btn, .cro-type-actions .chip { display: inline-flex; align-items: center; gap: 6px; }
.cro-manual-form, .cro-new-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 12px; }
.cro-manual-form[hidden], .cro-new-form[hidden] { display: none; }
.cro-manual-form label, .cro-new-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.74rem; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.5px; }
.cro-manual-form input, .cro-new-form input[type=text], .cro-new-form input[type=number] { background: #0f1218; border: 1px solid #2a2f3a; border-radius: 6px; color: #e5e7eb; padding: 7px 9px; font-size: 0.9rem; }
.cro-manual-form input:focus, .cro-new-form input:focus { outline: none; border-color: #6366f1; }
.cro-manual-form .actions, .cro-new-form .actions { display: flex; align-items: center; gap: 10px; }
.cro-new-form { flex-direction: column; align-items: stretch; border: 1px solid #2a2f3a; border-radius: 10px; padding: 14px; background: #14171f; }
.cro-new-form label.cro-check { flex-direction: row; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 0.85rem; color: #cbd5e1; }
.cro-phases-edit { border-top: 1px solid #20242e; padding-top: 10px; }
.cro-phases-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.cro-phases-head > span { font-size: 0.78rem; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.5px; }
.cro-phase-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.cro-phase-row .cro-ph-label { flex: 1; }
.cro-phase-row .cro-ph-min { width: 80px; }
.cro-hint { font-size: 0.76rem; margin-top: 4px; }
/* histórico */
.cro-row { padding: 10px 2px; border-bottom: 1px solid #1c2129; }
.cro-row:last-child { border-bottom: none; }
.cro-row-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cro-row-dur { font-weight: 700; color: #e5e7eb; min-width: 56px; }
.cro-row-label { color: #c7d2fe; font-weight: 600; }
.cro-row-when { flex: 1; font-size: 0.82rem; display: inline-flex; align-items: center; gap: 6px; }
.cro-row-head .bp-del { margin-left: auto; }
.cro-note { font-size: 0.84rem; margin: 4px 0; }
.cro-photos { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.cro-thumb { position: relative; width: 72px; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid #2a2f3a; }
.cro-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cro-thumb-del { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border: none; border-radius: 9999px; background: #000000aa; color: #fff; font-size: 14px; line-height: 18px; cursor: pointer; padding: 0; }
.cro-addphoto { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; }

/* ===== Feed: "Realizado hoje" (sessões concluídas que persistem) ===== */
.realizado-hoje h3 { margin: 0 0 10px; }
.rh-grid { display: flex; flex-direction: column; gap: 8px; }
.rh-card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: #0f1218; border: 1px solid #2a2f3a; border-radius: 10px; padding: 10px 12px; color: #e5e7eb; cursor: pointer; font: inherit; }
.rh-card:hover { border-color: #4338ca; background: #14171f; }
.rh-ic { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none; border-radius: 10px; background: #1e1b4b40; color: #a5b4fc; }
.rh-ic svg.icon { width: 24px; height: 24px; }
/* Atividade do relógio: o ícone vira o thumb do trajeto, preenchendo o slot. */
.rh-ic.rh-ic-route { background: #0f1115; border: 1px solid #20242e; overflow: hidden; padding: 1px; }
.rh-ic.rh-ic-route svg { width: 100%; height: 100%; }
.rh-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 auto; }
.rh-label { font-weight: 600; overflow-wrap: anywhere; }
.rh-meta, .rh-extra { font-size: 0.8rem; }
.rh-extra { color: #818cf8; }
/* Indicadores grandes à direita do card. O título à esquerda pode quebrar em 2 linhas
   pra comportá-los; sono pode ter quatro (nota nativa, Vaigo, duração e vigília). */
.rh-inds { flex: 0 0 auto; margin-left: auto; display: flex; gap: 13px; align-items: flex-start; padding-left: 10px; }
.rh-ind { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.rh-ind-val { font-size: 1.3rem; font-weight: 700; color: #e6e7eb; white-space: nowrap; }
.rh-ind-val.down { color: #34d399; }
.rh-ind-val.up { color: #fbbf24; }
.rh-ind-sub { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.5px; color: #6b7280; font-weight: 600; margin-top: 2px; }
@media (max-width: 600px) {
  /* Três indicadores (ex.: índice + dormindo + acordado) não devem esmagar o
     título. A segunda linha preserva cada conceito e continua fácil de ler. */
  .rh-card--stacked-inds {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
  }
  .rh-card--stacked-inds .rh-ic { grid-column: 1; grid-row: 1; }
  .rh-card--stacked-inds .rh-main { grid-column: 2; grid-row: 1; }
  .rh-card--stacked-inds .rh-inds {
    grid-column: 1 / -1;
    width: 100%;
    margin: 7px 0 0;
    padding-left: 56px;
    justify-content: space-between;
  }
  .rh-card--stacked-inds .rh-ind { flex: 1 1 0; align-items: center; }
  .rh-card--four-inds .rh-inds {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
  }
}

/* ===================== Tarefas (to-do) ===================== */
.tasks-root .habits-head { display: flex; align-items: center; gap: 10px; }
/* Eixo TIPO (Tarefas/Eventos/Rotinas): abas (.habits-subtabs/.seg-btn). À direita, o botão de
   filtro de CONTEXTO (como uma "4ª aba") que abre o pop-up menu Tudo/Trabalho/Pessoal. */
.tasks-tabbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tasks-tabbar .habits-subtabs { flex: 1 1 auto; }
.tasks-filter-btn { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; background: #0f1115; border: 1px solid #20242e; border-radius: 8px; color: #cbd5e1; font-family: inherit; font-size: 0.82rem; font-weight: 600; padding: 7px 11px; cursor: pointer; white-space: nowrap; }
.tasks-filter-btn:hover { color: #fff; }
.tasks-filter-btn.filtered { color: #fff; border-color: #2563eb; background: #16233f; }
.tasks-filter-caret { color: #64748b; font-size: 0.72rem; }
/* Pop-up menu in-app do filtro de contexto (ancorado ao botão, posição fixed). */
.tasks-ctx-menu { z-index: 1000; min-width: 150px; background: #14171f; border: 1px solid #2a2f3a; border-radius: 10px; padding: 5px; box-shadow: 0 8px 24px rgba(0,0,0,.45); display: flex; flex-direction: column; gap: 2px; }
.tasks-ctx-item { text-align: left; background: transparent; border: 0; border-radius: 7px; color: #cbd5e1; font-family: inherit; font-size: 0.9rem; font-weight: 500; padding: 9px 12px; cursor: pointer; }
.tasks-ctx-item:hover { background: #1f2937; color: #fff; }
.tasks-ctx-item.active { background: #2563eb; color: #fff; }
/* Linha de controles do tipo ativo: toggles à esquerda, "+" à direita. */
.tasks-controls { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.tasks-controls-left { flex: 1 1 auto; display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.tasks-controls-left .task-arch-row { margin-left: 0; }
#tasksBody { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.task-cat-select { flex: 0 0 auto; font-weight: 600; padding: 7px 10px; }
/* Visualização dos Eventos por período (Todos/Diário/…/Anual) — dropdown ao lado da sub-aba. */
.events-view-select { flex: 0 0 auto; padding: 7px 10px; }
/* Botão "Nova": só o "+" (azul), compacto e quadrado, no canto direito. */
.task-new-btn { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; padding: 7px 9px; }
.task-new-btn svg { width: 16px; height: 16px; }
/* "Arquivadas": toggle padrão (.set-toggle) à esquerda do "+"; aplica na aba ativa. */
.task-arch-row { flex: 0 0 auto; margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 0.84rem; color: #cbd5e1; cursor: pointer; white-space: nowrap; user-select: none; }
/* Vencimento opcional: check ao lado do rótulo liga/desliga o campo de data. */
.task-due-head { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.task-due-head input[type="checkbox"] { width: 15px; height: 15px; margin: 0; accent-color: #2563eb; cursor: pointer; }
.task-due-row input[type="datetime-local"]:disabled { opacity: 0.4; cursor: not-allowed; }
.tasks-empty { padding: 22px 12px; text-align: center; }

.task-card { background: #14171f; border: 1px solid #20242e; border-radius: 10px; padding: 10px 12px; }
.task-card.has-kids { padding-bottom: 8px; }
/* Subtarefas (qualquer nível): visual leve, sem caixa; a indentação vem do .task-children. */
.task-card.task-sub { background: transparent; border: 0; border-radius: 0; padding: 3px 0; }
.task-row { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
/* Tarefa-mãe: card escuro (#14171f); a área das subtarefas vira um bloco recuado um tico
   mais claro (#1b1f29), destacando a lista dentro da tarefa principal. */
.task-card:not(.task-sub) { background: #14171f; }
.task-card:not(.task-sub) > .task-children { background: #1b1f29; border-left: none; border-radius: 8px; margin: 8px 0 0; padding: 6px 8px; }
/* título + meta (data/categoria/ações) juntos; no desktop ficam lado a lado, no celular empilham. */
.task-body { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; }
.task-meta { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; }
.task-title { flex: 1 1 auto; min-width: 0; font-size: 0.92rem; color: #e6e7eb; overflow-wrap: anywhere; }
.task-title.done { color: #6b7280; text-decoration: line-through; }
/* Título da tarefa principal em destaque (negrito + um tico maior); subtarefas ficam leves. */
.task-card:not(.task-sub) > .task-row .task-title { font-weight: 600; font-size: 0.96rem; }
.task-card.task-sub .task-title { font-size: 0.86rem; }

.task-check { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid #3a4150; background: #0f1115; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; transition: background 0.15s, border-color 0.15s; }
.task-check:hover { border-color: #60a5fa; }
.task-check.done { background: #2563eb; border-color: #2563eb; }
.task-check svg { width: 13px; height: 13px; color: #fff; }

.task-due { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; font-size: 0.74rem; color: #9ca3af; }
.task-due svg { width: 12px; height: 12px; }
/* Badge de categoria (só na raiz) */
.task-cat { flex: 0 0 auto; font-size: 0.68rem; font-weight: 600; border-radius: 5px; padding: 2px 7px; }
.task-cat-work { color: #fcd34d; background: #422006; }
.task-cat-personal { color: #6ee7b7; background: #064e3b; }

.task-actions { flex: 0 0 auto; display: inline-flex; gap: 2px; }
.task-icon-btn { background: transparent; border: none; color: #6b7280; cursor: pointer; padding: 5px; border-radius: 6px; display: inline-flex; align-items: center; transition: color 0.15s, background 0.15s; }
.task-icon-btn:hover { color: #cbd5e1; background: #1f2937; }
.task-icon-btn.danger:hover { color: #fca5a5; background: #3f1d1d; }
.task-icon-btn svg { width: 15px; height: 15px; }

.task-progress { height: 6px; background: #0f1115; border-radius: 4px; overflow: hidden; margin: 9px 0 4px; }
.task-progress-bar { height: 100%; background: linear-gradient(90deg, #2563eb, #60a5fa); border-radius: 4px; transition: width 0.25s; }

/* Container dos filhos: indentação + guia à esquerda (acumula a cada nível). */
.task-children { display: flex; flex-direction: column; gap: 2px; margin: 6px 0 0 6px; padding-left: 8px; border-left: 2px solid #20242e; }
.task-children:empty { display: none; }

/* "Orelhinha" de arrastar: única zona que inicia o drag (handle do Sortable). touch-action:none
   pra que arrastar a orelhinha não role a página; alvo de toque generoso (~36px). */
.task-drag-handle { flex: 0 0 auto; align-self: center; color: #6b7280; cursor: grab; display: inline-flex; align-items: center; justify-content: center; padding: 8px 6px; margin: -6px -4px -6px 0; border-radius: 7px; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; transition: color 0.15s, background 0.15s; }
.task-drag-handle:hover { color: #cbd5e1; background: #1f2937; }
.task-drag-handle:active { cursor: grabbing; color: #cbd5e1; background: #1f2937; }
.task-drag-handle svg { width: 18px; height: 18px; pointer-events: none; }
@media (max-width: 560px) { .task-drag-handle { padding: 10px 8px; } .task-drag-handle svg { width: 20px; height: 20px; } }

/* Arrastar-e-soltar (SortableJS): fantasma (slot), escolhido e o clone flutuante. */
.task-card.sortable-ghost { opacity: 0.35; }
.task-card.sortable-chosen { background: #1a1e28; border-radius: 8px; }
.sortable-fallback { opacity: 0.92; box-shadow: 0 8px 24px rgba(0,0,0,0.45); border-radius: 10px; cursor: grabbing; }
.tasks-dragging .task-children { outline: 1px dashed rgba(37,99,235,0.5); outline-offset: 2px; border-radius: 8px; }
/* Durante o arrasto, revela os contêineres de subtarefa VAZIOS como zona de drop. Sem isso
   não dá pra aninhar uma tarefa dentro de outra que ainda não tem subtarefas: o contêiner
   fica display:none (regra :empty acima), altura 0, e o Sortable não acha onde soltar. */
.tasks-dragging .task-children:empty { display: block; min-height: 26px; }

.task-add-inline { margin-top: 8px; }
.task-add-inline[hidden] { display: none; }
.task-card.task-sub > .task-add-inline { margin-top: 4px; }
/* Celular: título numa linha cheia em cima; data/categoria/ações empilham embaixo (com as
   ações à direita). Evita o título ser espremido numa coluna estreita e quebrar letra a letra. */
@media (max-width: 560px) {
  .task-body { flex-direction: column; align-items: stretch; gap: 9px; }
  .task-meta .task-actions { margin-left: auto; }
  /* título principal com um respiro extra acima da linha de controles */
  .task-card:not(.task-sub) > .task-row .task-title { line-height: 1.3; }
}
.task-add-inline .voice-field input { width: 100%; padding: 7px 38px 7px 10px; background: #0f1115; color: #e6e7eb; border: 1px dashed #2a2f3a; border-radius: 6px; font-size: 0.84rem; box-sizing: border-box; }
.task-add-inline .voice-field input:focus { outline: none; border-style: solid; border-color: #2563eb; }

/* Eventos (kind='event'): períodos, sem checkbox de concluir. Borda esquerda colorida
   pelo estado (ativo/próximo/encerrado). */
.ev-list { display: flex; flex-direction: column; gap: 8px; }
.ev-card { display: flex; align-items: flex-start; gap: 10px; background: #14171f; border: 1px solid #20242e; border-left: 3px solid #475569; border-radius: 10px; padding: 10px 12px; }
.ev-card.ev-active { border-left-color: #22c55e; }
.ev-card.ev-soon { border-left-color: #60a5fa; }
.ev-card.ev-past { border-left-color: #475569; opacity: 0.7; }
.ev-body { flex: 1 1 auto; min-width: 0; }
.ev-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ev-title { font-size: 0.96rem; font-weight: 600; color: #e6e7eb; overflow-wrap: anywhere; }
.ev-state { flex: 0 0 auto; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.03em; border-radius: 5px; padding: 2px 7px; background: #1b1f29; color: #9ca3af; text-transform: uppercase; }
.ev-state.ev-active { color: #6ee7b7; background: #064e3b; }
.ev-state.ev-soon { color: #93c5fd; background: #1d2c4a; }
.ev-state.ev-past { color: #94a3b8; background: #1b1f29; }
.ev-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 5px; }
.ev-range { display: inline-flex; align-items: center; gap: 5px; font-size: 0.8rem; color: #cbd5e1; }
.ev-range svg { width: 13px; height: 13px; color: #9ca3af; }
.ev-actions { flex: 0 0 auto; }
.ev-date-fields { display: flex; gap: 10px; }
.ev-date-fields label { flex: 1; }
/* Lembrete (opt-in) do evento: checkbox no modal + sininho no card. */
.ev-remind-field { display: flex; flex-direction: row; align-items: center; gap: 8px; cursor: pointer; }
.ev-remind-field input[type="checkbox"] { width: 16px; height: 16px; min-width: auto; margin: 0; accent-color: #2563eb; cursor: pointer; flex: 0 0 auto; }
.ev-remind-field span { font-size: 0.9rem; color: #e6e7eb; }
.ev-remind-hint { margin: -4px 0 0; font-size: 0.78rem; }
.ev-remind-badge { font-size: 0.85rem; line-height: 1; flex: 0 0 auto; }

/* Rotinas/Automações (sub-aba Rotinas em Tarefas). */
.auto-hint { margin: 0 0 10px; font-size: 0.82rem; line-height: 1.45; }
.auto-list { display: flex; flex-direction: column; gap: 8px; }
.auto-card { display: flex; align-items: flex-start; gap: 10px; background: #14171f; border: 1px solid #20242e; border-left: 3px solid #8b5cf6; border-radius: 10px; padding: 10px 12px; }
.auto-card.auto-st-paused { border-left-color: #64748b; opacity: 0.78; }
.auto-card.auto-st-done { border-left-color: #22c55e; }
.auto-card.auto-st-error { border-left-color: #ef4444; }
.auto-body { flex: 1 1 auto; min-width: 0; cursor: pointer; }
.auto-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.auto-title { font-size: 0.96rem; font-weight: 600; color: #e6e7eb; overflow-wrap: anywhere; }
.auto-state { flex: 0 0 auto; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.03em; border-radius: 5px; padding: 2px 7px; background: #1b1f29; color: #9ca3af; text-transform: uppercase; }
.auto-state.auto-st-active { color: #c4b5fd; background: #2e1f50; }
.auto-state.auto-st-done { color: #6ee7b7; background: #064e3b; }
.auto-state.auto-st-error { color: #fca5a5; background: #3a1a1a; }
.auto-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 5px; }
.auto-sched { display: inline-flex; align-items: center; gap: 5px; font-size: 0.8rem; color: #cbd5e1; }
.auto-sched svg { width: 13px; height: 13px; color: #9ca3af; }
.auto-best { font-size: 0.8rem; color: #cbd5e1; }
.auto-best b { color: #e6e7eb; }
.auto-actions { flex: 0 0 auto; }
.auto-row2 { display: flex; gap: 10px; }
.auto-row2 label { flex: 1; }
.auto-alert-field { display: flex; flex-direction: row; align-items: center; gap: 8px; cursor: pointer; }
.auto-alert-field input[type="checkbox"] { width: 16px; height: 16px; min-width: auto; margin: 0; accent-color: #8b5cf6; cursor: pointer; flex: 0 0 auto; }
.auto-alert-field span { font-size: 0.9rem; color: #e6e7eb; }
/* Detalhe da rotina: relatório + histórico de medições. */
.auto-best-big { font-size: 0.95rem; color: #cbd5e1; margin: 4px 0; }
.auto-report { background: #14171f; border: 1px solid #20242e; border-radius: 8px; padding: 10px 12px; font-size: 0.86rem; color: #cbd5e1; line-height: 1.5; }
.auto-h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: #9ca3af; margin: 12px 0 6px; }
.auto-runs { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.auto-run { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 0.82rem; border-bottom: 1px solid #1b1f29; padding-bottom: 5px; }
.auto-run-when { color: #9ca3af; flex: 0 0 auto; }
.auto-run-val { color: #e6e7eb; font-weight: 600; }
.auto-run-src { color: #93c5fd; text-decoration: underline; overflow-wrap: anywhere; }
.auto-run-watch { flex-direction: column; align-items: flex-start; gap: 4px; }
.auto-run-items { display: flex; flex-direction: column; gap: 3px; }
.auto-weekdays { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 2px; }
.auto-wd { display: inline-flex; align-items: center; gap: 4px; font-size: 0.82rem; color: #cbd5e1; background: #14171f; border: 1px solid #20242e; border-radius: 8px; padding: 4px 8px; cursor: pointer; }
.auto-wd input { width: 14px; height: 14px; min-width: auto; margin: 0; accent-color: #8b5cf6; }
.auto-chart-wrap { position: relative; height: 160px; margin: 8px 0 4px; }
.auto-times { display: flex; flex-direction: column; gap: 6px; }
.auto-time-row { display: flex; align-items: center; gap: 8px; }
.auto-time-row input { flex: 1; }
.auto-time-del { flex: 0 0 auto; background: #2a1414; color: #fca5a5; border: 1px solid #4c1d1d; border-radius: 8px; padding: 4px 10px; cursor: pointer; }
.auto-time-add { width: auto; align-self: flex-start; padding: 5px 12px; font-size: 0.82rem; }

/* Barra "Google Agenda" no topo da lista de Eventos (conectar / sincronizar / desconectar). */
.gcal-bar { margin-bottom: 10px; }
.gcal-bar:empty { display: none; margin: 0; }
.gcal-connect-btn { display: inline-flex; align-items: center; gap: 8px; width: auto; }
.gcal-g { flex: 0 0 auto; }
.gcal-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: #14171f; border: 1px solid #20242e; border-radius: 10px; padding: 9px 12px; }
.gcal-status-label { display: inline-flex; align-items: center; gap: 7px; font-size: 0.85rem; color: #cbd5e1; overflow-wrap: anywhere; }
.gcal-status-actions { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.gcal-sm { width: auto; padding: 6px 12px; font-size: 0.82rem; }
.gcal-sm.danger { color: #fca5a5; border-color: #4c1d1d; }
.gcal-sm.danger:hover { background: #2a1414; }
.gcal-sm:disabled { opacity: 0.6; cursor: default; }
.gcal-help { font-size: 0.85rem; color: #cbd5e1; margin: 0 0 8px; line-height: 1.45; }
.gcal-help.muted { color: #9ca3af; font-size: 0.8rem; }
.gcal-help code { background: #1b1f29; border-radius: 4px; padding: 1px 5px; font-size: 0.92em; }
.modal-head h2 .gcal-g { vertical-align: -2px; margin-right: 4px; }

/* Lista de agendas conectadas (multi-agenda) no topo da aba Eventos. */
.gcal-cals { background: #14171f; border: 1px solid #20242e; border-radius: 10px; padding: 8px 10px; }
.gcal-cals-head { display: flex; align-items: center; gap: 7px; font-size: 0.8rem; color: #9ca3af;
  font-weight: 600; padding: 2px 2px 7px; }
.gcal-cal-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 2px;
  border-top: 1px solid #1d212b; }
.gcal-cal-name { display: inline-flex; align-items: center; gap: 7px; font-size: 0.86rem; color: #e5e7eb;
  font-weight: 600; overflow-wrap: anywhere; }
.gcal-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; background: #4285F4;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12) inset; }
.gcal-cal-sub { font-size: 0.78rem; color: #9ca3af; margin-left: auto; }
.gcal-cal-err { font-size: 0.78rem; color: #fca5a5; margin-left: auto; }
.gcal-cal-actions { display: inline-flex; align-items: center; gap: 3px; flex: 0 0 auto; }
.gcal-cals-foot { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 8px; margin-top: 4px;
  border-top: 1px solid #1d212b; }
/* Swatches de cor no modal de editar agenda. */
.gcal-swatches { display: flex; gap: 8px; flex-wrap: wrap; margin: 2px 0 4px; }
.gcal-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; padding: 0;
  cursor: pointer; flex: 0 0 auto; }
.gcal-swatch.sel { border-color: #e5e7eb; box-shadow: 0 0 0 2px #14171f, 0 0 0 4px #e5e7eb33; }
/* Seletor de contexto da agenda (Trabalho/Pessoal): chips com as cores de .task-cat-*, esmaecidos
   até serem escolhidos; o selecionado ganha contorno claro (mesmo idioma dos swatches). */
.gcal-ctxs { display: flex; gap: 8px; flex-wrap: wrap; margin: 2px 0 4px; }
.gcal-ctx { cursor: pointer; border: 1.5px solid transparent; padding: 5px 12px; font-size: 0.8rem;
  opacity: 0.55; transition: opacity 0.15s, border-color 0.15s; }
.gcal-ctx.sel { opacity: 1; border-color: currentColor; }

/* Selo da agenda nos cards de evento importados (source='gcal') — cor por agenda via --cal-color. */
.ev-gcal-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 0.68rem; font-weight: 600;
  color: #cbd5e1; background: #1b1f29; border: 1px solid #2a3140; border-radius: 5px; padding: 2px 7px;
  --cal-color: #4285F4; }
.ev-gcal-badge .gcal-dot { width: 8px; height: 8px; background: var(--cal-color); }
.ev-card.ev-gcal { border-left-color: var(--cal-color, #4285F4); }
.ev-card.ev-gcal.ev-active { border-left-color: #22c55e; }
.ev-card.ev-gcal.ev-past { border-left-color: #475569; }

/* Campo com microfone de ditado por voz (Web Speech API). Os seletores levam `.voice-field`
   junto pra vencer o `.form button` (largura total + azul) e o `.form input` do modal. */
.voice-field { position: relative; }
.modal-card .form .voice-field input, .modal-card .form .voice-field textarea { padding-right: 40px; }
.voice-field .voice-mic { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; min-width: 0; margin: 0; padding: 0; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; border-radius: 6px; color: #6b7280; font-weight: 400; cursor: pointer; transition: color 0.15s, background 0.15s; }
.voice-field .voice-mic:hover { color: #cbd5e1; background: #1f2937; }
.voice-field .voice-mic svg { width: 16px; height: 16px; }
.voice-field .voice-mic.recording { color: #fff; background: #b91c1c; animation: voice-pulse 1.2s ease-in-out infinite; }
.voice-field textarea ~ .voice-mic { top: 8px; }
@keyframes voice-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(185,28,28,0.5); } 50% { box-shadow: 0 0 0 5px rgba(185,28,28,0); } }

/* Mini-cards "Trabalho" / "Tarefas de hoje" no Feed */
.tasks-hero-card { background: #14171f; border: 1px solid #20242e; border-radius: 12px; padding: 12px 14px; }
.tasks-hero-card + .tasks-hero-card { margin-top: 10px; }
.th-head { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.th-head svg { width: 17px; height: 17px; color: #60a5fa; flex: 0 0 auto; }
.th-headlabel { font-weight: 600; font-size: 0.92rem; color: #e6e7eb; }
.th-count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #1f2937; color: #cbd5e1; font-size: 0.74rem; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.th-list { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
.th-row { display: flex; align-items: center; gap: 9px; padding: 5px 0; min-width: 0; }
.th-title { flex: 1 1 auto; min-width: 0; font-size: 0.88rem; color: #e6e7eb; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th-tag { flex: 0 0 auto; font-size: 0.7rem; font-weight: 600; color: #9ca3af; background: #1b1f29; border-radius: 5px; padding: 2px 7px; }
.th-tag.th-late { color: #fca5a5; background: #3f1d1d; }
/* Tarefa concluída no card do dia: fica riscada (some só no dia seguinte). */
.th-row.done .th-title { color: #6b7280; text-decoration: line-through; }
/* Evento (reunião/período) no card de Trabalho: sem check, só ícone de agenda alinhado onde o
   check ficaria (mesma largura, 20px) — distingue do afazer mas mantém o título alinhado. */
.th-ev .th-evicon { flex: 0 0 auto; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; color: #93a4c0; }
.th-ev .th-evicon svg { width: 14px; height: 14px; }

/* ===================== Biometria por etapas (3 formatos) ===================== */
.bio-datenav { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 14px; }
.bio-date { font-weight: 600; min-width: 90px; text-align: center; }
.bio-empty { padding: 28px 12px; text-align: center; }
.bio-fmt { margin-bottom: 26px; }
.bio-fmt-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #6b7280; margin-bottom: 10px; border-bottom: 1px solid #20242e; padding-bottom: 6px; }

/* Formato 1 — painéis de barras */
/* 2 painéis por linha (mais largura → rótulos completos tipo "Trabalho (agora)") */
#bioBars { display: flex; flex-wrap: wrap; gap: 16px; }
.bio-panel { flex: 1 1 calc(50% - 8px); min-width: 0; box-sizing: border-box; background: #14171f; border: 1px solid #20242e; border-radius: 10px; padding: 12px 14px; }
@media (max-width: 620px) { .bio-panel { flex-basis: 100%; } }
.bio-panel-h { font-weight: 700; font-size: 0.9rem; margin-bottom: 10px; }
.bio-bar-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.bio-bar-sub .bio-bar-label { color: #9ca3af; }
.bio-bar-label { flex: 0 0 44%; font-size: 0.8rem; color: #e6e7eb; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bio-bar-track { flex: 1 1 auto; height: 12px; background: #0f1115; border-radius: 6px; overflow: hidden; }
.bio-bar-fill { display: block; height: 100%; border-radius: 6px; min-width: 2px; transition: width 0.25s; }
.bio-bar-val { flex: 0 0 auto; font-size: 0.76rem; color: #cbd5e1; min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; }

/* Formato 2 — matriz / heatmap */
.bio-mx { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.bio-mx th { text-align: center; color: #9ca3af; font-weight: 600; padding: 6px 8px; font-size: 0.78rem; }
.bio-mx th:first-child { text-align: left; }
.bio-mx-label { padding: 7px 10px; color: #e6e7eb; white-space: nowrap; }
.bio-mx-sub .bio-mx-label { color: #9ca3af; font-size: 0.8rem; }
.bio-mx-cell { text-align: center; padding: 7px 8px; color: #e6e7eb; font-variant-numeric: tabular-nums; border-radius: 4px; }
.bio-mx-na { color: #4b5563; }

/* Formato 3 — timeline */
.bio-tl-metrics { display: flex; gap: 6px; margin-bottom: 10px; }
.bio-tl { position: relative; }
.bio-tl-row { position: relative; height: 30px; margin-bottom: 6px; background: #0f1115; border-radius: 6px; overflow: hidden; }
.bio-tl-actrow { height: 26px; }
.bio-tl-band { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; padding: 0 6px; border-right: 1px solid rgba(0,0,0,0.35); overflow: hidden; }
.bio-tl-act { opacity: 0.92; border-radius: 4px; top: 2px; bottom: 2px; }
.bio-tl-band-lbl { font-size: 0.7rem; color: #fff; white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
.bio-tl-axis { position: relative; height: 16px; margin-top: 2px; }
.bio-tl-tick { position: absolute; transform: translateX(-50%); font-size: 0.68rem; color: #6b7280; }
.bio-tl-tick:first-child { transform: none; }
.bio-tl-tick:last-child { transform: translateX(-100%); }
.bio-tl-noact { font-size: 0.76rem; padding: 0 8px; line-height: 26px; }
.bio-tl-note { font-size: 0.74rem; margin-top: 8px; }

/* Formato 4 — faixas por etapa, dois andares, um bloco por indicador */
.bio-st-metric { margin-bottom: 16px; }
.bio-st-h { font-weight: 700; font-size: 0.9rem; margin-bottom: 6px; }
.bio-st-tl { position: relative; }
.bio-st-tier { position: relative; height: 28px; margin-bottom: 4px; }
.bio-st-band { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 8px; border-radius: 5px; border: 1px solid #2a2f3a; overflow: hidden; box-sizing: border-box; }
.bio-st-macro { background: #1b1f29; }
.bio-st-act { background: #11161f; border-style: dashed; }
.bio-st-active { border-color: #60a5fa; background: #15233a; }
.bio-st-name { font-size: 0.72rem; color: #cbd5e1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bio-st-val { flex: 0 0 auto; font-size: 0.74rem; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.bio-st-axis { position: relative; height: 16px; margin-top: 2px; }

/* ============================================================
   Memória — aba de fatos/arquivos/links com tags por IA
   ============================================================ */
.mem-head { margin-bottom: 10px; }
.mem-search { flex: 1; min-width: 160px; }
.mem-search input { width: 100%; padding: 9px 38px 9px 12px; background: #0f1115; color: #e6e7eb; border: 1px solid #2a2f3a; border-radius: 8px; font-size: 0.92rem; box-sizing: border-box; }
.mem-search input:focus { outline: none; border-color: #2563eb; }
.mem-add-btn { padding: 8px 12px; }
.mem-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.mem-chip { padding: 5px 12px; background: #151a23; color: #9aa3b2; border: 1px solid #232938; border-radius: 999px; font-size: 0.8rem; cursor: pointer; }
.mem-chip.active { background: #1d2c4a; color: #93c5fd; border-color: #2f4a7d; }
/* :not([hidden]) — senão o display:flex venceria o atributo hidden (UA stylesheet) */
.mem-busy:not([hidden]) { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.mem-busy svg { animation: spin 1.2s linear infinite; }
.mem-empty { padding: 24px 4px; }
.mem-drophint { margin-top: 16px; font-size: 0.78rem; border: 1px dashed #2a2f3a; border-radius: 8px; padding: 10px 12px; text-align: center; }
.mem-root.mem-dragover { outline: 2px dashed #2563eb; outline-offset: 4px; border-radius: 10px; }
.mem-root.mem-dragover .mem-drophint { border-color: #2563eb; color: #93c5fd; }

.mem-card { display: flex; gap: 12px; align-items: flex-start; background: #14171f; border: 1px solid #20242e; border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer; }
.mem-card:hover { border-color: #2f3848; }
.mem-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; background: #0f1115; }
.mem-kind-ico { width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; border-radius: 8px; background: #10151e; color: #7c8aa0; flex: 0 0 auto; }
.mem-kind-ico svg { width: 22px; height: 22px; }
.mem-kind-link { color: #60a5fa; }
.mem-kind-pdf { color: #f87171; }
.mem-kind-text { color: #a7f3d0; }
/* Fato (always_context): ícone da categoria, destacado em âmbar (combina com o badge 📌 Fato)
   e com borda — pra saltar das memórias comuns na lista. Suporta emoji (📌 sem categoria). */
.mem-kind-fact { color: #fbbf24; background: #2a2114; box-shadow: inset 0 0 0 1px #4a3a18; font-size: 22px; line-height: 1; }
.mem-card-body { flex: 1; min-width: 0; }
.mem-card-title { font-size: 0.93rem; font-weight: 600; color: #e6e7eb; display: flex; align-items: center; gap: 6px; word-break: break-word; }
.mem-pending svg { width: 13px; height: 13px; color: #fbbf24; }
.mem-card-snippet { font-size: 0.8rem; margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.mem-card-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.mem-tag { background: #1d2c4a; color: #93c5fd; border-radius: 999px; padding: 2px 9px; font-size: 0.7rem; }
.mem-tag-more { background: #1a1f2b; color: #7c8aa0; }
.mem-date { font-size: 0.72rem; margin-left: auto; }

/* Fato (always_context): badge no card, borda de destaque, chip do filtro e editor */
.mem-chip-facts.active { background: #3a2f12; color: #fcd34d; border-color: #5c4a1e; }
.mem-card-fact { border-color: #4a3a14; }
.mem-fact-badge { display: inline-flex; align-items: center; gap: 4px; background: #3a2f12; color: #fcd34d; border-radius: 999px; padding: 2px 9px; font-size: 0.7rem; font-weight: 600; }
.mem-fact-edit { background: #10151e; border: 1px solid #20242e; border-radius: 8px; padding: 10px 12px; }
.mem-fact-toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; }
.mem-fact-toggle-lbl { font-size: 0.88rem; color: #e6e7eb; }
.mem-fact-toggle input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: #d97706; cursor: pointer; flex: 0 0 auto; }
.mem-fact-cats { margin-top: 10px; }
.mem-fact-cats-lbl { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
.mem-fact-cat-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.mem-fact-cat { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; background: #151a23; color: #9aa3b2; border: 1px solid #232938; border-radius: 999px; font-size: 0.78rem; cursor: pointer; }
.mem-fact-cat svg { width: 13px; height: 13px; }
.mem-fact-cat.active { background: #3a2f12; color: #fcd34d; border-color: #5c4a1e; }

.mem-modal-card { max-width: 640px; }
.mem-modal-head { justify-content: flex-start; align-items: center; gap: 10px; }
.mem-modal-head .mem-kind-ico { width: 36px; height: 36px; }
.mem-modal-head .mem-date { margin-left: auto; }
.mem-preview { width: 100%; max-height: 320px; object-fit: contain; border-radius: 10px; background: #0f1115; margin-bottom: 10px; }
.mem-open-file { display: inline-flex; align-items: center; gap: 8px; width: auto; margin-bottom: 10px; text-decoration: none; }
.mem-link { display: flex; align-items: center; gap: 8px; color: #60a5fa; font-size: 0.86rem; margin-bottom: 10px; word-break: break-all; text-decoration: none; }
.mem-link:hover { text-decoration: underline; }
.mem-link svg { flex: 0 0 auto; }
.mem-summary { background: #10151e; border: 1px solid #20242e; border-radius: 8px; padding: 10px 12px; font-size: 0.84rem; color: #cbd5e1; margin-bottom: 6px; }
.mem-modal-actions { display: flex; gap: 8px; align-items: center; }
.mem-actions-gap { flex: 1; }
.mem-modal-actions .btn { width: auto; margin-top: 0; }
.btn.danger-ghost { background: transparent; color: #f87171; border: 1px solid #3a2030; }
.btn.danger-ghost:hover { background: #2a141c; }

/* ============ Entretenimento ============ */
.ent-head { display: flex; align-items: center; gap: 8px; }
.ent-title { display: flex; align-items: center; gap: 8px; margin: 0; flex: 1; font-size: 1.05rem; }
.ent-title svg { width: 20px; height: 20px; color: #93c5fd; }
.ent-head-btn { width: auto; padding: 7px 10px; }
.ent-block { background: #10151e; border: 1px solid #20242e; border-radius: 12px; padding: 12px 14px; margin-top: 12px; }
.ent-block-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ent-block-head h3 { margin: 0; font-size: 0.95rem; flex: 0 0 auto; }
.ent-block-head svg { width: 16px; height: 16px; color: #7c8aa0; }
.ent-block-status { font-size: 0.7rem; margin-left: auto; }
.ent-loading svg { width: 14px; height: 14px; animation: spin 1.2s linear infinite; vertical-align: -2px; }
.ent-msg { font-size: 0.84rem; }
.ent-empty { padding: 14px 0; }
.ent-subhead { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; margin: 10px 0 6px; }
.ent-up { color: #34d399; }
.ent-down { color: #f87171; }
.ent-pct { font-size: 0.78rem; font-weight: 600; }
.ent-num { text-align: right; }

/* Cotações */
.ent-quotes { display: flex; gap: 10px; flex-wrap: wrap; }
.ent-quote { background: #0f1115; border: 1px solid #20242e; border-radius: 10px; padding: 10px 14px; min-width: 110px; }
.ent-quote-label { font-size: 0.74rem; color: #7c8aa0; }
.ent-quote-value { font-size: 1.05rem; font-weight: 700; color: #e6e7eb; margin: 2px 0; }

/* Notícias */
.ent-news-list { display: flex; flex-direction: column; gap: 10px; }
.ent-news { display: flex; gap: 12px; align-items: flex-start; text-decoration: none; color: inherit; border-radius: 10px; padding: 6px; margin: -6px; }
.ent-news:hover { background: #131a26; }
.ent-news-img { width: 96px; height: 64px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; background: #0f1115; }
.ent-news-title { font-size: 0.92rem; font-weight: 600; color: #e6e7eb; }
.ent-news-desc { font-size: 0.8rem; margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ent-news-src { font-size: 0.72rem; margin-top: 4px; }

/* Carrosséis (vídeos, filmes, receitas, posts) */
.ent-hscroll { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 6px; scrollbar-width: thin; }
.ent-hscroll > * { scroll-snap-align: start; flex: 0 0 auto; }
.ent-video { width: 200px; text-decoration: none; color: inherit; }
.ent-video-thumb { width: 200px; height: 112px; object-fit: cover; border-radius: 10px; background: #0f1115; }
.ent-video-title { font-size: 0.82rem; font-weight: 600; color: #e6e7eb; margin-top: 6px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ent-video-meta { font-size: 0.72rem; margin-top: 2px; }
.ent-yt-query { font-size: 0.76rem; margin: 8px 0 6px; }

/* Cinema */
.ent-cinema-city { font-size: 0.78rem; margin-bottom: 8px; }
.ent-movie { width: 120px; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; color: inherit; font: inherit; }
.ent-movie-poster { width: 120px; height: 170px; object-fit: cover; border-radius: 10px; background: #0f1115; }
.ent-movie-title { font-size: 0.8rem; font-weight: 600; color: #e6e7eb; margin-top: 6px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ent-movie-genre { font-size: 0.7rem; }
.ent-movie-modal { max-width: 640px; }
.ent-movie-detail { display: flex; gap: 14px; }
.ent-movie-poster-lg { width: 140px; height: 200px; object-fit: cover; border-radius: 10px; flex: 0 0 auto; background: #0f1115; }
.ent-synopsis { font-size: 0.85rem; color: #cbd5e1; margin: 8px 0; }
.ent-theater { margin-bottom: 8px; font-size: 0.85rem; }
.ent-sessions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.ent-session { background: #1d2c4a; color: #93c5fd; border-radius: 6px; padding: 2px 8px; font-size: 0.76rem; }

/* Instagram */
.ent-ig-profile { margin-bottom: 12px; }
.ent-ig-handle { display: flex; align-items: center; gap: 8px; text-decoration: none; color: #e6e7eb; margin-bottom: 8px; font-size: 0.88rem; }
.ent-ig-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: #0f1115; }
.ent-ig-post { width: 150px; text-decoration: none; color: inherit; }
.ent-ig-img { width: 150px; height: 150px; object-fit: cover; border-radius: 10px; background: #0f1115; }
.ent-ig-cap { font-size: 0.74rem; color: #9aa3b2; margin-top: 4px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* Futebol / F1 */
.ent-match { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid #1a1f2b; font-size: 0.86rem; }
.ent-match:last-of-type { border-bottom: 0; }
.ent-match-team:first-child { text-align: right; }
.ent-match-score { font-weight: 700; color: #e6e7eb; }
.ent-match-meta { font-size: 0.72rem; }
.ent-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; margin-top: 6px; }
.ent-table th { text-align: left; color: #7c8aa0; font-size: 0.72rem; font-weight: 600; padding: 4px 6px; }
.ent-table td { padding: 4px 6px; border-top: 1px solid #1a1f2b; }
.ent-f1-next { display: flex; flex-direction: column; gap: 2px; font-size: 0.88rem; margin-bottom: 6px; }

/* Receitas / Lua / Marés */
.ent-recipe { width: 160px; text-decoration: none; color: inherit; }
.ent-recipe-img { width: 160px; height: 110px; object-fit: cover; border-radius: 10px; background: #0f1115; }
.ent-recipe-title { font-size: 0.82rem; font-weight: 600; color: #e6e7eb; margin-top: 6px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ent-recipe-meta { font-size: 0.72rem; }
.ent-moon { display: flex; align-items: center; gap: 12px; font-size: 0.9rem; }
.ent-moon-emoji { font-size: 1.8rem; }
.ent-tide { display: flex; gap: 12px; align-items: center; padding: 4px 0; font-size: 0.86rem; }
.ent-tide-type { width: 64px; font-weight: 600; }

/* Preferências de Entretenimento (sub-aba das Configurações) */
.set-subtabs { margin-bottom: 12px; }
.ent-set-input { background: #0f1115; border: 1px solid #20242e; border-radius: 8px; color: #e6e7eb; padding: 7px 10px; font: inherit; width: 180px; }
.ent-set-sources { display: flex; flex-direction: column; gap: 10px; }
.ent-set-area { display: flex; flex-direction: column; gap: 4px; font-size: 0.86rem; color: #cbd5e1; }
.ent-set-area textarea { background: #0f1115; border: 1px solid #20242e; border-radius: 8px; color: #e6e7eb; padding: 8px 10px; font: inherit; font-size: 0.84rem; resize: vertical; }
#entSetSave { width: auto; margin-top: 12px; }
.ent-news-failed { margin-top: 8px; font-size: 0.76rem; }
